Skip to content

Commit 341b84e

Browse files
authored
Merge pull request #7323 from miri64/2017.07/xbee/fix/provide-netopt-proto
xbee: provide NETOPT_PROTO [2017.07 backport]
2 parents dd19e6c + e346573 commit 341b84e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/xbee/xbee.c

+11
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
#include "net/eui64.h"
3030
#include "net/netdev.h"
3131
#include "net/ieee802154.h"
32+
#ifdef MODULE_GNRC
33+
#include "net/gnrc.h"
34+
#endif
3235

3336
#define ENABLE_DEBUG (0)
3437
#include "debug.h"
@@ -769,6 +772,14 @@ static int xbee_get(netdev_t *ndev, netopt_t opt, void *value, size_t max_len)
769772
return sizeof(uint16_t);
770773
case NETOPT_NID:
771774
return _get_panid(dev, (uint8_t *)value, max_len);
775+
#ifdef MODULE_GNRC
776+
case NETOPT_PROTO:
777+
if (max_len != sizeof(gnrc_nettype_t)) {
778+
return -EOVERFLOW;
779+
}
780+
*((gnrc_nettype_t *)value) = XBEE_DEFAULT_PROTOCOL;
781+
return sizeof(gnrc_nettype_t);
782+
#endif
772783
default:
773784
return -ENOTSUP;
774785
}

0 commit comments

Comments
 (0)