* Repeater/Room server: new diagnostics, stats.n_full_events now repurposed to 'err_events' (bit flags)

* new Radio::isInRecvMode() method
This commit is contained in:
Scott Powell 2025-05-13 15:38:10 +10:00
parent 62a5115cc9
commit 177dd90ca1
8 changed files with 46 additions and 9 deletions

View file

@ -5,7 +5,7 @@
static uint8_t broadcastAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
static esp_now_peer_info_t peerInfo;
static bool is_send_complete = false;
static volatile bool is_send_complete = false;
static esp_err_t last_send_result;
static uint8_t rx_buf[256];
static uint8_t last_rx_len = 0;
@ -44,6 +44,8 @@ void ESPNOWRadio::init() {
peerInfo.channel = 0;
peerInfo.encrypt = false;
is_send_complete = true;
// Add peer
if (esp_now_add_peer(&peerInfo) == ESP_OK) {
ESPNOW_DEBUG_PRINTLN("init success");
@ -86,6 +88,11 @@ bool ESPNOWRadio::isSendComplete() {
return is_send_complete;
}
void ESPNOWRadio::onSendFinished() {
is_send_complete = true;
}
bool ESPNOWRadio::isInRecvMode() const {
return is_send_complete; // if NO send in progress, then we're in Rx mode
}
float ESPNOWRadio::getLastRSSI() const { return 0; }

View file

@ -15,6 +15,7 @@ public:
bool startSendRaw(const uint8_t* bytes, int len) override;
bool isSendComplete() override;
void onSendFinished() override;
bool isInRecvMode() const override;
uint32_t getPacketsRecv() const { return n_recv; }
uint32_t getPacketsSent() const { return n_sent; }