Skip to content

Commit

Permalink
Merge pull request #7323 from miri64/2017.07/xbee/fix/provide-netopt-…
Browse files Browse the repository at this point in the history
…proto

xbee: provide NETOPT_PROTO [2017.07 backport]
  • Loading branch information
kYc0o authored Jul 5, 2017
2 parents dd19e6c + e346573 commit 341b84e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/xbee/xbee.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 341b84e

Please sign in to comment.