diff --git a/cpu/cc2538/radio/cc2538_rf_netdev.c b/cpu/cc2538/radio/cc2538_rf_netdev.c index d2b76b67e2..9916d4da85 100644 --- a/cpu/cc2538/radio/cc2538_rf_netdev.c +++ b/cpu/cc2538/radio/cc2538_rf_netdev.c @@ -77,6 +77,13 @@ static int _get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len) } return sizeof(netopt_enable_t); + case NETOPT_CHANNEL: + if (max_len < sizeof(uint16_t)) { + return -EOVERFLOW; + } + *((uint16_t *)value) = (uint16_t)cc2538_get_chan(); + return sizeof(uint16_t); + case NETOPT_CHANNEL_PAGE: if (max_len < sizeof(uint16_t)) { return -EOVERFLOW; @@ -188,6 +195,7 @@ static int _set(netdev_t *netdev, netopt_t opt, const void *value, size_t value_ } else { cc2538_set_chan(chan); + res = sizeof(uint16_t); } } break;