mqtt_sn_client.h
error_t mqttSnClientTask(MqttSnClientContext *context, systime_t timeout)
Process MQTT-SN client events.
Definition: mqtt_sn_client.c:1340
error_t mqttSnClientSetPredefinedTopics(MqttSnClientContext *context, MqttSnPredefinedTopic *predefinedTopics, uint_t size)
Set the list of predefined topics.
Definition: mqtt_sn_client.c:170
uint16_t topicId
Topic identifier returned by the gateway (REGACK/SUBACK)
Definition: mqtt_sn_client.h:266
error_t(* MqttSnClientDtlsInitCallback)(MqttSnClientContext *context, TlsContext *dtlsContext)
DTLS initialization callback.
Definition: mqtt_sn_client.h:184
#define MQTT_SN_CLIENT_MSG_ID_TABLE_SIZE
Definition: mqtt_sn_client.h:62
error_t mqttSnClientDisconnect(MqttSnClientContext *context, systime_t duration)
Disconnect from the MQTT-SN gateway.
Definition: mqtt_sn_client.c:1374
void mqttSnClientDeinit(MqttSnClientContext *context)
Release MQTT-SN client context.
Definition: mqtt_sn_client.c:1468
#define MQTT_SN_CLIENT_MAX_WILL_PAYLOAD_LEN
Definition: mqtt_sn_client.h:90
error_t mqttSnClientBindToInterface(MqttSnClientContext *context, NetInterface *interface)
Bind the MQTT-SN client to a particular network interface.
Definition: mqtt_sn_client.c:319
error_t mqttSnClientPing(MqttSnClientContext *context)
Send ping request.
Definition: mqtt_sn_client.c:1073
error_t mqttSnClientSetKeepAlive(MqttSnClientContext *context, systime_t keepAlive)
Set keep-alive value.
Definition: mqtt_sn_client.c:218
error_t mqttSnClientRegisterDtlsInitCallback(MqttSnClientContext *context, MqttSnClientDtlsInitCallback callback)
Register DTLS initialization callback function.
Definition: mqtt_sn_client.c:122
const MqttSnPredefinedTopic * predefinedTopicTable
List of predefined topics.
Definition: mqtt_sn_client.h:242
#define MQTT_SN_CLIENT_TOPIC_TABLE_SIZE
Definition: mqtt_sn_client.h:55
error_t mqttSnClientInit(MqttSnClientContext *context)
Initialize MQTT-SN client context.
Definition: mqtt_sn_client.c:52
error_t mqttSnClientRegisterPublishCallback(MqttSnClientContext *context, MqttSnClientPublishCallback callback)
Register publish callback function.
Definition: mqtt_sn_client.c:147
MqttSnClientDtlsInitCallback dtlsInitCallback
DTLS initialization callback.
Definition: mqtt_sn_client.h:253
error_t mqttSnClientGetReturnCode(MqttSnClientContext *context, MqttSnReturnCode *returnCode)
Retrieve return code.
Definition: mqtt_sn_client.c:1318
error_t mqttSnClientUpdateWillMessage(MqttSnClientContext *context, const char_t *topic, const void *message, size_t length, MqttSnQosLevel qos, bool_t retain)
Update the Will message.
Definition: mqtt_sn_client.c:1171
error_t mqttSnClientSetTransportProtocol(MqttSnClientContext *context, MqttSnTransportProtocol transportProtocol)
Set the transport protocol to be used.
Definition: mqtt_sn_client.c:98
error_t mqttSnClientSubscribe(MqttSnClientContext *context, const char_t *topicName, MqttSnQosLevel qos)
Subscribe to topic.
Definition: mqtt_sn_client.c:874
General definitions for cryptographic algorithms.
@ MQTT_SN_CLIENT_STATE_DISCONNECTED
Definition: mqtt_sn_client.h:164
error_t mqttSnClientSetTimeout(MqttSnClientContext *context, systime_t timeout)
Set communication timeout.
Definition: mqtt_sn_client.c:197
@ MQTT_SN_CLIENT_STATE_RESP_RECEIVED
Definition: mqtt_sn_client.h:169
MqttSnTransportProtocol transportProtocol
Transport protocol (UDP or DTLS)
Definition: mqtt_sn_client.h:241
@ MQTT_SN_CLIENT_STATE_DISCONNECTING
Definition: mqtt_sn_client.h:173
MqttSnClientPublishCallback publishCallback
PUBLISH message received callback.
Definition: mqtt_sn_client.h:255
Definitions common to MQTT-SN client and gateway.
error_t mqttSnClientUnsubscribe(MqttSnClientContext *context, const char_t *topicName)
Unsubscribe from topic.
Definition: mqtt_sn_client.c:983
MqttSnClientTopicEntry topicTable[MQTT_SN_CLIENT_TOPIC_TABLE_SIZE]
Definition: mqtt_sn_client.h:268
error_t mqttSnClientSetIdentifier(MqttSnClientContext *context, const char_t *clientId)
Set client identifier.
Definition: mqtt_sn_client.c:239
#define MQTT_SN_CLIENT_PRIVATE_CONTEXT
Definition: mqtt_sn_client.h:139
systime_t retransmitStartTime
Time at which the last message was sent.
Definition: mqtt_sn_client.h:259
error_t mqttSnClientConnect(MqttSnClientContext *context, bool_t cleanSession)
Establish connection with the MQTT-SN gateway.
Definition: mqtt_sn_client.c:479
#define MQTT_SN_CLIENT_MAX_WILL_TOPIC_LEN
Definition: mqtt_sn_client.h:83
error_t mqttSnClientPublish(MqttSnClientContext *context, const char_t *topicName, const void *message, size_t length, MqttSnQosLevel qos, bool_t retain, bool_t dup, uint16_t *msgId)
Publish message.
Definition: mqtt_sn_client.c:633
TLS (Transport Layer Security)
error_t mqttSnClientSearchGateway(MqttSnClientContext *context, const IpAddr *destIpAddr, uint16_t destPort)
Search for a gateway.
Definition: mqtt_sn_client.c:366
error_t mqttSnClientSetGateway(MqttSnClientContext *context, const IpAddr *gwIpAddr, uint16_t gwPort)
Specify the address of the gateway.
Definition: mqtt_sn_client.c:342
#define MQTT_SN_CLIENT_MAX_TOPIC_NAME_LEN
Definition: mqtt_sn_client.h:76
MQTT-SN message formatting and parsing.
MqttSnClientMsgIdEntry msgIdTable[MQTT_SN_CLIENT_MSG_ID_TABLE_SIZE]
Definition: mqtt_sn_client.h:269
TCP/IP stack core.
error_t mqttSnClientSetWillMessage(MqttSnClientContext *context, const char_t *topic, const void *message, size_t length, MqttSnQosLevel qos, bool_t retain)
Specify the Will message.
Definition: mqtt_sn_client.c:269
void(* MqttSnClientPublishCallback)(MqttSnClientContext *context, const char_t *topic, const uint8_t *message, size_t length, MqttSnQosLevel qos, bool_t retain)
PUBLISH message received callback.
Definition: mqtt_sn_client.h:194