mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-16 17:57:44 -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:
|
||||
|
||||
/* 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…
Add table
Add a link
Reference in a new issue