Browse Source

0.5.97

merge MI improvements, get firmware information #753
pull/861/head
lumapu 2 years ago
parent
commit
28bd99ed1e
  1. 1
      src/CHANGES.md
  2. 92
      src/hm/miPayload.h

1
src/CHANGES.md

@ -11,6 +11,7 @@
* limit decimal places to 2 in `live` * limit decimal places to 2 in `live`
* added `-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48` to esp8266 debug build #657 * added `-DPIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48` to esp8266 debug build #657
* a `max-module-power` of `0` disables channel in live view `setup` * a `max-module-power` of `0` disables channel in live view `setup`
* merge MI improvements, get firmware information #753
## 0.5.96 ## 0.5.96
* added Nokia display again for ESP8266 #764 * added Nokia display again for ESP8266 #764

92
src/hm/miPayload.h

@ -413,49 +413,49 @@ const byteAssign_t InfoAssignment[] = {
DPRINTLN(DBG_INFO, F("process: compl. set of msgs detected")); DPRINTLN(DBG_INFO, F("process: compl. set of msgs detected"));
iv->setValue(iv->getPosByChFld(0, FLD_YD, rec), rec, calcYieldDayCh0(iv,0)); iv->setValue(iv->getPosByChFld(0, FLD_YD, rec), rec, calcYieldDayCh0(iv,0));
iv->doCalculations(); iv->doCalculations();
/*uint8_t payload[128]; //uint8_t payload[128];
uint8_t payloadLen = 0; //uint8_t payloadLen = 0;
memset(payload, 0, 128); //memset(payload, 0, 128);
for (uint8_t i = 0; i < (mPayload[iv->id].maxPackId); i++) { //for (uint8_t i = 0; i < (mPayload[iv->id].maxPackId); i++) {
memcpy(&payload[payloadLen], mPayload[iv->id].data[i], (mPayload[iv->id].len[i])); // memcpy(&payload[payloadLen], mPayload[iv->id].data[i], (mPayload[iv->id].len[i]));
payloadLen += (mPayload[iv->id].len[i]); // payloadLen += (mPayload[iv->id].len[i]);
yield(); // yield();
} //}
payloadLen -= 2; //payloadLen -= 2;
if (mSerialDebug) { //if (mSerialDebug) {
DPRINT(DBG_INFO, F("Payload (") + String(payloadLen) + "): "); // DPRINT(DBG_INFO, F("Payload (") + String(payloadLen) + "): ");
mSys->Radio.dumpBuf(payload, payloadLen); // mSys->Radio.dumpBuf(payload, payloadLen);
} //}
if (NULL == rec) { //if (NULL == rec) {
DPRINTLN(DBG_ERROR, F("record is NULL!")); // DPRINTLN(DBG_ERROR, F("record is NULL!"));
} else if ((rec->pyldLen == payloadLen) || (0 == rec->pyldLen)) { //} else if ((rec->pyldLen == payloadLen) || (0 == rec->pyldLen)) {
if (mPayload[iv->id].txId == (TX_REQ_INFO + ALL_FRAMES)) // if (mPayload[iv->id].txId == (TX_REQ_INFO + ALL_FRAMES))
mStat->rxSuccess++; // mStat->rxSuccess++;
rec->ts = mPayload[iv->id].ts; // rec->ts = mPayload[iv->id].ts;
for (uint8_t i = 0; i < rec->length; i++) { // for (uint8_t i = 0; i < rec->length; i++) {
iv->addValue(i, payload, rec); // iv->addValue(i, payload, rec);
yield(); // yield();
} // }
iv->doCalculations(); // iv->doCalculations();
notify(mPayload[iv->id].txCmd); // notify(mPayload[iv->id].txCmd);
if(AlarmData == mPayload[iv->id].txCmd) { // if(AlarmData == mPayload[iv->id].txCmd) {
uint8_t i = 0; // uint8_t i = 0;
uint16_t code; // uint16_t code;
uint32_t start, end; // uint32_t start, end;
while(1) { // while(1) {
code = iv->parseAlarmLog(i++, payload, payloadLen, &start, &end); // code = iv->parseAlarmLog(i++, payload, payloadLen, &start, &end);
if(0 == code) // if(0 == code)
break; // break;
if (NULL != mCbAlarm) // if (NULL != mCbAlarm)
(mCbAlarm)(code, start, end); // (mCbAlarm)(code, start, end);
yield(); // yield();
} // }
} // }
} else { //} else {
DPRINTLN(DBG_ERROR, F("plausibility check failed, expected ") + String(rec->pyldLen) + F(" bytes")); // DPRINTLN(DBG_ERROR, F("plausibility check failed, expected ") + String(rec->pyldLen) + F(" bytes"));
mStat->rxFail++; // mStat->rxFail++;
} //}
iv->setQueuedCmdFinished(); */ //iv->setQueuedCmdFinished();
//}*/ //}*/
} }
yield(); yield();
@ -588,9 +588,9 @@ const byteAssign_t InfoAssignment[] = {
if ( mPayload[iv->id].complete || //4ch device if ( mPayload[iv->id].complete || //4ch device
iv->type != INV_TYPE_4CH //other devices (iv->type != INV_TYPE_4CH //other devices
&& mPayload[iv->id].dataAB[CH0] && mPayload[iv->id].dataAB[CH0]
&& mPayload[iv->id].stsAB[CH0] ) { && mPayload[iv->id].stsAB[CH0])) {
miComplete(iv); miComplete(iv);
/*mPayload[iv->id].complete = true; // For 2 CH devices, this might be too short... /*mPayload[iv->id].complete = true; // For 2 CH devices, this might be too short...
DPRINTLN(DBG_INFO, F("(#") + String(iv->id) + F(") got all msgs")); DPRINTLN(DBG_INFO, F("(#") + String(iv->id) + F(") got all msgs"));
@ -657,7 +657,7 @@ const byteAssign_t InfoAssignment[] = {
//uint8_t cmd = getQueuedCmd(); //uint8_t cmd = getQueuedCmd();
if(!*complete) { if(!*complete) {
DPRINTLN(DBG_VERBOSE, F("incomlete, txCmd is 0x") + String(txCmd, HEX)); // + F("cmd is 0x") + String(cmd, HEX)); DPRINTLN(DBG_VERBOSE, F("incomlete, txCmd is 0x") + String(txCmd, HEX)); // + F("cmd is 0x") + String(cmd, HEX));
if (txCmd == 0x09 || txCmd == 0x11 || txCmd >= 0x36 && txCmd <= 0x39 ) if (txCmd == 0x09 || txCmd == 0x11 || (txCmd >= 0x36 && txCmd <= 0x39))
return false; return false;
} }

Loading…
Cancel
Save