mirror of
https://github.com/lumapu/ahoy.git
synced 2025-08-03 08:28:20 +02:00
MI - add some multiframe handling
This commit is contained in:
parent
53ae7fe7f5
commit
12f37c2cb0
2 changed files with 10 additions and 4 deletions
|
@ -253,7 +253,10 @@ class HmRadio {
|
|||
mBufCtrl.push(p);
|
||||
if (p.packet[0] == (TX_REQ_INFO + ALL_FRAMES)) // response from get information command
|
||||
isLastPackage = (p.packet[9] > 0x81); // > 0x81 indicates last packet received
|
||||
else if (p.packet[0] != 0x00) // ignore fragment number zero
|
||||
else if (p.packet[0] == ( 0x0f + ALL_FRAMES) ) // response from MI get information command
|
||||
isLastPackage = (p.packet[9] > 0x11); // > 0x11 indicates last packet received
|
||||
else if (p.packet[0] != 0x00 && p.packet[0] != 0x88 && p.packet[0] != 0x92)
|
||||
// ignore fragment number zero and MI status messages
|
||||
isLastPackage = true; // response from dev control command
|
||||
yield();
|
||||
}
|
||||
|
|
|
@ -221,14 +221,16 @@ const byteAssign_t InfoAssignment[] = {
|
|||
for (uint8_t i = 0; i < 5; i++) {
|
||||
iv->setValue(i, rec, (float) ((p->packet[(12+2*i)] << 8) + p->packet[(13+2*i)])/1);
|
||||
}
|
||||
iv->setQueuedCmdFinished();
|
||||
/*iv->setQueuedCmdFinished();
|
||||
mStat->rxSuccess++;
|
||||
mSys->Radio.sendCmdPacket(iv->radioId.u64, 0x0f, 0x01, false);
|
||||
mSys->Radio.sendCmdPacket(iv->radioId.u64, 0x0f, 0x01, false);*/
|
||||
} else if ( p->packet[9] == 0x01 ) {//second frame
|
||||
DPRINTLN(DBG_INFO, F("(#") + String(iv->id) + F(") got 2nd frame (hw info)"));
|
||||
mSys->Radio.sendCmdPacket(iv->radioId.u64, 0x0f, 0x12, false);
|
||||
//mSys->Radio.sendCmdPacket(iv->radioId.u64, 0x0f, 0x12, false);
|
||||
} else if ( p->packet[9] == 0x12 ) {//3rd frame
|
||||
DPRINTLN(DBG_INFO, F("(#") + String(iv->id) + F(") got 3rd frame (hw info)"));
|
||||
iv->setQueuedCmdFinished();
|
||||
mStat->rxSuccess++;
|
||||
}
|
||||
|
||||
} else if (p->packet[0] == (TX_REQ_INFO + ALL_FRAMES)) { // response from get information command
|
||||
|
@ -723,6 +725,7 @@ const byteAssign_t InfoAssignment[] = {
|
|||
}
|
||||
|
||||
|
||||
|
||||
IApp *mApp;
|
||||
HMSYSTEM *mSys;
|
||||
statistics_t *mStat;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue