fix statistics

- based on 0.8.65!
This commit is contained in:
rejoe2 2024-01-26 11:31:21 +01:00 committed by GitHub
parent 1118407019
commit 626ca86d0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 29 additions and 64 deletions

View file

@ -15,7 +15,6 @@
#endif
#define SPI_SPEED 1000000
#define RF_CHANNELS 5
const char* const rf24AmpPowerNames[] = {"MIN", "LOW", "HIGH", "MAX"};
@ -194,8 +193,7 @@ class HmRadio : public Radio {
return false;
}
bool isChipConnected(void) {
//DPRINTLN(DBG_VERBOSE, F("hmRadio.h:isChipConnected"));
bool isChipConnected(void) const {
return mNrf24->isChipConnected();
}
@ -285,24 +283,16 @@ class HmRadio : public Radio {
sendPacket(iv, cnt, isRetransmit, (IV_MI != iv->ivGen));
}
uint8_t getDataRate(void) {
uint8_t getDataRate(void) const {
if(!mNrf24->isChipConnected())
return 3; // unknown
return mNrf24->getDataRate();
}
bool isPVariant(void) {
bool isPVariant(void) const {
return mNrf24->isPVariant();
}
/*uint8_t getARC(void) {
return mNrf24->getARC();
}
uint8_t getPLOS(void) {
return mNrf24->getPLOS();
}*/
private:
inline bool getReceived(void) {
bool isLastPackage = false;
@ -318,8 +308,6 @@ class HmRadio : public Radio {
p.len = (len > MAX_RF_PAYLOAD_SIZE) ? MAX_RF_PAYLOAD_SIZE : len;
p.rssi = mNrf24->testRPD() ? -64 : -75;
p.millis = millis() - mMillis;
//p.arc = mNrf24->getARC();
//p.plos = mNrf24->getPLOS();
mNrf24->read(p.packet, p.len);
if (p.packet[0] != 0x00) {
@ -411,11 +399,11 @@ class HmRadio : public Radio {
mNRFisInRX = false;
}
uint64_t getIvId(Inverter<> *iv) {
uint64_t getIvId(Inverter<> *iv) const {
return iv->radioId.u64;
}
uint8_t getIvGen(Inverter<> *iv) {
uint8_t getIvGen(Inverter<> *iv) const {
return iv->ivGen;
}