Webserver+3d print

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

mqtt_client_packet.h File Reference

mqtt_client_packet.h File Reference

MQTT packet parsing and formatting. More...

Go to the source code of this file.

Functions

error_t mqttClientReceivePacket (MqttClientContext *context)
 Receive MQTT packet.
error_t mqttClientProcessPacket (MqttClientContext *context)
 Process incoming MQTT packet.
error_t mqttClientProcessConnAck (MqttClientContext *context, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen)
 Process incoming CONNACK packet.
error_t mqttClientProcessPubAck (MqttClientContext *context, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen)
 Process incoming PUBACK packet.
error_t mqttClientProcessPublish (MqttClientContext *context, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen)
 Process incoming PUBLISH packet.
error_t mqttClientProcessPubRec (MqttClientContext *context, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen)
 Process incoming PUBREC packet.
error_t mqttClientProcessPubRel (MqttClientContext *context, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen)
 Process incoming PUBREL packet.
error_t mqttClientProcessPubComp (MqttClientContext *context, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen)
 Process incoming PUBCOMP packet.
error_t mqttClientProcessSubAck (MqttClientContext *context, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen)
 Process incoming SUBACK packet.
error_t mqttClientProcessUnsubAck (MqttClientContext *context, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen)
 Process incoming UNSUBACK packet.
error_t mqttClientProcessPingResp (MqttClientContext *context, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen)
 Process incoming PINGRESP packet.
error_t mqttClientFormatConnect (MqttClientContext *context, bool_t cleanSession)
 Format CONNECT packet.
error_t mqttClientFormatPublish (MqttClientContext *context, const char_t *topic, const void *message, size_t length, MqttQosLevel qos, bool_t retain)
 Format PUBLISH packet.
error_t mqttClientFormatPubAck (MqttClientContext *context, uint16_t packetId)
 Format PUBACK packet.
error_t mqttClientFormatPubRec (MqttClientContext *context, uint16_t packetId)
 Format PUBREC packet.
error_t mqttClientFormatPubRel (MqttClientContext *context, uint16_t packetId)
 Format PUBREL packet.
error_t mqttClientFormatPubComp (MqttClientContext *context, uint16_t packetId)
 Format PUBCOMP packet.
error_t mqttClientFormatSubscribe (MqttClientContext *context, const char_t *topic, MqttQosLevel qos)
 Format SUBSCRIBE packet.
error_t mqttClientFormatUnsubscribe (MqttClientContext *context, const char_t *topic)
 Format UNSUBSCRIBE packet.
error_t mqttClientFormatPingReq (MqttClientContext *context)
 Format PINGREQ packet.
error_t mqttClientFormatDisconnect (MqttClientContext *context)
 Format DISCONNECT packet.

Detailed Description

MQTT packet parsing and formatting.

License

Copyright (C) 2010-2017 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:
1.7.6

Definition in file mqtt_client_packet.h.


Function Documentation

error_t mqttClientFormatConnect ( MqttClientContext *  context,
bool_t  cleanSession 
)

Format CONNECT packet.

Parameters:
[in]contextPointer to the MQTT 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 756 of file mqtt_client_packet.c.

error_t mqttClientFormatDisconnect ( MqttClientContext *  context )

Format DISCONNECT packet.

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

Definition at line 1380 of file mqtt_client_packet.c.

error_t mqttClientFormatPingReq ( MqttClientContext *  context )

Format PINGREQ packet.

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

Definition at line 1348 of file mqtt_client_packet.c.

error_t mqttClientFormatPubAck ( MqttClientContext *  context,
uint16_t  packetId 
)

Format PUBACK packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]packetIdPacket identifier
Returns:
Error code

Definition at line 1027 of file mqtt_client_packet.c.

error_t mqttClientFormatPubComp ( MqttClientContext *  context,
uint16_t  packetId 
)

Format PUBCOMP packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]packetIdPacket identifier
Returns:
Error code

Definition at line 1171 of file mqtt_client_packet.c.

error_t mqttClientFormatPublish ( MqttClientContext *  context,
const char_t *  topic,
const void *  message,
size_t  length,
MqttQosLevel  qos,
bool_t  retain 
)

Format PUBLISH packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]topicTopic name
[in]messageMessage 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
Returns:
Error code

Definition at line 953 of file mqtt_client_packet.c.

error_t mqttClientFormatPubRec ( MqttClientContext *  context,
uint16_t  packetId 
)

Format PUBREC packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]packetIdPacket identifier
Returns:
Error code

Definition at line 1075 of file mqtt_client_packet.c.

error_t mqttClientFormatPubRel ( MqttClientContext *  context,
uint16_t  packetId 
)

Format PUBREL packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]packetIdPacket identifier
Returns:
Error code

Definition at line 1123 of file mqtt_client_packet.c.

error_t mqttClientFormatSubscribe ( MqttClientContext *  context,
const char_t *  topic,
MqttQosLevel  qos 
)

