Update ebyte_lora.cpp

This commit is contained in:
Daniël Koek 2024-04-02 16:27:32 +01:00
parent 2f6bf26266
commit fcdcb7d71f

View file

@ -28,6 +28,7 @@ void EbyteLoraComponent::get_current_config_() {
set_mode_(CONFIGURATION);
uint8_t data[3] = {PROGRAM_CONF, 0x00, 0x08};
this->write_array(data, sizeof(data));
ESP_LOGD(TAG, "Config info requested");
}
ModeType EbyteLoraComponent::get_mode_() {
ModeType internalMode = MODE_INIT;
@ -201,21 +202,21 @@ void EbyteLoraComponent::loop() {
}
if (data[0] == PROGRAM_CONF) {
ESP_LOGD(TAG, "GOT PROGRAM_CONF");
memcpy(&this->config, &data, data.size());
ESP_LOGD(TAG, this->config.addh_description_().c_str());
ESP_LOGD(TAG, this->config.addl_description_().c_str());
ESP_LOGD(TAG, this->config.reg_0.air_data_rate_description_().c_str());
ESP_LOGD(TAG, this->config.reg_0.uart_baud_description_().c_str());
ESP_LOGD(TAG, this->config.reg_0.parity_description_().c_str());
ESP_LOGD(TAG, this->config.reg_1.rssi_noise_description_().c_str());
ESP_LOGD(TAG, this->config.reg_1.sub_packet_description_().c_str());
ESP_LOGD(TAG, this->config.reg_1.transmission_power_description_().c_str());
ESP_LOGD(TAG, this->config.channel_description_().c_str());
ESP_LOGD(TAG, this->config.reg_3.enable_lbt_description_().c_str());
ESP_LOGD(TAG, this->config.reg_3.wor_period_description_().c_str());
ESP_LOGD(TAG, this->config.reg_3.enable_rssi_description_().c_str());
ESP_LOGD(TAG, this->config.reg_3.transmission_type_description_().c_str());
set_mode_(NORMAL);
// memcpy(&this->config, &data, data.size());
// ESP_LOGD(TAG, this->config.addh_description_().c_str());
// ESP_LOGD(TAG, this->config.addl_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_0.air_data_rate_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_0.uart_baud_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_0.parity_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_1.rssi_noise_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_1.sub_packet_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_1.transmission_power_description_().c_str());
// ESP_LOGD(TAG, this->config.channel_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_3.enable_lbt_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_3.wor_period_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_3.enable_rssi_description_().c_str());
// ESP_LOGD(TAG, this->config.reg_3.transmission_type_description_().c_str());
// set_mode_(NORMAL);
}
}
void EbyteLoraComponent::send_switch_info_() {