FIx up zm_mqtt.cpp to actually compile
parent
282d736491
commit
6b32790a93
|
@ -1,18 +1,20 @@
|
|||
|
||||
#ifdef MOSQUITTOPP_FOUND
|
||||
#include "zm.h"
|
||||
#include "zm_logger.h"
|
||||
#include "zm_mqtt.h"
|
||||
#include "zm_monitor.h"
|
||||
#include "zm_mqtt.h"
|
||||
#ifdef MOSQUITTOPP_FOUND
|
||||
#include "zm_time.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
|
||||
MQTT::MQTT(Monitor *monitor) :
|
||||
mosquittopp("ZoneMinder"+std::to_string(monitor->Id()),
|
||||
monitor_(monitor),
|
||||
connected_(false) {
|
||||
connected_(false)
|
||||
{
|
||||
std::string name="ZoneMinder"+std::to_string(monitor->Id());
|
||||
mosquittopp(name.c_str());
|
||||
|
||||
mosqpp::lib_init();
|
||||
connect();
|
||||
}
|
||||
|
@ -51,7 +53,7 @@ void MQTT::on_connect(int rc) {
|
|||
}
|
||||
|
||||
void MQTT::on_message(const struct mosquitto_message *message) {
|
||||
Debug(1, "MQTT: Have message %s: %s", message->topic, message->payload);
|
||||
Debug(1, "MQTT: Have message %s: %s", message->topic, static_cast<const char *>(message->payload));
|
||||
}
|
||||
|
||||
void MQTT::on_subscribe(int mid, int qos_count, const int *granted_qos) {
|
||||
|
|
Loading…
Reference in New Issue