A small footprint MQTT library
Dependents: STM32F746_iothub_client_sample_mqtt FXOS8700CQ_To_Azure_IoT f767zi_mqtt FXOS8700CQ_To_Azure_IoT ... more
Diff: mqtt_client.c
- Revision:
- 17:73ae81ce481d
- Parent:
- 16:4e4835036f27
- Child:
- 18:6d13ad04e8a0
--- a/mqtt_client.c Fri Jun 02 15:53:19 2017 -0700 +++ b/mqtt_client.c Fri Jul 14 16:38:15 2017 -0700 @@ -913,6 +913,7 @@ if (mqtt_client == NULL || msgHandle == NULL) { /*Codes_SRS_MQTT_CLIENT_07_019: [If one of the parameters handle or msgHandle is NULL then mqtt_client_publish shall return a non-zero value.]*/ + LogError("Invalid parameter specified mqtt_client: %p, msgHandle: %p", mqtt_client, msgHandle); result = __FAILURE__; } else @@ -973,9 +974,10 @@ { int result; MQTT_CLIENT* mqtt_client = (MQTT_CLIENT*)handle; - if (mqtt_client == NULL || subscribeList == NULL || count == 0) + if (mqtt_client == NULL || subscribeList == NULL || count == 0 || packetId == 0) { /*Codes_SRS_MQTT_CLIENT_07_013: [If any of the parameters handle, subscribeList is NULL or count is 0 then mqtt_client_subscribe shall return a non-zero value.]*/ + LogError("Invalid parameter specified mqtt_client: %p, subscribeList: %p, count: %d, packetId: %d", mqtt_client, subscribeList, count, packetId); result = __FAILURE__; } else @@ -1020,9 +1022,10 @@ { int result; MQTT_CLIENT* mqtt_client = (MQTT_CLIENT*)handle; - if (mqtt_client == NULL || unsubscribeList == NULL || count == 0) + if (mqtt_client == NULL || unsubscribeList == NULL || count == 0 || packetId == 0) { /*Codes_SRS_MQTT_CLIENT_07_016: [If any of the parameters handle, unsubscribeList is NULL or count is 0 then mqtt_client_unsubscribe shall return a non-zero value.]*/ + LogError("Invalid parameter specified mqtt_client: %p, unsubscribeList: %p, count: %d, packetId: %d", mqtt_client, unsubscribeList, count, packetId); result = __FAILURE__; } else