mirror of
https://github.com/lumapu/ahoy.git
synced 2025-08-06 01:48:19 +02:00
fix 0 attempts in Communication
- 45ms-Problem seems to be solved
This commit is contained in:
parent
444a716012
commit
d7ea4bcb89
2 changed files with 6 additions and 3 deletions
|
@ -129,7 +129,7 @@ class Communication : public CommQueue<> {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case States::CHECK_FRAMES: {
|
case States::CHECK_FRAMES: {
|
||||||
if((q->iv->radio->mBufCtrl.empty() && !mIsRetransmit) || (0 == q->attempts)) { // radio buffer empty or no more answers
|
if((q->iv->radio->mBufCtrl.empty() && !mIsRetransmit) ) { // || (0 == q->attempts)) { // radio buffer empty or no more answers
|
||||||
if(*mSerialDebug) {
|
if(*mSerialDebug) {
|
||||||
DPRINT_IVID(DBG_INFO, q->iv->id);
|
DPRINT_IVID(DBG_INFO, q->iv->id);
|
||||||
DBGPRINT(F("request timeout: "));
|
DBGPRINT(F("request timeout: "));
|
||||||
|
@ -259,7 +259,7 @@ class Communication : public CommQueue<> {
|
||||||
if(framnr) {
|
if(framnr) {
|
||||||
if(0 == q->attempts) {
|
if(0 == q->attempts) {
|
||||||
DPRINT_IVID(DBG_INFO, q->iv->id);
|
DPRINT_IVID(DBG_INFO, q->iv->id);
|
||||||
DBGPRINT(F("no attempts left"));
|
DBGPRINTLN(F("no attempts left"));
|
||||||
closeRequest(q, false);
|
closeRequest(q, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -336,6 +336,8 @@ class HmRadio : public Radio {
|
||||||
isLastPackage = (p.packet[9] > ALL_FRAMES); // > ALL_FRAMES indicates last packet received
|
isLastPackage = (p.packet[9] > ALL_FRAMES); // > ALL_FRAMES indicates last packet received
|
||||||
if(mLastIv->mIsSingleframeReq) // we only expect one frame here...
|
if(mLastIv->mIsSingleframeReq) // we only expect one frame here...
|
||||||
isRetransmitAnswer = true;
|
isRetransmitAnswer = true;
|
||||||
|
if(isLastPackage)
|
||||||
|
mFramesExpected = p.packet[9] - ALL_FRAMES;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IV_MI == mLastIv->ivGen) {
|
if(IV_MI == mLastIv->ivGen) {
|
||||||
|
@ -350,8 +352,9 @@ class HmRadio : public Radio {
|
||||||
}
|
}
|
||||||
yield();
|
yield();
|
||||||
}
|
}
|
||||||
if(isLastPackage)
|
if(isLastPackage) {
|
||||||
mLastIv->mGotLastMsg = true;
|
mLastIv->mGotLastMsg = true;
|
||||||
|
}
|
||||||
return isLastPackage || isRetransmitAnswer;
|
return isLastPackage || isRetransmitAnswer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue