Skip to content

Commit 1d846a0

Browse files
committed
renamed getter for dropped messages
1 parent 51e4f43 commit 1d846a0

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ Check whether a session was present at the time of the last connect:
251251
bool sessionPresent();
252252
```
253253

254-
Configure dropping of overflowing messages (exceeding read buffer):
254+
Configure dropping of overflowing messages (exceeding read buffer) and checking the count of dropped messages:
255255

256256
```c++
257257
void dropOverflow(bool enabled);
258-
uint32_t getDropped();
258+
uint32_t droppedMessages();
259259
```
260260
261261
Access low-level information for debugging:

src/MQTTClient.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,9 @@ void MQTTClient::setTimeout(int _timeout) { this->timeout = _timeout; }
315315

316316
void MQTTClient::dropOverflow(bool enabled) {
317317
// configure drop overflow
318-
lwmqtt_drop_overflow(&this->client, enabled, &this->droppedMessages);
318+
lwmqtt_drop_overflow(&this->client, enabled, &this->_droppedMessages);
319319
}
320320

321-
uint32_t MQTTClient::getDropped() { return this->droppedMessages; }
322-
323321
bool MQTTClient::connect(const char clientID[], const char username[], const char password[], bool skip) {
324322
// close left open connection if still connected
325323
if (!skip && this->connected()) {

src/MQTTClient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class MQTTClient {
8989
bool _connected = false;
9090
lwmqtt_return_code_t _returnCode = (lwmqtt_return_code_t)0;
9191
lwmqtt_err_t _lastError = (lwmqtt_err_t)0;
92-
uint32_t droppedMessages = 0;
92+
uint32_t _droppedMessages = 0;
9393

9494
public:
9595
void *ref = nullptr;
@@ -139,7 +139,7 @@ class MQTTClient {
139139
}
140140

141141
void dropOverflow(bool enabled);
142-
uint32_t getDropped();
142+
uint32_t droppedMessages() { return this->_droppedMessages; }
143143

144144
bool connect(const char clientId[], bool skip = false) { return this->connect(clientId, nullptr, nullptr, skip); }
145145
bool connect(const char clientId[], const char username[], bool skip = false) {

0 commit comments

Comments
 (0)