mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-05 04:01:41 +02:00
0.7.62
* add timeout before payload is tried to process (necessary for HMS/HMT)
This commit is contained in:
parent
dae638f7c6
commit
41ade24538
5 changed files with 9 additions and 8 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
## 0.7.62 - 2023-10-01
|
## 0.7.62 - 2023-10-01
|
||||||
* fix communication to inverters #1198
|
* fix communication to inverters #1198
|
||||||
|
* add timeout before payload is tried to process (necessary for HMS/HMT)
|
||||||
|
|
||||||
## 0.7.61 - 2023-10-01
|
## 0.7.61 - 2023-10-01
|
||||||
* merged `hmPayload` and `hmsPayload` into single class
|
* merged `hmPayload` and `hmsPayload` into single class
|
||||||
|
|
|
@ -133,10 +133,10 @@ void app::loop(void) {
|
||||||
DBGPRINT(F("dBm | "));
|
DBGPRINT(F("dBm | "));
|
||||||
ah::dumpBuf(p->packet, p->len);
|
ah::dumpBuf(p->packet, p->len);
|
||||||
}
|
}
|
||||||
mNrfStat.frmCnt++;
|
|
||||||
|
|
||||||
Inverter<> *iv = mSys.findInverter(&p->packet[1]);
|
Inverter<> *iv = mSys.findInverter(&p->packet[1]);
|
||||||
if (NULL != iv) {
|
if (NULL != iv) {
|
||||||
|
iv->radioStatistics.frmCnt++;
|
||||||
if (IV_MI == iv->ivGen)
|
if (IV_MI == iv->ivGen)
|
||||||
mMiPayload.add(iv, p);
|
mMiPayload.add(iv, p);
|
||||||
else
|
else
|
||||||
|
@ -160,10 +160,10 @@ void app::loop(void) {
|
||||||
DBGPRINT(F("dBm | "));
|
DBGPRINT(F("dBm | "));
|
||||||
ah::dumpBuf(p->packet, p->len);
|
ah::dumpBuf(p->packet, p->len);
|
||||||
}
|
}
|
||||||
mCmtStat.frmCnt++;
|
|
||||||
|
|
||||||
Inverter<> *iv = mSys.findInverter(&p->packet[1]);
|
Inverter<> *iv = mSys.findInverter(&p->packet[1]);
|
||||||
if(NULL != iv) {
|
if(NULL != iv) {
|
||||||
|
iv->radioStatistics.frmCnt++;
|
||||||
if((iv->ivGen == IV_HMS) || (iv->ivGen == IV_HMT))
|
if((iv->ivGen == IV_HMS) || (iv->ivGen == IV_HMT))
|
||||||
mPayload.add(iv, p);
|
mPayload.add(iv, p);
|
||||||
}
|
}
|
||||||
|
@ -515,9 +515,6 @@ void app::resetSystem(void) {
|
||||||
mSaveReboot = false;
|
mSaveReboot = false;
|
||||||
|
|
||||||
mNetworkConnected = false;
|
mNetworkConnected = false;
|
||||||
|
|
||||||
memset(&mNrfStat, 0, sizeof(statistics_t));
|
|
||||||
memset(&mCmtStat, 0, sizeof(statistics_t));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -334,9 +334,6 @@ class app : public IApp, public ah::Scheduler {
|
||||||
|
|
||||||
bool mNetworkConnected;
|
bool mNetworkConnected;
|
||||||
|
|
||||||
statistics_t mNrfStat;
|
|
||||||
statistics_t mCmtStat;
|
|
||||||
|
|
||||||
// mqtt
|
// mqtt
|
||||||
PubMqttType mMqtt;
|
PubMqttType mMqtt;
|
||||||
bool mMqttReconnect;
|
bool mMqttReconnect;
|
||||||
|
|
|
@ -173,6 +173,7 @@ class Inverter {
|
||||||
alarmCnt = 0;
|
alarmCnt = 0;
|
||||||
alarmLastId = 0;
|
alarmLastId = 0;
|
||||||
rssi = -127;
|
rssi = -127;
|
||||||
|
memset(&radioStatistics, 0, sizeof(statistics_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
~Inverter() {
|
~Inverter() {
|
||||||
|
|
|
@ -31,6 +31,7 @@ typedef struct {
|
||||||
bool requested;
|
bool requested;
|
||||||
bool gotFragment;
|
bool gotFragment;
|
||||||
bool rxTmo;
|
bool rxTmo;
|
||||||
|
uint32_t sendMillis;
|
||||||
} invPayload_t;
|
} invPayload_t;
|
||||||
|
|
||||||
|
|
||||||
|
@ -247,6 +248,9 @@ class HmPayload {
|
||||||
continue; // skip to next inverter
|
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) {
|
if (!mPayload[iv->id].complete) {
|
||||||
bool crcPass, pyldComplete, fastNext;
|
bool crcPass, pyldComplete, fastNext;
|
||||||
|
|
||||||
|
@ -469,6 +473,7 @@ class HmPayload {
|
||||||
mPayload[id].requested = false;
|
mPayload[id].requested = false;
|
||||||
mPayload[id].ts = *mTimestamp;
|
mPayload[id].ts = *mTimestamp;
|
||||||
mPayload[id].rxTmo = setTxTmo; // design: don't start with complete retransmit
|
mPayload[id].rxTmo = setTxTmo; // design: don't start with complete retransmit
|
||||||
|
mPayload[id].sendMillis = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
IApp *mApp;
|
IApp *mApp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue