You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,17 @@ Full API documentation is available here: https://hmueller01.github.io/pubsubcli
45
45
`PubSubClient::setKeepAlive(keepAlive)`.
46
46
- The client uses MQTT 3.1.1 by default. It can be changed to use MQTT 3.1 by
47
47
changing value of `MQTT_VERSION` in `PubSubClient.h`.
48
+
- It can publish and subscribe to `PROGMEM` or `__FlashStringHelper` topics since [v3.3.0](https://github.com/hmueller01/pubsubclient3/releases/tag/v3.3.0).
49
+
Details see [mqtt_progmem](https://github.com/hmueller01/pubsubclient3/blob/63c77d764a6ba7c83868985eaeab6f07cc062874/examples/mqtt_progmem/src/mqtt_progmem.cpp#L39-L48) example.
50
+
But if you like to publish `PROGMEM` topics you have to use
* @brief Write an UTF-8 encoded string to the internal buffer at a given position. The string can have a length of 0 to 65535 bytes (depending on size of
695
+
* @brief Internal implementation of writeString using RAM or PROGMEM string.
696
+
* Write an UTF-8 encoded string to the internal buffer at a given position. The string can have a length of 0 to 65535 bytes (depending on size of
664
697
* internal buffer). The buffer is prefixed with two bytes representing the length of the string. See section 1.5.3 of MQTT v3.1.1 protocol specification.
665
698
* @note If the string does not fit in the buffer or is longer than 65535 bytes nothing is written to the buffer and the returned position is
666
699
* unchanged.
667
700
*
701
+
* @param progmem true if the string is stored in PROGMEM, false if in RAM.
668
702
* @param string 'C' string of the data that shall be written in the buffer.
669
703
* @param pos Position in the internal buffer to write the string.
670
704
* @return New position in the internal buffer (pos + 2 + string length), or pos if a buffer overrun would occur or the string is a nullptr.
ERROR_PSC_PRINTF_P("writeString(): string (%zu) does not fit into buf (%zu)\n", pos + 2 + sLen, _bufferSize);
720
+
ERROR_PSC_PRINTF_P("writeStringImpl(): string (%zu) does not fit into buf (%zu)\n", pos + 2 + sLen, _bufferSize);
683
721
}
684
722
return pos;
685
723
}
686
724
725
+
/**
726
+
* @brief Write an UTF-8 encoded string to the internal buffer at a given position. The string can have a length of 0 to 65535 bytes (depending on size of
727
+
* internal buffer). The buffer is prefixed with two bytes representing the length of the string. See section 1.5.3 of MQTT v3.1.1 protocol specification.
728
+
* @note If the string does not fit in the buffer or is longer than 65535 bytes nothing is written to the buffer and the returned position is
729
+
* unchanged.
730
+
*
731
+
* @param string 'C' string of the data that shall be written in the buffer.
732
+
* @param pos Position in the internal buffer to write the string.
733
+
* @return New position in the internal buffer (pos + 2 + string length), or pos if a buffer overrun would occur or the string is a nullptr.
0 commit comments