Browse Source

0.7.62

* add timeout before payload is tried to process (necessary for HMS/HMT)
pull/1219/head
lumapu 1 year ago
parent
commit
41ade24538
  1. 1
      src/CHANGES.md
  2. 7
      src/app.cpp
  3. 3
      src/app.h
  4. 1
      src/hm/hmInverter.h
  5. 5
      src/hm/hmPayload.h

1
src/CHANGES.md

@ -2,6 +2,7 @@
## 0.7.62 - 2023-10-01
* fix communication to inverters #1198
* add timeout before payload is tried to process (necessary for HMS/HMT)
## 0.7.61 - 2023-10-01
* merged `hmPayload` and `hmsPayload` into single class

7
src/app.cpp

@ -133,10 +133,10 @@ void app::loop(void) {
DBGPRINT(F("dBm | "));
ah::dumpBuf(p->packet, p->len);
}
mNrfStat.frmCnt++;
Inverter<> *iv = mSys.findInverter(&p->packet[1]);
if (NULL != iv) {
iv->radioStatistics.frmCnt++;
if (IV_MI == iv->ivGen)
mMiPayload.add(iv, p);
else
@ -160,10 +160,10 @@ void app::loop(void) {
DBGPRINT(F("dBm | "));
ah::dumpBuf(p->packet, p->len);
}
mCmtStat.frmCnt++;
Inverter<> *iv = mSys.findInverter(&p->packet[1]);
if(NULL != iv) {
iv->radioStatistics.frmCnt++;
if((iv->ivGen == IV_HMS) || (iv->ivGen == IV_HMT))
mPayload.add(iv, p);
}
@ -515,9 +515,6 @@ void app::resetSystem(void) {
mSaveReboot = false;
mNetworkConnected = false;
memset(&mNrfStat, 0, sizeof(statistics_t));
memset(&mCmtStat, 0, sizeof(statistics_t));
}
//-----------------------------------------------------------------------------

3
src/app.h

@ -334,9 +334,6 @@ class app : public IApp, public ah::Scheduler {
bool mNetworkConnected;
statistics_t mNrfStat;
statistics_t mCmtStat;
// mqtt
PubMqttType mMqtt;
bool mMqttReconnect;

1
src/hm/hmInverter.h

@ -173,6 +173,7 @@ class Inverter {
alarmCnt = 0;
alarmLastId = 0;
rssi = -127;
memset(&radioStatistics, 0, sizeof(statistics_t));
}
~Inverter() {

5
src/hm/hmPayload.h

@ -31,6 +31,7 @@ typedef struct {
bool requested;
bool gotFragment;
bool rxTmo;
uint32_t sendMillis;
} invPayload_t;
@ -247,6 +248,9 @@ class HmPayload {
continue; // skip to next inverter
}
if((mPayload[iv->id].sendMillis + 500) > millis())
return; // to fast, wait until packets are received!
if (!mPayload[iv->id].complete) {
bool crcPass, pyldComplete, fastNext;
@ -469,6 +473,7 @@ class HmPayload {
mPayload[id].requested = false;
mPayload[id].ts = *mTimestamp;
mPayload[id].rxTmo = setTxTmo; // design: don't start with complete retransmit
mPayload[id].sendMillis = millis();
}
IApp *mApp;

Loading…
Cancel
Save