some more bits

This commit is contained in:
Daniël Koek 2024-10-11 10:06:07 +01:00
parent 67c056dd0a
commit d4518e8e9d
3 changed files with 6 additions and 6 deletions

View file

@ -53,7 +53,7 @@ enum WorPeriod : uint8_t {
// reverse order on the data sheet
struct RegisterConfig {
uint8_t config_set;
bool config_set;
uint8_t addh;
uint8_t addl;
uint8_t air_data_rate;

View file

@ -394,7 +394,7 @@ bool EbyteLoraComponent::can_send_message_(const char *info) {
}
void EbyteLoraComponent::update() {
ESP_LOGD(TAG, "Update loop");
if (this->current_config_.config_set == 0) {
if (!this->current_config_.config_set) {
ESP_LOGD(TAG, "Config not set yet!, gonna request it now!");
this->get_current_config_();
return;
@ -409,7 +409,7 @@ void EbyteLoraComponent::update() {
}
}
// only make it normal when config is set
if (this->current_config_.config_set != 0 && this->config_mode_ != NORMAL) {
if (this->current_config_.config_set && this->config_mode_ != NORMAL) {
this->config_mode_ = this->get_mode_();
if (this->config_mode_ != NORMAL) {

View file

@ -117,14 +117,14 @@ class EbyteLoraComponent : public PollingComponent, public uart::UARTDevice {
void process_(std::vector<uint8_t> data);
void repeat_message_(std::vector<uint8_t> data);
// set if there is some sensor info available or it is in repeater mode
bool should_send_{};
bool should_send_ = false;
// if set it will function as a repeater only
bool repeater_enabled_ = false;
// used to tell one lora device apart from another
int network_id_ = 0;
int rssi_ = 0;
RegisterConfig current_config_;
RegisterConfig expected_config_;
RegisterConfig current_config_{};
RegisterConfig expected_config_{};
#ifdef USE_SENSOR
std::vector<Sensor> sensors_{};
std::map<int, std::map<std::string, sensor::Sensor *>> remote_sensors_{};