Hygiene fix in MQTT demos to log warning for unexpected PINGRESP packet event (#366)

Update MQTT demos to log warning on receiving PINGRESP packet in event callback
pull/368/head
Archit Aggarwal 4 years ago committed by GitHub
parent 559772a4db
commit 832a797c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -469,9 +469,9 @@ void vHandleOtherIncomingPacket( MQTTPacketInfo_t * pxPacketInfo,
case MQTT_PACKET_TYPE_PINGRESP:
/* Nothing to be done from application as library handles
* PINGRESP. */
* PINGRESP with the use of MQTT_ProcessLoop API function. */
LogWarn( ( "PINGRESP should not be handled by the application "
"callback when using MQTT_ProcessLoop.\n\n" ) );
"callback when using MQTT_ProcessLoop.\n" ) );
break;
case MQTT_PACKET_TYPE_PUBACK:

@ -778,7 +778,11 @@ static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
break;
case MQTT_PACKET_TYPE_PINGRESP:
LogInfo( ( "Ping Response successfully received.\r\n" ) );
/* Nothing to be done from application as library handles
* PINGRESP with the use of MQTT_ProcessLoop API function. */
LogWarn( ( "PINGRESP should not be handled by the application "
"callback when using MQTT_ProcessLoop.\n" ) );
break;
case MQTT_PACKET_TYPE_PUBREC:

@ -1716,7 +1716,7 @@ static void prvEventCallback( MQTTContext_t * pMqttContext,
case MQTT_PACKET_TYPE_PINGRESP:
/* Nothing to be done from application as library handles
* PINGRESP. */
* PINGRESP with the use of MQTT_ProcessLoop API function. */
LogWarn( ( "PINGRESP should not be handled by the application "
"callback when using MQTT_ProcessLoop.\n" ) );
break;

@ -902,7 +902,11 @@ static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
break;
case MQTT_PACKET_TYPE_PINGRESP:
LogInfo( ( "Ping Response successfully received.\r\n" ) );
/* Nothing to be done from application as library handles
* PINGRESP with the use of MQTT_ProcessLoop API function. */
LogWarn( ( "PINGRESP should not be handled by the application "
"callback when using MQTT_ProcessLoop.\n" ) );
break;
/* Any other packet type is invalid. */

@ -153,8 +153,8 @@
*/
#define mqttexampleTRANSPORT_SEND_RECV_TIMEOUT_MS ( 200U )
#define MILLISECONDS_PER_SECOND ( 1000U ) /**< @brief Milliseconds per second. */
#define MILLISECONDS_PER_TICK ( MILLISECONDS_PER_SECOND / configTICK_RATE_HZ ) /**< Milliseconds per FreeRTOS tick. */
#define MILLISECONDS_PER_SECOND ( 1000U ) /**< @brief Milliseconds per second. */
#define MILLISECONDS_PER_TICK ( MILLISECONDS_PER_SECOND / configTICK_RATE_HZ ) /**< Milliseconds per FreeRTOS tick. */
/*-----------------------------------------------------------*/
@ -723,7 +723,11 @@ static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
break;
case MQTT_PACKET_TYPE_PINGRESP:
LogInfo( ( "Ping Response successfully received." ) );
/* Nothing to be done from application as library handles
* PINGRESP with the use of MQTT_ProcessLoop API function. */
LogWarn( ( "PINGRESP should not be handled by the application "
"callback when using MQTT_ProcessLoop.\n" ) );
break;
/* Any other packet type is invalid. */

@ -621,7 +621,11 @@ static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
break;
case MQTT_PACKET_TYPE_PINGRESP:
LogInfo( ( "Ping Response successfully received.\r\n" ) );
/* Nothing to be done from application as library handles
* PINGRESP with the use of MQTT_ProcessLoop API function. */
LogWarn( ( "PINGRESP should not be handled by the application "
"callback when using MQTT_ProcessLoop.\n" ) );
break;
/* Any other packet type is invalid. */

Loading…
Cancel
Save