Skip to content

Commit 52e3e60

Browse files
committed
Add documentation about port number handling in scan_mac_cmds
1 parent c13a2fd commit 52e3e60

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lmic/lmic.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,10 +889,14 @@ scan_mac_cmds(
889889
uint8_t cmd;
890890

891891
LMIC.pendMacLen = 0;
892-
if (port == 0)
892+
if (port == 0) {
893+
// port zero: mac data is in the normal payload, and there can't be
894+
// piggyback mac data.
893895
LMIC.pendMacPiggyback = 0;
894-
else
896+
} else {
897+
// port is either -1 (no port) or non-zero (piggyback): treat as piggyback.
895898
LMIC.pendMacPiggyback = 1;
899+
}
896900

897901
while( oidx < olen ) {
898902
bit_t response_fit;

0 commit comments

Comments
 (0)