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

kw2xrf: Fetch short addr from device

This change modifies the kw2xrf_get_addr_short function to retrieve the
short address from the device and not from netdev
This commit is contained in:
Koen Zandberg 2018-12-01 17:50:00 +01:00
parent b044e83a44
commit 666e83479f
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B

View File

@ -293,7 +293,11 @@ void kw2xrf_set_addr_long(kw2xrf_t *dev, uint64_t addr)
uint16_t kw2xrf_get_addr_short(kw2xrf_t *dev)
{
return (dev->netdev.short_addr[0] << 8) | dev->netdev.short_addr[1];
uint16_t addr;
uint8_t *ap = (uint8_t *)(&addr);
kw2xrf_read_iregs(dev, MKW2XDMI_MACSHORTADDRS0_LSB, ap,
IEEE802154_SHORT_ADDRESS_LEN);
return byteorder_swaps(addr);
}
uint64_t kw2xrf_get_addr_long(kw2xrf_t *dev)