8static const char *
const TAG =
"pipsolar";
10void Pipsolar::setup() {
22void Pipsolar::loop() {
41 ESP_LOGD(TAG,
"response length for command OK");
45 ESP_LOGD(TAG,
"command successful");
47 ESP_LOGD(TAG,
"command not successful");
60 ESP_LOGD(TAG,
"response length for command %s not OK: with length %zu",
72 if (this->grid_rating_voltage_) {
73 this->grid_rating_voltage_->publish_state(value_grid_rating_voltage_);
75 if (this->grid_rating_current_) {
76 this->grid_rating_current_->publish_state(value_grid_rating_current_);
78 if (this->ac_output_rating_voltage_) {
79 this->ac_output_rating_voltage_->publish_state(value_ac_output_rating_voltage_);
81 if (this->ac_output_rating_frequency_) {
82 this->ac_output_rating_frequency_->publish_state(value_ac_output_rating_frequency_);
84 if (this->ac_output_rating_current_) {
85 this->ac_output_rating_current_->publish_state(value_ac_output_rating_current_);
87 if (this->ac_output_rating_apparent_power_) {
88 this->ac_output_rating_apparent_power_->publish_state(value_ac_output_rating_apparent_power_);
90 if (this->ac_output_rating_active_power_) {
91 this->ac_output_rating_active_power_->publish_state(value_ac_output_rating_active_power_);
93 if (this->battery_rating_voltage_) {
94 this->battery_rating_voltage_->publish_state(value_battery_rating_voltage_);
96 if (this->battery_recharge_voltage_) {
97 this->battery_recharge_voltage_->publish_state(value_battery_recharge_voltage_);
99 if (this->battery_under_voltage_) {
100 this->battery_under_voltage_->publish_state(value_battery_under_voltage_);
102 if (this->battery_bulk_voltage_) {
103 this->battery_bulk_voltage_->publish_state(value_battery_bulk_voltage_);
105 if (this->battery_float_voltage_) {
106 this->battery_float_voltage_->publish_state(value_battery_float_voltage_);
108 if (this->battery_type_) {
109 this->battery_type_->publish_state(value_battery_type_);
111 if (this->current_max_ac_charging_current_) {
112 this->current_max_ac_charging_current_->publish_state(value_current_max_ac_charging_current_);
114 if (this->current_max_charging_current_) {
115 this->current_max_charging_current_->publish_state(value_current_max_charging_current_);
117 if (this->input_voltage_range_) {
118 this->input_voltage_range_->publish_state(value_input_voltage_range_);
121 if (this->input_voltage_range_switch_) {
122 this->input_voltage_range_switch_->publish_state(value_input_voltage_range_ == 1);
124 if (this->output_source_priority_) {
125 this->output_source_priority_->publish_state(value_output_source_priority_);
128 if (this->output_source_priority_utility_switch_) {
129 this->output_source_priority_utility_switch_->publish_state(value_output_source_priority_ == 0);
131 if (this->output_source_priority_solar_switch_) {
132 this->output_source_priority_solar_switch_->publish_state(value_output_source_priority_ == 1);
134 if (this->output_source_priority_battery_switch_) {
135 this->output_source_priority_battery_switch_->publish_state(value_output_source_priority_ == 2);
137 if (this->output_source_priority_hybrid_switch_) {
138 this->output_source_priority_hybrid_switch_->publish_state(value_output_source_priority_ == 3);
140 if (this->charger_source_priority_) {
141 this->charger_source_priority_->publish_state(value_charger_source_priority_);
143 if (this->parallel_max_num_) {
144 this->parallel_max_num_->publish_state(value_parallel_max_num_);
146 if (this->machine_type_) {
147 this->machine_type_->publish_state(value_machine_type_);
149 if (this->topology_) {
150 this->topology_->publish_state(value_topology_);
152 if (this->output_mode_) {
153 this->output_mode_->publish_state(value_output_mode_);
155 if (this->battery_redischarge_voltage_) {
156 this->battery_redischarge_voltage_->publish_state(value_battery_redischarge_voltage_);
158 if (this->pv_ok_condition_for_parallel_) {
159 this->pv_ok_condition_for_parallel_->publish_state(value_pv_ok_condition_for_parallel_);
162 if (this->pv_ok_condition_for_parallel_switch_) {
163 this->pv_ok_condition_for_parallel_switch_->publish_state(value_pv_ok_condition_for_parallel_ == 1);
165 if (this->pv_power_balance_) {
166 this->pv_power_balance_->publish_state(value_pv_power_balance_ == 1);
169 if (this->pv_power_balance_switch_) {
170 this->pv_power_balance_switch_->publish_state(value_pv_power_balance_ == 1);
175 if (this->grid_voltage_) {
176 this->grid_voltage_->publish_state(value_grid_voltage_);
178 if (this->grid_frequency_) {
179 this->grid_frequency_->publish_state(value_grid_frequency_);
181 if (this->ac_output_voltage_) {
182 this->ac_output_voltage_->publish_state(value_ac_output_voltage_);
184 if (this->ac_output_frequency_) {
185 this->ac_output_frequency_->publish_state(value_ac_output_frequency_);
187 if (this->ac_output_apparent_power_) {
188 this->ac_output_apparent_power_->publish_state(value_ac_output_apparent_power_);
190 if (this->ac_output_active_power_) {
191 this->ac_output_active_power_->publish_state(value_ac_output_active_power_);
193 if (this->output_load_percent_) {
194 this->output_load_percent_->publish_state(value_output_load_percent_);
196 if (this->bus_voltage_) {
197 this->bus_voltage_->publish_state(value_bus_voltage_);
199 if (this->battery_voltage_) {
200 this->battery_voltage_->publish_state(value_battery_voltage_);
202 if (this->battery_charging_current_) {
203 this->battery_charging_current_->publish_state(value_battery_charging_current_);
205 if (this->battery_capacity_percent_) {
206 this->battery_capacity_percent_->publish_state(value_battery_capacity_percent_);
208 if (this->inverter_heat_sink_temperature_) {
209 this->inverter_heat_sink_temperature_->publish_state(value_inverter_heat_sink_temperature_);
211 if (this->pv_input_current_for_battery_) {
212 this->pv_input_current_for_battery_->publish_state(value_pv_input_current_for_battery_);
214 if (this->pv_input_voltage_) {
215 this->pv_input_voltage_->publish_state(value_pv_input_voltage_);
217 if (this->battery_voltage_scc_) {
218 this->battery_voltage_scc_->publish_state(value_battery_voltage_scc_);
220 if (this->battery_discharge_current_) {
221 this->battery_discharge_current_->publish_state(value_battery_discharge_current_);
223 if (this->add_sbu_priority_version_) {
224 this->add_sbu_priority_version_->publish_state(value_add_sbu_priority_version_);
226 if (this->configuration_status_) {
227 this->configuration_status_->publish_state(value_configuration_status_);
229 if (this->scc_firmware_version_) {
230 this->scc_firmware_version_->publish_state(value_scc_firmware_version_);
232 if (this->load_status_) {
233 this->load_status_->publish_state(value_load_status_);
235 if (this->battery_voltage_to_steady_while_charging_) {
236 this->battery_voltage_to_steady_while_charging_->publish_state(
237 value_battery_voltage_to_steady_while_charging_);
239 if (this->charging_status_) {
240 this->charging_status_->publish_state(value_charging_status_);
242 if (this->scc_charging_status_) {
243 this->scc_charging_status_->publish_state(value_scc_charging_status_);
245 if (this->ac_charging_status_) {
246 this->ac_charging_status_->publish_state(value_ac_charging_status_);
248 if (this->battery_voltage_offset_for_fans_on_) {
249 this->battery_voltage_offset_for_fans_on_->publish_state(value_battery_voltage_offset_for_fans_on_ / 10.0f);
251 if (this->eeprom_version_) {
252 this->eeprom_version_->publish_state(value_eeprom_version_);
254 if (this->pv_charging_power_) {
255 this->pv_charging_power_->publish_state(value_pv_charging_power_);
257 if (this->charging_to_floating_mode_) {
258 this->charging_to_floating_mode_->publish_state(value_charging_to_floating_mode_);
260 if (this->switch_on_) {
261 this->switch_on_->publish_state(value_switch_on_);
263 if (this->dustproof_installed_) {
264 this->dustproof_installed_->publish_state(value_dustproof_installed_);
269 if (this->device_mode_) {
270 mode = value_device_mode_;
271 this->device_mode_->publish_state(
mode);
276 if (this->silence_buzzer_open_buzzer_) {
277 this->silence_buzzer_open_buzzer_->publish_state(value_silence_buzzer_open_buzzer_);
279 if (this->overload_bypass_function_) {
280 this->overload_bypass_function_->publish_state(value_overload_bypass_function_);
282 if (this->lcd_escape_to_default_) {
283 this->lcd_escape_to_default_->publish_state(value_lcd_escape_to_default_);
285 if (this->overload_restart_function_) {
286 this->overload_restart_function_->publish_state(value_overload_restart_function_);
288 if (this->over_temperature_restart_function_) {
289 this->over_temperature_restart_function_->publish_state(value_over_temperature_restart_function_);
291 if (this->backlight_on_) {
292 this->backlight_on_->publish_state(value_backlight_on_);
294 if (this->alarm_on_when_primary_source_interrupt_) {
295 this->alarm_on_when_primary_source_interrupt_->publish_state(value_alarm_on_when_primary_source_interrupt_);
297 if (this->fault_code_record_) {
298 this->fault_code_record_->publish_state(value_fault_code_record_);
300 if (this->power_saving_) {
301 this->power_saving_->publish_state(value_power_saving_);
306 if (this->warnings_present_) {
307 this->warnings_present_->publish_state(value_warnings_present_);
309 if (this->faults_present_) {
310 this->faults_present_->publish_state(value_faults_present_);
312 if (this->warning_power_loss_) {
313 this->warning_power_loss_->publish_state(value_warning_power_loss_);
315 if (this->fault_inverter_fault_) {
316 this->fault_inverter_fault_->publish_state(value_fault_inverter_fault_);
318 if (this->fault_bus_over_) {
319 this->fault_bus_over_->publish_state(value_fault_bus_over_);
321 if (this->fault_bus_under_) {
322 this->fault_bus_under_->publish_state(value_fault_bus_under_);
324 if (this->fault_bus_soft_fail_) {
325 this->fault_bus_soft_fail_->publish_state(value_fault_bus_soft_fail_);
327 if (this->warning_line_fail_) {
328 this->warning_line_fail_->publish_state(value_warning_line_fail_);
330 if (this->fault_opvshort_) {
331 this->fault_opvshort_->publish_state(value_fault_opvshort_);
333 if (this->fault_inverter_voltage_too_low_) {
334 this->fault_inverter_voltage_too_low_->publish_state(value_fault_inverter_voltage_too_low_);
336 if (this->fault_inverter_voltage_too_high_) {
337 this->fault_inverter_voltage_too_high_->publish_state(value_fault_inverter_voltage_too_high_);
339 if (this->warning_over_temperature_) {
340 this->warning_over_temperature_->publish_state(value_warning_over_temperature_);
342 if (this->warning_fan_lock_) {
343 this->warning_fan_lock_->publish_state(value_warning_fan_lock_);
345 if (this->warning_battery_voltage_high_) {
346 this->warning_battery_voltage_high_->publish_state(value_warning_battery_voltage_high_);
348 if (this->warning_battery_low_alarm_) {
349 this->warning_battery_low_alarm_->publish_state(value_warning_battery_low_alarm_);
351 if (this->warning_battery_under_shutdown_) {
352 this->warning_battery_under_shutdown_->publish_state(value_warning_battery_under_shutdown_);
354 if (this->warning_battery_derating_) {
355 this->warning_battery_derating_->publish_state(value_warning_battery_derating_);
357 if (this->warning_over_load_) {
358 this->warning_over_load_->publish_state(value_warning_over_load_);
360 if (this->warning_eeprom_failed_) {
361 this->warning_eeprom_failed_->publish_state(value_warning_eeprom_failed_);
363 if (this->fault_inverter_over_current_) {
364 this->fault_inverter_over_current_->publish_state(value_fault_inverter_over_current_);
366 if (this->fault_inverter_soft_failed_) {
367 this->fault_inverter_soft_failed_->publish_state(value_fault_inverter_soft_failed_);
369 if (this->fault_self_test_failed_) {
370 this->fault_self_test_failed_->publish_state(value_fault_self_test_failed_);
372 if (this->fault_op_dc_voltage_over_) {
373 this->fault_op_dc_voltage_over_->publish_state(value_fault_op_dc_voltage_over_);
375 if (this->fault_battery_open_) {
376 this->fault_battery_open_->publish_state(value_fault_battery_open_);
378 if (this->fault_current_sensor_failed_) {
379 this->fault_current_sensor_failed_->publish_state(value_fault_current_sensor_failed_);
381 if (this->fault_battery_short_) {
382 this->fault_battery_short_->publish_state(value_fault_battery_short_);
384 if (this->warning_power_limit_) {
385 this->warning_power_limit_->publish_state(value_warning_power_limit_);
387 if (this->warning_pv_voltage_high_) {
388 this->warning_pv_voltage_high_->publish_state(value_warning_pv_voltage_high_);
390 if (this->fault_mppt_overload_) {
391 this->fault_mppt_overload_->publish_state(value_fault_mppt_overload_);
393 if (this->warning_mppt_overload_) {
394 this->warning_mppt_overload_->publish_state(value_warning_mppt_overload_);
396 if (this->warning_battery_too_low_to_charge_) {
397 this->warning_battery_too_low_to_charge_->publish_state(value_warning_battery_too_low_to_charge_);
399 if (this->fault_dc_dc_over_current_) {
400 this->fault_dc_dc_over_current_->publish_state(value_fault_dc_dc_over_current_);
402 if (this->fault_code_) {
403 this->fault_code_->publish_state(value_fault_code_);
405 if (this->warnung_low_pv_energy_) {
406 this->warnung_low_pv_energy_->publish_state(value_warnung_low_pv_energy_);
408 if (this->warning_high_ac_input_during_bus_soft_start_) {
409 this->warning_high_ac_input_during_bus_soft_start_->publish_state(
410 value_warning_high_ac_input_during_bus_soft_start_);
412 if (this->warning_battery_equalization_) {
413 this->warning_battery_equalization_->publish_state(value_warning_battery_equalization_);
431 ESP_LOGD(TAG,
"Decode QPIRI");
432 sscanf(tmp,
"(%f %f %f %f %f %d %d %f %f %f %f %f %d %d %d %d %d %d %d %d %d %d %f %d %d",
433 &value_grid_rating_voltage_, &value_grid_rating_current_, &value_ac_output_rating_voltage_,
434 &value_ac_output_rating_frequency_, &value_ac_output_rating_current_,
435 &value_ac_output_rating_apparent_power_, &value_ac_output_rating_active_power_,
436 &value_battery_rating_voltage_, &value_battery_recharge_voltage_,
437 &value_battery_under_voltage_, &value_battery_bulk_voltage_, &value_battery_float_voltage_,
438 &value_battery_type_, &value_current_max_ac_charging_current_,
439 &value_current_max_charging_current_, &value_input_voltage_range_,
440 &value_output_source_priority_, &value_charger_source_priority_, &value_parallel_max_num_,
441 &value_machine_type_, &value_topology_, &value_output_mode_,
442 &value_battery_redischarge_voltage_, &value_pv_ok_condition_for_parallel_,
443 &value_pv_power_balance_);
444 if (this->last_qpiri_) {
445 this->last_qpiri_->publish_state(tmp);
450 ESP_LOGD(TAG,
"Decode QPIGS");
453 "(%f %f %f %f %d %d %d %d %f %d %d %d %f %f %f %d %1d%1d%1d%1d%1d%1d%1d%1d %d %d %d %1d%1d%1d",
454 &value_grid_voltage_, &value_grid_frequency_, &value_ac_output_voltage_,
455 &value_ac_output_frequency_,
456 &value_ac_output_apparent_power_, &value_ac_output_active_power_, &value_output_load_percent_,
457 &value_bus_voltage_, &value_battery_voltage_, &value_battery_charging_current_,
458 &value_battery_capacity_percent_, &value_inverter_heat_sink_temperature_,
459 &value_pv_input_current_for_battery_, &value_pv_input_voltage_, &value_battery_voltage_scc_,
460 &value_battery_discharge_current_, &value_add_sbu_priority_version_,
461 &value_configuration_status_, &value_scc_firmware_version_, &value_load_status_,
462 &value_battery_voltage_to_steady_while_charging_, &value_charging_status_,
463 &value_scc_charging_status_, &value_ac_charging_status_,
464 &value_battery_voltage_offset_for_fans_on_, &value_eeprom_version_, &value_pv_charging_power_,
465 &value_charging_to_floating_mode_, &value_switch_on_,
466 &value_dustproof_installed_);
467 if (this->last_qpigs_) {
468 this->last_qpigs_->publish_state(tmp);
473 ESP_LOGD(TAG,
"Decode QMOD");
475 if (this->last_qmod_) {
476 this->last_qmod_->publish_state(tmp);
481 ESP_LOGD(TAG,
"Decode QFLAG");
484 for (
size_t i = 1; i < strlen(tmp); i++) {
493 this->value_silence_buzzer_open_buzzer_ = enabled;
496 this->value_overload_bypass_function_ = enabled;
499 this->value_lcd_escape_to_default_ = enabled;
502 this->value_overload_restart_function_ = enabled;
505 this->value_over_temperature_restart_function_ = enabled;
508 this->value_backlight_on_ = enabled;
511 this->value_alarm_on_when_primary_source_interrupt_ = enabled;
514 this->value_fault_code_record_ = enabled;
517 this->value_power_saving_ = enabled;
521 if (this->last_qflag_) {
522 this->last_qflag_->publish_state(tmp);
527 ESP_LOGD(TAG,
"Decode QPIWS");
530 this->value_warnings_present_ =
false;
531 this->value_faults_present_ =
false;
533 for (
size_t i = 1; i < strlen(tmp); i++) {
534 enabled = tmp[i] ==
'1';
537 this->value_warning_power_loss_ = enabled;
538 this->value_warnings_present_ += enabled;
541 this->value_fault_inverter_fault_ = enabled;
542 this->value_faults_present_ += enabled;
545 this->value_fault_bus_over_ = enabled;
546 this->value_faults_present_ += enabled;
549 this->value_fault_bus_under_ = enabled;
550 this->value_faults_present_ += enabled;
553 this->value_fault_bus_soft_fail_ = enabled;
554 this->value_faults_present_ += enabled;
557 this->value_warning_line_fail_ = enabled;
558 this->value_warnings_present_ += enabled;
561 this->value_fault_opvshort_ = enabled;
562 this->value_faults_present_ += enabled;
565 this->value_fault_inverter_voltage_too_low_ = enabled;
566 this->value_faults_present_ += enabled;
569 this->value_fault_inverter_voltage_too_high_ = enabled;
570 this->value_faults_present_ += enabled;
573 this->value_warning_over_temperature_ = enabled;
574 this->value_warnings_present_ += enabled;
577 this->value_warning_fan_lock_ = enabled;
578 this->value_warnings_present_ += enabled;
581 this->value_warning_battery_voltage_high_ = enabled;
582 this->value_warnings_present_ += enabled;
585 this->value_warning_battery_low_alarm_ = enabled;
586 this->value_warnings_present_ += enabled;
589 this->value_warning_battery_under_shutdown_ = enabled;
590 this->value_warnings_present_ += enabled;
593 this->value_warning_battery_derating_ = enabled;
594 this->value_warnings_present_ += enabled;
597 this->value_warning_over_load_ = enabled;
598 this->value_warnings_present_ += enabled;
601 this->value_warning_eeprom_failed_ = enabled;
602 this->value_warnings_present_ += enabled;
605 this->value_fault_inverter_over_current_ = enabled;
606 this->value_faults_present_ += enabled;
609 this->value_fault_inverter_soft_failed_ = enabled;
610 this->value_faults_present_ += enabled;
613 this->value_fault_self_test_failed_ = enabled;
614 this->value_faults_present_ += enabled;
617 this->value_fault_op_dc_voltage_over_ = enabled;
618 this->value_faults_present_ += enabled;
621 this->value_fault_battery_open_ = enabled;
622 this->value_faults_present_ += enabled;
625 this->value_fault_current_sensor_failed_ = enabled;
626 this->value_faults_present_ += enabled;
629 this->value_fault_battery_short_ = enabled;
630 this->value_faults_present_ += enabled;
633 this->value_warning_power_limit_ = enabled;
634 this->value_warnings_present_ += enabled;
637 this->value_warning_pv_voltage_high_ = enabled;
638 this->value_warnings_present_ += enabled;
641 this->value_fault_mppt_overload_ = enabled;
642 this->value_faults_present_ += enabled;
645 this->value_warning_mppt_overload_ = enabled;
646 this->value_warnings_present_ += enabled;
649 this->value_warning_battery_too_low_to_charge_ = enabled;
650 this->value_warnings_present_ += enabled;
653 this->value_fault_dc_dc_over_current_ = enabled;
654 this->value_faults_present_ += enabled;
662 this->value_warnung_low_pv_energy_ = enabled;
663 this->value_warnings_present_ += enabled;
666 this->value_warning_high_ac_input_during_bus_soft_start_ = enabled;
667 this->value_warnings_present_ += enabled;
670 this->value_warning_battery_equalization_ = enabled;
671 this->value_warnings_present_ += enabled;
675 if (this->last_qpiws_) {
676 this->last_qpiws_->publish_state(tmp);
681 ESP_LOGD(TAG,
"Decode QT");
682 if (this->last_qt_) {
683 this->last_qt_->publish_state(tmp);
688 ESP_LOGD(TAG,
"Decode QMN");
689 if (this->last_qmn_) {
690 this->last_qmn_->publish_state(tmp);
747 ESP_LOGD(TAG,
"timeout command from queue: %s", command);
775 ESP_LOGD(TAG,
"checking crc on incoming message");
778 ESP_LOGD(TAG,
"CRC OK");
784 ESP_LOGD(TAG,
"CRC NOK expected: %X %X but got: %X %X", ((uint8_t) ((
crc16) >> 8)), ((uint8_t) ((
crc16) &0xff)),
794 uint8_t byte_command[16];
796 for (uint8_t i = 0; i <
length; i++) {
810 ESP_LOGD(TAG,
"Sending command from queue: %s with length %d", command,
length);
842 ESP_LOGD(TAG,
"Sending polling command : %s with length %d",
856 ESP_LOGD(TAG,
"Command queued successfully: %s with length %u at position %d", command,
861 ESP_LOGD(TAG,
"Command queue full dropping command: %s", command);
864void Pipsolar::switch_command(
const std::string &command) {
865 ESP_LOGD(TAG,
"got command: %s", command.c_str());
868void Pipsolar::dump_config() {
869 ESP_LOGCONFIG(TAG,
"Pipsolar:\n"
872 if (used_polling_command.length != 0) {
873 ESP_LOGCONFIG(TAG,
"%s", used_polling_command.command);
877void Pipsolar::update() {
878 for (
auto &used_polling_command : this->used_polling_commands_) {
879 if (used_polling_command.length != 0) {
880 used_polling_command.needs_update =
true;
886 for (
auto &used_polling_command : this->used_polling_commands_) {
887 if (used_polling_command.length == strlen(command)) {
888 uint8_t
len = strlen(command);
889 if (memcmp(used_polling_command.command, command,
len) == 0) {
893 if (used_polling_command.length == 0) {
894 size_t length = strlen(command) + 1;
895 const char *beg = command;
897 used_polling_command.command =
new uint8_t[
length];
899 for (; beg !=
end; ++beg, ++i) {
900 used_polling_command.command[i] = (uint8_t) (*beg);
902 used_polling_command.errors = 0;
903 used_polling_command.identifier = polling_command;
904 used_polling_command.length =
length - 1;
905 used_polling_command.needs_update =
true;
913 uint8_t crc_low = crc & 0xff;
914 uint8_t crc_high = crc >> 8;
915 if (crc_low == 0x28 || crc_low == 0x0d || crc_low == 0x0a)
917 if (crc_high == 0x28 || crc_high == 0x0d || crc_high == 0x0a)
919 crc = (crc_high << 8) | crc_low;
BedjetMode mode
BedJet operating mode.
static const size_t COMMAND_QUEUE_LENGTH
uint8_t read_buffer_[PIPSOLAR_READ_BUFFER_LENGTH]
uint16_t pipsolar_crc_(uint8_t *msg, uint8_t len)
bool send_next_command_()
void empty_uart_buffer_()
uint8_t check_incoming_crc_()
uint32_t command_start_millis_
uint8_t check_incoming_length_(uint8_t length)
void queue_command_(const char *command, uint8_t length)
static const size_t PIPSOLAR_READ_BUFFER_LENGTH
std::string command_queue_[COMMAND_QUEUE_LENGTH]
uint8_t command_queue_position_
PollingCommand used_polling_commands_[POLLING_COMMANDS_MAX]
static const size_t POLLING_COMMANDS_MAX
static const size_t COMMAND_TIMEOUT
void add_polling_command_(const char *command, ENUMPollingCommand polling_command)
uint8_t last_polling_command_
void write_str(const char *str)
bool read_byte(uint8_t *data)
void write_array(const uint8_t *data, size_t len)
size_t write(uint8_t data)
Providing packet encoding functions for exchanging data with a remote host.
uint16_t crc16(const uint8_t *data, uint16_t len, uint16_t crc, uint16_t reverse_poly, bool refin, bool refout)
Calculate a CRC-16 checksum of data with size len.
optional< T > parse_number(const char *str)
Parse an unsigned decimal number from a null-terminated string.
uint16_t crc16be(const uint8_t *data, uint16_t len, uint16_t crc, uint16_t poly, bool refin, bool refout)
uint32_t IRAM_ATTR HOT millis()