Format SUBSCRIBE packet.

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

Definition at line 1221 of file mqtt_client_packet.c.

error_t mqttClientFormatUnsubscribe ( MqttClientContext *  context,
const char_t *  topic 
)

Format UNSUBSCRIBE packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]topicTopic filter
Returns:
Error code

Definition at line 1289 of file mqtt_client_packet.c.

error_t mqttClientProcessConnAck ( MqttClientContext *  context,
bool_t  dup,
MqttQosLevel  qos,
bool_t  retain,
size_t  remainingLen 
)

Process incoming CONNACK packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]dupDUP flag from the fixed header
[in]qosQoS field from the fixed header
[in]retainRETAIN flag from the fixed header
[in]remainingLenLength of the variable header and the payload

Definition at line 262 of file mqtt_client_packet.c.

error_t mqttClientProcessPacket ( MqttClientContext *  context )

Process incoming MQTT packet.

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

Definition at line 167 of file mqtt_client_packet.c.

error_t mqttClientProcessPingResp ( MqttClientContext *  context,
bool_t  dup,
MqttQosLevel  qos,
bool_t  retain,
size_t  remainingLen 
)

Process incoming PINGRESP packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]dupDUP flag from the fixed header
[in]qosQoS field from the fixed header
[in]retainRETAIN flag from the fixed header
[in]remainingLenLength of the variable header and the payload

Definition at line 725 of file mqtt_client_packet.c.

error_t mqttClientProcessPubAck ( MqttClientContext *  context,
bool_t  dup,
MqttQosLevel  qos,
bool_t  retain,
size_t  remainingLen 
)

Process incoming PUBACK packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]dupDUP flag from the fixed header
[in]qosQoS field from the fixed header
[in]retainRETAIN flag from the fixed header
[in]remainingLenLength of the variable header and the payload

Definition at line 433 of file mqtt_client_packet.c.

error_t mqttClientProcessPubComp ( MqttClientContext *  context,
bool_t  dup,
MqttQosLevel  qos,
bool_t  retain,
size_t  remainingLen 
)

Process incoming PUBCOMP packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]dupDUP flag from the fixed header
[in]qosQoS field from the fixed header
[in]retainRETAIN flag from the fixed header
[in]remainingLenLength of the variable header and the payload

Definition at line 593 of file mqtt_client_packet.c.

error_t mqttClientProcessPublish ( MqttClientContext *  context,
bool_t  dup,
MqttQosLevel  qos,
bool_t  retain,
size_t  remainingLen 
)

Process incoming PUBLISH packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]dupDUP flag from the fixed header
[in]qosQoS field from the fixed header
[in]retainRETAIN flag from the fixed header
[in]remainingLenLength of the variable header and the payload

Definition at line 319 of file mqtt_client_packet.c.

error_t mqttClientProcessPubRec ( MqttClientContext *  context,
bool_t  dup,
MqttQosLevel  qos,
bool_t  retain,
size_t  remainingLen 
)

Process incoming PUBREC packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]dupDUP flag from the fixed header
[in]qosQoS field from the fixed header
[in]retainRETAIN flag from the fixed header
[in]remainingLenLength of the variable header and the payload

Definition at line 477 of file mqtt_client_packet.c.

error_t mqttClientProcessPubRel ( MqttClientContext *  context,
bool_t  dup,
MqttQosLevel  qos,
bool_t  retain,
size_t  remainingLen 
)

Process incoming PUBREL packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]dupDUP flag from the fixed header
[in]qosQoS field from the fixed header
[in]retainRETAIN flag from the fixed header
[in]remainingLenLength of the variable header and the payload

Definition at line 535 of file mqtt_client_packet.c.

error_t mqttClientProcessSubAck ( MqttClientContext *  context,
bool_t  dup,
MqttQosLevel  qos,
bool_t  retain,
size_t  remainingLen 
)

Process incoming SUBACK packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]dupDUP flag from the fixed header
[in]qosQoS field from the fixed header
[in]retainRETAIN flag from the fixed header
[in]remainingLenLength of the variable header and the payload

Definition at line 637 of file mqtt_client_packet.c.

error_t mqttClientProcessUnsubAck ( MqttClientContext *  context,
bool_t  dup,
MqttQosLevel  qos,
bool_t  retain,
size_t  remainingLen 
)

Process incoming UNSUBACK packet.

Parameters:
[in]contextPointer to the MQTT client context
[in]dupDUP flag from the fixed header
[in]qosQoS field from the fixed header
[in]retainRETAIN flag from the fixed header
[in]remainingLenLength of the variable header and the payload

Definition at line 681 of file mqtt_client_packet.c.

error_t mqttClientReceivePacket ( MqttClientContext *  context )

Receive MQTT packet.

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

Definition at line 71 of file mqtt_client_packet.c.