From bccb306fff6b469221e7a9b2f6aaa38d638096ff Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Sat, 24 Aug 2024 20:31:51 +0200 Subject: [PATCH] some fixes --- esphome/components/espnow/espnow.cpp | 2 +- esphome/components/espnow/espnow.h | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/esphome/components/espnow/espnow.cpp b/esphome/components/espnow/espnow.cpp index ddcc4f4d20..d3c93ce5c0 100644 --- a/esphome/components/espnow/espnow.cpp +++ b/esphome/components/espnow/espnow.cpp @@ -31,7 +31,7 @@ static void application_task(void *param) { } #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 1) -using struct { +struct { uint16_t frame_head; uint16_t duration; uint8_t destination_address[6]; diff --git a/esphome/components/espnow/espnow.h b/esphome/components/espnow/espnow.h index c086613e62..ede16f6308 100644 --- a/esphome/components/espnow/espnow.h +++ b/esphome/components/espnow/espnow.h @@ -26,7 +26,7 @@ class ESPNowProtocol : public Parented { public: ESPNowProtocol(){}; - void setup() override; + void setup(); virtual void on_receive(ESPNowPacket packet) { return; }; virtual void on_sent(ESPNowPacket packet, bool status) { return; }; @@ -45,18 +45,9 @@ class ESPNowProtocol : public Parented { class ESPNowDefaultProtocol : public ESPNowProtocol { public: - void on_receive(ESPNowPacket packet) { - this->on_receive_.call(packet); - return true; - }; - void on_sent(ESPNowPacket packet, bool status) { - this->on_sent_.call(packet, status); - return true; - }; - void on_new_peer(ESPNowPacket packet) { - this->on_new_peer_.call(packet); - return true; - }; + void on_receive(ESPNowPacket packet) { this->on_receive_.call(packet); }; + void on_sent(ESPNowPacket packet, bool status) { this->on_sent_.call(packet, status); }; + void on_new_peer(ESPNowPacket packet) { this->on_new_peer_.call(packet); }; uint32_t get_app_id() override { return ESPNOW_DEFAULT_APP_ID; };