[riot-notifications] [RIOT-OS/RIOT] gnrc_netif: centralize device-type-specific functions (#10524)

Martine Lenders notifications at github.com
Fri Jan 4 12:53:55 CET 2019


miri64 commented on this pull request.



>  #include "net/ieee802154.h"
 
+netopt_t gnrc_netif_get_l2addr_opt(gnrc_netif_t *netif)
+{
+    netopt_t res = NETOPT_ADDRESS;
+
+    switch (netif->device_type) {
+#if defined(MODULE_NETDEV_IEEE802154) || defined(MODULE_XBEE) || \
+    defined(MODULE_NORDIC_SOFTDEVICE_BLE)
+        case NETDEV_TYPE_IEEE802154:
+        case NETDEV_TYPE_BLE: {
+                netdev_t *dev = netif->dev;
+                uint16_t tmp;
+
+                res = dev->driver->get(dev, NETOPT_SRC_LEN, &tmp, sizeof(tmp));
+                assert(res == sizeof(tmp));
+                netif->l2addr_len = (uint8_t)tmp;

Addressed

-- 
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/10524#discussion_r245279134
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190104/df7b94c5/attachment.html>


More information about the notifications mailing list