This commit is contained in:
Daniël Koek 2024-03-26 16:37:46 +00:00
parent d691a4eb84
commit b0bf6355c1
2 changed files with 4 additions and 2 deletions

View file

@ -5,6 +5,7 @@ namespace lora {
void Lora::update() { void Lora::update() {
can_send_message_(); can_send_message_();
get_mode_(); get_mode_();
check_for_message_();
if (!this->update_needed_) if (!this->update_needed_)
return; return;
if (this->rssi_sensor_ != nullptr) if (this->rssi_sensor_ != nullptr)
@ -145,7 +146,7 @@ void Lora::send_pin_info_(uint8_t pin, bool value) {
this->setup_wait_response_(5000); this->setup_wait_response_(5000);
ESP_LOGD(TAG, "Successfully put in queue"); ESP_LOGD(TAG, "Successfully put in queue");
} }
void Lora::loop() { void Lora::check_for_message_() {
std::string buffer; std::string buffer;
std::vector<uint8_t> data; std::vector<uint8_t> data;
bool pin_data_found = false; bool pin_data_found = false;

View file

@ -31,7 +31,7 @@ class Lora : public PollingComponent, public uart::UARTDevice {
void setup() override; void setup() override;
float get_setup_priority() const override { return setup_priority::HARDWARE; } float get_setup_priority() const override { return setup_priority::HARDWARE; }
void update() override; void update() override;
void loop() override;
void dump_config() override; void dump_config() override;
/// Helper function to write the value of a pin. /// Helper function to write the value of a pin.
void digital_write(uint8_t pin, bool value); void digital_write(uint8_t pin, bool value);
@ -45,6 +45,7 @@ class Lora : public PollingComponent, public uart::UARTDevice {
ModeType mode_ = MODE_INIT; ModeType mode_ = MODE_INIT;
// set WOR mode // set WOR mode
void set_mode_(ModeType mode); void set_mode_(ModeType mode);
void check_for_message_();
ModeType get_mode_(); ModeType get_mode_();
// checks the aux port to see if it is done setting // checks the aux port to see if it is done setting
void setup_wait_response_(uint32_t timeout = 1000); void setup_wait_response_(uint32_t timeout = 1000);