diff --git a/cpu/cc2538/radio/cc2538_rf_netdev.c b/cpu/cc2538/radio/cc2538_rf_netdev.c index e63e610d9e48f3b5820faa46eba863ae25c393a0..d2b76b67e20254993729ae08f144249b334cc293 100644 --- a/cpu/cc2538/radio/cc2538_rf_netdev.c +++ b/cpu/cc2538/radio/cc2538_rf_netdev.c @@ -50,6 +50,24 @@ static int _get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len) } switch (opt) { + case NETOPT_ADDRESS: + if (max_len < sizeof(uint16_t)) { + return -EOVERFLOW; + } + else { + *(uint16_t*)value = cc2538_get_addr_short(); + } + return sizeof(uint16_t); + + case NETOPT_ADDRESS_LONG: + if (max_len < sizeof(uint64_t)) { + return -EOVERFLOW; + } + else { + *(uint64_t*)value = cc2538_get_addr_long(); + } + return sizeof(uint64_t); + case NETOPT_AUTOACK: if (RFCORE->XREG_FRMCTRL0bits.AUTOACK) { *((netopt_enable_t *)value) = NETOPT_ENABLE; @@ -139,6 +157,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *value, size_t value_ } else { cc2538_set_addr_short(*((const uint16_t*)value)); + res = sizeof(uint16_t); } break; @@ -148,6 +167,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *value, size_t value_ } else { cc2538_set_addr_long(*((const uint64_t*)value)); + res = sizeof(uint64_t); } break;