3 years, 7 months ago.

Missing Void* reference in subscribe callback


I started writing an application using the Paho Embedded C++/C client libs. Everything works as expected, except of the subscribe callbacks.

Since my software is written in C++, I can't find a way to pass a context variable into the callback. So currently don't see a way to access my objects from within the callback.

I've seen in the API of the Paho MQTT C Client for Unix / Mac / Windows that it accepts for example a void* to pass the context into the callback. See:

Am I missing something or what is the best strategy to access objects outside of the callback?

The only thing I could think is some static variables in a class.

Any hints are very much appreciated, Tobias

Question relating to:

Working on MQTT, a machine-to-machine (M2M) "Internet of Things" connectivity protocol.
Comment on this question
Be the first to answer this question.

You need to log in to post a question