mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-15 01:46:38 +02:00
no retransmit on Restart / CleanState_LockAndAlarm
This commit is contained in:
parent
a98afcdeb2
commit
f5c784f44c
2 changed files with 25 additions and 27 deletions
|
@ -325,6 +325,11 @@ void app::processPayload(bool retransmit) {
|
|||
if(!buildPayload(iv->id)) { // payload not complete
|
||||
if(mPayload[iv->id].requested) {
|
||||
if(retransmit) {
|
||||
if(iv->devControlCmd == Restart || CleanState_LockAndAlarm || iv->devControlCmd) {
|
||||
// This is required to prevent retransmissions without answer.
|
||||
DPRINTLN(DBG_INFO, F("Prevent retransmit on Restart / CleanState_LockAndAlarm..."));
|
||||
mPayload[iv->id].retransmits = mConfig.maxRetransPerPyld;
|
||||
} else {
|
||||
if(mPayload[iv->id].retransmits < mConfig.maxRetransPerPyld) {
|
||||
mPayload[iv->id].retransmits++;
|
||||
if(mPayload[iv->id].maxPackId != 0) {
|
||||
|
@ -353,6 +358,7 @@ void app::processPayload(bool retransmit) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // payload complete
|
||||
DPRINTLN(DBG_INFO, F("procPyld: cmd: ") + String(mPayload[iv->id].txCmd));
|
||||
DPRINTLN(DBG_INFO, F("procPyld: txid: 0x") + String(mPayload[iv->id].txId, HEX));
|
||||
|
|
|
@ -190,14 +190,6 @@ class HmRadio {
|
|||
mTxBuf[10 + cnt] = Ahoy::crc8(mTxBuf, 10 + cnt);
|
||||
|
||||
sendPacket(invId, mTxBuf, 10 + (++cnt), true);
|
||||
|
||||
// Is required to prevent retransmissions without answer.
|
||||
if (cmd == CleanState_LockAndAlarm || cmd == Restart)
|
||||
{
|
||||
DPRINTLN(DBG_INFO, F("TODO: Prevent retransmit after Reboot / CleanState_LockAndAlarm..."));
|
||||
// if(mPayload[iv->id].retransmits < mConfig.maxRetransPerPyld)
|
||||
//mPayload[iv->id].retransmits = mConfig.maxRetransPerPyld;
|
||||
}
|
||||
}
|
||||
|
||||
void sendTimePacket(uint64_t invId, uint8_t cmd, uint32_t ts, uint16_t alarmMesId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue