MQTT packet parsing and formatting. More...
Go to the source code of this file.
Detailed Description
MQTT packet parsing and formatting.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2026 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.
- Version
- 2.6.4
Definition in file mqtt_client_packet.h.
Function Documentation
◆ mqttClientFormatConnect()
| error_t mqttClientFormatConnect | ( | MqttClientContext * | context, |
| bool_t | cleanSession | ||
| ) |
Format CONNECT packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] cleanSession If 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 767 of file mqtt_client_packet.c.
◆ mqttClientFormatDisconnect()
| error_t mqttClientFormatDisconnect | ( | MqttClientContext * | context | ) |
Format DISCONNECT packet.
- Parameters
-
[in] context Pointer to the MQTT client context
- Returns
- Error code
Definition at line 1443 of file mqtt_client_packet.c.
◆ mqttClientFormatPingReq()
| error_t mqttClientFormatPingReq | ( | MqttClientContext * | context | ) |
Format PINGREQ packet.
- Parameters
-
[in] context Pointer to the MQTT client context
- Returns
- Error code
Definition at line 1411 of file mqtt_client_packet.c.
◆ mqttClientFormatPubAck()
| error_t mqttClientFormatPubAck | ( | MqttClientContext * | context, |
| uint16_t | packetId | ||
| ) |
Format PUBACK packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] packetId Packet identifier
- Returns
- Error code
Definition at line 1076 of file mqtt_client_packet.c.
◆ mqttClientFormatPubComp()
| error_t mqttClientFormatPubComp | ( | MqttClientContext * | context, |
| uint16_t | packetId | ||
| ) |
Format PUBCOMP packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] packetId Packet identifier
- Returns
- Error code
Definition at line 1220 of file mqtt_client_packet.c.
◆ mqttClientFormatPublish()
| error_t mqttClientFormatPublish | ( | MqttClientContext * | context, |
| MqttPublishInfo * | publishInfo | ||
| ) |
Format PUBLISH packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] publishInfo PUBLISH packet parameters
- Returns
- Error code
Definition at line 964 of file mqtt_client_packet.c.
◆ mqttClientFormatPubRec()
| error_t mqttClientFormatPubRec | ( | MqttClientContext * | context, |
| uint16_t | packetId | ||
| ) |
Format PUBREC packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] packetId Packet identifier
- Returns
- Error code
Definition at line 1124 of file mqtt_client_packet.c.
◆ mqttClientFormatPubRel()
| error_t mqttClientFormatPubRel | ( | MqttClientContext * | context, |
| uint16_t | packetId | ||
| ) |
Format PUBREL packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] packetId Packet identifier
- Returns
- Error code
Definition at line 1172 of file mqtt_client_packet.c.
◆ mqttClientFormatSubscribe()
| error_t mqttClientFormatSubscribe | ( | MqttClientContext * | context, |
| const char_t * | topic, | ||
| MqttQosLevel | qos | ||
| ) |
Format SUBSCRIBE packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] topic Topic filter [in] qos Maximum QoS level at which the server can send application messages to the client
- Returns
- Error code
Definition at line 1270 of file mqtt_client_packet.c.
◆ mqttClientFormatUnsubscribe()
| error_t mqttClientFormatUnsubscribe | ( | MqttClientContext * | context, |
| const char_t * | topic | ||
| ) |
Format UNSUBSCRIBE packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] topic Topic filter
- Returns
- Error code
Definition at line 1345 of file mqtt_client_packet.c.
◆ mqttClientProcessConnAck()
| error_t mqttClientProcessConnAck | ( | MqttClientContext * | context, |
| bool_t | dup, | ||
| MqttQosLevel | qos, | ||
| bool_t | retain, | ||
| size_t | remainingLen | ||
| ) |
Process incoming CONNACK packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] dup DUP flag from the fixed header [in] qos QoS field from the fixed header [in] retain RETAIN flag from the fixed header [in] remainingLen Length of the variable header and the payload
Definition at line 273 of file mqtt_client_packet.c.
◆ mqttClientProcessPacket()
| error_t mqttClientProcessPacket | ( | MqttClientContext * | context | ) |
Process incoming MQTT packet.
- Parameters
-
[in] context Pointer to the MQTT client context
- Returns
- Error code
Definition at line 169 of file mqtt_client_packet.c.
◆ mqttClientProcessPingResp()
| error_t mqttClientProcessPingResp | ( | MqttClientContext * | context, |
| bool_t | dup, | ||
| MqttQosLevel | qos, | ||
| bool_t | retain, | ||
| size_t | remainingLen | ||
| ) |
Process incoming PINGRESP packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] dup DUP flag from the fixed header [in] qos QoS field from the fixed header [in] retain RETAIN flag from the fixed header [in] remainingLen Length of the variable header and the payload
Definition at line 736 of file mqtt_client_packet.c.
◆ mqttClientProcessPubAck()
| error_t mqttClientProcessPubAck | ( | MqttClientContext * | context, |
| bool_t | dup, | ||
| MqttQosLevel | qos, | ||
| bool_t | retain, | ||
| size_t | remainingLen | ||
| ) |
Process incoming PUBACK packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] dup DUP flag from the fixed header [in] qos QoS field from the fixed header [in] retain RETAIN flag from the fixed header [in] remainingLen Length of the variable header and the payload
Definition at line 444 of file mqtt_client_packet.c.
◆ mqttClientProcessPubComp()
| error_t mqttClientProcessPubComp | ( | MqttClientContext * | context, |
| bool_t | dup, | ||
| MqttQosLevel | qos, | ||
| bool_t | retain, | ||
| size_t | remainingLen | ||
| ) |
Process incoming PUBCOMP packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] dup DUP flag from the fixed header [in] qos QoS field from the fixed header [in] retain RETAIN flag from the fixed header [in] remainingLen Length of the variable header and the payload
Definition at line 604 of file mqtt_client_packet.c.
◆ mqttClientProcessPublish()
| error_t mqttClientProcessPublish | ( | MqttClientContext * | context, |
| bool_t | dup, | ||
| MqttQosLevel | qos, | ||
| bool_t | retain, | ||
| size_t | remainingLen | ||
| ) |
Process incoming PUBLISH packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] dup DUP flag from the fixed header [in] qos QoS field from the fixed header [in] retain RETAIN flag from the fixed header [in] remainingLen Length of the variable header and the payload
Definition at line 330 of file mqtt_client_packet.c.
◆ mqttClientProcessPubRec()
| error_t mqttClientProcessPubRec | ( | MqttClientContext * | context, |
| bool_t | dup, | ||
| MqttQosLevel | qos, | ||
| bool_t | retain, | ||
| size_t | remainingLen | ||
| ) |
Process incoming PUBREC packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] dup DUP flag from the fixed header [in] qos QoS field from the fixed header [in] retain RETAIN flag from the fixed header [in] remainingLen Length of the variable header and the payload
Definition at line 488 of file mqtt_client_packet.c.
◆ mqttClientProcessPubRel()
| error_t mqttClientProcessPubRel | ( | MqttClientContext * | context, |
| bool_t | dup, | ||
| MqttQosLevel | qos, | ||
| bool_t | retain, | ||
| size_t | remainingLen | ||
| ) |
Process incoming PUBREL packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] dup DUP flag from the fixed header [in] qos QoS field from the fixed header [in] retain RETAIN flag from the fixed header [in] remainingLen Length of the variable header and the payload
Definition at line 546 of file mqtt_client_packet.c.
◆ mqttClientProcessSubAck()
| error_t mqttClientProcessSubAck | ( | MqttClientContext * | context, |
| bool_t | dup, | ||
| MqttQosLevel | qos, | ||
| bool_t | retain, | ||
| size_t | remainingLen | ||
| ) |
Process incoming SUBACK packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] dup DUP flag from the fixed header [in] qos QoS field from the fixed header [in] retain RETAIN flag from the fixed header [in] remainingLen Length of the variable header and the payload
Definition at line 648 of file mqtt_client_packet.c.
◆ mqttClientProcessUnsubAck()
| error_t mqttClientProcessUnsubAck | ( | MqttClientContext * | context, |
| bool_t | dup, | ||
| MqttQosLevel | qos, | ||
| bool_t | retain, | ||
| size_t | remainingLen | ||
| ) |
Process incoming UNSUBACK packet.
- Parameters
-
[in] context Pointer to the MQTT client context [in] dup DUP flag from the fixed header [in] qos QoS field from the fixed header [in] retain RETAIN flag from the fixed header [in] remainingLen Length of the variable header and the payload
Definition at line 692 of file mqtt_client_packet.c.
◆ mqttClientReceivePacket()
| error_t mqttClientReceivePacket | ( | MqttClientContext * | context | ) |
Receive MQTT packet.
- Parameters
-
[in] context Pointer to the MQTT client context
- Returns
- Error code
Definition at line 73 of file mqtt_client_packet.c.
