mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +01:00
Merge pull request #7319 from miri64/xbee/fix/provide-netopt-proto
xbee: provide NETOPT_PROTO
This commit is contained in:
commit
39c6051090
@ -29,6 +29,9 @@
|
||||
#include "net/eui64.h"
|
||||
#include "net/netdev.h"
|
||||
#include "net/ieee802154.h"
|
||||
#ifdef MODULE_GNRC
|
||||
#include "net/gnrc.h"
|
||||
#endif
|
||||
|
||||
#define ENABLE_DEBUG (0)
|
||||
#include "debug.h"
|
||||
@ -769,6 +772,14 @@ static int xbee_get(netdev_t *ndev, netopt_t opt, void *value, size_t max_len)
|
||||
return sizeof(uint16_t);
|
||||
case NETOPT_NID:
|
||||
return _get_panid(dev, (uint8_t *)value, max_len);
|
||||
#ifdef MODULE_GNRC
|
||||
case NETOPT_PROTO:
|
||||
if (max_len != sizeof(gnrc_nettype_t)) {
|
||||
return -EOVERFLOW;
|
||||
}
|
||||
*((gnrc_nettype_t *)value) = XBEE_DEFAULT_PROTOCOL;
|
||||
return sizeof(gnrc_nettype_t);
|
||||
#endif
|
||||
default:
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user