1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-15 17:43:51 +01:00

Merge pull request #21579 from fabian18/pr/submac_tx_power

submac: add TX power to retrievable netopts
This commit is contained in:
mguetschow 2025-07-03 13:06:08 +00:00 committed by GitHub
commit 06a22e3dd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;