Skip to content

Commit

Permalink
added ref property
Browse files Browse the repository at this point in the history
  • Loading branch information
256dpi committed Dec 2, 2019
1 parent dd70d75 commit d0c2820
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ void onMessageAdvanced(MQTTClientCallbackAdvanced);
```
- 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.
- 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..
Set more advanced options:
Expand Down
2 changes: 2 additions & 0 deletions src/MQTTClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class MQTTClient {
lwmqtt_err_t _lastError = (lwmqtt_err_t)0;

public:
void * ref;

explicit MQTTClient(int bufSize = 128);

~MQTTClient();
Expand Down

0 comments on commit d0c2820

Please sign in to comment.