s-net-Tools
|
Class HdlcdClient. More...
#include <HdlcdClient.h>
Public Member Functions | |
HdlcdClient (boost::asio::io_service &a_IOService, const std::string &a_SerialPortName, HdlcdSessionDescriptor a_HdlcdSessionDescriptor) | |
The constructor of HdlcdClient objects. More... | |
void | AsyncConnect (boost::asio::ip::tcp::resolver::iterator a_EndpointIterator, std::function< void(bool a_bSuccess)> a_OnConnectedCallback) |
Perform an asynchronous connect procedure regarding both TCP sockets. More... | |
~HdlcdClient () | |
The destructor of HdlcdClient objects. More... | |
void | Shutdown () |
Shuts all TCP connections down. More... | |
void | Close () |
Close the client entity. More... | |
void | SetOnDataCallback (std::function< void(const HdlcdPacketData &a_PacketData)> a_OnDataCallback) |
Provide a callback method to be called for received data packets. More... | |
void | SetOnCtrlCallback (std::function< void(const HdlcdPacketCtrl &a_PacketCtrl)> a_OnCtrlCallback) |
Provide a callback method to be called for received control packets. More... | |
void | SetOnClosedCallback (std::function< void()> a_OnClosedCallback) |
Provide a callback method to be called if this client entity is closing. More... | |
bool | Send (const HdlcdPacketData &a_PacketData, std::function< void()> a_OnSendDoneCallback=nullptr) |
Send a single data packet to the peer entity. More... | |
bool | Send (const HdlcdPacketCtrl &a_PacketCtrl, std::function< void()> a_OnSendDoneCallback=nullptr) |
Send a single control packet to the peer entity. More... | |
Class HdlcdClient.
The main helper class to easily implement clients of the HDLCd access protocol
Definition at line 54 of file HdlcdClient.h.
|
inline |
The constructor of HdlcdClient objects.
The constructor of HdlcdClient objects
a_IOService | the boost IOService object |
a_SerialPortName | the name of the serial port device |
a_HdlcdSessionDescriptor | the indentifier of the session, see "service access point" |
Definition at line 64 of file HdlcdClient.h.
|
inline |
The destructor of HdlcdClient objects.
All open connections will automatically be closed by the destructor
Definition at line 116 of file HdlcdClient.h.
|
inline |
Perform an asynchronous connect procedure regarding both TCP sockets.
Perform an asynchronous connect procedure regarding both TCP sockets
a_EndpointIterator | the boost endpoint iteratior referring to the destination |
a_OnConnectedCallback | the callback to be called if a result is available. |
Definition at line 82 of file HdlcdClient.h.
|
inline |
Close the client entity.
Close the client entity and all its TCP connections
Definition at line 141 of file HdlcdClient.h.
|
inline |
Send a single data packet to the peer entity.
Send a single data packet to the peer entity
a_PacketData | the data packet to be transmitted |
a_OnSendDoneCallback | the callback handler to be called if the provided data packet was sent (optional) |
Definition at line 203 of file HdlcdClient.h.
|
inline |
Send a single control packet to the peer entity.
Send a single control packet to the peer entity
a_PacketCtrl | the control packet to be transmitted |
a_OnSendDoneCallback | the callback handler to be called if the provided control packet was sent (optional) |
Definition at line 223 of file HdlcdClient.h.
|
inline |
Provide a callback method to be called if this client entity is closing.
This method can be used to provide a function pointer callback to be called if this entoty is closing, e.g., the peer closed its endpoint
a_OnClosedCallback | the funtion pointer to the callback method, may be an empty function pointer to remove the callback |
Definition at line 192 of file HdlcdClient.h.
|
inline |
Provide a callback method to be called for received control packets.
Control packets are received in an asynchronous way. Use this method to specify a callback method to be called on reception of single control packets
a_OnCtrlCallback | the funtion pointer to the callback method, may be an empty function pointer to remove the callback |
Definition at line 182 of file HdlcdClient.h.
|
inline |
Provide a callback method to be called for received data packets.
Data packets are received in an asynchronous way. Use this method to specify a callback method to be called on reception of single data packets
a_OnDataCallback | the funtion pointer to the callback method, may be an empty function pointer to remove the callback |
Definition at line 172 of file HdlcdClient.h.
|
inline |
Shuts all TCP connections down.
Initiates a shutdown procedure for correct teardown of all TCP connections
Definition at line 127 of file HdlcdClient.h.