odtone::sap::link
// In header: </home/carlos/Projectos/odtone/inc/odtone/sap/link.hpp> class link : public odtone::sap::sap { public: // construct/copy/destruct link(const mih::config &, boost::asio::io_service &, const default_handler &); ~link(); // public member functions void async_send(mih::message &, const handler & = handler()); // private member functions void recv_handler(buffer< uint8 > &, size_t, const boost::system::error_code &); void send_handler(mih::frame_vla &, const handler &, size_t, const boost::system::error_code &); };
Link SAP I/O Service.
This module handles the comunication between Link SAP and its local the MIHF. After being initialized, and in order to run this service, it must be invoked the run() method of the boost::asio::io_service associated.
link
public
construct/copy/destructlink(const mih::config & cfg, boost::asio::io_service & io, const default_handler & h);
Construct a Link SAP I/O Service. The defined callback is invoked when a request message is received The signature of the callback is: void(odtone::mih::message&, const boost::system::error_code&).
Parameters: |
|
~link();
Destruct a Link SAP I/O Service.
link
public member functionsvoid async_send(mih::message & msg, const handler & h = handler());
Asynchronously send a MIH message to the local MIHF. After sending the message, the callback is called to report the success or failure in delivering the message to the local MIHF. This method retuns immediately.
Parameters: |
|
link
private member functionsvoid recv_handler(buffer< uint8 > & buff, size_t rbytes, const boost::system::error_code & ec);
Received message callback. This function is executed to process the received messages. If this is a valid message, the message is dispatched to the handler defined by the user.
Parameters: |
|
void send_handler(mih::frame_vla & fm, const handler & h, size_t sbytes, const boost::system::error_code & ec);
Sent message handler. After sending the message, this function is called to report the success or failure in delivering the message to the local MIHF.
Parameters: |
|