diff --git a/source/core_mqtt.c b/source/core_mqtt.c index b625f08d7..1efb3520a 100644 --- a/source/core_mqtt.c +++ b/source/core_mqtt.c @@ -3373,6 +3373,10 @@ const char * MQTT_Status_strerror( MQTTStatus_t status ) str = "MQTTKeepAliveTimeout"; break; + case MQTTNeedMoreBytes: + str = "MQTTNeedMoreBytes"; + break; + default: str = "Invalid MQTT Status code"; break; diff --git a/test/unit-test/core_mqtt_utest.c b/test/unit-test/core_mqtt_utest.c index 762feefe7..97f87c080 100644 --- a/test/unit-test/core_mqtt_utest.c +++ b/test/unit-test/core_mqtt_utest.c @@ -5842,7 +5842,11 @@ void test_MQTT_Status_strerror( void ) str = MQTT_Status_strerror( status ); TEST_ASSERT_EQUAL_STRING( "MQTTKeepAliveTimeout", str ); - status = MQTTKeepAliveTimeout + 1; + status = MQTTNeedMoreBytes; + str = MQTT_Status_strerror( status ); + TEST_ASSERT_EQUAL_STRING( "MQTTNeedMoreBytes", str ); + + status = MQTTNeedMoreBytes + 1; str = MQTT_Status_strerror( status ); TEST_ASSERT_EQUAL_STRING( "Invalid MQTT Status code", str ); }