12static constexpr uint8_t MAX_FRAME_LENGTH = 31;
13static constexpr uint8_t MAX_TARGETS = 5;
15static constexpr uint8_t MIN_FRAME_LENGTH = 11;
27 SUB_SENSOR_WITH_DEDUP(target_count, uint8_t)
31 void setup()
override;
32 void dump_config()
override;
38 void set_target_distance_sensor(uint8_t target,
sensor::Sensor *s) {
45 template<
typename F>
void add_on_data_callback(F &&callback) { this->
data_callback_.add(std::forward<F>(callback)); }
virtual void setup()
Where the component's initialization should happen.
Collects binary frames that give their own length, of up to N bytes, in one or more FrameFormats; the...
InstallationMode installation_mode_
LengthFrameReader< MAX_FRAME_LENGTH, DataFrame, CmdFrame > reader_
bool handle_frame_(const uint8_t *frame, uint8_t len)
bool handle_periodic_data_(const uint8_t *data, uint8_t packet_len)
bool handle_ack_(const uint8_t *data, uint8_t len)
std::array< TargetSensors, MAX_TARGETS > target_sensors_
LazyCallbackManager< void()> data_callback_
Base-class for all sensors.
A sensor pointer that may be null plus the last value it published, stored inline.
offset: where the length field starts, counted from the first header byte.
sensor::SensorWithDedup< float > angle
sensor::SensorWithDedup< float > x
sensor::SensorWithDedup< float > y
sensor::SensorWithDedup< float > distance