Skip to content

Commit 1754c8f

Browse files
committed
Merge branch 'backport/fix_energy_scan_api_para_mismatch_v54' into 'release/v5.4'
fix(openthread): set channel for energy scan(Backport v5.4) See merge request espressif/esp-idf!34597
2 parents f012157 + 7c03514 commit 1754c8f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

components/ieee802154/include/esp_ieee802154_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <stdint.h>
1010
#include <stdbool.h>
1111

12+
#define US_PER_SYMBLE 16
13+
1214
#ifdef __cplusplus
1315
extern "C" {
1416
#endif

components/openthread/src/port/esp_openthread_radio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,8 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
412412

413413
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
414414
{
415-
esp_ieee802154_energy_detect(aScanDuration);
415+
esp_ieee802154_set_channel(aScanChannel);
416+
esp_ieee802154_energy_detect(aScanDuration * US_PER_MS / US_PER_SYMBLE);
416417

417418
return OT_ERROR_NONE;
418419
}

0 commit comments

Comments
 (0)