SNode.C
Loading...
Searching...
No Matches
net::rc::SocketAddress Class Referencefinal

#include <SocketAddress.h>

Inheritance diagram for net::rc::SocketAddress:
Collaboration diagram for net::rc::SocketAddress:

Public Member Functions

 SocketAddress ()
 
 SocketAddress (const std::string &btAddress)
 
 SocketAddress (uint8_t channel)
 
 SocketAddress (const std::string &btAddress, uint8_t channel)
 
 SocketAddress (const SockAddr &sockAddr, SockLen sockAddrLen)
 
void init ()
 
SocketAddresssetBtAddress (const std::string &btAddress)
 
std::string getBtAddress () const
 
SocketAddresssetChannel (uint8_t channel)
 
uint8_t getChannel () const
 
std::string toString (bool expanded=true) const override
 
- Public Member Functions inherited from net::SocketAddress< sockaddr_rc >
 SocketAddress (sa_family_t af, SockLen sockAddrLen=sizeof(SockAddr))
 
 SocketAddress (const SocketAddress &socketAddress)
 
 SocketAddress (const SockAddr &sockAddr, SockLen sockAddrLen)
 
SocketAddressoperator= (const SocketAddress &socketAddress)
 
const sockaddr & getSockAddr ()
 
const SockLengetSockAddrLen () const
 
sa_family_t getAddressFamily () const
 
- Public Member Functions inherited from core::socket::SocketAddress
virtual ~SocketAddress ()
 
virtual bool useNext ()
 

Private Types

using Super = net::SocketAddress<sockaddr_rc>
 

Private Attributes

std::string btAddress
 
uint8_t channel = 0
 

Additional Inherited Members

- Public Types inherited from net::SocketAddress< sockaddr_rc >
using SockAddr
 
using SockLen
 
- Protected Attributes inherited from net::SocketAddress< sockaddr_rc >
SockAddr sockAddr
 
SockLen sockAddrLen
 

Detailed Description

Definition at line 38 of file SocketAddress.h.

Member Typedef Documentation

◆ Super

using net::rc::SocketAddress::Super = net::SocketAddress<sockaddr_rc>
private

Definition at line 40 of file SocketAddress.h.

Constructor & Destructor Documentation

◆ SocketAddress() [1/5]

net::rc::SocketAddress::SocketAddress ( )

Definition at line 30 of file SocketAddress.cpp.

31 : Super(AF_BLUETOOTH) {
32 }
net::SocketAddress< sockaddr_rc > Super

References SocketAddress().

Referenced by SocketAddress(), SocketAddress(), SocketAddress(), and SocketAddress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SocketAddress() [2/5]

net::rc::SocketAddress::SocketAddress ( const std::string & btAddress)
explicit

Definition at line 34 of file SocketAddress.cpp.

35 : SocketAddress() {
37 }
SocketAddress & setBtAddress(const std::string &btAddress)

References setBtAddress(), and SocketAddress().

Here is the call graph for this function:

◆ SocketAddress() [3/5]

net::rc::SocketAddress::SocketAddress ( uint8_t channel)
explicit

Definition at line 39 of file SocketAddress.cpp.

40 : SocketAddress() {
42 }
SocketAddress & setChannel(uint8_t channel)

References setChannel(), and SocketAddress().

Here is the call graph for this function:

◆ SocketAddress() [4/5]

net::rc::SocketAddress::SocketAddress ( const std::string & btAddress,
uint8_t channel )

Definition at line 44 of file SocketAddress.cpp.

References setBtAddress(), setChannel(), and SocketAddress().

Here is the call graph for this function:

◆ SocketAddress() [5/5]

net::rc::SocketAddress::SocketAddress ( const SockAddr & sockAddr,
SockLen sockAddrLen )

Definition at line 50 of file SocketAddress.cpp.

52 channel = sockAddr.rc_channel;
53
54 char btAddressC[15];
55 ba2str(&sockAddr.rc_bdaddr, btAddressC);
56 btAddress = btAddressC;
57 }

References SocketAddress().

Referenced by SocketAddress().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ getBtAddress()

std::string net::rc::SocketAddress::getBtAddress ( ) const

Definition at line 70 of file SocketAddress.cpp.

70 {
71 return btAddress;
72 }

◆ getChannel()

uint8_t net::rc::SocketAddress::getChannel ( ) const

Definition at line 80 of file SocketAddress.cpp.

80 {
81 return channel;
82 }

References channel.

◆ init()

void net::rc::SocketAddress::init ( )

Definition at line 59 of file SocketAddress.cpp.

59 {
60 sockAddr.rc_channel = channel;
61 str2ba(btAddress.c_str(), &sockAddr.rc_bdaddr);
62 }

◆ setBtAddress()

SocketAddress & net::rc::SocketAddress::setBtAddress ( const std::string & btAddress)

Definition at line 64 of file SocketAddress.cpp.

64 {
65 this->btAddress = btAddress;
66
67 return *this;
68 }

Referenced by SocketAddress(), and SocketAddress().

Here is the caller graph for this function:

◆ setChannel()

SocketAddress & net::rc::SocketAddress::setChannel ( uint8_t channel)

Definition at line 74 of file SocketAddress.cpp.

74 {
75 this->channel = channel;
76
77 return *this;
78 }

References channel.

Referenced by SocketAddress(), and SocketAddress().

Here is the caller graph for this function:

◆ toString()

std::string net::rc::SocketAddress::toString ( bool expanded = true) const
overridevirtual

Implements core::socket::SocketAddress.

Definition at line 84 of file SocketAddress.cpp.

84 {
85 return std::string(btAddress).append(expanded ? std::string(":").append(std::to_string(channel)) : "");
86 }

Member Data Documentation

◆ btAddress

std::string net::rc::SocketAddress::btAddress
private

Definition at line 60 of file SocketAddress.h.

◆ channel

uint8_t net::rc::SocketAddress::channel = 0
private

Definition at line 61 of file SocketAddress.h.

Referenced by getChannel(), and setChannel().


The documentation for this class was generated from the following files: