feat(openthread): disable the rx on when idle in coex scenario

This commit is contained in:
zwx 2024-02-01 11:34:37 +08:00 committed by Xu Si Yu
parent cb04df5ddf
commit fff9980a5b
3 changed files with 19 additions and 1 deletions

View File

@ -376,6 +376,15 @@ menu "OpenThread"
default n
help
Select this option to enable the OpenThread Radio Spinel for external protocol stack, such as Zigbee.
config OPENTHREAD_RX_ON_WHEN_IDLE
bool "Enable OpenThread radio capibility rx on when idle"
default y if !ESP_COEX_SW_COEXIST_ENABLE
default n if ESP_COEX_SW_COEXIST_ENABLE
help
Select this option to enable OpenThread radio capibility rx on when idle. Do not support this feature when
SW coexistence is enabled.
menu "Thread Address Query Config"
config OPENTHREAD_ADDRESS_QUERY_TIMEOUT
int "Timeout value (in seconds) for a address notification response after sending an address query."

View File

@ -343,7 +343,11 @@ int8_t otPlatRadioGetRssi(otInstance *aInstance)
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
{
return (otRadioCaps)(OT_RADIO_CAPS_ENERGY_SCAN | OT_RADIO_CAPS_RX_ON_WHEN_IDLE |
// FIXME: Remove `CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE` when JIRA: TZ-609 fixed.
return (otRadioCaps)(OT_RADIO_CAPS_ENERGY_SCAN |
#if CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE
OT_RADIO_CAPS_RX_ON_WHEN_IDLE |
#endif
OT_RADIO_CAPS_TRANSMIT_SEC | OT_RADIO_CAPS_RECEIVE_TIMING | OT_RADIO_CAPS_TRANSMIT_TIMING |
OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_SLEEP_TO_TX);
}
@ -771,8 +775,10 @@ otError otPlatRadioSetChannelMaxTransmitPower(otInstance *aInstance, uint8_t aCh
return OT_ERROR_NONE;
}
#if CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE
void otPlatRadioSetRxOnWhenIdle(otInstance *aInstance, bool aEnable)
{
OT_UNUSED_VARIABLE(aInstance);
esp_ieee802154_set_rx_when_idle(aEnable);
}
#endif

View File

@ -6,6 +6,7 @@
#include "esp_openthread_radio.h"
#include "sdkconfig.h"
#include "esp_check.h"
#include "esp_err.h"
#include "esp_openthread_border_router.h"
@ -413,7 +414,9 @@ otError otPlatRadioConfigureEnhAckProbing(otInstance *aInstance, otLinkMetrics a
}
#endif
#if CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE
void otPlatRadioSetRxOnWhenIdle(otInstance *aInstance, bool aEnable)
{
s_radio.SetRxOnWhenIdle(aEnable);
}
#endif