38 using AuthInfo = std::pair<std::string, BinaryData>;
59 using ClientSendDataReqCb = std::function<void (
const std::uint8_t* buf, std::size_t bufSize,
unsigned broadcastRadius)>;
323 std::unique_ptr<SessionImpl> m_pImpl;
Interface for Session entity.
Definition Session.h:29
std::size_t getSleepingClientMsgLimit() const
Get currenly configured limit to pending messages being accumulated for the sleeping client.
void setSleepingClientMsgLimit(std::size_t value)
Provide limit to number pending messages being accumulated for the sleeping client.
Session()
Default constructor.
bool start()
Start this object's operation.
std::function< void()> BrokerReconnectReqCb
Type of callback used to request reconnection to the broker.
Definition Session.h:76
std::pair< std::string, BinaryData > AuthInfo
Type of authentication information.
Definition Session.h:38
bool getBrokerConnected() const
Get currently recorded broker connection status.
void setSendDataBrokerReqCb(BrokerSendDataReqCb &&func)
Set the callback to be invoked when new data needs to be sent to the broker.
void setBrokerReconnectReqCb(BrokerReconnectReqCb &&func)
Set the callback to be invoked when the session needs to close existing TCP/IP connection to the brok...
void setDefaultClientId(const std::string &value)
Provide default client ID for clients that report empty one in their attempt to connect.
unsigned getRetryPeriod() const
Get the current configuration of the retry period.
const std::string & getDefaultClientId() const
Get current default client id configuration.
void tick()
Notify the Session object about requested time period expiry.
std::size_t dataFromClient(const std::uint8_t *buf, std::size_t len)
Provide data received from the client for processing.
void setRetryPeriod(unsigned value)
Set retry period to wait between resending unacknowledged message to the client and/or broker.
std::function< void(const char *msg)> ErrorReportCb
Type of the callback used to report detected errors.
Definition Session.h:93
std::function< unsigned()> CancelTickWaitReqCb
Type of callback, used to cancel existing time measurement.
Definition Session.h:52
std::function< void(unsigned value)> NextTickProgramReqCb
Type of callback, used to request new time measurement.
Definition Session.h:44
std::uint16_t getPubOnlyKeepAlive() const
Get current configuration of the default "keep alive" period for "publish only" clients.
bool addPredefinedTopic(const std::string &topic, std::uint16_t topicId)
Add predefined topic string and ID information.
void setCancelTickWaitReqCb(CancelTickWaitReqCb &&func)
Set the callback to be invoked when previously requested time measurement needs to be cancelled.
void setGatewayId(std::uint8_t value)
Set gateway numeric ID to be reported when requested.
std::function< void()> TerminationReqCb
Type of callback, used to request session termination.
Definition Session.h:71
void setErrorReportCb(ErrorReportCb &&func)
Set the callback to be used to report detected errors.
void setRetryCount(unsigned value)
Set number of retry attempts to perform before abandoning attempt to send unacknowledged message.
std::size_t dataFromBroker(const std::uint8_t *buf, std::size_t len)
Provide data received from the broker for processing.
void setTerminationReqCb(TerminationReqCb &&func)
Set the callback to be invoked when the session needs to be terminated and this Session object delete...
void setFwdEncSessionDeletedReportCb(FwdEncSessionDeletedReportCb &&func)
Set the callback to be invoked when the forwarding encapsulation session is about to be deleted.
std::function< bool(Session *session)> FwdEncSessionCreatedReportCb
Type of callback used to notify the application about forwarding encapsulation session being created.
Definition Session.h:104
std::uint8_t getGatewayId() const
Get configured gateway numeric ID to be reported when requested.
std::vector< std::uint8_t > BinaryData
Type for buffer of binary data.
Definition Session.h:33
std::function< void(const std::uint8_t *buf, std::size_t bufSize, unsigned broadcastRadius)> ClientSendDataReqCb
Type of callback, used to request delivery of serialised message to the client.
Definition Session.h:59
void setClientConnectedReportCb(ClientConnectedReportCb &&func)
Set the callback to be invoked when MQTT-SN client is successfully connected to the broker.
void setBrokerConnected(bool connected)
Notify the Session object about broker being connected / disconnected.
void setAuthInfoReqCb(AuthInfoReqCb &&func)
Set the callback to be used to request authentication information for specific client.
void setSendDataClientReqCb(ClientSendDataReqCb &&func)
Set the callback to be invoked when new data needs to be sent to the client.
bool isRunning() const
Check whether the object's operation has been successfull started.
void setFwdEncSessionCreatedReportCb(FwdEncSessionCreatedReportCb &&func)
Set the callback to be invoked when the forwarding encapsulation session is detected and to notify ap...
void setNextTickProgramReqCb(NextTickProgramReqCb &&func)
Set the callback to be invoked when new time measurement is required.
std::function< void(Session *session)> FwdEncSessionDeletedReportCb
Type of callback used to notify the application about forwarding encapsulation session being deleted.
Definition Session.h:110
void setPubOnlyKeepAlive(std::uint16_t value)
Provide default "keep alive" period for "publish only" clients, that do not make an attempt to connec...
std::function< void(const std::uint8_t *buf, std::size_t bufSize)> BrokerSendDataReqCb
Type of callback, used to request delivery of serialised message to the broker.
Definition Session.h:65
bool setTopicIdAllocationRange(std::uint16_t minVal, std::uint16_t maxVal)
Limit range of topic IDs allocated for newly registered topics.
void stop()
Stop the operation of the object.
unsigned getRetryCount() const
Get the current configuration of the retry count.
std::function< AuthInfo(const std::string &clientId)> AuthInfoReqCb
Type of callback used to request authentication information of the client that is trying connect.
Definition Session.h:89
std::function< void(const std::string &clientId)> ClientConnectedReportCb
Type of callback used to report client ID of the newly connected MQTT-SN client.
Definition Session.h:83
Main namespace for all classes / functions of the gateway library.