EFWob / ESPPubSubClientWrapper

MIT License
3 stars 0 forks source link

Example improvement request #5

Closed NohWayJose closed 7 months ago

NohWayJose commented 8 months ago

Your simple example could easily cover more useful areas if it illustrated the mqtt-server as a char * (and a uint8_t ip address version, commented out) and the mqtt-port as a uint16_t (and a string version commented out)

It would also be more helpful if the topic in the callback function was more realistic and included a / which seems like a reasonable assumption for a / delimited topic hierarchy but which is currently failing to compile ("character constant too long for its type")

EFWob commented 8 months ago

Thanks for your feedback!

Your simple example could easily cover more useful areas if it illustrated the mqtt-server as a char * (and a uint8_t ip address version, commented out) and the mqtt-port as a uint16_t (and a string version commented out)

Yes, if you have any specific ideas, you can always leave a pull request. I could try self but might miss something then...

It would also be more helpful if the topic in the callback function was more realistic and included a / which seems like a reasonable assumption for a / delimited topic hierarchy but which is currently failing to compile ("character constant too long for its type")

Could you elaborate on that one a bit more. An easy example would help :-)

I wholeheartedly agree that level delimiting / is a must. However, I never had a problem with this. Just an example from a project that I have currently open on my desk:

pubSubClient.on("movement/+/set/+", setMovementParameter);

This includes levels and even level-wildcards and works like a charm (for me)...

Best

Erik

EFWob commented 7 months ago

Real issue was not clear to me. Please feel free to (re-)open that issue again with clarifying logs/code snippets...