This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Thread MQTT example causes ASSERT in Debug build

I am using nRF52840 with nRF5 SDK for Thread and Zigbee 1.0.0 on the nRF52840 development kit.

The Release build of the mqttsn_client example compiles and runs fine.

Using the Debug build causes an ASSERT.

Pressing Button 1, calls  mqttsn_client_search_gateway(&m_client, SEARCH_GATEWAY_TIMEOUT);

which calls  mqttsn_client_state_update(p_client, SENT_SEARCHGW) in mqttsn_client.c

which generates an ASSERT because fsm_event == SENT_SEARCHGW, which is not handled anywhere in mqttsn_client_state_update()

        case MQTTSN_CLIENT_DISCONNECTED:
        {
            switch (fsm_event)
            {
                case SENT_CONNECT:
                    p_client->client_state = MQTTSN_CLIENT_ESTABLISHING_CONNECTION;
                    break;

                default:
                    ASSERT(false);
                    break;
            }
            break;
        }

mqttsn_client_state_update() needs to handle that event.

Thanks,

Mary

Related