Skip to content

Commit 075e4fc

Browse files
authored
Change initial UpLinkCounter values to 0
In LoRaWAN specs (1.0.2), the frame counter is supposed to be reset to 0 on start of APB session. In the code the initial values was 1. 4.3.1.5 Frame counter (FCnt) Lines 21/22 After a JoinReq – JoinAccept message exchange or a reset for a personalized end-device, the frame counters on the end-device and the frame counters on the network server for that end-device are reset to 0.
1 parent 254bcbc commit 075e4fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mac/LoRaMac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static uint8_t LoRaMacRxPayload[LORAMAC_PHY_MAXPAYLOAD];
149149
* LoRaMAC frame counter. Each time a packet is sent the counter is incremented.
150150
* Only the 16 LSB bits are sent
151151
*/
152-
static uint32_t UpLinkCounter = 1;
152+
static uint32_t UpLinkCounter = 0;
153153

154154
/*!
155155
* LoRaMAC frame counter. Each time a packet is received the counter is incremented.
@@ -3012,7 +3012,7 @@ static void ResetMacParameters( void )
30123012
IsLoRaMacNetworkJoined = false;
30133013

30143014
// Counters
3015-
UpLinkCounter = 1;
3015+
UpLinkCounter = 0;
30163016
DownLinkCounter = 0;
30173017
AdrAckCounter = 0;
30183018

0 commit comments

Comments
 (0)