Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added @warning comments about using API with parameters from stack #175

Merged
merged 1 commit into from
May 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions include/aws_iot_mqtt_client_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,15 @@ IoT_Error_t aws_iot_mqtt_publish(AWS_IoT_Client *pClient, const char *pTopicName
* Called to send a subscribe message to the broker requesting a subscription
* to an MQTT topic.
* @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.
*
* @param pClient Reference to the IoT Client
* @param pTopicName Topic Name to publish to
* @param pTopicName Topic Name to publish to. pTopicName needs to be static in memory since
* no malloc are performed by the SDK
* @param topicNameLen Length of the topic name
* @param pApplicationHandler_t Reference to the handler function for this subscription
* @param pApplicationHandlerData Data to be passed as argument to the application handler callback
* @param pApplicationHandlerData Point to data passed to the callback.
* pApplicationHandlerData also needs to be static in memory since no malloc are performed by the SDK
*
* @return An IoT Error Type defining successful/failed subscription
*/
Expand Down
12 changes: 10 additions & 2 deletions src/aws_iot_mqtt_client_subscribe.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,15 @@ static uint32_t _aws_iot_mqtt_get_free_message_handler_index(AWS_IoT_Client *pCl
* 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.
*
* @param pClient Reference to the IoT Client
* @param pTopicName Topic Name to publish to
* @param pTopicName Topic Name to publish to. pTopicName needs to be static in memory since
* no malloc are performed by the SDK
* @param topicNameLen Length of the topic name
* @param pApplicationHandler_t Reference to the handler function for this subscription
* @param pApplicationHandlerData Point to data passed to the callback.
* pApplicationHandlerData also needs to be static in memory since no malloc are performed by the SDK
*
* @return An IoT Error Type defining successful/failed subscription
*/
Expand Down Expand Up @@ -277,11 +281,15 @@ static IoT_Error_t _aws_iot_mqtt_internal_subscribe(AWS_IoT_Client *pClient, con
* 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.
*
* @param pClient Reference to the IoT Client
* @param pTopicName Topic Name to publish to
* @param pTopicName Topic Name to publish to. pTopicName needs to be static in memory since
* no malloc are performed by the SDK
* @param topicNameLen Length of the topic name
* @param pApplicationHandler_t Reference to the handler function for this subscription
* @param pApplicationHandlerData Point to data passed to the callback.
* pApplicationHandlerData also needs to be static in memory since no malloc are performed by the SDK
*
* @return An IoT Error Type defining successful/failed subscription
*/
Expand Down
1 change: 1 addition & 0 deletions src/aws_iot_mqtt_client_unsubscribe.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ static IoT_Error_t _aws_iot_mqtt_internal_unsubscribe(AWS_IoT_Client *pClient, c
if(pClient->clientData.messageHandlers[i].topicName != NULL &&
(strcmp(pClient->clientData.messageHandlers[i].topicName, pTopicFilter) == 0)) {
subscriptionExists = true;
break;
}
}

Expand Down