FreeRTOS:
BLE
BLE
|
Return to main page ↑ |
File contains serializer and deserializer APIS for sending and receiving MQTT messages over BLE using a companion device SDK. More...
#include "types/iot_mqtt_types.h"
#include "aws_clientcredential.h"
Go to the source code of this file.
Functions | |
bool | IotBleMqtt_InitSerialize (void) |
Initializes the serializer for MQTT messages over BLE. More... | |
void | IotBleMqtt_CleanupSerialize (void) |
Cleanup the serializerfor Mqtt messages over BLE. | |
IotMqttError_t | IotBleMqtt_SerializeConnect (const IotMqttConnectInfo_t *const pConnectInfo, uint8_t **const pConnectPacket, size_t *const pPacketSize) |
Serialize the MQTT CONNECT message sent over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_DeserializeConnack (struct _mqttPacket *pConnack) |
Deserialize MQTT CONNACK message received over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_SerializePublish (const IotMqttPublishInfo_t *const pPublishInfo, uint8_t **const pPublishPacket, size_t *const pPacketSize, uint16_t *const pPacketIdentifier, uint8_t **pPacketIdentifierHigh) |
Serialize MQTT PUBLISH message sent over BLE connection. More... | |
void | IotBleMqtt_PublishSetDup (uint8_t *const pPublishPacket, uint8_t *pPacketIdentifierHigh, uint16_t *const pNewPacketIdentifier) |
Set the DUP flag to indicate its a duplicate QoS1/QoS2 message. More... | |
IotMqttError_t | IotBleMqtt_DeserializePublish (struct _mqttPacket *pConnack) |
Deserialize MQTT PUBLISH message received over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_SerializePuback (uint16_t packetIdentifier, uint8_t **const pPubackPacket, size_t *const pPacketSize) |
Serialize MQTT PUBACK message sent over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_DeserializePuback (struct _mqttPacket *pConnack) |
Deserialize MQTT PUBACK message received from a BLE connection. More... | |
IotMqttError_t | IotBleMqtt_SerializeSubscribe (const IotMqttSubscription_t *const pSubscriptionList, size_t subscriptionCount, uint8_t **const pSubscribePacket, size_t *const pPacketSize, uint16_t *const pPacketIdentifier) |
Serialize MQTT SUBSCRIBE message sent over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_DeserializeSuback (struct _mqttPacket *pConnack) |
Deserialize MQTT SUBACK message received over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_SerializeUnsubscribe (const IotMqttSubscription_t *const pSubscriptionList, size_t subscriptionCount, uint8_t **const pUnsubscribePacket, size_t *const pPacketSize, uint16_t *const pPacketIdentifier) |
Serialize MQTT UNSUBSCRIBE message sent over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_DeserializeUnsuback (struct _mqttPacket *pConnack) |
Deserialize MQTT UNSUBACK message received over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_SerializeDisconnect (uint8_t **const pDisconnectPacket, size_t *const pPacketSize) |
Serialize MQTT DISCONNECT message sent over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_SerializePingreq (uint8_t **const pPingreqPacket, size_t *const pPacketSize) |
Serializes MQTT PING request message sent over BLE connection. More... | |
IotMqttError_t | IotBleMqtt_DeserializePingresp (struct _mqttPacket *pConnack) |
Deserializes MQTT PINGRESP received over BLE connection. More... | |
uint8_t | IotBleMqtt_GetPacketType (void *pNetworkConnection, const IotNetworkInterface_t *pNetworkInterface) |
Gets the packet type for the MQTT message. More... | |
size_t | IotBleMqtt_GetRemainingLength (void *pNetworkConnection, const IotNetworkInterface_t *pNetworkInterface) |
Gets the payload length for the MQTT message. More... | |
void | IotBleMqtt_FreePacket (uint8_t *pPacket) |
Frees an MQTT message. More... | |
File contains serializer and deserializer APIS for sending and receiving MQTT messages over BLE using a companion device SDK.
bool IotBleMqtt_InitSerialize | ( | void | ) |
Initializes the serializer for MQTT messages over BLE.
IotMqttError_t IotBleMqtt_SerializeConnect | ( | const IotMqttConnectInfo_t *const | pConnectInfo, |
uint8_t **const | pConnectPacket, | ||
size_t *const | pPacketSize | ||
) |
Serialize the MQTT CONNECT message sent over BLE connection.
Serialize the CONNECT message parameters into a CBOR map to be sent over BLE connection.
[in] | pConnectInfo | MQTT CONNECT parameters. |
[in] | pWillInfo | Will Message parameters. |
[out] | pConnectPacket | The buffer containing the serialized data. |
[in] | pPacketSize | The Size of the serialized data. |
IotMqttError_t IotBleMqtt_DeserializeConnack | ( | struct _mqttPacket * | pConnack | ) |
Deserialize MQTT CONNACK message received over BLE connection.
Deserialize CONNACK parameters from a CBOR map received over BLE connection.
[in] | pConnackStart | Pointer to start of the CONNACK message within a buffer. |
[in] | dataLength | Length of buffer containing the CONNACK message. |
[out] | pBytesProcessed | Length of the CONNACK message parsed. |
IotMqttError_t IotBleMqtt_SerializePublish | ( | const IotMqttPublishInfo_t *const | pPublishInfo, |
uint8_t **const | pPublishPacket, | ||
size_t *const | pPacketSize, | ||
uint16_t *const | pPacketIdentifier, | ||
uint8_t ** | pPacketIdentifierHigh | ||
) |
Serialize MQTT PUBLISH message sent over BLE connection.
Serialize PUBLISH message parameters into a CBOR map to be sent over BLE connection.
[in] | pPublishInfo | Pointer to the structure containing PUBLISH message parameters. |
[out] | pPublishPacket | Pointer to the serialized PUBLISH message. |
[out] | pPacketSize | Length of the serialized PUBLISH message. |
[out] | pPacketIdentifier | Unique Identifier for the PUBLISH message. |
void IotBleMqtt_PublishSetDup | ( | uint8_t *const | pPublishPacket, |
uint8_t * | pPacketIdentifierHigh, | ||
uint16_t *const | pNewPacketIdentifier | ||
) |
Set the DUP flag to indicate its a duplicate QoS1/QoS2 message.
Sets the DUP flag in the serialized message to indicate its a duplicate QoS1/QoS2 message.
[in] | pPublishOperation | The operation containing the PUBLISH message. |
IotMqttError_t IotBleMqtt_DeserializePublish | ( | struct _mqttPacket * | pConnack | ) |
Deserialize MQTT PUBLISH message received over BLE connection.
Deserializes the PUBLISH parameters from a CBOR map received over BLE connection.
[in] | pPublishStart | Pointer to start of the PUBLISH message within a buffer. |
[in] | dataLength | Length of buffer containing the PUBLISH message. |
[out] | pOutput | Parameters parsed from PUBLISH message. |
[out] | pPacketIdentifier | Unique identifier for the PUBLISH message. |
[out] | pBytesProcessed | Length of the PUBLISH message parsed. |
IotMqttError_t IotBleMqtt_SerializePuback | ( | uint16_t | packetIdentifier, |
uint8_t **const | pPubackPacket, | ||
size_t *const | pPacketSize | ||
) |
Serialize MQTT PUBACK message sent over BLE connection.
Serializes the PUBACK parameters into a CBOR map to be sent over BLE connection.
[in] | packetIdentifier | Identifier to be included in the PUBACK message. |
[out] | pPubackPacket | Pointer to the start of the PUBACK message. |
[out] | pPacketSize | Length of the PUBACK message. |
IotMqttError_t IotBleMqtt_DeserializePuback | ( | struct _mqttPacket * | pConnack | ) |
Deserialize MQTT PUBACK message received from a BLE connection.
Deserializes the PUBACK parameters from a CBOR map received over BLE connection.
[in] | pPubackStart | Pointer to start of the PUBACK message within a buffer. |
[in] | dataLength | Length of buffer containing the PUBACK message. |
[out] | pPacketIdentifier | Unique identifier for the PUBACK message. |
[out] | pBytesProcessed | Length of the PUBACK message parsed. |
IotMqttError_t IotBleMqtt_SerializeSubscribe | ( | const IotMqttSubscription_t *const | pSubscriptionList, |
size_t | subscriptionCount, | ||
uint8_t **const | pSubscribePacket, | ||
size_t *const | pPacketSize, | ||
uint16_t *const | pPacketIdentifier | ||
) |
Serialize MQTT SUBSCRIBE message sent over BLE connection.
Serialize the SUBSCRIBE message parameters into a CBOR map to be sent over BLE connection.
[in] | pSubscriptionList | Pointer to a array of subscriptions. |
[out] | subscriptionCount | Number of subscriptions. |
[out] | pSubscribePacket | Pointer to the SUBSCRIBE message. |
[out] | pPacketSize | Length of the SUBSCRIBE message. |
[out] | pPacketIdentifier | Unique identifier for the SUBSCRIBE message. |
IotMqttError_t IotBleMqtt_DeserializeSuback | ( | struct _mqttPacket * | pConnack | ) |
Deserialize MQTT SUBACK message received over BLE connection.
Deserializes MQTT SUBACK parameters from a CBOR map received over BLE connection. Removes the subscription callback from the connection, if it received an error response for a subscription
[in] | mqttConnection | The MQTT connection used. |
[in] | pSubackStart | Start of the SUBACK message within a buffer. |
[in] | dataLength | Length of the buffer containing SUBACK message |
[out] | pPacketIdentifier | Unique identifier for the SUBACK message. |
[out] | pBytesProcessed | Length of the SUBACK message parsed. |
IotMqttError_t IotBleMqtt_SerializeUnsubscribe | ( | const IotMqttSubscription_t *const | pSubscriptionList, |
size_t | subscriptionCount, | ||
uint8_t **const | pUnsubscribePacket, | ||
size_t *const | pPacketSize, | ||
uint16_t *const | pPacketIdentifier | ||
) |
Serialize MQTT UNSUBSCRIBE message sent over BLE connection.
Serialize the UNSUBSCRIBE message parameters into a CBOR map to be sent over BLE connection.
[in] | pSubscriptionList | Pointer to a array of subscriptions. |
[out] | subscriptionCount | Number of subscriptions. |
[out] | pUnsubscribePacket | Pointer to the UNSUBSCRIBE message. |
[out] | pPacketSize | Length of the UNSUBSCRIBE message. |
[out] | pPacketIdentifier | Unique identifier for the UNSUBSCRIBE message. |
IotMqttError_t IotBleMqtt_DeserializeUnsuback | ( | struct _mqttPacket * | pConnack | ) |
Deserialize MQTT UNSUBACK message received over BLE connection.
Deserializes the UNSUBACK parameters from a CBOR map received over BLE connection.
[in] | pUnsubackStart | Start of the UNSUBACK message within a buffer. |
[in] | dataLength | Length of the buffer containing UNSUBACK message |
[out] | pPacketIdentifier | Unique identifier for the UNSUBACK message. |
[out] | pBytesProcessed | Length of the SUBACK message parsed. |
IotMqttError_t IotBleMqtt_SerializeDisconnect | ( | uint8_t **const | pDisconnectPacket, |
size_t *const | pPacketSize | ||
) |
Serialize MQTT DISCONNECT message sent over BLE connection.
Serialize the DISCONNECT message parameters into a CBOR map to be sent over BLE connection.
[out] | pDisconnectPacket | Pointer to the DISCONNECT message |
[out] | pPacketSize | Length of the DISCONNECT message. |
IotMqttError_t IotBleMqtt_SerializePingreq | ( | uint8_t **const | pPingreqPacket, |
size_t *const | pPacketSize | ||
) |
Serializes MQTT PING request message sent over BLE connection.
Serializes PING request message parameters into a cbor map to be sent over BLE connection.
[out] | pPingreqPacket | Pointer to the PING request packet |
[out] | pPacketSize | Size of the PING request packet |
IotMqttError_t IotBleMqtt_DeserializePingresp | ( | struct _mqttPacket * | pConnack | ) |
Deserializes MQTT PINGRESP received over BLE connection.
Deserializes PINGRESP parameters from a CBOR map received over BLE connection.
[in] | pPingrespStart | Pointer to start of buffer containing PING response |
[in] | dataLength | Length of the buffer containing PING response |
[out] | pBytesProcessed | Number of bytes parsed |
uint8_t IotBleMqtt_GetPacketType | ( | void * | pNetworkConnection, |
const IotNetworkInterface_t * | pNetworkInterface | ||
) |
Gets the packet type for the MQTT message.
Parses the CBOR message received and gets the packet type.
[in] | pPacket | Pointer to the start of the packet |
[in] | packetSize | length of the buffer containing the packet |
size_t IotBleMqtt_GetRemainingLength | ( | void * | pNetworkConnection, |
const IotNetworkInterface_t * | pNetworkInterface | ||
) |
Gets the payload length for the MQTT message.
Parses the CBOR message received and gets the remaining payload length.
[in] | pPacket | Pointer to the start of the packet |
[in] | packetSize | length of the buffer containing the packet |
void IotBleMqtt_FreePacket | ( | uint8_t * | pPacket | ) |
Frees an MQTT message.
[in] | Pointer | to the message. |