Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The size of CFlist in Joinaccept message #2

Open
Newton1026 opened this issue Aug 7, 2018 · 1 comment
Open

The size of CFlist in Joinaccept message #2

Newton1026 opened this issue Aug 7, 2018 · 1 comment

Comments

@Newton1026
Copy link

Hi, i found a issue about the library, the function is located in the path(/util-lorawan-packets/lw_packets.c LoRaWAN_MarshalPacket())
the code is following:
if (packet->BODY.JoinAccept.hasCFlist) {
memcpy(&(outBuffer[pos]), packet->BODY.JoinAccept.CFlist.FreqCH4, 3);
pos += 3;
memcpy(&(outBuffer[pos]), packet->BODY.JoinAccept.CFlist.FreqCH5, 3);
pos += 3;
memcpy(&(outBuffer[pos]), packet->BODY.JoinAccept.CFlist.FreqCH6, 3);
pos += 3;
memcpy(&(outBuffer[pos]), packet->BODY.JoinAccept.CFlist.FreqCH7, 3);
pos += 3;
memcpy(&(outBuffer[pos]), packet->BODY.JoinAccept.CFlist.FreqCH8, 3);
pos += 3;
}
In accordance with LoRaWAN standard protocols,the length of CFlist Field should be set with 16 bytes,but the above coding showed that the length of CFlist Field is 15 bytes,could you explain it?

@niondir
Copy link
Member

niondir commented Aug 15, 2018

In LoRaWAN 1.0 (LoRaWAN 1.0.1_d3.pdf) the CFList is defined as 5x3 bytes + 1 byte RFU, which explains the "missing" byte.

The LoRaWAN 1.1 (LoRaWAN-Regional-Parameters-v1 1rA.pdf) spec defines that last byte as CFListType - which is not supported yet - pull requests are very welcome :)

The CFListType shall be equal to zero (0) to indicate that the CFList contains a list of frequencies.

We could just check that is is 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants