19static const char *
const TAG =
"ld2450";
96template<
size_t N> uint8_t
find_uint8(
const StringToUint8 (&arr)[N],
const std::string &str) {
97 for (
const auto &entry : arr) {
104template<
size_t N>
const char *
find_str(
const Uint8ToString (&arr)[N], uint8_t value) {
105 for (
const auto &entry : arr) {
106 if (value == entry.value)
113static constexpr uint8_t CMD_ENABLE_CONF = 0xFF;
114static constexpr uint8_t CMD_DISABLE_CONF = 0xFE;
115static constexpr uint8_t CMD_QUERY_VERSION = 0xA0;
116static constexpr uint8_t CMD_QUERY_MAC_ADDRESS = 0xA5;
117static constexpr uint8_t CMD_RESET = 0xA2;
118static constexpr uint8_t CMD_RESTART = 0xA3;
119static constexpr uint8_t CMD_BLUETOOTH = 0xA4;
120static constexpr uint8_t CMD_SINGLE_TARGET_MODE = 0x80;
121static constexpr uint8_t CMD_MULTI_TARGET_MODE = 0x90;
122static constexpr uint8_t CMD_QUERY_TARGET_MODE = 0x91;
123static constexpr uint8_t CMD_SET_BAUD_RATE = 0xA1;
124static constexpr uint8_t CMD_QUERY_ZONE = 0xC1;
125static constexpr uint8_t CMD_SET_ZONE = 0xC2;
127static constexpr uint8_t HEADER_FOOTER_SIZE = 4;
129static constexpr uint8_t CMD_FRAME_HEADER[HEADER_FOOTER_SIZE] = {0xFD, 0xFC, 0xFB, 0xFA};
130static constexpr uint8_t CMD_FRAME_FOOTER[HEADER_FOOTER_SIZE] = {0x04, 0x03, 0x02, 0x01};
132static constexpr uint8_t DATA_FRAME_HEADER[HEADER_FOOTER_SIZE] = {0xAA, 0xFF, 0x03, 0x00};
133static constexpr uint8_t DATA_FRAME_FOOTER[2] = {0x55, 0xCC};
135static constexpr uint8_t NO_MAC[] = {0x08, 0x05, 0x04, 0x03, 0x02, 0x01};
137static inline uint32_t convert_seconds_to_ms(uint16_t value) {
return (
uint32_t) value * 1000; };
139static inline void convert_int_values_to_hex(
const int *values, uint8_t *bytes) {
140 for (uint8_t i = 0; i < 4; i++) {
141 uint16_t
val = values[i] & 0xFFFF;
143 bytes[i * 2 + 1] = (
val >> 8) & 0xFF;
147static inline int16_t decode_coordinate(uint8_t low_byte, uint8_t high_byte) {
148 int16_t coordinate = (high_byte & 0x7F) << 8 | low_byte;
149 if ((high_byte & 0x80) == 0) {
150 coordinate = -coordinate;
155static inline int16_t decode_speed(uint8_t low_byte, uint8_t high_byte) {
156 int16_t
speed = (high_byte & 0x7F) << 8 | low_byte;
157 if ((high_byte & 0x80) == 0) {
163static inline int16_t hex_to_signed_int(
const uint8_t *buffer, uint8_t offset) {
164 uint16_t hex_val = (buffer[offset + 1] << 8) | buffer[offset];
165 int16_t dec_val =
static_cast<int16_t
>(hex_val);
166 if (dec_val & 0x8000) {
172static inline bool validate_header_footer(
const uint8_t *header_footer,
const uint8_t *buffer) {
173 return std::memcmp(header_footer, buffer, HEADER_FOOTER_SIZE) == 0;
178 if (this->presence_timeout_number_ !=
nullptr) {
179 this->
pref_ = this->presence_timeout_number_->make_entity_preference<
float>();
180 this->set_presence_timeout();
183 this->restart_and_read_all_info();
186void LD2450Component::dump_config() {
193 " Firmware version: %s\n"
196#ifdef USE_BINARY_SENSOR
197 ESP_LOGCONFIG(TAG,
"Binary Sensors:");
198 LOG_BINARY_SENSOR(
" ",
"MovingTarget", this->moving_target_binary_sensor_);
199 LOG_BINARY_SENSOR(
" ",
"StillTarget", this->still_target_binary_sensor_);
200 LOG_BINARY_SENSOR(
" ",
"Target", this->target_binary_sensor_);
203 ESP_LOGCONFIG(TAG,
"Sensors:");
204 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"MovingTargetCount", this->moving_target_count_sensor_);
205 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"StillTargetCount", this->still_target_count_sensor_);
206 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"TargetCount", this->target_count_sensor_);
208 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"TargetX", s);
211 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"TargetY", s);
214 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"TargetAngle", s);
217 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"TargetDistance", s);
220 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"TargetResolution", s);
223 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"TargetSpeed", s);
226 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"ZoneTargetCount", s);
229 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"ZoneMovingTargetCount", s);
232 LOG_SENSOR_WITH_DEDUP_SAFE(
" ",
"ZoneStillTargetCount", s);
235#ifdef USE_TEXT_SENSOR
236 ESP_LOGCONFIG(TAG,
"Text Sensors:");
237 LOG_TEXT_SENSOR(
" ",
"Version", this->version_text_sensor_);
238 LOG_TEXT_SENSOR(
" ",
"MAC address", this->mac_text_sensor_);
240 LOG_TEXT_SENSOR(
" ",
"Direction", s);
244 ESP_LOGCONFIG(TAG,
"Numbers:");
245 LOG_NUMBER(
" ",
"PresenceTimeout", this->presence_timeout_number_);
247 LOG_NUMBER(
" ",
"ZoneX1", n.x1);
248 LOG_NUMBER(
" ",
"ZoneY1", n.y1);
249 LOG_NUMBER(
" ",
"ZoneX2", n.x2);
250 LOG_NUMBER(
" ",
"ZoneY2", n.y2);
254 ESP_LOGCONFIG(TAG,
"Selects:");
255 LOG_SELECT(
" ",
"BaudRate", this->baud_rate_select_);
256 LOG_SELECT(
" ",
"ZoneType", this->zone_type_select_);
259 ESP_LOGCONFIG(TAG,
"Switches:");
260 LOG_SWITCH(
" ",
"Bluetooth", this->bluetooth_switch_);
261 LOG_SWITCH(
" ",
"MultiTarget", this->multi_target_switch_);
264 ESP_LOGCONFIG(TAG,
"Buttons:");
265 LOG_BUTTON(
" ",
"FactoryReset", this->factory_reset_button_);
266 LOG_BUTTON(
" ",
"Restart", this->restart_button_);
270void LD2450Component::loop() {
273 uint8_t buf[MAX_LINE_LENGTH];
275 size_t to_read = std::min(avail,
sizeof(buf));
281 for (
size_t i = 0; i < to_read; i++) {
292 if (target.x > zone.
x1 && target.x < zone.
x2 && target.y > zone.
y1 && target.y < zone.
y2) {
293 if (target.is_moving) {
303void LD2450Component::reset_radar_zone() {
314void LD2450Component::set_radar_zone(int32_t zone_type, int32_t zone1_x1, int32_t zone1_y1, int32_t zone1_x2,
315 int32_t zone1_y2, int32_t zone2_x1, int32_t zone2_y1, int32_t zone2_x2,
316 int32_t zone2_y2, int32_t zone3_x1, int32_t zone3_y1, int32_t zone3_x2,
319 int zone_parameters[12] = {zone1_x1, zone1_y1, zone1_x2, zone1_y2, zone2_x1, zone2_y1,
320 zone2_x2, zone2_y2, zone3_x1, zone3_y1, zone3_x2, zone3_y2};
321 for (uint8_t i = 0; i < MAX_ZONES; i++) {
332 uint8_t cmd_value[26] = {};
333 uint8_t zone_type_bytes[2] = {
static_cast<uint8_t
>(this->
zone_type_), 0x00};
334 uint8_t area_config[24] = {};
335 for (uint8_t i = 0; i < MAX_ZONES; i++) {
338 ld2450::convert_int_values_to_hex(values, area_config + (i * 8));
340 std::memcpy(cmd_value, zone_type_bytes,
sizeof(zone_type_bytes));
341 std::memcpy(cmd_value + 2, area_config,
sizeof(area_config));
343 this->
send_command_(CMD_SET_ZONE, cmd_value,
sizeof(cmd_value));
349 if (check_millis == 0) {
353 this->
timeout_ = ld2450::convert_seconds_to_ms(DEFAULT_PRESENCE_TIMEOUT);
360 uint8_t index, start;
361 for (index = 0; index < MAX_ZONES; index++) {
362 start = 12 + index * 8;
380void LD2450Component::read_all_info() {
388 if (this->baud_rate_select_ !=
nullptr) {
390 this->baud_rate_select_->publish_state(*index);
393 this->publish_zone_type();
398void LD2450Component::query_zone_info() {
405void LD2450Component::restart_and_read_all_info() {
408 this->
set_timeout(1500, [
this]() { this->read_all_info(); });
413 ESP_LOGV(TAG,
"Sending COMMAND %02X", command);
415 this->
write_array(CMD_FRAME_HEADER,
sizeof(CMD_FRAME_HEADER));
418 if (command_value !=
nullptr) {
419 len += command_value_len;
422 uint8_t len_cmd[] = {
len, 0x00, command, 0x00};
425 if (command_value !=
nullptr) {
426 this->
write_array(command_value, command_value_len);
429 this->
write_array(CMD_FRAME_FOOTER,
sizeof(CMD_FRAME_FOOTER));
431 if (command != CMD_ENABLE_CONF && command != CMD_DISABLE_CONF) {
441 ESP_LOGE(TAG,
"Invalid length");
444 if (!ld2450::validate_header_footer(DATA_FRAME_HEADER, this->
buffer_data_) ||
447 ESP_LOGE(TAG,
"Invalid header/footer");
451 int16_t target_count = 0;
452 int16_t still_target_count = 0;
453 int16_t moving_target_count = 0;
463 bool is_moving =
false;
465#if defined(USE_BINARY_SENSOR) || defined(USE_SENSOR) || defined(USE_TEXT_SENSOR)
467 for (index = 0; index < MAX_TARGETS; index++) {
486 moving_target_count++;
490 int32_t x_squared = (int32_t) tx * tx;
491 int32_t y_squared = (int32_t) ty * ty;
492 td = (uint16_t) sqrtf(x_squared + y_squared);
498 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_x_sensors_[index]);
499 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_y_sensors_[index]);
500 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_resolution_sensors_[index]);
501 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_speed_sensors_[index]);
502 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_distance_sensors_[index]);
503 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_angle_sensors_[index]);
505 SAFE_PUBLISH_SENSOR(this->move_x_sensors_[index], tx);
506 SAFE_PUBLISH_SENSOR(this->move_y_sensors_[index], ty);
507 SAFE_PUBLISH_SENSOR(this->move_resolution_sensors_[index], res);
508 SAFE_PUBLISH_SENSOR(this->move_speed_sensors_[index], ts);
509 SAFE_PUBLISH_SENSOR(this->move_distance_sensors_[index], td);
511 angle = atan2f(
static_cast<float>(-tx),
static_cast<float>(ty)) * (180.0f / std::numbers::pi_v<float>);
512 SAFE_PUBLISH_SENSOR(this->move_angle_sensors_[index], angle);
515#ifdef USE_TEXT_SENSOR
528 if (tsd !=
nullptr) {
542 still_target_count = target_count - moving_target_count;
547 uint8_t zone_still_targets = 0;
548 uint8_t zone_moving_targets = 0;
549 uint8_t zone_all_targets = 0;
550 for (index = 0; index < MAX_ZONES; index++) {
552 zone_all_targets = zone_still_targets + zone_moving_targets;
555 SAFE_PUBLISH_SENSOR(this->zone_still_target_count_sensors_[index], zone_still_targets);
557 SAFE_PUBLISH_SENSOR(this->zone_moving_target_count_sensors_[index], zone_moving_targets);
559 SAFE_PUBLISH_SENSOR(this->zone_target_count_sensors_[index], zone_all_targets);
563 SAFE_PUBLISH_SENSOR(this->target_count_sensor_, target_count);
565 SAFE_PUBLISH_SENSOR(this->still_target_count_sensor_, still_target_count);
567 SAFE_PUBLISH_SENSOR(this->moving_target_count_sensor_, moving_target_count);
571#ifdef USE_BINARY_SENSOR
573 if (this->target_binary_sensor_ !=
nullptr) {
574 if (target_count > 0) {
575 this->target_binary_sensor_->publish_state(
true);
578 this->target_binary_sensor_->publish_state(
false);
580 ESP_LOGV(TAG,
"Clear presence waiting timeout: %" PRIu32, this->
timeout_);
585 if (this->moving_target_binary_sensor_ !=
nullptr) {
586 if (moving_target_count > 0) {
587 this->moving_target_binary_sensor_->publish_state(
true);
590 this->moving_target_binary_sensor_->publish_state(
false);
595 if (this->still_target_binary_sensor_ !=
nullptr) {
596 if (still_target_count > 0) {
597 this->still_target_binary_sensor_->publish_state(
true);
600 this->still_target_binary_sensor_->publish_state(
false);
607 if (target_count > 0) {
610 if (moving_target_count > 0) {
613 if (still_target_count > 0) {
624 ESP_LOGE(TAG,
"Invalid length");
627 if (!ld2450::validate_header_footer(CMD_FRAME_HEADER, this->
buffer_data_)) {
633 ESP_LOGE(TAG,
"Invalid status");
642 case CMD_ENABLE_CONF:
643 ESP_LOGV(TAG,
"Enable conf");
646 case CMD_DISABLE_CONF:
647 ESP_LOGV(TAG,
"Disabled conf");
650 case CMD_SET_BAUD_RATE:
651 ESP_LOGV(TAG,
"Baud rate change");
653 if (this->baud_rate_select_ !=
nullptr) {
654 auto baud = this->baud_rate_select_->current_option();
655 ESP_LOGE(TAG,
"Change baud rate to %.*s and reinstall", (
int) baud.size(), baud.c_str());
660 case CMD_QUERY_VERSION: {
664 ESP_LOGV(TAG,
"Firmware version: %s", version_s);
665#ifdef USE_TEXT_SENSOR
666 if (this->version_text_sensor_ !=
nullptr) {
667 this->version_text_sensor_->publish_state(version_s);
673 case CMD_QUERY_MAC_ADDRESS: {
685 ESP_LOGV(TAG,
"MAC address: %s", mac_str);
686#ifdef USE_TEXT_SENSOR
687 if (this->mac_text_sensor_ !=
nullptr) {
688 this->mac_text_sensor_->publish_state(mac_str);
692 if (this->bluetooth_switch_ !=
nullptr) {
700 ESP_LOGV(TAG,
"Bluetooth");
703 case CMD_SINGLE_TARGET_MODE:
704 ESP_LOGV(TAG,
"Single target conf");
706 if (this->multi_target_switch_ !=
nullptr) {
707 this->multi_target_switch_->publish_state(
false);
712 case CMD_MULTI_TARGET_MODE:
713 ESP_LOGV(TAG,
"Multi target conf");
715 if (this->multi_target_switch_ !=
nullptr) {
716 this->multi_target_switch_->publish_state(
true);
721 case CMD_QUERY_TARGET_MODE:
722 ESP_LOGV(TAG,
"Query target tracking mode");
724 if (this->multi_target_switch_ !=
nullptr) {
725 this->multi_target_switch_->publish_state(this->
buffer_data_[10] == 0x02);
731 ESP_LOGV(TAG,
"Query zone conf");
733 this->publish_zone_type();
735 if (this->zone_type_select_ !=
nullptr) {
736 auto zone = this->zone_type_select_->current_option();
737 ESP_LOGV(TAG,
"Change zone type to: %.*s", (
int) zone.size(), zone.c_str());
741 ESP_LOGV(TAG,
"Zone: Disabled");
744 ESP_LOGV(TAG,
"Zone: Area detection");
747 ESP_LOGV(TAG,
"Zone: Area filter");
753 ESP_LOGV(TAG,
"Set zone conf");
754 this->query_zone_info();
774 ESP_LOGW(TAG,
"Max command length exceeded; ignoring");
783#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
790#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
797 ESP_LOGV(TAG,
"Ack Data incomplete");
804 const uint8_t cmd = enable ? CMD_ENABLE_CONF : CMD_DISABLE_CONF;
805 const uint8_t cmd_value[2] = {0x01, 0x00};
806 this->
send_command_(cmd, enable ? cmd_value :
nullptr,
sizeof(cmd_value));
810void LD2450Component::set_bluetooth(
bool enable) {
812 const uint8_t cmd_value[2] = {enable ? (uint8_t) 0x01 : (uint8_t) 0x00, 0x00};
813 this->
send_command_(CMD_BLUETOOTH, cmd_value,
sizeof(cmd_value));
814 this->
set_timeout(200, [
this]() { this->restart_and_read_all_info(); });
818void LD2450Component::set_baud_rate(
const char *
state) {
821 this->
send_command_(CMD_SET_BAUD_RATE, cmd_value,
sizeof(cmd_value));
826void LD2450Component::set_zone_type(
const char *
state) {
827 ESP_LOGV(TAG,
"Set zone type: %s",
state);
834void LD2450Component::publish_zone_type() {
836 if (this->zone_type_select_ !=
nullptr) {
843void LD2450Component::set_multi_target(
bool enable) {
845 uint8_t cmd = enable ? CMD_MULTI_TARGET_MODE : CMD_SINGLE_TARGET_MODE;
851void LD2450Component::factory_reset() {
854 this->
set_timeout(200, [
this]() { this->restart_and_read_all_info(); });
865 uint8_t cmd_value[2] = {0x01, 0x00};
876void LD2450Component::set_move_x_sensor(uint8_t target,
sensor::Sensor *s) {
877 this->move_x_sensors_[target].set_sensor(s);
879void LD2450Component::set_move_y_sensor(uint8_t target,
sensor::Sensor *s) {
880 this->move_y_sensors_[target].set_sensor(s);
882void LD2450Component::set_move_speed_sensor(uint8_t target, sensor::Sensor *s) {
883 this->move_speed_sensors_[target].set_sensor(s);
885void LD2450Component::set_move_angle_sensor(uint8_t target, sensor::Sensor *s) {
886 this->move_angle_sensors_[target].set_sensor(s);
888void LD2450Component::set_move_distance_sensor(uint8_t target, sensor::Sensor *s) {
889 this->move_distance_sensors_[target].set_sensor(s);
891void LD2450Component::set_move_resolution_sensor(uint8_t target, sensor::Sensor *s) {
892 this->move_resolution_sensors_[target].set_sensor(s);
894void LD2450Component::set_zone_target_count_sensor(uint8_t zone, sensor::Sensor *s) {
895 this->zone_target_count_sensors_[zone].set_sensor(s);
897void LD2450Component::set_zone_still_target_count_sensor(uint8_t zone, sensor::Sensor *s) {
898 this->zone_still_target_count_sensors_[zone].set_sensor(s);
900void LD2450Component::set_zone_moving_target_count_sensor(uint8_t zone, sensor::Sensor *s) {
901 this->zone_moving_target_count_sensors_[zone].set_sensor(s);
904#ifdef USE_TEXT_SENSOR
905void LD2450Component::set_direction_text_sensor(uint8_t target, text_sensor::TextSensor *s) {
906 this->direction_text_sensors_[target] = s;
912void LD2450Component::set_zone_coordinate(uint8_t zone) {
917 if (!x1sens->has_state() || !y1sens->has_state() || !x2sens->has_state() || !y2sens->has_state()) {
927void LD2450Component::set_zone_numbers(uint8_t zone, number::Number *x1, number::Number *y1, number::Number *x2,
928 number::Number *y2) {
929 if (zone < MAX_ZONES) {
940void LD2450Component::set_presence_timeout() {
941 if (this->presence_timeout_number_ !=
nullptr) {
942 if (this->presence_timeout_number_->state == 0) {
944 this->presence_timeout_number_->publish_state(timeout);
945 this->
timeout_ = ld2450::convert_seconds_to_ms(timeout);
947 if (this->presence_timeout_number_->has_state()) {
949 this->
timeout_ = ld2450::convert_seconds_to_ms(this->presence_timeout_number_->state);
961 value = DEFAULT_PRESENCE_TIMEOUT;
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
virtual void setup()
Where the component's initialization should happen.
ESPDEPRECATED("Use const char* or uint32_t overload instead. Removed in 2026.7.0", "2026.1.0") void set_timeout(const std voi set_timeout)(const char *name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a unique name.
void save_to_flash_(float value)
std::array< SensorWithDedup< int16_t >, MAX_TARGETS > move_y_sensors_
std::array< SensorWithDedup< uint8_t >, MAX_ZONES > zone_moving_target_count_sensors_
std::array< Deduplicator< uint8_t >, MAX_TARGETS > direction_dedup_
uint32_t still_presence_millis_
void send_command_(uint8_t command_str, const uint8_t *command_value, uint8_t command_value_len)
std::array< SensorWithDedup< uint8_t >, MAX_ZONES > zone_target_count_sensors_
void query_target_tracking_mode_()
void send_set_zone_command_()
void set_config_mode_(bool enable)
std::array< text_sensor::TextSensor *, MAX_TARGETS > direction_text_sensors_
void count_targets_in_zone_(const Zone &zone, uint8_t &still, uint8_t &moving)
uint32_t moving_presence_millis_
void readline_(int readch)
std::array< SensorWithDedup< uint16_t >, MAX_TARGETS > move_resolution_sensors_
uint8_t buffer_data_[MAX_LINE_LENGTH]
Target target_info_[MAX_TARGETS]
uint32_t presence_millis_
Zone zone_config_[MAX_ZONES]
ESPPreferenceObject pref_
std::array< SensorWithDedup< uint16_t >, MAX_TARGETS > move_distance_sensors_
std::array< SensorWithDedup< uint8_t >, MAX_ZONES > zone_still_target_count_sensors_
LazyCallbackManager< void()> data_callback_
std::array< SensorWithDedup< int16_t >, MAX_TARGETS > move_speed_sensors_
std::array< SensorWithDedup< float >, MAX_TARGETS > move_angle_sensors_
float restore_from_flash_()
ZoneOfNumbers zone_numbers_[MAX_ZONES]
void handle_periodic_data_()
std::array< SensorWithDedup< int16_t >, MAX_TARGETS > move_x_sensors_
bool get_timeout_status_(uint32_t check_millis)
void publish_state(float state)
Base-class for all sensors.
void publish_state(const std::string &state)
uint32_t get_baud_rate() const
optional< std::array< uint8_t, N > > read_array()
void write_array(const uint8_t *data, size_t len)
constexpr uint32_t BAUD_RATES[]
constexpr Uint8ToString DIRECTION_BY_UINT[]
constexpr StringToUint8 ZONE_TYPE_BY_STR[]
constexpr StringToUint8 BAUD_RATES_BY_STR[]
constexpr Uint8ToString ZONE_TYPE_BY_UINT[]
uint8_t find_uint8(const StringToUint8(&arr)[N], const std::string &str)
const char * find_str(const Uint8ToString(&arr)[N], uint8_t value)
void format_version_str(const uint8_t *version, std::span< char, 20 > buffer)
const char * format_mac_str(const uint8_t *mac_address, std::span< char, 18 > buffer)
optional< size_t > find_index(const uint32_t(&arr)[N], uint32_t value)
std::vector< uint8_t > bytes
char * format_hex_pretty_to(char *buffer, size_t buffer_size, const uint8_t *data, size_t length, char separator)
Format byte array as uppercase hex to buffer (base implementation).
constexpr size_t format_hex_pretty_size(size_t byte_count)
Calculate buffer size needed for format_hex_pretty_to with separator: "XX:XX:...:XX\0".
void HOT delay(uint32_t ms)
Application App
Global storage of Application pointer - only one Application can exist.