diff --git a/src/hm/Communication.h b/src/hm/Communication.h index b02c03b7..15ca3d5d 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -86,7 +86,7 @@ class Communication : public CommQueue<> { mIsRetransmit = false; if(NULL == q->iv->radio) cmdDone(false); // can't communicate while radio is not defined! - mFirstTry = q->iv->isAvailable(); + mFirstTry = INV_RADIO_TYPE_NRF == q->iv->ivRadioType && q->iv->isAvailable(); q->iv->mCmd = q->cmd; q->iv->mIsSingleframeReq = false; mFramesExpected = getFramesExpected(q); // function to get expected frame count. @@ -185,7 +185,7 @@ class Communication : public CommQueue<> { if (p->packet[0] == (TX_REQ_INFO + ALL_FRAMES)) { // response from get information command if(parseFrame(p)) { q->iv->curFrmCnt++; - if(!mIsRetransmit && p->packet[9] == 2 && p->millis < 85) + if(!mIsRetransmit && (p->packet[9] == 0x02 || p->packet[9] == 0x82) && p->millis < 85) mHeu.setIvRetriesGood(q->iv,p->millis < 70); } } else if (p->packet[0] == (TX_REQ_DEVCONTROL + ALL_FRAMES)) { // response from dev control command @@ -444,7 +444,6 @@ class Communication : public CommQueue<> { record_t<> *rec = q->iv->getRecordStruct(RealTimeRunData_Debug); // choose the record structure rec->ts = q->ts; miStsConsolidate(q, ((p->packet[0] == 0x88) ? 1 : 2), rec, p->packet[10], p->packet[12], p->packet[9], p->packet[11]); - //mHeu.setGotFragment(q->iv); only do this when we are through the cycle? } return true; diff --git a/src/hms/hmsRadio.h b/src/hms/hmsRadio.h index 48ff3750..3c569e02 100644 --- a/src/hms/hmsRadio.h +++ b/src/hms/hmsRadio.h @@ -166,9 +166,10 @@ class CmtRadio : public Radio { mBufCtrl.push(p); // this code completly stops communication! - //if(p.packet[9] > ALL_FRAMES) // indicates last frame + if(p.packet[9] > ALL_FRAMES) // indicates last frame // mRadioWaitTime.stopTimeMonitor(); // we got everything we expected and can exit rx mode... - //optionally instead: mRadioWaitTime.startTimeMonitor(DURATION_PAUSE_LASTFR); // let the inverter first get back to rx mode? + //optionally instead: + mRadioWaitTime.startTimeMonitor(DURATION_PAUSE_LASTFR); // let the inverter first get back to rx mode? } CmtType mCmt;