Webserver+3d print
mqtt_client_misc.c File Reference
Helper functions for MQTT client. More...
Go to the source code of this file.
Functions | |
void | mqttClientChangeState (MqttClientContext *context, MqttClientState newState) |
Update MQTT client state. | |
error_t | mqttClientCheckKeepAlive (MqttClientContext *context) |
Check keep-alive time interval. | |
error_t | mqttSerializeHeader (uint8_t *buffer, size_t *pos, MqttPacketType type, bool_t dup, MqttQosLevel qos, bool_t retain, size_t remainingLen) |
Serialize fixed header. | |
error_t | mqttSerializeByte (uint8_t *buffer, size_t bufferLen, size_t *pos, uint8_t value) |
Write a 8-bit integer to the output buffer. | |
error_t | mqttSerializeShort (uint8_t *buffer, size_t bufferLen, size_t *pos, uint16_t value) |
Write a 16-bit integer to the output buffer. | |
error_t | mqttSerializeString (uint8_t *buffer, size_t bufferLen, size_t *pos, const void *string, size_t stringLen) |
Serialize string. | |
error_t | mqttSerializeData (uint8_t *buffer, size_t bufferLen, size_t *pos, const void *data, size_t dataLen) |
Serialize raw data. | |
error_t | mqttDeserializeHeader (uint8_t *buffer, size_t bufferLen, size_t *pos, MqttPacketType *type, bool_t *dup, MqttQosLevel *qos, bool_t *retain, size_t *remainingLen) |
Deserialize fixed header. | |
error_t | mqttDeserializeByte (uint8_t *buffer, size_t bufferLen, size_t *pos, uint8_t *value) |
Read a 8-bit integer from the input buffer. | |
error_t | mqttDeserializeShort (uint8_t *buffer, size_t bufferLen, size_t *pos, uint16_t *value) |
Read a 16-bit integer from the input buffer. | |
error_t | mqttDeserializeString (uint8_t *buffer, size_t bufferLen, size_t *pos, char_t **string, size_t *stringLen) |
Deserialize string. |
Detailed Description
Helper functions for MQTT client.
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.
- Version:
- 1.7.6
Definition in file mqtt_client_misc.c.
Function Documentation
void mqttClientChangeState | ( | MqttClientContext * | context, |
MqttClientState | newState | ||
) |
Update MQTT client state.
- Parameters:
-
[in] context Pointer to the MQTT client context [in] newState New state to switch to
Definition at line 50 of file mqtt_client_misc.c.
error_t mqttClientCheckKeepAlive | ( | MqttClientContext * | context ) |
Check keep-alive time interval.
- Parameters:
-
[in] context Pointer to the MQTT client context
- Returns:
- Error code
Definition at line 63 of file mqtt_client_misc.c.
error_t mqttDeserializeByte | ( | uint8_t * | buffer, |
size_t | bufferLen, | ||
size_t * | pos, | ||
uint8_t * | value | ||
) |
Read a 8-bit integer from the input buffer.
- Parameters:
-
[in] buffer Pointer to the input buffer [in] bufferLen Length of the input buffer [in,out] pos Current position [out] value Value of the 8-bit integer
- Returns:
- Error code
Definition at line 414 of file mqtt_client_misc.c.
error_t mqttDeserializeHeader | ( | uint8_t * | buffer, |
size_t | bufferLen, | ||
size_t * | pos, | ||
MqttPacketType * | type, | ||
bool_t * | dup, | ||
MqttQosLevel * | qos, | ||
bool_t * | retain, | ||
size_t * | remainingLen | ||
) |
Deserialize fixed header.
- Parameters:
-
[in] buffer Pointer to the input buffer [in] bufferLen Length of the input buffer [in,out] pos Current position [out] type MQTT control packet type [out] dup DUP flag from the fixed header [out] qos QoS field from the fixed header [out] retain RETAIN flag from the fixed header [out] remainingLen Length of the variable header and the payload
- Returns:
- Error code
Definition at line 336 of file mqtt_client_misc.c.
error_t mqttDeserializeShort | ( | uint8_t * | buffer, |
size_t | bufferLen, | ||
size_t * | pos, | ||
uint16_t * | value | ||
) |
Read a 16-bit integer from the input buffer.
- Parameters:
-
[in] buffer Pointer to the input buffer [in] bufferLen Length of the input buffer [in,out] pos Current position [out] value Value of the 16-bit integer
- Returns:
- Error code
Definition at line 446 of file mqtt_client_misc.c.
error_t mqttDeserializeString | ( | uint8_t * | buffer, |
size_t | bufferLen, | ||
size_t * | pos, | ||
char_t ** | string, | ||
size_t * | stringLen | ||
) |
Deserialize string.
- Parameters:
-
[in] buffer Pointer to the input buffer [in] bufferLen Length of the input buffer [in,out] pos Current position [out] string Pointer to the string [out] stringLen Length of the string, in bytes
- Returns:
- Error code
Definition at line 479 of file mqtt_client_misc.c.
error_t mqttSerializeByte | ( | uint8_t * | buffer, |
size_t | bufferLen, | ||
size_t * | pos, | ||
uint8_t | value | ||
) |
Write a 8-bit integer to the output buffer.
- Parameters:
-
[in] buffer Pointer to the output buffer [in] bufferLen Maximum number of bytes the output buffer can hold [in,out] pos Current position [in] value 8-bit integer to be serialized
- Returns:
- Error code
Definition at line 197 of file mqtt_client_misc.c.
error_t mqttSerializeData | ( | uint8_t * | buffer, |
size_t | bufferLen, | ||
size_t * | pos, | ||
const void * | data, | ||
size_t | dataLen | ||
) |
Serialize raw data.
- Parameters:
-
[in] buffer Pointer to the output buffer [in] bufferLen Maximum number of bytes the output buffer can hold [in,out] pos Current position [in] data Pointer to the raw data to be serialized [in] dataLen Length of the raw data, in bytes
- Returns:
- Error code
Definition at line 300 of file mqtt_client_misc.c.
error_t mqttSerializeHeader | ( | uint8_t * | buffer, |
size_t * | pos, | ||
MqttPacketType | type, | ||
bool_t | dup, | ||
MqttQosLevel | qos, | ||
bool_t | retain, | ||
size_t | remainingLen | ||
) |
Serialize fixed header.
- Parameters:
-
[in] buffer Pointer to the output buffer [in,out] pos Current position [in] type MQTT control packet type [in] dup DUP flag [in] qos QoS field [in] retain RETAIN flag [in] remainingLen Length of the variable header and the payload
- Returns:
- Error code
Definition at line 128 of file mqtt_client_misc.c.
error_t mqttSerializeShort | ( | uint8_t * | buffer, |
size_t | bufferLen, | ||
size_t * | pos, | ||
uint16_t | value | ||
) |
Write a 16-bit integer to the output buffer.
- Parameters:
-
[in] buffer Pointer to the output buffer [in] bufferLen Maximum number of bytes the output buffer can hold [in,out] pos Current position [in] value 16-bit integer to be serialized
- Returns:
- Error code
Definition at line 229 of file mqtt_client_misc.c.
error_t mqttSerializeString | ( | uint8_t * | buffer, |
size_t | bufferLen, | ||
size_t * | pos, | ||
const void * | string, | ||
size_t | stringLen | ||
) |
Serialize string.
- Parameters:
-
[in] buffer Pointer to the output buffer [in] bufferLen Maximum number of bytes the output buffer can hold [in,out] pos Current position [in] string Pointer to the string to be serialized [in] stringLen Length of the string, in bytes
- Returns:
- Error code
Definition at line 263 of file mqtt_client_misc.c.
Generated on Tue Jul 12 2022 17:10:21 by
