diff --git a/components/ieee802154/include/esp_ieee802154_types.h b/components/ieee802154/include/esp_ieee802154_types.h index 0b83cf2eed..8c551f7552 100644 --- a/components/ieee802154/include/esp_ieee802154_types.h +++ b/components/ieee802154/include/esp_ieee802154_types.h @@ -9,6 +9,8 @@ #include #include +#define US_PER_SYMBLE 16 + #ifdef __cplusplus extern "C" { #endif diff --git a/components/openthread/src/port/esp_openthread_radio.c b/components/openthread/src/port/esp_openthread_radio.c index 3e0f4286fe..f87cb68291 100644 --- a/components/openthread/src/port/esp_openthread_radio.c +++ b/components/openthread/src/port/esp_openthread_radio.c @@ -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; }