1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #10426 from bergzand/pr/cc2538_rf/undedup_channel

cc2538_rf: Don't use netdev_ieee802154_t for channel
This commit is contained in:
Martine Lenders 2018-11-25 13:26:57 +01:00 committed by GitHub
commit 7a8469f1aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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