Browse Source

MI - change logic for progressing 4ch dev info cmd

Not tested yet, but compiled on 0.5.107.

So no urgent check in is required, but most likely this will perform more consistent than the previous version.
pull/820/head
rejoe2 2 years ago
committed by GitHub
parent
commit
7baa95c759
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/hm/miPayload.h

10
src/hm/miPayload.h

@ -448,8 +448,8 @@ const byteAssign_t InfoAssignment[] = {
} else { } else {
bool change = false; bool change = false;
if ( cmd >= 0x36 && cmd < 0x39 ) { // MI-1500 Data command if ( cmd >= 0x36 && cmd < 0x39 ) { // MI-1500 Data command
cmd++; // just request the next channel //cmd++; // just request the next channel
change = true; //change = true;
} else if ( cmd == 0x09 ) {//MI single or dual channel device } else if ( cmd == 0x09 ) {//MI single or dual channel device
if ( mPayload[iv->id].dataAB[CH1] && iv->type == INV_TYPE_2CH ) { if ( mPayload[iv->id].dataAB[CH1] && iv->type == INV_TYPE_2CH ) {
if (!mPayload[iv->id].stsAB[CH1] && mPayload[iv->id].retransmits<2) {} if (!mPayload[iv->id].stsAB[CH1] && mPayload[iv->id].retransmits<2) {}
@ -472,6 +472,7 @@ const byteAssign_t InfoAssignment[] = {
if (change) { if (change) {
DBGPRINT(F("next request is")); DBGPRINT(F("next request is"));
//mPayload[iv->id].skipfirstrepeat = 0; //mPayload[iv->id].skipfirstrepeat = 0;
mPayload[iv->id].txCmd = cmd;
} else { } else {
DBGPRINT(F("sth.")); DBGPRINT(F("sth."));
DBGPRINT(F(" missing: Request Retransmit")); DBGPRINT(F(" missing: Request Retransmit"));
@ -480,7 +481,6 @@ const byteAssign_t InfoAssignment[] = {
DBGHEXLN(cmd); DBGHEXLN(cmd);
//mSys->Radio.sendCmdPacket(iv->radioId.u64, cmd, cmd, true); //mSys->Radio.sendCmdPacket(iv->radioId.u64, cmd, cmd, true);
mSys->Radio.prepareDevInformCmd(iv->radioId.u64, cmd, mPayload[iv->id].ts, iv->alarmMesIndex, true, cmd); mSys->Radio.prepareDevInformCmd(iv->radioId.u64, cmd, mPayload[iv->id].ts, iv->alarmMesIndex, true, cmd);
mPayload[iv->id].txCmd = cmd;
yield(); yield();
} }
} }
@ -682,11 +682,13 @@ const byteAssign_t InfoAssignment[] = {
}*/ }*/
miStsConsolidate(iv, datachan, rec, p->packet[23], p->packet[24]); miStsConsolidate(iv, datachan, rec, p->packet[23], p->packet[24]);
if (p->packet[0] < (0x39 + ALL_FRAMES) ) { if (p->packet[0] < (0x39 + ALL_FRAMES) ) {
/*uint8_t cmd = p->packet[0] - ALL_FRAMES + 1; /*uint8_t cmd = p->packet[0] - ALL_FRAMES + 1;
mSys->Radio.prepareDevInformCmd(iv->radioId.u64, cmd, mPayload[iv->id].ts, iv->alarmMesIndex, false, cmd); mSys->Radio.prepareDevInformCmd(iv->radioId.u64, cmd, mPayload[iv->id].ts, iv->alarmMesIndex, false, cmd);
mPayload[iv->id].txCmd = cmd;*/ mPayload[iv->id].txCmd = cmd;*/
mPayload[iv->id].txCmd++;
if (mPayload[iv->id].retransmits)
mPayload[iv->id].retransmits--; // reserve retransmissions for each response
mPayload[iv->id].complete = false; mPayload[iv->id].complete = false;
} }

Loading…
Cancel
Save