Skip to content

Commit d0c2820

Browse files
committed
added ref property
1 parent dd70d75 commit d0c2820

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ void onMessageAdvanced(MQTTClientCallbackAdvanced);
139139
```
140140
141141
- The set callback is mostly called during a call to `loop()` but may also be called during a call to `subscribe()`, `unsubscribe()` or `publish() // QoS > 0` if messages have been received before receiving the required acknowledgement. Therefore, it is strongly recommended to not call `subscribe()`, `unsubscribe()` or `publish() // QoS > 0` directly in the callback.
142+
- In case you need a reference to an object that manages the client, use the `void * ref` property on the client to store a pointer, and access it directly from the advanced callback..
142143
143144
Set more advanced options:
144145

src/MQTTClient.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class MQTTClient {
5757
lwmqtt_err_t _lastError = (lwmqtt_err_t)0;
5858

5959
public:
60+
void * ref;
61+
6062
explicit MQTTClient(int bufSize = 128);
6163

6264
~MQTTClient();

0 commit comments

Comments
 (0)