mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-14 15:54:47 +00:00
46 lines
1.0 KiB
C++
46 lines
1.0 KiB
C++
/**
|
|
* @copyright Utilitech AS 2023
|
|
* License: Fair Source
|
|
*
|
|
*/
|
|
|
|
#include "PassthroughMqttHandler.h"
|
|
#include "hexutils.h"
|
|
|
|
bool PassthroughMqttHandler::publish(AmsData* data, AmsData* previousState, EnergyAccounting* ea, PriceService* ps) {
|
|
return false;
|
|
}
|
|
|
|
bool PassthroughMqttHandler::publishTemperatures(AmsConfiguration*, HwTools*) {
|
|
return false;
|
|
}
|
|
|
|
bool PassthroughMqttHandler::publishPrices(PriceService*) {
|
|
return false;
|
|
}
|
|
|
|
bool PassthroughMqttHandler::publishSystem(HwTools* hw, PriceService* ps, EnergyAccounting* ea) {
|
|
return false;
|
|
}
|
|
|
|
bool PassthroughMqttHandler::publishBytes(uint8_t* buf, uint16_t len) {
|
|
mqtt.publish(topic.c_str(), toHex(buf, len));
|
|
bool ret = mqtt.loop();
|
|
delay(10);
|
|
return ret;
|
|
}
|
|
|
|
bool PassthroughMqttHandler::publishString(char* str) {
|
|
mqtt.publish(topic.c_str(), str);
|
|
bool ret = mqtt.loop();
|
|
delay(10);
|
|
return ret;
|
|
}
|
|
|
|
uint8_t PassthroughMqttHandler::getFormat() {
|
|
return 255;
|
|
}
|
|
|
|
void PassthroughMqttHandler::onMessage(String &topic, String &payload) {
|
|
}
|