mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
kw2xrf: Add NETOPT_ADDRESS{,_LONG} to getters
This commit is contained in:
parent
666e83479f
commit
014901aae4
@ -258,6 +258,20 @@ int _get(netdev_t *netdev, netopt_t opt, void *value, size_t len)
|
||||
}
|
||||
|
||||
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:
|
||||
if (len < sizeof(netopt_state_t)) {
|
||||
return -EOVERFLOW;
|
||||
|
Loading…
Reference in New Issue
Block a user