ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
serial.cpp
Go to the documentation of this file.
1#include "serial.h"
2
3#include <cstring>
4
5namespace esphome::duco {
6
7void DucoSerial::update() { this->parent_->send(this, FUNCTION_NODE_DATA, {0x01, 0x01, 0x00, 0x1a, 0x10}); }
8
10 if (message.size > 2) {
11 // The serial number starts at byte 2 and is padded with zeros
12 const char *serial = reinterpret_cast<const char *>(message.data + 2);
13 this->publish_state(serial, strnlen(serial, message.size - 2));
14 }
15}
16
17} // namespace esphome::duco
void update() override
Definition serial.cpp:7
void receive_response(const DucoMessage &message) override
Definition serial.cpp:9
void publish_state(const std::string &state)
Definition text_sensor.h:42
const LogString * message
Definition component.cpp:35
A received message; data points into the receive buffer and is valid only during the callback.
Definition duco.h:22