[riot-notifications] [RIOT-OS/RIOT] drivers/sx127x: improve netdev adaption (#8232)

Alexandre Abadie notifications at github.com
Sat Dec 9 19:42:53 CET 2017


aabadie commented on this pull request.



> @@ -375,10 +375,14 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *val, size_t len)
             assert(len <= sizeof(netopt_state_t));
             return _set_state(dev, *((const netopt_state_t*) val));
 
-        case NETOPT_DEVICE_MODE:
-            assert(len <= sizeof(uint8_t));
-            sx127x_set_modem(dev, *((const uint8_t*) val));
-            return sizeof(netopt_enable_t);
+        case NETOPT_DEVICE_TYPE:
+            assert(len <= sizeof(uint16_t));
+            /* Only LoRa modem is supported for the moment */
+            if (*(const uint16_t*) val == NETDEV_TYPE_LORA) {
+                sx127x_set_modem(dev, SX127X_MODEM_LORA);
+                return sizeof(uint16_t);
+            }

Done

-- 
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/8232#discussion_r155929296
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20171209/e5a140f9/attachment.html>


More information about the notifications mailing list