mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-18 02:37:47 -04:00
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
This commit is contained in:
parent
559772a4db
commit
832a797c69
6 changed files with 25 additions and 9 deletions
|
@ -469,9 +469,9 @@ void vHandleOtherIncomingPacket( MQTTPacketInfo_t * pxPacketInfo,
|
||||||
case MQTT_PACKET_TYPE_PINGRESP:
|
case MQTT_PACKET_TYPE_PINGRESP:
|
||||||
|
|
||||||
/* Nothing to be done from application as library handles
|
/* 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 "
|
LogWarn( ( "PINGRESP should not be handled by the application "
|
||||||
"callback when using MQTT_ProcessLoop.\n\n" ) );
|
"callback when using MQTT_ProcessLoop.\n" ) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MQTT_PACKET_TYPE_PUBACK:
|
case MQTT_PACKET_TYPE_PUBACK:
|
||||||
|
|
|
@ -778,7 +778,11 @@ static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MQTT_PACKET_TYPE_PINGRESP:
|
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;
|
break;
|
||||||
|
|
||||||
case MQTT_PACKET_TYPE_PUBREC:
|
case MQTT_PACKET_TYPE_PUBREC:
|
||||||
|
|
|
@ -1716,7 +1716,7 @@ static void prvEventCallback( MQTTContext_t * pMqttContext,
|
||||||
case MQTT_PACKET_TYPE_PINGRESP:
|
case MQTT_PACKET_TYPE_PINGRESP:
|
||||||
|
|
||||||
/* Nothing to be done from application as library handles
|
/* 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 "
|
LogWarn( ( "PINGRESP should not be handled by the application "
|
||||||
"callback when using MQTT_ProcessLoop.\n" ) );
|
"callback when using MQTT_ProcessLoop.\n" ) );
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -902,7 +902,11 @@ static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MQTT_PACKET_TYPE_PINGRESP:
|
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;
|
break;
|
||||||
|
|
||||||
/* Any other packet type is invalid. */
|
/* Any other packet type is invalid. */
|
||||||
|
|
|
@ -723,7 +723,11 @@ static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MQTT_PACKET_TYPE_PINGRESP:
|
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;
|
break;
|
||||||
|
|
||||||
/* Any other packet type is invalid. */
|
/* Any other packet type is invalid. */
|
||||||
|
|
|
@ -621,7 +621,11 @@ static void prvMQTTProcessResponse( MQTTPacketInfo_t * pxIncomingPacket,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MQTT_PACKET_TYPE_PINGRESP:
|
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;
|
break;
|
||||||
|
|
||||||
/* Any other packet type is invalid. */
|
/* Any other packet type is invalid. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue