mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-02 03:37:57 +00:00
28 lines
816 B
C++
28 lines
816 B
C++
//
|
|
// Created by stephane bourque on 2023-01-22.
|
|
//
|
|
#include "AP_WS_Connection.h"
|
|
#include "StorageService.h"
|
|
|
|
#include "fmt/format.h"
|
|
#include "framework/KafkaManager.h"
|
|
#include "framework/ow_constants.h"
|
|
|
|
namespace OpenWifi {
|
|
void AP_WS_Connection::Process_alarm(Poco::JSON::Object::Ptr ParamsObj) {
|
|
if (!State_.Connected) {
|
|
poco_warning(Logger_,
|
|
fmt::format("INVALID-PROTOCOL({}): Device '{}' is not following protocol",
|
|
CId_, CN_));
|
|
Errors_++;
|
|
return;
|
|
}
|
|
poco_trace(Logger_, fmt::format("Alarm data received for {}", SerialNumber_));
|
|
|
|
if (ParamsObj->has(uCentralProtocol::SERIAL) && ParamsObj->has(uCentralProtocol::DATA)) {
|
|
if (KafkaManager()->Enabled()) {
|
|
KafkaManager()->PostMessage(KafkaTopics::ALERTS, SerialNumber_, *ParamsObj);
|
|
}
|
|
}
|
|
}
|
|
} // namespace OpenWifi
|