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

payload len on received topics via MQTTSN and Thread

HI,

I am trying to read the payload length of the data coming in a topic via MQTTSN over OpenThread. In the event handler, I am getting the event and trying to get the length from it:

void mqttsn_evt_handler(mqttsn_client_t * p_clientmqttsn_event_t * p_event)
{
....
    switch(p_event->event_id)
    {
....
        case MQTTSN_EVENT_RECEIVED:
            NRF_LOG_DEBUG("MQTT-SN event: Client received content.\r\n");

At this point, I am expecting the length to be in:

p_event->event_data.published.packet.len

but this is always 0. I guess this is also the incorrect place to check for the *payload* length, this looks more like the entire packet length. I could not find other member that might resemble a length.

Is there any other place where the payload length might be read from? This seems to be an important check in making sure I am parsing correctly the data coming from MQTTSN.

Regards,

Edgar

Parents Reply Children
No Data
Related