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

José Alamos notifications at github.com
Mon Aug 2 16:34:37 CEST 2021


@jia200x requested changes on this pull request.



> @@ -48,6 +60,19 @@ int gnrc_lorawan_set_dr(gnrc_lorawan_t *mac, uint8_t datarate)
     return 0;
 }
 
+int gnrc_lorawan_set_tx_power(gnrc_lorawan_t *mac, uint8_t tx_pwr)
+{
+    netdev_t *dev = gnrc_lorawan_get_netdev(mac);
+
+    if (!gnrc_lorawan_validate_tx_power(tx_pwr)) {
+        return -EINVAL;
+    }
+    DEBUG("gnrc_lorawan_region: TX Power index: %u \n",tx_pwr);
+
+    int tx_pwr_db = GNRC_LORAWAN_TX_POWER_MAX - (tx_pwr * 2);

```suggestion
    uint16_t tx_pwr_db = GNRC_LORAWAN_TX_POWER_MAX - (tx_pwr * 2);
```

NETOPT_TX_POWER requires `int16_t`. This will probably crash on 32-bit platforms.

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


More information about the notifications mailing list