Skip to content

Commit 9b16cfc

Browse files
committed
Merge branch 'fix/154_txpower_set_api_v5.1' into 'release/v5.1'
fix(802.15.4): fix the behavior of the `esp_ieee802154_set_txpower` (v5.1) See merge request espressif/esp-idf!37739
2 parents c70a55c + 7392a31 commit 9b16cfc

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

components/ieee802154/esp_ieee802154.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ int8_t esp_ieee802154_get_txpower(void)
6565

6666
esp_err_t esp_ieee802154_set_txpower(int8_t power)
6767
{
68-
ieee802154_pib_set_power(power);
69-
return ESP_OK;
68+
esp_ieee802154_txpower_table_t power_table;
69+
memset(&power_table, power, sizeof(power_table));
70+
return ieee802154_pib_set_power_table(power_table);
7071
}
7172

7273
esp_err_t esp_ieee802154_set_power_table(esp_ieee802154_txpower_table_t power_table)

components/ieee802154/include/esp_ieee802154.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ uint8_t esp_ieee802154_get_channel(void);
5959
esp_err_t esp_ieee802154_set_channel(uint8_t channel);
6060

6161
/**
62-
* @brief Get the transmit power.
62+
* @brief Get the transmission power for the current channel.
6363
*
64-
* @return The transmit power in dBm.
64+
* @return The transmission power in dBm.
6565
*
6666
*/
6767
int8_t esp_ieee802154_get_txpower(void);
6868

6969
/**
70-
* @brief Set the transmit power.
70+
* @brief Set the transmission power for all channels.
7171
*
72-
* @param[in] power The transmit power in dBm.
72+
* @param[in] power The transmission power in dBm.
7373
*
7474
* @return
7575
* - ESP_OK on success.

0 commit comments

Comments
 (0)