Skip to content

Commit

Permalink
Merge pull request #10426 from bergzand/pr/cc2538_rf/undedup_channel
Browse files Browse the repository at this point in the history
 cc2538_rf: Don't use netdev_ieee802154_t for channel
  • Loading branch information
miri64 committed Nov 25, 2018
2 parents 29acd40 + 8970446 commit 7a8469f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cpu/cc2538/radio/cc2538_rf_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7a8469f

Please sign in to comment.