mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-22 21:36:11 +02:00
add data request to PowerLimit update req.
This commit is contained in:
parent
626ca86d0d
commit
19184727bc
2 changed files with 11 additions and 5 deletions
|
@ -264,8 +264,10 @@ class Communication : public CommQueue<> {
|
||||||
DBGPRINT(F(" frames missing "));
|
DBGPRINT(F(" frames missing "));
|
||||||
DBGPRINTLN(F("-> complete retransmit"));
|
DBGPRINTLN(F("-> complete retransmit"));
|
||||||
}
|
}
|
||||||
|
mHeu.evalTxChQuality(q->iv, false, (q->attemptsMax - 1 - q->attempts), q->iv->curFrmCnt);
|
||||||
q->iv->radioStatistics.txCnt--;
|
q->iv->radioStatistics.txCnt--;
|
||||||
q->iv->radioStatistics.retransmits++;
|
q->iv->radioStatistics.retransmits++;
|
||||||
|
mCompleteRetry = true;
|
||||||
mState = States::RESET;
|
mState = States::RESET;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -511,6 +513,7 @@ class Communication : public CommQueue<> {
|
||||||
|
|
||||||
} else
|
} else
|
||||||
DBGPRINTLN(F("-> complete retransmit"));
|
DBGPRINTLN(F("-> complete retransmit"));
|
||||||
|
mCompleteRetry = true;
|
||||||
mState = States::RESET;
|
mState = States::RESET;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -611,7 +614,7 @@ class Communication : public CommQueue<> {
|
||||||
mHeu.evalTxChQuality(q->iv, crcPass, (q->attemptsMax - 1 - q->attempts), q->iv->curFrmCnt);
|
mHeu.evalTxChQuality(q->iv, crcPass, (q->attemptsMax - 1 - q->attempts), q->iv->curFrmCnt);
|
||||||
if(crcPass)
|
if(crcPass)
|
||||||
q->iv->radioStatistics.rxSuccess++;
|
q->iv->radioStatistics.rxSuccess++;
|
||||||
else if(q->iv->mGotFragment)
|
else if(q->iv->mGotFragment || mCompleteRetry)
|
||||||
q->iv->radioStatistics.rxFail++; // got no complete payload
|
q->iv->radioStatistics.rxFail++; // got no complete payload
|
||||||
else
|
else
|
||||||
q->iv->radioStatistics.rxFailNoAnser++; // got nothing
|
q->iv->radioStatistics.rxFailNoAnser++; // got nothing
|
||||||
|
@ -626,6 +629,7 @@ class Communication : public CommQueue<> {
|
||||||
q->iv->mGotLastMsg = false;
|
q->iv->mGotLastMsg = false;
|
||||||
q->iv->miMultiParts = 0;
|
q->iv->miMultiParts = 0;
|
||||||
mIsRetransmit = false;
|
mIsRetransmit = false;
|
||||||
|
mCompleteRetry = false;
|
||||||
mState = States::RESET;
|
mState = States::RESET;
|
||||||
DBGPRINTLN(F("-----"));
|
DBGPRINTLN(F("-----"));
|
||||||
}
|
}
|
||||||
|
@ -1020,8 +1024,9 @@ class Communication : public CommQueue<> {
|
||||||
uint16_t *mInverterGap;
|
uint16_t *mInverterGap;
|
||||||
TimeMonitor mWaitTime = TimeMonitor(0, true); // start as expired (due to code in RESET state)
|
TimeMonitor mWaitTime = TimeMonitor(0, true); // start as expired (due to code in RESET state)
|
||||||
std::array<frame_t, MAX_PAYLOAD_ENTRIES> mLocalBuf;
|
std::array<frame_t, MAX_PAYLOAD_ENTRIES> mLocalBuf;
|
||||||
bool mFirstTry = false; // see, if we should do a second try
|
bool mFirstTry = false; // see, if we should do a second try
|
||||||
bool mIsRetransmit = false; // we already had waited one complete cycle
|
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 mMaxFrameId;
|
||||||
uint8_t mFramesExpected = 12; // 0x8c was highest last frame for alarm data
|
uint8_t mFramesExpected = 12; // 0x8c was highest last frame for alarm data
|
||||||
uint16_t mTimeout = 0; // calculating that once should be ok
|
uint16_t mTimeout = 0; // calculating that once should be ok
|
||||||
|
|
|
@ -194,9 +194,10 @@ class Inverter {
|
||||||
if(mNextLive)
|
if(mNextLive)
|
||||||
cb(RealTimeRunData_Debug, false); // get live data
|
cb(RealTimeRunData_Debug, false); // get live data
|
||||||
else {
|
else {
|
||||||
if(actPowerLimit == 0xffff)
|
if(actPowerLimit == 0xffff) {
|
||||||
cb(SystemConfigPara, false); // power limit info
|
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
|
cb(devControlCmd, false); // custom command which was received by API
|
||||||
devControlCmd = InitDataState;
|
devControlCmd = InitDataState;
|
||||||
mGetLossInterval = 1;
|
mGetLossInterval = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue