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 60 of file SocketAddress.h.

Member Typedef Documentation

◆ Super

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

Definition at line 62 of file SocketAddress.h.

Constructor & Destructor Documentation

◆ SocketAddress() [1/5]

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

Definition at line 52 of file SocketAddress.cpp.

53 : Super(AF_BLUETOOTH) {
54 }
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 56 of file SocketAddress.cpp.

57 : SocketAddress() {
59 }
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 61 of file SocketAddress.cpp.

62 : SocketAddress() {
64 }
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 66 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 72 of file SocketAddress.cpp.

74 channel = sockAddr.rc_channel;
75
76 char btAddressC[15];
77 ba2str(&sockAddr.rc_bdaddr, btAddressC);
78 btAddress = btAddressC;
79 }

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 92 of file SocketAddress.cpp.

92 {
93 return btAddress;
94 }

◆ getChannel()

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

Definition at line 102 of file SocketAddress.cpp.

102 {
103 return channel;
104 }

References channel.

◆ init()

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

Definition at line 81 of file SocketAddress.cpp.

81 {
82 sockAddr.rc_channel = channel;
83 str2ba(btAddress.c_str(), &sockAddr.rc_bdaddr);
84 }

◆ setBtAddress()

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

Definition at line 86 of file SocketAddress.cpp.

86 {
87 this->btAddress = btAddress;
88
89 return *this;
90 }

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 96 of file SocketAddress.cpp.

96 {
97 this->channel = channel;
98
99 return *this;
100 }

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 106 of file SocketAddress.cpp.

106 {
107 return std::string(btAddress).append(expanded ? std::string(":").append(std::to_string(channel)) : "");
108 }

Member Data Documentation

◆ btAddress

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

Definition at line 82 of file SocketAddress.h.

◆ channel

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

Definition at line 83 of file SocketAddress.h.

Referenced by getChannel(), and setChannel().


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