Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Convert incoming payload into something useful #17

Open
TomHBP opened this issue Feb 3, 2023 · 0 comments
Open

Convert incoming payload into something useful #17

TomHBP opened this issue Feb 3, 2023 · 0 comments

Comments

@TomHBP
Copy link

TomHBP commented Feb 3, 2023

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant