[riot-notifications] [RIOT-OS/RIOT] pkg/semtech-loramac: refactor API and make it thread-safe (#8798)

jia200x notifications at github.com
Thu Apr 19 13:14:21 CEST 2018

jia200x approved this pull request.


>  RadioEvents_t semtech_loramac_radio_events;
-uint8_t semtech_loramac_dev_eui[LORAMAC_DEVEUI_LEN];
-uint8_t semtech_loramac_app_eui[LORAMAC_APPEUI_LEN];
-uint8_t semtech_loramac_app_key[LORAMAC_APPKEY_LEN];
-uint8_t semtech_loramac_nwk_skey[LORAMAC_NWKSKEY_LEN];
-uint8_t semtech_loramac_app_skey[LORAMAC_APPSKEY_LEN];
-uint8_t semtech_loramac_dev_addr[LORAMAC_DEVADDR_LEN];
-static uint8_t _semtech_loramac_radio_payload[SX127X_RX_BUFFER_SIZE];
-static semtech_loramac_rx_data_t _semtech_loramac_rx_data;
+LoRaMacPrimitives_t semtech_loramac_primitives;

Same question as above here

+sx127x_t sx127x;

yeah, you are right. I forgot that :)

> @@ -76,49 +74,49 @@ static int _cmd_loramac(int argc, char **argv)
         if (strcmp("deveui", argv[2]) == 0) {
             uint8_t deveui[LORAMAC_DEVEUI_LEN];
-            semtech_loramac_get_deveui(deveui);
+            semtech_loramac_get_deveui(&loramac, deveui);

>I understand what you mean and I avoided it on purpose. That would have required other internal get/set functions, with switch/case depending on the parameters, very similar to netdev.

Yes, unless it's done via snippets (this is, writing integrated LoRaMAC code in a function and calling it via LORAMAC_CMD, but might confuse end users...)

Do you think it's possible to do the same with Join, etc?

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20180419/b729a79d/attachment.html>

More information about the notifications mailing list