Skip to content

Commit

Permalink
Merge branch 'backport/fix_energy_scan_api_para_mismatch_v54' into 'r…
Browse files Browse the repository at this point in the history
…elease/v5.4'

fix(openthread): set channel for energy scan(Backport v5.4)

See merge request espressif/esp-idf!34597
  • Loading branch information
chshu committed Nov 5, 2024
2 parents f012157 + 7c03514 commit 1754c8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/ieee802154/include/esp_ieee802154_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <stdint.h>
#include <stdbool.h>

#define US_PER_SYMBLE 16

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
3 changes: 2 additions & 1 deletion components/openthread/src/port/esp_openthread_radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)

otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
{
esp_ieee802154_energy_detect(aScanDuration);
esp_ieee802154_set_channel(aScanChannel);
esp_ieee802154_energy_detect(aScanDuration * US_PER_MS / US_PER_SYMBLE);

return OT_ERROR_NONE;
}
Expand Down

0 comments on commit 1754c8f

Please sign in to comment.