Skip to content
Snippets Groups Projects
Unverified Commit 014901aa authored by Koen Zandberg's avatar Koen Zandberg
Browse files

kw2xrf: Add NETOPT_ADDRESS{,_LONG} to getters

parent 666e8347
No related branches found
No related tags found
No related merge requests found
...@@ -258,6 +258,20 @@ int _get(netdev_t *netdev, netopt_t opt, void *value, size_t len) ...@@ -258,6 +258,20 @@ int _get(netdev_t *netdev, netopt_t opt, void *value, size_t len)
} }
switch (opt) { switch (opt) {
case NETOPT_ADDRESS:
if (len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
*((uint16_t *)value) = kw2xrf_get_addr_short(dev);
return sizeof(uint16_t);
case NETOPT_ADDRESS_LONG:
if (len < sizeof(uint64_t)) {
return -EOVERFLOW;
}
*((uint64_t *)value) = kw2xrf_get_addr_long(dev);
return sizeof(uint64_t);
case NETOPT_STATE: case NETOPT_STATE:
if (len < sizeof(netopt_state_t)) { if (len < sizeof(netopt_state_t)) {
return -EOVERFLOW; return -EOVERFLOW;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment