Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
aws_iot_mqtt_client_subscribe.c File Reference
MQTT client subscribe API definitions. More...
Go to the source code of this file.
Functions | |
| static IoT_Error_t | _aws_iot_mqtt_serialize_subscribe (unsigned char *pTxBuf, size_t txBufLen, unsigned char dup, uint16_t packetId, uint32_t topicCount, const char **pTopicNameList, uint16_t *pTopicNameLenList, QoS *pRequestedQoSs, uint32_t *pSerializedLen) |
| Serializes the supplied subscribe data into the supplied buffer, ready for sending. | |
| static IoT_Error_t | _aws_iot_mqtt_deserialize_suback (uint16_t *pPacketId, uint32_t maxExpectedQoSCount, uint32_t *pGrantedQoSCount, QoS *pGrantedQoSs, unsigned char *pRxBuf, size_t rxBufLen) |
| Deserializes the supplied (wire) buffer into suback data. | |
| static IoT_Error_t | _aws_iot_mqtt_internal_subscribe (AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen, QoS qos, pApplicationHandler_t pApplicationHandler, void *pApplicationHandlerData) |
| Subscribe to an MQTT topic. | |
| IoT_Error_t | aws_iot_mqtt_subscribe (AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen, QoS qos, pApplicationHandler_t pApplicationHandler, void *pApplicationHandlerData) |
| Subscribe to an MQTT topic. | |
| static IoT_Error_t | _aws_iot_mqtt_internal_resubscribe (AWS_IoT_Client *pClient) |
| Subscribe to an MQTT topic. | |
| IoT_Error_t | aws_iot_mqtt_resubscribe (AWS_IoT_Client *pClient) |
| Subscribe to an MQTT topic. | |
Detailed Description
MQTT client subscribe API definitions.
Definition in file aws_iot_mqtt_client_subscribe.c.
Function Documentation
| static IoT_Error_t _aws_iot_mqtt_deserialize_suback | ( | uint16_t * | pPacketId, |
| uint32_t | maxExpectedQoSCount, | ||
| uint32_t * | pGrantedQoSCount, | ||
| QoS * | pGrantedQoSs, | ||
| unsigned char * | pRxBuf, | ||
| size_t | rxBufLen | ||
| ) | [static] |
Deserializes the supplied (wire) buffer into suback data.
- Parameters:
-
pPacketId returned integer - the MQTT packet identifier maxExpectedQoSCount - the maximum number of members allowed in the grantedQoSs array pGrantedQoSCount returned uint32_t - number of members in the grantedQoSs array pGrantedQoSs returned array of QoS type - the granted qualities of service pRxBuf the raw buffer data, of the correct length determined by the remaining length field rxBufLen the length in bytes of the data in the supplied buffer
- Returns:
- An IoT Error Type defining successful/failed operation
Definition at line 116 of file aws_iot_mqtt_client_subscribe.c.
| static IoT_Error_t _aws_iot_mqtt_internal_resubscribe | ( | AWS_IoT_Client * | pClient ) | [static] |
Subscribe to an MQTT topic.
Called to send a subscribe message to the broker requesting a subscription to an MQTT topic. This is the internal function which is called by the resubscribe API to perform the operation. Not meant to be called directly as it doesn't do validations or client state changes
- Note:
- Call is blocking. The call returns after the receipt of the SUBACK control packet.
- Parameters:
-
pClient Reference to the IoT Client
- Returns:
- An IoT Error Type defining successful/failed subscription
Definition at line 345 of file aws_iot_mqtt_client_subscribe.c.
| static IoT_Error_t _aws_iot_mqtt_internal_subscribe | ( | AWS_IoT_Client * | pClient, |
| const char * | pTopicName, | ||
| uint16_t | topicNameLen, | ||
| QoS | qos, | ||
| pApplicationHandler_t | pApplicationHandler, | ||
| void * | pApplicationHandlerData | ||
| ) | [static] |
Subscribe to an MQTT topic.
Called to send a subscribe message to the broker requesting a subscription to an MQTT topic. This is the internal function which is called by the subscribe API to perform the operation. Not meant to be called directly as it doesn't do validations or client state changes
- Note:
- Call is blocking. The call returns after the receipt of the SUBACK control packet.
- Warning:
- pTopicName and pApplicationHandlerData need to be static in memory.
- Parameters:
-
pClient Reference to the IoT Client pTopicName Topic Name to publish to. pTopicName needs to be static in memory since no malloc are performed by the SDK topicNameLen Length of the topic name pApplicationHandler_t Reference to the handler function for this subscription pApplicationHandlerData Point to data passed to the callback. pApplicationHandlerData also needs to be static in memory since no malloc are performed by the SDK
- Returns:
- An IoT Error Type defining successful/failed subscription
Definition at line 207 of file aws_iot_mqtt_client_subscribe.c.
| static IoT_Error_t _aws_iot_mqtt_serialize_subscribe | ( | unsigned char * | pTxBuf, |
| size_t | txBufLen, | ||
| unsigned char | dup, | ||
| uint16_t | packetId, | ||
| uint32_t | topicCount, | ||
| const char ** | pTopicNameList, | ||
| uint16_t * | pTopicNameLenList, | ||
| QoS * | pRequestedQoSs, | ||
| uint32_t * | pSerializedLen | ||
| ) | [static] |
Serializes the supplied subscribe data into the supplied buffer, ready for sending.
- Parameters:
-
pTxBuf the buffer into which the packet will be serialized txBufLen the length in bytes of the supplied buffer dup unsigned char - the MQTT dup flag packetId uint16_t - the MQTT packet identifier topicCount - number of members in the topicFilters and reqQos arrays pTopicNameList - array of topic filter names pTopicNameLenList - array of length of topic filter names pRequestedQoSs - array of requested QoS pSerializedLen - the length of the serialized data
- Returns:
- An IoT Error Type defining successful/failed operation
Definition at line 58 of file aws_iot_mqtt_client_subscribe.c.
| IoT_Error_t aws_iot_mqtt_resubscribe | ( | AWS_IoT_Client * | pClient ) |
Subscribe to an MQTT topic.
Called to send a subscribe message to the broker requesting a subscription to an MQTT topic. This is the outer function which does the validations and calls the internal resubscribe above to perform the actual operation. It is also responsible for client state changes
- Note:
- Call is blocking. The call returns after the receipt of the SUBACK control packet.
- Parameters:
-
pClient Reference to the IoT Client
- Returns:
- An IoT Error Type defining successful/failed subscription
Definition at line 412 of file aws_iot_mqtt_client_subscribe.c.
| IoT_Error_t aws_iot_mqtt_subscribe | ( | AWS_IoT_Client * | pClient, |
| const char * | pTopicName, | ||
| uint16_t | topicNameLen, | ||
| QoS | qos, | ||
| pApplicationHandler_t | pApplicationHandler, | ||
| void * | pApplicationHandlerData | ||
| ) |
Subscribe to an MQTT topic.
Called to send a subscribe message to the broker requesting a subscription to an MQTT topic. This is the outer function which does the validations and calls the internal subscribe above to perform the actual operation. It is also responsible for client state changes
- Note:
- Call is blocking. The call returns after the receipt of the SUBACK control packet.
- Warning:
- pTopicName and pApplicationHandlerData need to be static in memory.
- Parameters:
-
pClient Reference to the IoT Client pTopicName Topic Name to publish to. pTopicName needs to be static in memory since no malloc are performed by the SDK topicNameLen Length of the topic name pApplicationHandler_t Reference to the handler function for this subscription pApplicationHandlerData Point to data passed to the callback. pApplicationHandlerData also needs to be static in memory since no malloc are performed by the SDK
- Returns:
- An IoT Error Type defining successful/failed subscription
Definition at line 296 of file aws_iot_mqtt_client_subscribe.c.
Generated on Tue Jul 12 2022 19:02:38 by
1.7.2