Wiznet / RP2040-HAT-C

Ethernet Example for RP2040
64 stars 35 forks source link

Convert incoming payload into something useful #17

Open TomHBP opened 1 year ago

TomHBP commented 1 year ago

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.