Skip to content

Commit 633655b

Browse files
committed
documented arbitrary publish payload size
1 parent 1d846a0 commit 633655b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ Other shields and boards should also work if they provide a [Client](https://www
2828

2929
## Notes
3030

31-
- The maximum size for packets being published and received is set by default to 128 bytes. To change the buffer sizes, you need to use `MQTTClient client(256)` instead of just `MQTTClient client` on the top of your sketch. The passed value denotes the read and write buffer size.
31+
- The maximum size for packets being published and received is set by default to 128 bytes. To change the buffer sizes, you need to use `MQTTClient client(256)` instead of just `MQTTClient client` on the top of your sketch. The passed value denotes the read and write buffer size. **Beginning with version 2.6, the message payload is sent separately during publishing. Therefore, the write buffer is only needed to encode the packet header and topic, for which the default 128 bytes should be enough. However, the receiving of messages is still fully constrained by the read buffer.**
3232

3333
- On the ESP8266 it has been reported that an additional `delay(10);` after `client.loop();` fixes many stability issues with WiFi connections.
3434

35-
- To use the library with shiftr.io, you need to provide the token key (username) and token secret (password) as the second and third argument to `client.connect(name, key, secret)`.
35+
- To use the library with shiftr.io, you need to provide the instance name (username) and token secret (password) as the second and third argument to `client.connect(client_id, username, password)`.
3636

3737
## Example
3838

@@ -181,7 +181,7 @@ void setClockSource(MQTTClientClockSource);
181181
182182
- The specified callback is used by the internal timers to get a monotonic time in milliseconds. Since the clock source for the built-in `millis` is stopped when the Arduino goes into deep sleep, you need to provide a custom callback that first syncs with a built-in or external Real Time Clock (RTC). You can pass `NULL` to reset to the default implementation.
183183
184-
Connect to broker using the supplied client id and an optional username and password:
184+
Connect to broker using the supplied client ID and an optional username and password:
185185
186186
```c++
187187
bool connect(const char clientID[], bool skip = false);
@@ -208,6 +208,7 @@ bool publish(const char topic[], const char payload[], int length);
208208
bool publish(const char topic[], const char payload[], int length, bool retained, int qos);
209209
```
210210
211+
- Beginning with version 2.6, payloads for arbitrary length may be published, see [Notes](#notes).
211212
- The functions return a boolean that indicates if the publishing has been successful (true).
212213
213214
Subscribe to a topic:

0 commit comments

Comments
 (0)