mqtt_sn_client_message.h File Reference

MQTT-SN message formatting and parsing. More...

#include "core/net.h"
#include "mqtt_sn/mqtt_sn_client.h"

Go to the source code of this file.

Functions

error_t mqttSnClientProcessMessage (MqttSnClientContext *context, MqttSnMessage *message, const IpAddr *ipAddr, uint16_t port)
 Process incoming MQTT-SN message. More...
 
error_t mqttSnClientProcessGwInfo (MqttSnClientContext *context, const MqttSnMessage *message, const IpAddr *ipAddr, uint16_t port)
 Process incoming GWINFO message. More...
 
error_t mqttSnClientProcessConnAck (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming CONNACK message. More...
 
error_t mqttSnClientProcessWillTopicReq (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming WILLTOPICREQ message. More...
 
error_t mqttSnClientProcessWillMsgReq (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming WILLMSGREQ message. More...
 
error_t mqttSnClientProcessRegister (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming REGISTER message. More...
 
error_t mqttSnClientProcessRegAck (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming REGACK message. More...
 
error_t mqttSnClientProcessPublish (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming PUBLISH message. More...
 
error_t mqttSnClientProcessPubAck (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming PUBACK message. More...
 
error_t mqttSnClientProcessPubRec (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming PUBREC message. More...
 
error_t mqttSnClientProcessPubRel (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming PUBREL message. More...
 
error_t mqttSnClientProcessPubComp (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming PUBCOMP message. More...
 
error_t mqttSnClientProcessSubAck (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming SUBACK message. More...
 
error_t mqttSnClientProcessUnsubAck (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming UNSUBACK message. More...
 
error_t mqttSnClientProcessPingReq (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming PINGREQ message. More...
 
error_t mqttSnClientProcessPingResp (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming PINGRESP message. More...
 
error_t mqttSnClientProcessDisconnect (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming DISCONNECT message. More...
 
error_t mqttSnClientProcessWillTopicResp (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming WILLTOPICRESP message. More...
 
error_t mqttSnClientProcessWillMsgResp (MqttSnClientContext *context, const MqttSnMessage *message)
 Process incoming WILLMSGRESP message. More...
 
error_t mqttSnClientSendSearchGw (MqttSnClientContext *context, uint8_t radius, const IpAddr *destIpAddr, uint16_t destPort)
 Send SEARCHGW message. More...
 
error_t mqttSnClientSendConnect (MqttSnClientContext *context, bool_t cleanSession)
 Send CONNECT message. More...
 
error_t mqttSnClientSendWillTopic (MqttSnClientContext *context)
 Send WILLTOPIC message. More...
 
error_t mqttSnClientSendWillMsg (MqttSnClientContext *context)
 Send WILLMSG message. More...
 
error_t mqttSnClientSendRegister (MqttSnClientContext *context, const char_t *topicName)
 Send REGISTER message. More...
 
error_t mqttSnClientSendRegAck (MqttSnClientContext *context, uint16_t msgId, uint16_t topicId, MqttSnReturnCode returnCode)
 Send REGACK message. More...
 
error_t mqttSnClientSendPublish (MqttSnClientContext *context, uint16_t msgId, const char_t *topicName, const uint8_t *data, size_t length, MqttSnQosLevel qos, bool_t retain, bool_t dup)
 Send PUBLISH message. More...
 
error_t mqttSnClientSendPubAck (MqttSnClientContext *context, uint16_t msgId, uint16_t topicId, MqttSnReturnCode returnCode)
 Send PUBACK message. More...
 
error_t mqttSnClientSendPubRec (MqttSnClientContext *context, uint16_t msgId)
 Send PUBREC message. More...
 
error_t mqttSnClientSendPubRel (MqttSnClientContext *context, uint16_t msgId)
 Send PUBREL message. More...
 
error_t mqttSnClientSendPubComp (MqttSnClientContext *context, uint16_t msgId)
 Send PUBCOMP message. More...
 
error_t mqttSnClientSendSubscribe (MqttSnClientContext *context, const char_t *topicName, MqttSnQosLevel qos)
 Send SUBSCRIBE message. More...
 
error_t mqttSnClientSendUnsubscribe (MqttSnClientContext *context, const char_t *topicName)
 Send UNSUBSCRIBE message. More...
 
error_t mqttSnClientSendPingReq (MqttSnClientContext *context)
 Send PINGREQ message. More...
 
error_t mqttSnClientSendPingResp (MqttSnClientContext *context)
 Send PINGRESP message. More...
 
error_t mqttSnClientSendDisconnect (MqttSnClientContext *context, uint16_t duration)
 Send DISCONNECT message. More...
 
error_t mqttSnClientSendWillTopicUpd (MqttSnClientContext *context)
 Send WILLTOPICUPD message. More...
 
error_t mqttSnClientSendWillMsgUpd (MqttSnClientContext *context)
 Send WILLMSGUPD message. More...
 

Detailed Description

MQTT-SN message formatting and parsing.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file mqtt_sn_client_message.h.

Function Documentation

◆ mqttSnClientProcessConnAck()

error_t mqttSnClientProcessConnAck ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming CONNACK message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 237 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessDisconnect()

error_t mqttSnClientProcessDisconnect ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming DISCONNECT message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 814 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessGwInfo()

error_t mqttSnClientProcessGwInfo ( MqttSnClientContext context,
const MqttSnMessage message,
const IpAddr ipAddr,
uint16_t  port 
)

Process incoming GWINFO message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
[in]ipAddrSource IP address
[in]portSource port
Returns
Error code

Definition at line 200 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessMessage()

error_t mqttSnClientProcessMessage ( MqttSnClientContext context,
MqttSnMessage message,
const IpAddr ipAddr,
uint16_t  port 
)

Process incoming MQTT-SN message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
[in]ipAddrSource IP address
[in]portSource port
Returns
Error code

Definition at line 57 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessPingReq()

error_t mqttSnClientProcessPingReq ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming PINGREQ message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 749 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessPingResp()

error_t mqttSnClientProcessPingResp ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming PINGRESP message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 778 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessPubAck()

error_t mqttSnClientProcessPubAck ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming PUBACK message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 519 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessPubComp()

error_t mqttSnClientProcessPubComp ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming PUBCOMP message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 630 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessPublish()

error_t mqttSnClientProcessPublish ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming PUBLISH message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 418 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessPubRec()

error_t mqttSnClientProcessPubRec ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming PUBREC message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 560 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessPubRel()

error_t mqttSnClientProcessPubRel ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming PUBREL message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 598 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessRegAck()

error_t mqttSnClientProcessRegAck ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming REGACK message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 376 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessRegister()

error_t mqttSnClientProcessRegister ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming REGISTER message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 331 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessSubAck()

error_t mqttSnClientProcessSubAck ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming SUBACK message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 668 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessUnsubAck()

error_t mqttSnClientProcessUnsubAck ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming UNSUBACK message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 711 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessWillMsgReq()

error_t mqttSnClientProcessWillMsgReq ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming WILLMSGREQ message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 303 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessWillMsgResp()

error_t mqttSnClientProcessWillMsgResp ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming WILLMSGRESP message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 880 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessWillTopicReq()

error_t mqttSnClientProcessWillTopicReq ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming WILLTOPICREQ message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 275 of file mqtt_sn_client_message.c.

◆ mqttSnClientProcessWillTopicResp()

error_t mqttSnClientProcessWillTopicResp ( MqttSnClientContext context,
const MqttSnMessage message 
)

Process incoming WILLTOPICRESP message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]messagePointer to the received MQTT-SN message
Returns
Error code

Definition at line 842 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendConnect()

error_t mqttSnClientSendConnect ( MqttSnClientContext context,
bool_t  cleanSession 
)

Send CONNECT message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]cleanSessionIf this flag is set, then the client and server must discard any previous session and start a new one
Returns
Error code

Definition at line 959 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendDisconnect()

error_t mqttSnClientSendDisconnect ( MqttSnClientContext context,
uint16_t  duration 
)

Send DISCONNECT message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]durationValue of the sleep timer
Returns
Error code

Definition at line 1686 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendPingReq()

error_t mqttSnClientSendPingReq ( MqttSnClientContext context)

Send PINGREQ message.

Parameters
[in]contextPointer to the MQTT-SN client context
Returns
Error code

Definition at line 1616 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendPingResp()

error_t mqttSnClientSendPingResp ( MqttSnClientContext context)

Send PINGRESP message.

Parameters
[in]contextPointer to the MQTT-SN client context
Returns
Error code

Definition at line 1652 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendPubAck()

error_t mqttSnClientSendPubAck ( MqttSnClientContext context,
uint16_t  msgId,
uint16_t  topicId,
MqttSnReturnCode  returnCode 
)

Send PUBACK message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]msgIdMessage identifier of the corresponding PUBLISH message
[in]topicIdTopic identifier
[in]returnCodeReturn code
Returns
Error code

Definition at line 1303 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendPubComp()

error_t mqttSnClientSendPubComp ( MqttSnClientContext context,
uint16_t  msgId 
)

Send PUBCOMP message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]msgIdMessage identifier of the corresponding PUBLISH message
Returns
Error code

Definition at line 1418 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendPublish()

error_t mqttSnClientSendPublish ( MqttSnClientContext context,
uint16_t  msgId,
const char_t topicName,
const uint8_t *  data,
size_t  length,
MqttSnQosLevel  qos,
bool_t  retain,
bool_t  dup 
)

Send PUBLISH message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]msgIdMessage identifier
[in]topicNameShort topic name
[in]dataMessage payload
[in]lengthLength of the message payload
[in]qosQoS level to be used when publishing the message
[in]retainThis flag specifies if the message is to be retained
[in]dupThis flag specifies if the message is sent for the first time or if the message is retransmitted
Returns
Error code

Definition at line 1186 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendPubRec()

error_t mqttSnClientSendPubRec ( MqttSnClientContext context,
uint16_t  msgId 
)

Send PUBREC message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]msgIdMessage identifier of the corresponding PUBLISH message
Returns
Error code

Definition at line 1338 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendPubRel()

error_t mqttSnClientSendPubRel ( MqttSnClientContext context,
uint16_t  msgId 
)

Send PUBREL message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]msgIdMessage identifier of the corresponding PUBLISH message
Returns
Error code

Definition at line 1372 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendRegAck()

error_t mqttSnClientSendRegAck ( MqttSnClientContext context,
uint16_t  msgId,
uint16_t  topicId,
MqttSnReturnCode  returnCode 
)

Send REGACK message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]msgIdMessage identifier
[in]topicIdTopic identifier
[in]returnCodeReturn code
Returns
Error code

Definition at line 1144 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendRegister()

error_t mqttSnClientSendRegister ( MqttSnClientContext context,
const char_t topicName 
)

Send REGISTER message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]topicNameTopic name
Returns
Error code

Definition at line 1094 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendSearchGw()

error_t mqttSnClientSendSearchGw ( MqttSnClientContext context,
uint8_t  radius,
const IpAddr destIpAddr,
uint16_t  destPort 
)

Send SEARCHGW message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]radiusBroadcast radius of SEARCHGW message
[in]destIpAddrDestination IP address
[in]destPortDestination port number
Returns
Error code

Definition at line 920 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendSubscribe()

error_t mqttSnClientSendSubscribe ( MqttSnClientContext context,
const char_t topicName,
MqttSnQosLevel  qos 
)

Send SUBSCRIBE message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]topicNameTopic filter
[in]qosMaximum QoS level at which the server can send application messages to the client
Returns
Error code

Definition at line 1454 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendUnsubscribe()

error_t mqttSnClientSendUnsubscribe ( MqttSnClientContext context,
const char_t topicName 
)

Send UNSUBSCRIBE message.

Parameters
[in]contextPointer to the MQTT-SN client context
[in]topicNameTopic filter
Returns
Error code

Definition at line 1536 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendWillMsg()

error_t mqttSnClientSendWillMsg ( MqttSnClientContext context)

Send WILLMSG message.

Parameters
[in]contextPointer to the MQTT-SN client context
Returns
Error code

Definition at line 1059 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendWillMsgUpd()

error_t mqttSnClientSendWillMsgUpd ( MqttSnClientContext context)

Send WILLMSGUPD message.

Parameters
[in]contextPointer to the MQTT-SN client context
Returns
Error code

Definition at line 1773 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendWillTopic()

error_t mqttSnClientSendWillTopic ( MqttSnClientContext context)

Send WILLTOPIC message.

Parameters
[in]contextPointer to the MQTT-SN client context
Returns
Error code

Definition at line 1025 of file mqtt_sn_client_message.c.

◆ mqttSnClientSendWillTopicUpd()

error_t mqttSnClientSendWillTopicUpd ( MqttSnClientContext context)

Send WILLTOPICUPD message.

Parameters
[in]contextPointer to the MQTT-SN client context
Returns
Error code

Definition at line 1727 of file mqtt_sn_client_message.c.