1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #10425 from bergzand/pr/cc2538_rf/undedup_address

cc2538_rf: Don't use netdev_ieee802154_t for link layer address
This commit is contained in:
Martine Lenders 2018-11-22 12:45:52 +01:00 committed by GitHub
commit 3771e6a2c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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