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

Convert incoming payload into something useful #17

@TomHBP

Description

@TomHBP

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions