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:
parent
b044e83a44
commit
666e83479f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user