Skip to content

Commit

Permalink
0.7.62
Browse files Browse the repository at this point in the history
* add timeout before payload is tried to process (necessary for HMS/HMT)
  • Loading branch information
lumapu committed Oct 1, 2023
1 parent dae638f commit 41ade24
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
Expand Down Expand Up @@ -515,9 +515,6 @@ void app::resetSystem(void) {
mSaveReboot = false;

mNetworkConnected = false;

memset(&mNrfStat, 0, sizeof(statistics_t));
memset(&mCmtStat, 0, sizeof(statistics_t));
}

//-----------------------------------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions src/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,6 @@ class app : public IApp, public ah::Scheduler {

bool mNetworkConnected;

statistics_t mNrfStat;
statistics_t mCmtStat;

// mqtt
PubMqttType mMqtt;
bool mMqttReconnect;
Expand Down
1 change: 1 addition & 0 deletions src/hm/hmInverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class Inverter {
alarmCnt = 0;
alarmLastId = 0;
rssi = -127;
memset(&radioStatistics, 0, sizeof(statistics_t));
}

~Inverter() {
Expand Down
5 changes: 5 additions & 0 deletions src/hm/hmPayload.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ typedef struct {
bool requested;
bool gotFragment;
bool rxTmo;
uint32_t sendMillis;
} invPayload_t;


Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 41ade24

Please sign in to comment.