8 static const char *
const TAG =
"pipsolar";
22 void Pipsolar::loop() {
43 ESP_LOGD(TAG,
"response length for command OK");
47 ESP_LOGD(TAG,
"command successful");
49 ESP_LOGD(TAG,
"command not successful");
62 ESP_LOGD(TAG,
"response length for command %s not OK: with length %zu",
74 if (this->grid_rating_voltage_) {
75 this->grid_rating_voltage_->publish_state(value_grid_rating_voltage_);
77 if (this->grid_rating_current_) {
78 this->grid_rating_current_->publish_state(value_grid_rating_current_);
80 if (this->ac_output_rating_voltage_) {
81 this->ac_output_rating_voltage_->publish_state(value_ac_output_rating_voltage_);
83 if (this->ac_output_rating_frequency_) {
84 this->ac_output_rating_frequency_->publish_state(value_ac_output_rating_frequency_);
86 if (this->ac_output_rating_current_) {
87 this->ac_output_rating_current_->publish_state(value_ac_output_rating_current_);
89 if (this->ac_output_rating_apparent_power_) {
90 this->ac_output_rating_apparent_power_->publish_state(value_ac_output_rating_apparent_power_);
92 if (this->ac_output_rating_active_power_) {
93 this->ac_output_rating_active_power_->publish_state(value_ac_output_rating_active_power_);
95 if (this->battery_rating_voltage_) {
96 this->battery_rating_voltage_->publish_state(value_battery_rating_voltage_);
98 if (this->battery_recharge_voltage_) {
99 this->battery_recharge_voltage_->publish_state(value_battery_recharge_voltage_);
101 if (this->battery_under_voltage_) {
102 this->battery_under_voltage_->publish_state(value_battery_under_voltage_);
104 if (this->battery_bulk_voltage_) {
105 this->battery_bulk_voltage_->publish_state(value_battery_bulk_voltage_);
107 if (this->battery_float_voltage_) {
108 this->battery_float_voltage_->publish_state(value_battery_float_voltage_);
110 if (this->battery_type_) {
111 this->battery_type_->publish_state(value_battery_type_);
113 if (this->current_max_ac_charging_current_) {
114 this->current_max_ac_charging_current_->publish_state(value_current_max_ac_charging_current_);
116 if (this->current_max_charging_current_) {
117 this->current_max_charging_current_->publish_state(value_current_max_charging_current_);
119 if (this->input_voltage_range_) {
120 this->input_voltage_range_->publish_state(value_input_voltage_range_);
123 if (this->input_voltage_range_switch_) {
124 this->input_voltage_range_switch_->publish_state(value_input_voltage_range_ == 1);
126 if (this->output_source_priority_) {
127 this->output_source_priority_->publish_state(value_output_source_priority_);
130 if (this->output_source_priority_utility_switch_) {
131 this->output_source_priority_utility_switch_->publish_state(value_output_source_priority_ == 0);
133 if (this->output_source_priority_solar_switch_) {
134 this->output_source_priority_solar_switch_->publish_state(value_output_source_priority_ == 1);
136 if (this->output_source_priority_battery_switch_) {
137 this->output_source_priority_battery_switch_->publish_state(value_output_source_priority_ == 2);
139 if (this->output_source_priority_hybrid_switch_) {
140 this->output_source_priority_hybrid_switch_->publish_state(value_output_source_priority_ == 3);
142 if (this->charger_source_priority_) {
143 this->charger_source_priority_->publish_state(value_charger_source_priority_);
145 if (this->parallel_max_num_) {
146 this->parallel_max_num_->publish_state(value_parallel_max_num_);
148 if (this->machine_type_) {
149 this->machine_type_->publish_state(value_machine_type_);
151 if (this->topology_) {
152 this->topology_->publish_state(value_topology_);
154 if (this->output_mode_) {
155 this->output_mode_->publish_state(value_output_mode_);
157 if (this->battery_redischarge_voltage_) {
158 this->battery_redischarge_voltage_->publish_state(value_battery_redischarge_voltage_);
160 if (this->pv_ok_condition_for_parallel_) {
161 this->pv_ok_condition_for_parallel_->publish_state(value_pv_ok_condition_for_parallel_);
164 if (this->pv_ok_condition_for_parallel_switch_) {
165 this->pv_ok_condition_for_parallel_switch_->publish_state(value_pv_ok_condition_for_parallel_ == 1);
167 if (this->pv_power_balance_) {
168 this->pv_power_balance_->publish_state(value_pv_power_balance_ == 1);
171 if (this->pv_power_balance_switch_) {
172 this->pv_power_balance_switch_->publish_state(value_pv_power_balance_ == 1);
177 if (this->grid_voltage_) {
178 this->grid_voltage_->publish_state(value_grid_voltage_);
180 if (this->grid_frequency_) {
181 this->grid_frequency_->publish_state(value_grid_frequency_);
183 if (this->ac_output_voltage_) {
184 this->ac_output_voltage_->publish_state(value_ac_output_voltage_);
186 if (this->ac_output_frequency_) {
187 this->ac_output_frequency_->publish_state(value_ac_output_frequency_);
189 if (this->ac_output_apparent_power_) {
190 this->ac_output_apparent_power_->publish_state(value_ac_output_apparent_power_);
192 if (this->ac_output_active_power_) {
193 this->ac_output_active_power_->publish_state(value_ac_output_active_power_);
195 if (this->output_load_percent_) {
196 this->output_load_percent_->publish_state(value_output_load_percent_);
198 if (this->bus_voltage_) {
199 this->bus_voltage_->publish_state(value_bus_voltage_);
201 if (this->battery_voltage_) {
202 this->battery_voltage_->publish_state(value_battery_voltage_);
204 if (this->battery_charging_current_) {
205 this->battery_charging_current_->publish_state(value_battery_charging_current_);
207 if (this->battery_capacity_percent_) {
208 this->battery_capacity_percent_->publish_state(value_battery_capacity_percent_);
210 if (this->inverter_heat_sink_temperature_) {
211 this->inverter_heat_sink_temperature_->publish_state(value_inverter_heat_sink_temperature_);
213 if (this->pv_input_current_for_battery_) {
214 this->pv_input_current_for_battery_->publish_state(value_pv_input_current_for_battery_);
216 if (this->pv_input_voltage_) {
217 this->pv_input_voltage_->publish_state(value_pv_input_voltage_);
219 if (this->battery_voltage_scc_) {
220 this->battery_voltage_scc_->publish_state(value_battery_voltage_scc_);
222 if (this->battery_discharge_current_) {
223 this->battery_discharge_current_->publish_state(value_battery_discharge_current_);
225 if (this->add_sbu_priority_version_) {
226 this->add_sbu_priority_version_->publish_state(value_add_sbu_priority_version_);
228 if (this->configuration_status_) {
229 this->configuration_status_->publish_state(value_configuration_status_);
231 if (this->scc_firmware_version_) {
232 this->scc_firmware_version_->publish_state(value_scc_firmware_version_);
234 if (this->load_status_) {
235 this->load_status_->publish_state(value_load_status_);
237 if (this->battery_voltage_to_steady_while_charging_) {
238 this->battery_voltage_to_steady_while_charging_->publish_state(
239 value_battery_voltage_to_steady_while_charging_);
241 if (this->charging_status_) {
242 this->charging_status_->publish_state(value_charging_status_);
244 if (this->scc_charging_status_) {
245 this->scc_charging_status_->publish_state(value_scc_charging_status_);
247 if (this->ac_charging_status_) {
248 this->ac_charging_status_->publish_state(value_ac_charging_status_);
250 if (this->battery_voltage_offset_for_fans_on_) {
251 this->battery_voltage_offset_for_fans_on_->publish_state(value_battery_voltage_offset_for_fans_on_ / 10.0f);
253 if (this->eeprom_version_) {
254 this->eeprom_version_->publish_state(value_eeprom_version_);
256 if (this->pv_charging_power_) {
257 this->pv_charging_power_->publish_state(value_pv_charging_power_);
259 if (this->charging_to_floating_mode_) {
260 this->charging_to_floating_mode_->publish_state(value_charging_to_floating_mode_);
262 if (this->switch_on_) {
263 this->switch_on_->publish_state(value_switch_on_);
265 if (this->dustproof_installed_) {
266 this->dustproof_installed_->publish_state(value_dustproof_installed_);
271 if (this->device_mode_) {
272 mode = value_device_mode_;
273 this->device_mode_->publish_state(mode);
278 if (this->silence_buzzer_open_buzzer_) {
279 this->silence_buzzer_open_buzzer_->publish_state(value_silence_buzzer_open_buzzer_);
281 if (this->overload_bypass_function_) {
282 this->overload_bypass_function_->publish_state(value_overload_bypass_function_);
284 if (this->lcd_escape_to_default_) {
285 this->lcd_escape_to_default_->publish_state(value_lcd_escape_to_default_);
287 if (this->overload_restart_function_) {
288 this->overload_restart_function_->publish_state(value_overload_restart_function_);
290 if (this->over_temperature_restart_function_) {
291 this->over_temperature_restart_function_->publish_state(value_over_temperature_restart_function_);
293 if (this->backlight_on_) {
294 this->backlight_on_->publish_state(value_backlight_on_);
296 if (this->alarm_on_when_primary_source_interrupt_) {
297 this->alarm_on_when_primary_source_interrupt_->publish_state(value_alarm_on_when_primary_source_interrupt_);
299 if (this->fault_code_record_) {
300 this->fault_code_record_->publish_state(value_fault_code_record_);
302 if (this->power_saving_) {
303 this->power_saving_->publish_state(value_power_saving_);
308 if (this->warnings_present_) {
309 this->warnings_present_->publish_state(value_warnings_present_);
311 if (this->faults_present_) {
312 this->faults_present_->publish_state(value_faults_present_);
314 if (this->warning_power_loss_) {
315 this->warning_power_loss_->publish_state(value_warning_power_loss_);
317 if (this->fault_inverter_fault_) {
318 this->fault_inverter_fault_->publish_state(value_fault_inverter_fault_);
320 if (this->fault_bus_over_) {
321 this->fault_bus_over_->publish_state(value_fault_bus_over_);
323 if (this->fault_bus_under_) {
324 this->fault_bus_under_->publish_state(value_fault_bus_under_);
326 if (this->fault_bus_soft_fail_) {
327 this->fault_bus_soft_fail_->publish_state(value_fault_bus_soft_fail_);
329 if (this->warning_line_fail_) {
330 this->warning_line_fail_->publish_state(value_warning_line_fail_);
332 if (this->fault_opvshort_) {
333 this->fault_opvshort_->publish_state(value_fault_opvshort_);
335 if (this->fault_inverter_voltage_too_low_) {
336 this->fault_inverter_voltage_too_low_->publish_state(value_fault_inverter_voltage_too_low_);
338 if (this->fault_inverter_voltage_too_high_) {
339 this->fault_inverter_voltage_too_high_->publish_state(value_fault_inverter_voltage_too_high_);
341 if (this->warning_over_temperature_) {
342 this->warning_over_temperature_->publish_state(value_warning_over_temperature_);
344 if (this->warning_fan_lock_) {
345 this->warning_fan_lock_->publish_state(value_warning_fan_lock_);
347 if (this->warning_battery_voltage_high_) {
348 this->warning_battery_voltage_high_->publish_state(value_warning_battery_voltage_high_);
350 if (this->warning_battery_low_alarm_) {
351 this->warning_battery_low_alarm_->publish_state(value_warning_battery_low_alarm_);
353 if (this->warning_battery_under_shutdown_) {
354 this->warning_battery_under_shutdown_->publish_state(value_warning_battery_under_shutdown_);
356 if (this->warning_battery_derating_) {
357 this->warning_battery_derating_->publish_state(value_warning_battery_derating_);
359 if (this->warning_over_load_) {
360 this->warning_over_load_->publish_state(value_warning_over_load_);
362 if (this->warning_eeprom_failed_) {
363 this->warning_eeprom_failed_->publish_state(value_warning_eeprom_failed_);
365 if (this->fault_inverter_over_current_) {
366 this->fault_inverter_over_current_->publish_state(value_fault_inverter_over_current_);
368 if (this->fault_inverter_soft_failed_) {
369 this->fault_inverter_soft_failed_->publish_state(value_fault_inverter_soft_failed_);
371 if (this->fault_self_test_failed_) {
372 this->fault_self_test_failed_->publish_state(value_fault_self_test_failed_);
374 if (this->fault_op_dc_voltage_over_) {
375 this->fault_op_dc_voltage_over_->publish_state(value_fault_op_dc_voltage_over_);
377 if (this->fault_battery_open_) {
378 this->fault_battery_open_->publish_state(value_fault_battery_open_);
380 if (this->fault_current_sensor_failed_) {
381 this->fault_current_sensor_failed_->publish_state(value_fault_current_sensor_failed_);
383 if (this->fault_battery_short_) {
384 this->fault_battery_short_->publish_state(value_fault_battery_short_);
386 if (this->warning_power_limit_) {
387 this->warning_power_limit_->publish_state(value_warning_power_limit_);
389 if (this->warning_pv_voltage_high_) {
390 this->warning_pv_voltage_high_->publish_state(value_warning_pv_voltage_high_);
392 if (this->fault_mppt_overload_) {
393 this->fault_mppt_overload_->publish_state(value_fault_mppt_overload_);
395 if (this->warning_mppt_overload_) {
396 this->warning_mppt_overload_->publish_state(value_warning_mppt_overload_);
398 if (this->warning_battery_too_low_to_charge_) {
399 this->warning_battery_too_low_to_charge_->publish_state(value_warning_battery_too_low_to_charge_);
401 if (this->fault_dc_dc_over_current_) {
402 this->fault_dc_dc_over_current_->publish_state(value_fault_dc_dc_over_current_);
404 if (this->fault_code_) {
405 this->fault_code_->publish_state(value_fault_code_);
407 if (this->warnung_low_pv_energy_) {
408 this->warnung_low_pv_energy_->publish_state(value_warnung_low_pv_energy_);
410 if (this->warning_high_ac_input_during_bus_soft_start_) {
411 this->warning_high_ac_input_during_bus_soft_start_->publish_state(
412 value_warning_high_ac_input_during_bus_soft_start_);
414 if (this->warning_battery_equalization_) {
415 this->warning_battery_equalization_->publish_state(value_warning_battery_equalization_);
433 ESP_LOGD(TAG,
"Decode QPIRI");
434 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",
435 &value_grid_rating_voltage_, &value_grid_rating_current_, &value_ac_output_rating_voltage_,
436 &value_ac_output_rating_frequency_, &value_ac_output_rating_current_,
437 &value_ac_output_rating_apparent_power_, &value_ac_output_rating_active_power_,
438 &value_battery_rating_voltage_, &value_battery_recharge_voltage_,
439 &value_battery_under_voltage_, &value_battery_bulk_voltage_, &value_battery_float_voltage_,
440 &value_battery_type_, &value_current_max_ac_charging_current_,
441 &value_current_max_charging_current_, &value_input_voltage_range_,
442 &value_output_source_priority_, &value_charger_source_priority_, &value_parallel_max_num_,
443 &value_machine_type_, &value_topology_, &value_output_mode_,
444 &value_battery_redischarge_voltage_, &value_pv_ok_condition_for_parallel_,
445 &value_pv_power_balance_);
446 if (this->last_qpiri_) {
447 this->last_qpiri_->publish_state(tmp);
452 ESP_LOGD(TAG,
"Decode QPIGS");
455 "(%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",
456 &value_grid_voltage_, &value_grid_frequency_, &value_ac_output_voltage_,
457 &value_ac_output_frequency_,
458 &value_ac_output_apparent_power_, &value_ac_output_active_power_, &value_output_load_percent_,
459 &value_bus_voltage_, &value_battery_voltage_, &value_battery_charging_current_,
460 &value_battery_capacity_percent_, &value_inverter_heat_sink_temperature_,
461 &value_pv_input_current_for_battery_, &value_pv_input_voltage_, &value_battery_voltage_scc_,
462 &value_battery_discharge_current_, &value_add_sbu_priority_version_,
463 &value_configuration_status_, &value_scc_firmware_version_, &value_load_status_,
464 &value_battery_voltage_to_steady_while_charging_, &value_charging_status_,
465 &value_scc_charging_status_, &value_ac_charging_status_,
466 &value_battery_voltage_offset_for_fans_on_, &value_eeprom_version_, &value_pv_charging_power_,
467 &value_charging_to_floating_mode_, &value_switch_on_,
468 &value_dustproof_installed_);
469 if (this->last_qpigs_) {
470 this->last_qpigs_->publish_state(tmp);
475 ESP_LOGD(TAG,
"Decode QMOD");
477 if (this->last_qmod_) {
478 this->last_qmod_->publish_state(tmp);
483 ESP_LOGD(TAG,
"Decode QFLAG");
486 for (
size_t i = 1; i < strlen(tmp); i++) {
495 this->value_silence_buzzer_open_buzzer_ = enabled;
498 this->value_overload_bypass_function_ = enabled;
501 this->value_lcd_escape_to_default_ = enabled;
504 this->value_overload_restart_function_ = enabled;
507 this->value_over_temperature_restart_function_ = enabled;
510 this->value_backlight_on_ = enabled;
513 this->value_alarm_on_when_primary_source_interrupt_ = enabled;
516 this->value_fault_code_record_ = enabled;
519 this->value_power_saving_ = enabled;
523 if (this->last_qflag_) {
524 this->last_qflag_->publish_state(tmp);
529 ESP_LOGD(TAG,
"Decode QPIWS");
532 this->value_warnings_present_ =
false;
533 this->value_faults_present_ =
true;
535 for (
size_t i = 1; i < strlen(tmp); i++) {
536 enabled = tmp[i] ==
'1';
539 this->value_warning_power_loss_ = enabled;
540 this->value_warnings_present_ += enabled;
543 this->value_fault_inverter_fault_ = enabled;
544 this->value_faults_present_ += enabled;
547 this->value_fault_bus_over_ = enabled;
548 this->value_faults_present_ += enabled;
551 this->value_fault_bus_under_ = enabled;
552 this->value_faults_present_ += enabled;
555 this->value_fault_bus_soft_fail_ = enabled;
556 this->value_faults_present_ += enabled;
559 this->value_warning_line_fail_ = enabled;
560 this->value_warnings_present_ += enabled;
563 this->value_fault_opvshort_ = enabled;
564 this->value_faults_present_ += enabled;
567 this->value_fault_inverter_voltage_too_low_ = enabled;
568 this->value_faults_present_ += enabled;
571 this->value_fault_inverter_voltage_too_high_ = enabled;
572 this->value_faults_present_ += enabled;
575 this->value_warning_over_temperature_ = enabled;
576 this->value_warnings_present_ += enabled;
579 this->value_warning_fan_lock_ = enabled;
580 this->value_warnings_present_ += enabled;
583 this->value_warning_battery_voltage_high_ = enabled;
584 this->value_warnings_present_ += enabled;
587 this->value_warning_battery_low_alarm_ = enabled;
588 this->value_warnings_present_ += enabled;
591 this->value_warning_battery_under_shutdown_ = enabled;
592 this->value_warnings_present_ += enabled;
595 this->value_warning_battery_derating_ = enabled;
596 this->value_warnings_present_ += enabled;
599 this->value_warning_over_load_ = enabled;
600 this->value_warnings_present_ += enabled;
603 this->value_warning_eeprom_failed_ = enabled;
604 this->value_warnings_present_ += enabled;
607 this->value_fault_inverter_over_current_ = enabled;
608 this->value_faults_present_ += enabled;
611 this->value_fault_inverter_soft_failed_ = enabled;
612 this->value_faults_present_ += enabled;
615 this->value_fault_self_test_failed_ = enabled;
616 this->value_faults_present_ += enabled;
619 this->value_fault_op_dc_voltage_over_ = enabled;
620 this->value_faults_present_ += enabled;
623 this->value_fault_battery_open_ = enabled;
624 this->value_faults_present_ += enabled;
627 this->value_fault_current_sensor_failed_ = enabled;
628 this->value_faults_present_ += enabled;
631 this->value_fault_battery_short_ = enabled;
632 this->value_faults_present_ += enabled;
635 this->value_warning_power_limit_ = enabled;
636 this->value_warnings_present_ += enabled;
639 this->value_warning_pv_voltage_high_ = enabled;
640 this->value_warnings_present_ += enabled;
643 this->value_fault_mppt_overload_ = enabled;
644 this->value_faults_present_ += enabled;
647 this->value_warning_mppt_overload_ = enabled;
648 this->value_warnings_present_ += enabled;
651 this->value_warning_battery_too_low_to_charge_ = enabled;
652 this->value_warnings_present_ += enabled;
655 this->value_fault_dc_dc_over_current_ = enabled;
656 this->value_faults_present_ += enabled;
661 this->value_fault_code_ = parse_number<int>(fc).value_or(0);
664 this->value_warnung_low_pv_energy_ = enabled;
665 this->value_warnings_present_ += enabled;
668 this->value_warning_high_ac_input_during_bus_soft_start_ = enabled;
669 this->value_warnings_present_ += enabled;
672 this->value_warning_battery_equalization_ = enabled;
673 this->value_warnings_present_ += enabled;
677 if (this->last_qpiws_) {
678 this->last_qpiws_->publish_state(tmp);
683 ESP_LOGD(TAG,
"Decode QT");
684 if (this->last_qt_) {
685 this->last_qt_->publish_state(tmp);
690 ESP_LOGD(TAG,
"Decode QMN");
691 if (this->last_qmn_) {
692 this->last_qmn_->publish_state(tmp);
748 ESP_LOGD(TAG,
"timeout command from queue: %s", command);
776 ESP_LOGD(TAG,
"checking crc on incoming message");
779 ESP_LOGD(TAG,
"CRC OK");
785 ESP_LOGD(TAG,
"CRC NOK expected: %X %X but got: %X %X", ((uint8_t) ((crc16) >> 8)), ((uint8_t) ((crc16) &0xff)),
795 uint8_t byte_command[16];
797 for (uint8_t i = 0; i <
length; i++) {
807 this->
write(((uint8_t) ((crc16) >> 8)));
808 this->
write(((uint8_t) ((crc16) &0xff)));
811 ESP_LOGD(TAG,
"Sending command from queue: %s with length %d", command, length);
836 this->
write(((uint8_t) ((crc16) >> 8)));
837 this->
write(((uint8_t) ((crc16) &0xff)));
840 ESP_LOGD(TAG,
"Sending polling command : %s with length %d",
848 uint8_t testposition = (next_position + i) % COMMAND_QUEUE_LENGTH;
851 ESP_LOGD(TAG,
"Command queued successfully: %s with length %u at position %d", command,
856 ESP_LOGD(TAG,
"Command queue full dropping command: %s", command);
859 void Pipsolar::switch_command(
const std::string &command) {
860 ESP_LOGD(TAG,
"got command: %s", command.c_str());
863 void Pipsolar::dump_config() {
864 ESP_LOGCONFIG(TAG,
"Pipsolar:");
865 ESP_LOGCONFIG(TAG,
"used commands:");
867 if (used_polling_command.length != 0) {
868 ESP_LOGCONFIG(TAG,
"%s", used_polling_command.command);
872 void Pipsolar::update() {}
876 if (used_polling_command.length == strlen(command)) {
877 uint8_t
len = strlen(command);
878 if (memcmp(used_polling_command.command, command, len) == 0) {
882 if (used_polling_command.length == 0) {
883 size_t length = strlen(command) + 1;
884 const char *beg = command;
886 used_polling_command.command =
new uint8_t[
length];
888 for (; beg !=
end; ++beg, ++i) {
889 used_polling_command.command[i] = (uint8_t) (*beg);
891 used_polling_command.errors = 0;
892 used_polling_command.identifier = polling_command;
893 used_polling_command.length = length - 1;
901 uint8_t crc_low = crc & 0xff;
902 uint8_t crc_high = crc >> 8;
903 if (crc_low == 0x28 || crc_low == 0x0d || crc_low == 0x0a)
905 if (crc_high == 0x28 || crc_high == 0x0d || crc_high == 0x0a)
907 crc = (crc_high << 8) | crc_low;
void write_str(const char *str)
uint32_t update_interval_
std::string command_queue_[COMMAND_QUEUE_LENGTH]
static const size_t COMMAND_QUEUE_LENGTH
uint16_t crc16be(const uint8_t *data, uint16_t len, uint16_t crc, uint16_t poly, bool refin, bool refout)
uint8_t check_incoming_crc_()
void write_array(const uint8_t *data, size_t len)
uint8_t check_incoming_length_(uint8_t length)
static const size_t COMMAND_TIMEOUT
uint8_t read_buffer_[PIPSOLAR_READ_BUFFER_LENGTH]
void add_polling_command_(const char *command, ENUMPollingCommand polling_command)
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.
uint32_t IRAM_ATTR HOT millis()
uint16_t pipsolar_crc_(uint8_t *msg, uint8_t len)
virtual void setup()
Where the component's initialization should happen.
uint32_t command_start_millis_
bool read_byte(uint8_t *data)
void queue_command_(const char *command, uint8_t length)
BedjetMode mode
BedJet operating mode.
static const size_t PIPSOLAR_READ_BUFFER_LENGTH
PollingCommand used_polling_commands_[15]
uint8_t last_polling_command_
uint8_t send_next_command_()
uint8_t command_queue_position_
void empty_uart_buffer_()
Implementation of SPI Controller mode.
size_t write(uint8_t data)