mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
netdev_ieee802154: fix IID getter
With ace5db70e858b8c114580e8b4f65a3994ee3c4e7 the IID may be gotten from the device again. However, following the current refactoring efforts regarding the `netdev_ieee802154` layer, the devices don't necessarily store the address in the `netdev_ieee802154_t` struct anymore. So we need to access the address using the driver's `get` function here instead.
This commit is contained in:
parent
4eaf1d8135
commit
fcfc7c3357
@ -33,18 +33,20 @@ static int _get_iid(netdev_ieee802154_t *dev, eui64_t *value, size_t max_len)
|
||||
{
|
||||
(void)max_len;
|
||||
|
||||
uint8_t *addr;
|
||||
uint8_t addr[IEEE802154_LONG_ADDRESS_LEN];
|
||||
uint16_t addr_len;
|
||||
|
||||
assert(max_len >= sizeof(eui64_t));
|
||||
|
||||
if (dev->flags & NETDEV_IEEE802154_SRC_MODE_LONG) {
|
||||
addr_len = IEEE802154_LONG_ADDRESS_LEN;
|
||||
addr = dev->long_addr;
|
||||
dev->netdev.driver->get(&dev->netdev, NETOPT_SRC_LEN, &addr_len,
|
||||
sizeof(addr_len));
|
||||
if (addr_len == IEEE802154_LONG_ADDRESS_LEN) {
|
||||
dev->netdev.driver->get(&dev->netdev, NETOPT_ADDRESS_LONG, addr,
|
||||
addr_len);
|
||||
}
|
||||
else {
|
||||
addr_len = IEEE802154_SHORT_ADDRESS_LEN;
|
||||
addr = dev->short_addr;
|
||||
dev->netdev.driver->get(&dev->netdev, NETOPT_ADDRESS, addr,
|
||||
addr_len);
|
||||
}
|
||||
ieee802154_get_iid(value, addr, addr_len);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user