1
0
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:
Koen Zandberg 2018-12-01 17:50:46 +01:00
parent 666e83479f
commit 014901aae4
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B

View File

@ -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;