From 19184727bc0251c26dc606c7be2e1f10404954a5 Mon Sep 17 00:00:00 2001 From: rejoe2 Date: Sat, 27 Jan 2024 09:37:55 +0100 Subject: [PATCH] add data request to PowerLimit update req. --- src/hm/Communication.h | 11 ++++++++--- src/hm/hmInverter.h | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/hm/Communication.h b/src/hm/Communication.h index bfb6a4df..23ffe158 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -264,8 +264,10 @@ class Communication : public CommQueue<> { DBGPRINT(F(" frames missing ")); DBGPRINTLN(F("-> complete retransmit")); } + mHeu.evalTxChQuality(q->iv, false, (q->attemptsMax - 1 - q->attempts), q->iv->curFrmCnt); q->iv->radioStatistics.txCnt--; q->iv->radioStatistics.retransmits++; + mCompleteRetry = true; mState = States::RESET; return; } @@ -511,6 +513,7 @@ class Communication : public CommQueue<> { } else DBGPRINTLN(F("-> complete retransmit")); + mCompleteRetry = true; mState = States::RESET; return; } @@ -611,7 +614,7 @@ class Communication : public CommQueue<> { mHeu.evalTxChQuality(q->iv, crcPass, (q->attemptsMax - 1 - q->attempts), q->iv->curFrmCnt); if(crcPass) q->iv->radioStatistics.rxSuccess++; - else if(q->iv->mGotFragment) + else if(q->iv->mGotFragment || mCompleteRetry) q->iv->radioStatistics.rxFail++; // got no complete payload else q->iv->radioStatistics.rxFailNoAnser++; // got nothing @@ -626,6 +629,7 @@ class Communication : public CommQueue<> { q->iv->mGotLastMsg = false; q->iv->miMultiParts = 0; mIsRetransmit = false; + mCompleteRetry = false; mState = States::RESET; DBGPRINTLN(F("-----")); } @@ -1020,8 +1024,9 @@ class Communication : public CommQueue<> { uint16_t *mInverterGap; TimeMonitor mWaitTime = TimeMonitor(0, true); // start as expired (due to code in RESET state) std::array mLocalBuf; - bool mFirstTry = false; // see, if we should do a second try - bool mIsRetransmit = false; // we already had waited one complete cycle + bool mFirstTry = false; // see, if we should do a second try + bool mCompleteRetry = false; // remember if we did request a complete retransmission + bool mIsRetransmit = false; // we already had waited one complete cycle uint8_t mMaxFrameId; uint8_t mFramesExpected = 12; // 0x8c was highest last frame for alarm data uint16_t mTimeout = 0; // calculating that once should be ok diff --git a/src/hm/hmInverter.h b/src/hm/hmInverter.h index 5ef3752d..bcf732ea 100644 --- a/src/hm/hmInverter.h +++ b/src/hm/hmInverter.h @@ -194,9 +194,10 @@ class Inverter { if(mNextLive) cb(RealTimeRunData_Debug, false); // get live data else { - if(actPowerLimit == 0xffff) + if(actPowerLimit == 0xffff) { cb(SystemConfigPara, false); // power limit info - else if(InitDataState != devControlCmd) { + cb(RealTimeRunData_Debug, false); + } else if(InitDataState != devControlCmd) { cb(devControlCmd, false); // custom command which was received by API devControlCmd = InitDataState; mGetLossInterval = 1;