mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
compile on mac osx
This commit is contained in:
@@ -210,13 +210,18 @@ void Mqtt::incoming(const char * topic, const char * payload) {
|
||||
// received an MQTT message that we subscribed too
|
||||
// topic is the full path
|
||||
// payload is json or a single string and converted to a json with key 'value'
|
||||
void Mqtt::on_message(const char * topic, const char * payload, size_t len) const {
|
||||
void Mqtt::on_message(const char * topic, const char * message, size_t len) const {
|
||||
// This causes a compile error "error: variable-sized object may not be initialized"
|
||||
// so commenting out and assuming with the new mqtt lib it's always null terminated
|
||||
|
||||
/*
|
||||
// sometimes the payload is not terminated correctly, so make a copy
|
||||
// convert payload to a null-terminated char string
|
||||
char message[len + 2] = {'\0'};
|
||||
if (payload != nullptr) {
|
||||
strlcpy(message, payload, len + 1);
|
||||
}
|
||||
*/
|
||||
|
||||
#if defined(EMSESP_DEBUG)
|
||||
if (len) {
|
||||
|
||||
Reference in New Issue
Block a user