Skip to content

Commit f8fcc17

Browse files
authored
Merge pull request #2190 from brianwiddas/espnow-missing-methods
Add missing methods in ESPNOWRadio()
2 parents bdeb7d8 + 811ac1c commit f8fcc17

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/helpers/esp32/ESPNOWRadio.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
class ESPNOWRadio : public mesh::Radio {
66
protected:
7-
uint32_t n_recv, n_sent;
7+
uint32_t n_recv, n_sent, n_recv_errors;
88

99
public:
10-
ESPNOWRadio() { n_recv = n_sent = 0; }
10+
ESPNOWRadio() { n_recv = n_sent = n_recv_errors = 0; }
1111

1212
void init();
1313
int recvRaw(uint8_t* bytes, int sz) override;
@@ -19,12 +19,21 @@ class ESPNOWRadio : public mesh::Radio {
1919

2020
uint32_t getPacketsRecv() const { return n_recv; }
2121
uint32_t getPacketsSent() const { return n_sent; }
22-
void resetStats() { n_recv = n_sent = 0; }
22+
uint32_t getPacketsRecvErrors() const { return n_recv_errors; }
23+
void resetStats() { n_recv = n_sent = n_recv_errors = 0; }
2324

2425
virtual float getLastRSSI() const override;
2526
virtual float getLastSNR() const override;
2627

2728
float packetScore(float snr, int packet_len) override { return 0; }
29+
30+
/**
31+
* These two functions do nothing for ESP-NOW, but are needed for the
32+
* Radio interface.
33+
*/
34+
virtual void setRxBoostedGainMode(bool) { }
35+
virtual bool getRxBoostedGainMode() const { return false; }
36+
2837
uint32_t intID();
2938
void setTxPower(uint8_t dbm);
3039
};

0 commit comments

Comments
 (0)