mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 17:29:50 +03:00
fixes #1494
This commit is contained in:
@@ -212,7 +212,7 @@ 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 uint8_t * payload, size_t len) const {
|
||||
void Mqtt::on_message(const char * topic, const uint8_t * payload, size_t len) {
|
||||
// the payload is not terminated
|
||||
// convert payload to a null-terminated char string
|
||||
// see https://www.emelis.net/espMqttClient/#code-samples
|
||||
@@ -390,11 +390,6 @@ void Mqtt::start() {
|
||||
}
|
||||
|
||||
EMSESP::esp8266React.setWill(will_topic); // with qos 1, retain true
|
||||
|
||||
EMSESP::esp8266React.onMessage(
|
||||
[this](const espMqttClientTypes::MessageProperties & properties, const char * topic, const uint8_t * payload, size_t len, size_t index, size_t total) {
|
||||
on_message(topic, payload, len); // receiving mqtt
|
||||
});
|
||||
}
|
||||
|
||||
void Mqtt::set_publish_time_boiler(uint16_t publish_time) {
|
||||
|
||||
@@ -60,6 +60,7 @@ class Mqtt {
|
||||
|
||||
static void on_connect();
|
||||
static void on_disconnect(espMqttClientTypes::DisconnectReason reason);
|
||||
static void on_message(const char * topic, const uint8_t * payload, size_t len);
|
||||
static void subscribe(const uint8_t device_type, const std::string & topic, mqtt_sub_function_p cb);
|
||||
static void subscribe(const std::string & topic);
|
||||
static void resubscribe();
|
||||
@@ -231,7 +232,6 @@ class Mqtt {
|
||||
static void queue_unsubscribe_message(const std::string & topic);
|
||||
|
||||
void on_publish(uint16_t packetId) const;
|
||||
void on_message(const char * topic, const uint8_t * payload, size_t len) const;
|
||||
|
||||
// function handlers for MQTT subscriptions
|
||||
struct MQTTSubFunction {
|
||||
@@ -295,4 +295,4 @@ class Mqtt {
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "3.6.5-dev.3"
|
||||
#define EMSESP_APP_VERSION "3.6.5-dev.4"
|
||||
|
||||
Reference in New Issue
Block a user