1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

submac: add TX power to retrievable netopts

This commit is contained in:
Fabian Hüßler 2025-07-03 09:10:22 +02:00
parent 05b965ac25
commit 3e38157196
2 changed files with 6 additions and 2 deletions

View File

@ -59,6 +59,9 @@ static int _get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
case NETOPT_IEEE802154_PHY:
*((uint8_t*) value) = ieee802154_get_phy_mode(submac);
return 1;
case NETOPT_TX_POWER:
*((int16_t *)value) = netdev_submac->dev.txpower;
return sizeof(int16_t);
default:
break;
}

View File

@ -783,8 +783,9 @@ int ieee802154_set_phy_conf(ieee802154_submac_t *submac, const ieee802154_phy_co
/* Go back to RX if needed */
if (current_state == IEEE802154_FSM_STATE_RX) {
res = ieee802154_radio_set_rx(dev);
assert (res >= 0);
int rx = ieee802154_radio_set_rx(dev);
assert(rx >= 0);
(void)rx;
}
return res;