43PROGMEM_STRING_TABLE(BaudRateStrings,
"9600",
"19200",
"38400",
"57600",
"115200",
"230400",
"256000",
"460800");
49 "Direction is the table index");
55static constexpr uint32_t BAUD_RATES[] PROGMEM = {9600, 19200, 38400, 57600, 115200, 230400, 256000, 460800};
58static constexpr uint8_t CMD_ENABLE_CONF = 0xFF;
59static constexpr uint8_t CMD_DISABLE_CONF = 0xFE;
60static constexpr uint8_t CMD_QUERY_VERSION = 0xA0;
61static constexpr uint8_t CMD_QUERY_MAC_ADDRESS = 0xA5;
62static constexpr uint8_t CMD_RESET = 0xA2;
63static constexpr uint8_t CMD_RESTART = 0xA3;
64static constexpr uint8_t CMD_BLUETOOTH = 0xA4;
65static constexpr uint8_t CMD_SINGLE_TARGET_MODE = 0x80;
66static constexpr uint8_t CMD_MULTI_TARGET_MODE = 0x90;
67static constexpr uint8_t CMD_QUERY_TARGET_MODE = 0x91;
68static constexpr uint8_t CMD_SET_BAUD_RATE = 0xA1;
69static constexpr uint8_t CMD_QUERY_ZONE = 0xC1;
70static constexpr uint8_t CMD_SET_ZONE = 0xC2;
71using ld24xx::CMD_FRAME_FOOTER;
72using ld24xx::CMD_FRAME_HEADER;
73using ld24xx::HEADER_FOOTER_SIZE;
76static constexpr uint8_t DATA_FRAME_HEADER[HEADER_FOOTER_SIZE] = {0xAA, 0xFF, 0x03, 0x00};
77static constexpr uint8_t DATA_FRAME_FOOTER[2] = {0x55, 0xCC};
80static constexpr uint8_t ZONE_ACK_FRAME_SIZE = 40;
81static constexpr uint8_t PERIODIC_FRAME_SIZE = 30;
85static inline void convert_int_values_to_hex(
const int *values, uint8_t *bytes) {
86 for (uint8_t i = 0; i < 4; i++) {
87 uint16_t
val = values[i] & 0xFFFF;
89 bytes[i * 2 + 1] = (
val >> 8) & 0xFF;
93static inline int16_t decode_coordinate(uint8_t low_byte, uint8_t high_byte) {
94 int16_t coordinate = (high_byte & 0x7F) << 8 | low_byte;
95 if ((high_byte & 0x80) == 0) {
96 coordinate = -coordinate;
101static inline int16_t decode_speed(uint8_t low_byte, uint8_t high_byte) {
102 int16_t
speed = (high_byte & 0x7F) << 8 | low_byte;
103 if ((high_byte & 0x80) == 0) {
113 if (
len < HEADER_FOOTER_SIZE) {
116 if (
buffer[0] == DATA_FRAME_HEADER[0]) {
117 return PERIODIC_FRAME_SIZE;
126#ifdef USE_BINARY_SENSOR
127 if (this->connected_binary_sensor_ !=
nullptr) {
128 this->connected_binary_sensor_->publish_initial_state(
false);
132 if (this->presence_timeout_number_ !=
nullptr) {
133 this->
pref_ = this->presence_timeout_number_->make_entity_preference<
float>();
134 this->set_presence_timeout();
137#ifdef LD2450_POLYGON_ZONE_COUNT
142 this->restart_and_read_all_info();
145void LD2450Component::dump_config() {
146 char mac_s[MAC_ADDRESS_PRETTY_BUFFER_SIZE];
152 " Firmware version: %s\n"
154 " Link timeout: %" PRIu32
" ms",
155 version_s, mac_str, this->link_timeout_ms_);
156#ifdef USE_BINARY_SENSOR
157 ESP_LOGCONFIG(TAG,
"Binary Sensors:");
158 LOG_BINARY_SENSOR(
" ",
"Connected", this->connected_binary_sensor_);
159 LOG_BINARY_SENSOR(
" ",
"MovingTarget", this->moving_target_binary_sensor_);
160 LOG_BINARY_SENSOR(
" ",
"StillTarget", this->still_target_binary_sensor_);
161 LOG_BINARY_SENSOR(
" ",
"Target", this->target_binary_sensor_);
164 ESP_LOGCONFIG(TAG,
"Sensors:");
165 LOG_SENSOR_WITH_DEDUP(
" ",
"MovingTargetCount", this->moving_target_count_sensor_);
166 LOG_SENSOR_WITH_DEDUP(
" ",
"StillTargetCount", this->still_target_count_sensor_);
167 LOG_SENSOR_WITH_DEDUP(
" ",
"TargetCount", this->target_count_sensor_);
169 LOG_SENSOR_WITH_DEDUP(
" ",
"TargetX", s);
172 LOG_SENSOR_WITH_DEDUP(
" ",
"TargetY", s);
175 LOG_SENSOR_WITH_DEDUP(
" ",
"TargetAngle", s);
178 LOG_SENSOR_WITH_DEDUP(
" ",
"TargetDistance", s);
181 LOG_SENSOR_WITH_DEDUP(
" ",
"TargetResolution", s);
184 LOG_SENSOR_WITH_DEDUP(
" ",
"TargetSpeed", s);
187 LOG_SENSOR_WITH_DEDUP(
" ",
"ZoneTargetCount", s);
190 LOG_SENSOR_WITH_DEDUP(
" ",
"ZoneMovingTargetCount", s);
193 LOG_SENSOR_WITH_DEDUP(
" ",
"ZoneStillTargetCount", s);
196#ifdef USE_TEXT_SENSOR
197 ESP_LOGCONFIG(TAG,
"Text Sensors:");
198 LOG_TEXT_SENSOR(
" ",
"Version", this->version_text_sensor_);
199 LOG_TEXT_SENSOR(
" ",
"MAC address", this->mac_text_sensor_);
201 LOG_TEXT_SENSOR(
" ",
"Direction", s);
203#ifdef USE_LD2450_TARGET_XY
205 LOG_TEXT_SENSOR(
" ",
"TargetXY", s);
210 ESP_LOGCONFIG(TAG,
"Numbers:");
211 LOG_NUMBER(
" ",
"PresenceTimeout", this->presence_timeout_number_);
213 LOG_NUMBER(
" ",
"ZoneX1", n.x1);
214 LOG_NUMBER(
" ",
"ZoneY1", n.y1);
215 LOG_NUMBER(
" ",
"ZoneX2", n.x2);
216 LOG_NUMBER(
" ",
"ZoneY2", n.y2);
220 ESP_LOGCONFIG(TAG,
"Selects:");
221 LOG_SELECT(
" ",
"BaudRate", this->baud_rate_select_);
222 LOG_SELECT(
" ",
"ZoneType", this->zone_type_select_);
225 ESP_LOGCONFIG(TAG,
"Switches:");
226 LOG_SWITCH(
" ",
"Bluetooth", this->bluetooth_switch_);
227 LOG_SWITCH(
" ",
"MultiTarget", this->multi_target_switch_);
230 ESP_LOGCONFIG(TAG,
"Buttons:");
231 LOG_BUTTON(
" ",
"FactoryReset", this->factory_reset_button_);
232 LOG_BUTTON(
" ",
"Restart", this->restart_button_);
234#ifdef LD2450_POLYGON_ZONE_COUNT
235 ESP_LOGCONFIG(TAG,
"Polygon Zones:");
236 for (PolygonZone *zone : this->polygon_zones_) {
242void LD2450Component::loop() {
301 ESP_LOGI(TAG,
"Radar link restored");
303 ESP_LOGD(TAG,
"Receiving radar frames");
306#ifdef USE_BINARY_SENSOR
307 PUBLISH_STATE(this->connected_binary_sensor_,
true);
313 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_x_sensors_[target]);
314 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_y_sensors_[target]);
315 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_resolution_sensors_[target]);
316 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_speed_sensors_[target]);
317 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_distance_sensors_[target]);
318 SAFE_PUBLISH_SENSOR_UNKNOWN(this->move_angle_sensors_[target]);
324 ESP_LOGW(TAG,
"Radar link lost: no valid frame for %" PRIu32
" ms (%s, %u invalid frames)", silent_ms,
325 this->
bytes_since_frame_ ? LOG_STR_LITERAL(
"bytes received") : LOG_STR_LITERAL(
"no bytes received"),
328#ifdef USE_BINARY_SENSOR
329 PUBLISH_STATE(this->connected_binary_sensor_,
false);
334#ifdef USE_BINARY_SENSOR
336 {this->target_binary_sensor_, this->moving_target_binary_sensor_, this->still_target_binary_sensor_}) {
338 s->invalidate_state();
346#ifdef LD2450_POLYGON_ZONE_COUNT
348 zone->invalidate_presence();
351 for (uint8_t i = 0; i < MAX_TARGETS; i++) {
355#ifdef USE_LD2450_TARGET_XY
356 PUBLISH_STATE(this->target_xy_text_sensors_[i],
"unknown");
361#ifdef USE_TEXT_SENSOR
363 if (this->
direction_dedup_[i].next_unknown() && this->direction_text_sensors_[i] !=
nullptr) {
364 this->direction_text_sensors_[i]->publish_state(
"unknown");
369 for (uint8_t i = 0; i < MAX_ZONES; i++) {
370 SAFE_PUBLISH_SENSOR_UNKNOWN(this->zone_target_count_sensors_[i]);
371 SAFE_PUBLISH_SENSOR_UNKNOWN(this->zone_still_target_count_sensors_[i]);
372 SAFE_PUBLISH_SENSOR_UNKNOWN(this->zone_moving_target_count_sensors_[i]);
374 SAFE_PUBLISH_SENSOR_UNKNOWN(this->target_count_sensor_);
375 SAFE_PUBLISH_SENSOR_UNKNOWN(this->still_target_count_sensor_);
376 SAFE_PUBLISH_SENSOR_UNKNOWN(this->moving_target_count_sensor_);
385 if (target.x > zone.
x1 && target.x < zone.
x2 && target.y > zone.
y1 && target.y < zone.
y2) {
386 if (target.is_moving) {
396void LD2450Component::reset_radar_zone() {
407void LD2450Component::set_radar_zone(int32_t zone_type, int32_t zone1_x1, int32_t zone1_y1, int32_t zone1_x2,
408 int32_t zone1_y2, int32_t zone2_x1, int32_t zone2_y1, int32_t zone2_x2,
409 int32_t zone2_y2, int32_t zone3_x1, int32_t zone3_y1, int32_t zone3_x2,
412 int zone_parameters[12] = {zone1_x1, zone1_y1, zone1_x2, zone1_y2, zone2_x1, zone2_y1,
413 zone2_x2, zone2_y2, zone3_x1, zone3_y1, zone3_x2, zone3_y2};
414 for (uint8_t i = 0; i < MAX_ZONES; i++) {
425 uint8_t cmd_value[26] = {};
426 uint8_t zone_type_bytes[2] = {
static_cast<uint8_t
>(this->
zone_type_), 0x00};
427 uint8_t area_config[24] = {};
428 for (uint8_t i = 0; i < MAX_ZONES; i++) {
431 ld2450::convert_int_values_to_hex(values, area_config + (i * 8));
433 std::memcpy(cmd_value, zone_type_bytes,
sizeof(zone_type_bytes));
434 std::memcpy(cmd_value + 2, area_config,
sizeof(area_config));
436 this->
send_command_(CMD_SET_ZONE, cmd_value,
sizeof(cmd_value));
442 if (check_millis == 0) {
450 uint8_t index, start;
451 for (index = 0; index < MAX_ZONES; index++) {
452 start = 12 + index * 8;
459 if (this->zone_numbers_[index].x1 !=
nullptr) {
460 this->zone_numbers_[index].x1->publish_state(this->
zone_config_[index].x1);
461 this->zone_numbers_[index].y1->publish_state(this->
zone_config_[index].y1);
462 this->zone_numbers_[index].x2->publish_state(this->
zone_config_[index].x2);
463 this->zone_numbers_[index].y2->publish_state(this->
zone_config_[index].y2);
470void LD2450Component::read_all_info() {
479 if (this->baud_rate_select_ !=
nullptr) {
481 this->baud_rate_select_->publish_state(*index);
484 this->publish_zone_type();
489void LD2450Component::query_zone_info() {
496void LD2450Component::restart_and_read_all_info() {
499 this->
set_timeout(1500, [
this]() { this->read_all_info(); });
504 ESP_LOGV(TAG,
"Sending COMMAND %02X", command);
506 this->
write_array(CMD_FRAME_HEADER,
sizeof(CMD_FRAME_HEADER));
509 if (command_value !=
nullptr) {
510 len += command_value_len;
513 uint8_t len_cmd[] = {
len, 0x00, command, 0x00};
516 if (command_value !=
nullptr) {
517 this->
write_array(command_value, command_value_len);
520 this->
write_array(CMD_FRAME_FOOTER,
sizeof(CMD_FRAME_FOOTER));
522 if (command != CMD_ENABLE_CONF && command != CMD_DISABLE_CONF) {
531 int16_t target_count = 0;
532 int16_t still_target_count = 0;
533 int16_t moving_target_count = 0;
543 bool is_moving =
false;
545#if defined(USE_BINARY_SENSOR) || defined(USE_SENSOR) || defined(USE_TEXT_SENSOR)
547 for (index = 0; index < MAX_TARGETS; index++) {
566 moving_target_count++;
570 int32_t x_squared = (int32_t) tx * tx;
571 int32_t y_squared = (int32_t) ty * ty;
572 td = (uint16_t) sqrtf(x_squared + y_squared);
580 SAFE_PUBLISH_SENSOR(this->move_x_sensors_[index], tx);
581 SAFE_PUBLISH_SENSOR(this->move_y_sensors_[index], ty);
582 SAFE_PUBLISH_SENSOR(this->move_resolution_sensors_[index], res);
583 SAFE_PUBLISH_SENSOR(this->move_speed_sensors_[index], ts);
584 SAFE_PUBLISH_SENSOR(this->move_distance_sensors_[index], td);
586 angle = atan2f(
static_cast<float>(-tx),
static_cast<float>(ty)) * (180.0f / std::numbers::pi_v<float>);
587 SAFE_PUBLISH_SENSOR(this->move_angle_sensors_[index], angle);
590#ifdef USE_TEXT_SENSOR
602 PUBLISH_STATE(this->direction_text_sensors_[index],
603 DirectionStrings::get_progmem_str(
direction, DirectionStrings::LAST_INDEX));
609#ifdef USE_LD2450_TARGET_XY
615#ifdef USE_LD2450_TARGET_XY
617 previous.
x != this->target_info_[index].x || previous.
y != this->target_info_[index].y);
622 still_target_count = target_count - moving_target_count;
625#ifdef LD2450_POLYGON_ZONE_COUNT
628 if (!zone->has_polygon())
630 bool target_inside =
false;
633 if ((target.x != 0 || target.y != 0) && zone->contains(target.x, target.y)) {
634 target_inside =
true;
644 uint8_t zone_still_targets = 0;
645 uint8_t zone_moving_targets = 0;
646 uint8_t zone_all_targets = 0;
647 for (index = 0; index < MAX_ZONES; index++) {
649 zone_all_targets = zone_still_targets + zone_moving_targets;
652 SAFE_PUBLISH_SENSOR(this->zone_still_target_count_sensors_[index], zone_still_targets);
654 SAFE_PUBLISH_SENSOR(this->zone_moving_target_count_sensors_[index], zone_moving_targets);
656 SAFE_PUBLISH_SENSOR(this->zone_target_count_sensors_[index], zone_all_targets);
660 SAFE_PUBLISH_SENSOR(this->target_count_sensor_, target_count);
662 SAFE_PUBLISH_SENSOR(this->still_target_count_sensor_, still_target_count);
664 SAFE_PUBLISH_SENSOR(this->moving_target_count_sensor_, moving_target_count);
668#ifdef USE_BINARY_SENSOR
670 if (this->target_binary_sensor_ !=
nullptr) {
671 if (target_count > 0) {
672 this->target_binary_sensor_->publish_state(
true);
675 this->target_binary_sensor_->publish_state(
false);
677 ESP_LOGV(TAG,
"Clear presence waiting timeout: %" PRIu32, this->
timeout_);
682 if (this->moving_target_binary_sensor_ !=
nullptr) {
683 if (moving_target_count > 0) {
684 this->moving_target_binary_sensor_->publish_state(
true);
687 this->moving_target_binary_sensor_->publish_state(
false);
692 if (this->still_target_binary_sensor_ !=
nullptr) {
693 if (still_target_count > 0) {
694 this->still_target_binary_sensor_->publish_state(
true);
697 this->still_target_binary_sensor_->publish_state(
false);
702#ifdef USE_BINARY_SENSOR
704 if (target_count > 0) {
707 if (moving_target_count > 0) {
710 if (still_target_count > 0) {
721 ESP_LOGE(TAG,
"Invalid status");
730 case CMD_ENABLE_CONF:
731 ESP_LOGV(TAG,
"Enable conf");
734 case CMD_DISABLE_CONF:
735 ESP_LOGV(TAG,
"Disabled conf");
738 case CMD_SET_BAUD_RATE:
739 ESP_LOGV(TAG,
"Baud rate change");
741 if (this->baud_rate_select_ !=
nullptr) {
742 auto baud = this->baud_rate_select_->current_option();
743 ESP_LOGE(TAG,
"Change baud rate to %.*s and reinstall", (
int) baud.size(), baud.c_str());
748 case CMD_QUERY_VERSION: {
755 ESP_LOGV(TAG,
"Firmware version: %s", version_s);
756#ifdef USE_TEXT_SENSOR
757 PUBLISH_STATE(this->version_text_sensor_, version_s);
762 case CMD_QUERY_MAC_ADDRESS: {
769 char mac_s[MAC_ADDRESS_PRETTY_BUFFER_SIZE];
771 ESP_LOGV(TAG,
"MAC address: %s", mac_str);
772#ifdef USE_TEXT_SENSOR
773 PUBLISH_STATE(this->mac_text_sensor_, mac_str);
782 ESP_LOGV(TAG,
"Bluetooth");
785 case CMD_SINGLE_TARGET_MODE:
786 ESP_LOGV(TAG,
"Single target conf");
788 PUBLISH_STATE(this->multi_target_switch_,
false);
792 case CMD_MULTI_TARGET_MODE:
793 ESP_LOGV(TAG,
"Multi target conf");
795 PUBLISH_STATE(this->multi_target_switch_,
true);
799 case CMD_QUERY_TARGET_MODE:
803 ESP_LOGV(TAG,
"Query target tracking mode");
805 PUBLISH_STATE(this->multi_target_switch_, this->
buffer_data_[10] == 0x02);
813 ESP_LOGV(TAG,
"Query zone conf");
815 this->publish_zone_type();
817 if (this->zone_type_select_ !=
nullptr) {
818 auto zone = this->zone_type_select_->current_option();
819 ESP_LOGV(TAG,
"Change zone type to: %.*s", (
int) zone.size(), zone.c_str());
823 ESP_LOGV(TAG,
"Zone: Disabled");
826 ESP_LOGV(TAG,
"Zone: Area detection");
829 ESP_LOGV(TAG,
"Zone: Area filter");
835 ESP_LOGV(TAG,
"Set zone conf");
836 this->query_zone_info();
851 [
this](uint8_t frame_len) {
return this->
handle_frame_(frame_len); },
856 ESP_LOGW(TAG,
"Invalid header/footer");
865 if (
end[-2] != DATA_FRAME_FOOTER[0] ||
end[-1] != DATA_FRAME_FOOTER[1]) {
873 if (!ld2450::validate_header_footer(CMD_FRAME_FOOTER,
end - HEADER_FOOTER_SIZE)) {
883 const uint8_t cmd = enable ? CMD_ENABLE_CONF : CMD_DISABLE_CONF;
884 const uint8_t cmd_value[2] = {0x01, 0x00};
885 this->
send_command_(cmd, enable ? cmd_value :
nullptr,
sizeof(cmd_value));
889void LD2450Component::set_bluetooth(
bool enable) {
892 const uint8_t cmd_value[2] = {enable ? (uint8_t) 0x01 : (uint8_t) 0x00, 0x00};
893 this->
send_command_(CMD_BLUETOOTH, cmd_value,
sizeof(cmd_value));
894 this->
set_timeout(200, [
this]() { this->restart_and_read_all_info(); });
898void LD2450Component::set_baud_rate(
const char *
state) {
901 this->set_baud_rate(
static_cast<BaudRate>(index + 1));
905void LD2450Component::set_baud_rate(
BaudRate rate) {
908 const uint8_t cmd_value[2] = {rate, 0x00};
909 this->
send_command_(CMD_SET_BAUD_RATE, cmd_value,
sizeof(cmd_value));
914void LD2450Component::set_zone_type(
const char *
state) {
915 ESP_LOGV(TAG,
"Set zone type: %s",
state);
918 this->set_zone_type(
static_cast<ZoneType>(index));
928void LD2450Component::publish_zone_type() {
930 PUBLISH_STATE(this->zone_type_select_,
static_cast<size_t>(this->
zone_type_));
935void LD2450Component::set_multi_target(
bool enable) {
937 uint8_t cmd = enable ? CMD_MULTI_TARGET_MODE : CMD_SINGLE_TARGET_MODE;
943void LD2450Component::factory_reset() {
947 this->
set_timeout(200, [
this]() { this->restart_and_read_all_info(); });
961 uint8_t cmd_value[2] = {0x01, 0x00};
972void LD2450Component::set_move_x_sensor(uint8_t target,
sensor::Sensor *s) {
973 this->move_x_sensors_[target].set_sensor(s);
975void LD2450Component::set_move_y_sensor(uint8_t target,
sensor::Sensor *s) {
976 this->move_y_sensors_[target].set_sensor(s);
978void LD2450Component::set_move_speed_sensor(uint8_t target, sensor::Sensor *s) {
979 this->move_speed_sensors_[target].set_sensor(s);
981void LD2450Component::set_move_angle_sensor(uint8_t target, sensor::Sensor *s) {
982 this->move_angle_sensors_[target].set_sensor(s);
984void LD2450Component::set_move_distance_sensor(uint8_t target, sensor::Sensor *s) {
985 this->move_distance_sensors_[target].set_sensor(s);
987void LD2450Component::set_move_resolution_sensor(uint8_t target, sensor::Sensor *s) {
988 this->move_resolution_sensors_[target].set_sensor(s);
990void LD2450Component::set_zone_target_count_sensor(uint8_t zone, sensor::Sensor *s) {
991 this->zone_target_count_sensors_[zone].set_sensor(s);
993void LD2450Component::set_zone_still_target_count_sensor(uint8_t zone, sensor::Sensor *s) {
994 this->zone_still_target_count_sensors_[zone].set_sensor(s);
996void LD2450Component::set_zone_moving_target_count_sensor(uint8_t zone, sensor::Sensor *s) {
997 this->zone_moving_target_count_sensors_[zone].set_sensor(s);
1000#ifdef USE_TEXT_SENSOR
1001void LD2450Component::set_direction_text_sensor(uint8_t target, text_sensor::TextSensor *s) {
1002 this->direction_text_sensors_[target] = s;
1005#ifdef USE_LD2450_TARGET_XY
1006void LD2450Component::set_target_xy_text_sensor(uint8_t target, text_sensor::TextSensor *s) {
1007 this->target_xy_text_sensors_[target] = s;
1013 if (s ==
nullptr || (!changed && s->
has_state()))
1016 if (
pos.x == 0 &&
pos.y == 0) {
1022 const size_t len = buf_append_printf(text,
sizeof(text), 0,
"%d,%d",
pos.x,
pos.y);
1031 while (zone < MAX_ZONES && this->
zone_numbers_[zone].x1 != n && this->zone_numbers_[zone].y1 != n &&
1032 this->zone_numbers_[zone].x2 != n && this->zone_numbers_[zone].y2 != n)
1034 if (zone == MAX_ZONES)
1050void LD2450Component::set_zone_numbers(uint8_t zone, number::Number *x1, number::Number *y1, number::Number *x2,
1051 number::Number *y2) {
1052 if (zone < MAX_ZONES) {
1053 this->zone_numbers_[zone].x1 = x1;
1054 this->zone_numbers_[zone].y1 = y1;
1055 this->zone_numbers_[zone].x2 = x2;
1056 this->zone_numbers_[zone].y2 = y2;
1063void LD2450Component::set_presence_timeout() {
1064 if (this->presence_timeout_number_ ==
nullptr)
1067 if (!this->presence_timeout_number_->has_state())
1069 const float timeout = this->presence_timeout_number_->state;
1071 this->
timeout_ = ld2450::convert_seconds_to_ms(timeout);
1081 value = DEFAULT_PRESENCE_TIMEOUT;