Closed conaito closed 1 year ago
I'll see what i can do
i append function publish in broker, but not test it.
can you give me some sample code to how to use / test it?
char *topic="test/test";
char *payload="some text";
broker->publish(topic,payload);
if client subscribe to topic it receive message
nice! i will test it soon! thx a lot. btw. is this message set as retain?
nice! i will test it soon! thx a lot. btw. is this message set as retain?
now this message Qos 0 and not retain.
Works great, thanks! It's exactly what I was looking for.
Sort of continuing with this topic ....for/in the loop calling broker.update() is there a way to get notified or set up a call back function for when there is a valid subscribe to a new topic or a valid unsubscribe from a current topic? That way would know when and what to broadcast based only from the connected clients needs and desires. The envisioned use for this code would be to publish using broker->publish(topic,payload); shown above -With only the needed topics/payloads of connected client(s) out of the many many topic possibilities for our devices. Thanks!
hi, there are no such functions now. But I can add, and it will be possible to receive events like the rest through the onEvent function
That would be excellent and appreciated!
Is there a way I am able to use the requested feature before the library is updated? Thanks
I plan to add a branch for development, all new functionality will go there, and then into the main and releases.
Is there a way to send a message from broker to the clients or a special client? if not can you implement such solution? As far as i see there is not client as such in the library to can do it?