Update ebyte_lora.cpp

This commit is contained in:
Daniël Koek 2024-04-08 19:46:09 +01:00
parent 5be241d1c0
commit 1f2c779bd5

View file

@ -350,9 +350,8 @@ void EbyteLoraComponent::loop() {
} }
if (data[0] == PROGRAM_CONF) { if (data[0] == PROGRAM_CONF) {
ESP_LOGD(TAG, "GOT PROGRAM_CONF"); ESP_LOGD(TAG, "GOT PROGRAM_CONF");
auto *sbuff = reinterpret_cast<const RegisterConfig *>(&data);
memset(&this->config, 0, sizeof(RegisterConfig)); memset(&this->config, 0, sizeof(RegisterConfig));
memcpy(&this->config, sbuff, sbuff->length); memcpy(&this->config, &data[0], sizeof(RegisterConfig));
set_mode_(NORMAL); set_mode_(NORMAL);
} }
} }