1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_netif: set-up 6Lo for NRFmin

This commit is contained in:
Martine Lenders 2018-01-18 12:59:57 +01:00
parent 83b111080f
commit 851eb767be
3 changed files with 12 additions and 4 deletions

View File

@ -123,7 +123,7 @@ ifneq (,$(filter trickle,$(USEMODULE)))
USEMODULE += xtimer
endif
ifneq (,$(filter ieee802154,$(USEMODULE)))
ifneq (,$(filter ieee802154 nrfmin,$(USEMODULE)))
ifneq (,$(filter gnrc_ipv6, $(USEMODULE)))
USEMODULE += gnrc_sixlowpan
endif

View File

@ -31,6 +31,10 @@
#include "nrfmin.h"
#include "net/netdev.h"
#ifdef MODULE_GNRC_SIXLOWPAN
#include "net/gnrc/nettype.h"
#endif
#define ENABLE_DEBUG (0)
#include "debug.h"
@ -495,9 +499,12 @@ static int nrfmin_get(netdev_t *dev, netopt_t opt, void *val, size_t max_len)
assert(max_len >= sizeof(uint16_t));
*((uint16_t*)val) = CONF_PSEUDO_NID;
return sizeof(uint16_t);
#ifdef MODULE_GNRC_SIXLOWPAN
case NETOPT_PROTO:
*((uint16_t *)val) = 809; /* TODO */
return 2;
assert(max_len >= sizeof(uint16_t));
*((uint16_t *)val) = GNRC_NETTYPE_SIXLOWPAN;
return sizeof(uint16_t);
#endif
case NETOPT_DEVICE_TYPE:
assert(max_len >= sizeof(uint16_t));
*((uint16_t *)val) = NETDEV_TYPE_NRFMIN;

View File

@ -1157,8 +1157,9 @@ static void _init_from_device(gnrc_netif_t *netif)
assert(res == sizeof(tmp));
netif->device_type = (uint8_t)tmp;
switch (netif->device_type) {
#ifdef MODULE_NETDEV_IEEE802154
#if defined(MODULE_NETDEV_IEEE802154) || defined(MODULE_NRFMIN)
case NETDEV_TYPE_IEEE802154:
case NETDEV_TYPE_NRFMIN:
#ifdef MODULE_GNRC_SIXLOWPAN_IPHC
netif->flags |= GNRC_NETIF_FLAGS_6LO_HC;
#endif