ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
ds1603l.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
10
11namespace esphome::ds1603l {
12
13class DS1603L final : public sensor::Sensor, public Component, public uart::UARTDevice {
14 public:
15 void loop() override;
16 void dump_config() override;
17
18 protected:
19 static constexpr uint8_t HEADER_BYTE = 0xFF;
20 static constexpr size_t FRAME_SIZE = 4;
21
22 // Validates the checksum of the frame and publishes it. Returns false if the frame is invalid.
23 bool parse_data_(const uint8_t *frame);
24
26};
27
28} // namespace esphome::ds1603l
Collects fixed length binary frames of N bytes that start with the header bytes HEADER....
bool parse_data_(const uint8_t *frame)
Definition ds1603l.cpp:28
FrameReader< FRAME_SIZE, HEADER_BYTE > reader_
Definition ds1603l.h:25
void dump_config() override
Definition ds1603l.cpp:26
void loop() override
Definition ds1603l.cpp:10
static constexpr uint8_t HEADER_BYTE
Definition ds1603l.h:19
Base-class for all sensors.
Definition sensor.h:48