Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MQTT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ namespace MQTT {
_payload_len(strlen_P((PGM_P)payload)), _payload(new uint8_t[_payload_len + 1]),
_payload_mine(true)
{
strncpy((char*)_payload, (PGM_P)payload, _payload_len);
strncpy_P((char*)_payload, (PGM_P)payload, _payload_len);
}

Publish Publish_P(String topic, PGM_P payload, uint32_t length) {
Expand Down
7 changes: 7 additions & 0 deletions src/MQTT.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ namespace MQTT {
Reserved, // Reserved
};

//! The Quality of Service (QoS) level is an agreement between sender and receiver of a message regarding the guarantees of delivering a message.
enum Qos {
QOS0 = 0, //! At most once
QOS1 = 1, //! At least once
QOS2 = 2 //! Exactly once
};

#ifdef _GLIBCXX_FUNCTIONAL
typedef std::function<bool(Client&)> payload_callback_t;
#else
Expand Down