[riot-notifications] [RIOT-OS/RIOT] gnrc_lorawan : Add ADR support (#15995)

José Alamos notifications at github.com
Mon Aug 2 16:26:19 CEST 2021


@jia200x commented on this pull request.



> +    mac->mlme.pending_mlme_opts |=  GNRC_LORAWAN_MLME_OPTS_LINK_ADR_ANS;
+
+    DEBUG("gnrc_lorawan_mlme: LinkADRReq DataRate_TXPower : DR%u TX%u\n", dr, tx_power);
+    DEBUG("gnrc_lorawan_mlme: LinkADRReq ChMaskCntrl : %u and Channel mask : \
+           %u\n", chmask_ctrl, channel_mask);
+    DEBUG("gnrc_lorawan_mlme: LinkADRReq Redundancy : %u\n", nbtrans);
+
+    return consumed_bytes;
+}
+
+int _fopts_mlme_link_adr_ans(gnrc_lorawan_t *mac, lorawan_buffer_t *buf)
+{
+    for (uint8_t _count = mac->mlme.adr_req_cnt; buf && _count; _count--) {
+        assert(buf->index + GNRC_LORAWAN_CID_LINK_ADR_ANS_SIZE <= buf->size);
+        buf->data[buf->index++] = GNRC_LORAWAN_CID_LINK_ADR_ANS;
+        buf->data[buf->index++] = mac->mlme.adr_flags;

```suggestion
        buf->data[buf->index++] = mac->mlme.adr_flags & GNRC_LORAWAN_ADR_ANS_MASK;
```

Where `GNRC_LORAWAN_ADR_ANS_MASK=0x7`. Note `adr_flags` is keeping track of the contiguous block too, therefore the current snippet will always add an extra bit.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15995#pullrequestreview-720264949
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210802/b570f490/attachment.htm>


More information about the notifications mailing list