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

José Alamos notifications at github.com
Fri Jul 16 12:44:51 CEST 2021


@jia200x commented on this pull request.



>  {
-    DEBUG("gnrc_lorawan_mlme: LinkADRReq DataRate_TXPower : DR%u TX%u\n",
-           p[1] >> 4, p[1] & 0x0f);
-    DEBUG("gnrc_lorawan_mlme: LinkADRReq ChMask : %u\n", (p[3] << 8 ) | p[2]);
-    DEBUG("gnrc_lorawan_mlme: LinkADRReq Redundancy : %u\n", p[4]);
+    uint8_t last_adr_pos;
+
+    for (; index < len; index += GNRC_LORAWAN_FOPT_LINK_ADR_REQ_SIZE ) {
+        if ( p[index] == GNRC_LORAWAN_CID_LINK_ADR_REQ )
+        {
+            mac->mlme.adr_req_cnt++;
+        }
+    }
+
+    if (mac->mlme.adr_req_recv) {
+        return index;

the semantics of this new signature indicate that the return value is the number of consumed bytes. The index doesn't reflect that.

-- 
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-708241487
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210716/e3226f2b/attachment.htm>


More information about the notifications mailing list