From df2fd4b1367e59c9ccf0a66fbe86973f43b6cf71 Mon Sep 17 00:00:00 2001 From: Tobias Gunkel Date: Mon, 11 Mar 2024 03:23:05 +0100 Subject: [PATCH] Static payload with no ack does not have packet counter --- src/nrf_to_nrf.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/nrf_to_nrf.cpp b/src/nrf_to_nrf.cpp index d9ce0b3..1ec18d8 100644 --- a/src/nrf_to_nrf.cpp +++ b/src/nrf_to_nrf.cpp @@ -272,16 +272,17 @@ bool nrf_to_nrf::available(uint8_t* pipe_num) } NRF_RADIO->TXADDRESS = txAddress; startListening(false); - } - // If the packet has the same ID number and data, it is most likely a - // duplicate - if(NRF_RADIO->CRCCNF != 0){ //If CRC enabled, check this data - if (packetCtr == lastPacketCounter && packetData == lastData) { - NRF_RADIO->TASKS_START = 1; - return 0; - } + // If the packet has the same ID number and data, it is most likely a + // duplicate + if(NRF_RADIO->CRCCNF != 0) { //If CRC enabled, check this data + if (packetCtr == lastPacketCounter && packetData == lastData) { + NRF_RADIO->TASKS_START = 1; + return 0; + } + } } + #if defined CCM_ENCRYPTION_ENABLED if (enableEncryption) { ccmData.counter = counter;