4#if defined(USE_ESP32) || defined(USE_ARDUINO) || defined(USE_HOST)
20#ifdef USE_BINARY_SENSOR
24#include <dlms_parser/dlms_parser.h>
26#if __has_include(<psa/crypto.h>)
27#include <dlms_parser/decryption/aes_128_gcm_decryptor_tfpsa.h>
28#elif !defined(USE_ESP8266) && __has_include(<mbedtls/gcm.h>)
29#if __has_include(<mbedtls/esp_config.h>)
30#include <mbedtls/esp_config.h>
32#include <dlms_parser/decryption/aes_128_gcm_decryptor_mbedtls.h>
33#elif __has_include(<bearssl/bearssl.h>)
34#include <dlms_parser/decryption/aes_128_gcm_decryptor_bearssl.h>
36#error "The platform doesn't provide a compatible encryption library for dlms_parser"
42#ifndef DLMS_MAX_SENSORS
43static constexpr uint8_t DLMS_MAX_SENSORS = 0;
45#ifndef DLMS_MAX_TEXT_SENSORS
46static constexpr uint8_t DLMS_MAX_TEXT_SENSORS = 0;
48#ifndef DLMS_MAX_BINARY_SENSORS
49static constexpr uint8_t DLMS_MAX_BINARY_SENSORS = 0;
64#ifdef USE_BINARY_SENSOR
78#if __has_include(<psa/crypto.h>)
80#elif !defined(USE_ESP8266) && __has_include(<mbedtls/gcm.h>)
89 const char *authentication_key, std::vector<CustomPattern> custom_patterns);
91 void setup()
override;
101#ifdef USE_BINARY_SENSOR
109 void on_data_(
const dlms_parser::AxdrCapture &capture);
126#ifdef USE_TEXT_SENSOR
129#ifdef USE_BINARY_SENSOR
Minimal static vector - saves memory by avoiding std::vector overhead.
Base class for all binary_sensor-type classes.
DlmsMeterComponent(uint32_t receive_timeout_ms, bool skip_crc_check, const char *decryption_key, const char *authentication_key, std::vector< CustomPattern > custom_patterns)
StaticVector< SensorItem, DLMS_MAX_SENSORS > sensors_
std::vector< CustomPattern > custom_patterns_
void on_data_(const dlms_parser::AxdrCapture &capture)
std::array< uint8_t, 2048 > rx_buffer_
void register_text_sensor(const dlms_parser::ObisId &obis, text_sensor::TextSensor *sensor)
void dump_config() override
uint32_t receive_timeout_ms_
StaticVector< TextSensorItem, DLMS_MAX_TEXT_SENSORS > text_sensors_
void register_sensor(const dlms_parser::ObisId &obis, sensor::Sensor *sensor)
StaticVector< BinarySensorItem, DLMS_MAX_BINARY_SENSORS > binary_sensors_
size_t bytes_accumulated_
dlms_parser::DlmsParser parser_
Aes128GcmDecryptorImpl decryptor_
void register_binary_sensor(const dlms_parser::ObisId &obis, binary_sensor::BinarySensor *sensor)
uint32_t last_rx_char_time_
Base-class for all sensors.
dlms_parser::Aes128GcmDecryptorTfPsa Aes128GcmDecryptorImpl
binary_sensor::BinarySensor * sensor
dlms_parser::ObisId default_obis
text_sensor::TextSensor * sensor