I have managed to get the MQTT_publish_sub example working on my W5500-evb-pico.
I am now trying to get to the point where I can parse an incoming message to the topic I am subscribed to, The incoming message is correctly printed to the serial port with the line:
printf("%.s\n", (uint32_t)message->payloadlen, (uint8_t )message->payload);
However I am unable to work out how to convert the payload into a string. I'm sure it's simple but the use of void pointers and the typedef MQTTMessage is confusing me. Is anyone able to help?
Many thanks.
I have managed to get the MQTT_publish_sub example working on my W5500-evb-pico. I am now trying to get to the point where I can parse an incoming message to the topic I am subscribed to, The incoming message is correctly printed to the serial port with the line: printf("%.s\n", (uint32_t)message->payloadlen, (uint8_t )message->payload); However I am unable to work out how to convert the payload into a string. I'm sure it's simple but the use of void pointers and the typedef MQTTMessage is confusing me. Is anyone able to help? Many thanks.