mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-03 12:15:54 +02:00
fixed radio statistics
This commit is contained in:
parent
179c51302b
commit
ac246bb763
1 changed files with 13 additions and 6 deletions
|
@ -56,6 +56,7 @@ class Communication : public CommQueue<> {
|
||||||
|
|
||||||
mHeu.printStatus(q->iv);
|
mHeu.printStatus(q->iv);
|
||||||
mHeu.getTxCh(q->iv);
|
mHeu.getTxCh(q->iv);
|
||||||
|
mGotFragment = false;
|
||||||
mState = States::START;
|
mState = States::START;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -87,16 +88,20 @@ class Communication : public CommQueue<> {
|
||||||
DBGPRINT(String(millis() - mWaitTimeout + timeout));
|
DBGPRINT(String(millis() - mWaitTimeout + timeout));
|
||||||
DBGPRINTLN(F("ms"));
|
DBGPRINTLN(F("ms"));
|
||||||
|
|
||||||
q->iv->radioStatistics.rxFailNoAnser++; // got nothing
|
if(!mGotFragment) {
|
||||||
mHeu.setGotNothing(q->iv);
|
q->iv->radioStatistics.rxFailNoAnser++; // got nothing
|
||||||
if((IV_HMS == q->iv->ivGen) || (IV_HMT == q->iv->ivGen)) {
|
mHeu.setGotNothing(q->iv);
|
||||||
q->iv->radio->switchFrequency(q->iv, HOY_BOOT_FREQ_KHZ, WORK_FREQ_KHZ);
|
if((IV_HMS == q->iv->ivGen) || (IV_HMT == q->iv->ivGen)) {
|
||||||
mWaitTimeout = millis() + 1000;
|
q->iv->radio->switchFrequency(q->iv, HOY_BOOT_FREQ_KHZ, WORK_FREQ_KHZ);
|
||||||
}
|
mWaitTimeout = millis() + 1000;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
q->iv->radioStatistics.rxFail++;
|
||||||
mState = States::RESET;
|
mState = States::RESET;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mGotFragment = true;
|
||||||
States nextState = States::RESET;
|
States nextState = States::RESET;
|
||||||
while(!q->iv->radio->mBufCtrl.empty()) {
|
while(!q->iv->radio->mBufCtrl.empty()) {
|
||||||
packet_t *p = &q->iv->radio->mBufCtrl.front();
|
packet_t *p = &q->iv->radio->mBufCtrl.front();
|
||||||
|
@ -132,6 +137,7 @@ class Communication : public CommQueue<> {
|
||||||
parseMiFrame(p, q);
|
parseMiFrame(p, q);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
q->iv->radioStatistics.rxFail++; // got no complete payload
|
||||||
DPRINTLN(DBG_WARN, F("Inverter serial does not match"));
|
DPRINTLN(DBG_WARN, F("Inverter serial does not match"));
|
||||||
mWaitTimeout = millis() + timeout;
|
mWaitTimeout = millis() + timeout;
|
||||||
}
|
}
|
||||||
|
@ -712,6 +718,7 @@ class Communication : public CommQueue<> {
|
||||||
uint32_t *mTimestamp;
|
uint32_t *mTimestamp;
|
||||||
uint32_t mWaitTimeout = 0;
|
uint32_t mWaitTimeout = 0;
|
||||||
std::array<frame_t, MAX_PAYLOAD_ENTRIES> mLocalBuf;
|
std::array<frame_t, MAX_PAYLOAD_ENTRIES> mLocalBuf;
|
||||||
|
bool mGotFragment = false;
|
||||||
uint8_t mMaxFrameId;
|
uint8_t mMaxFrameId;
|
||||||
uint8_t mPayload[MAX_BUFFER];
|
uint8_t mPayload[MAX_BUFFER];
|
||||||
payloadListenerType mCbPayload = NULL;
|
payloadListenerType mCbPayload = NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue