Skip to content

Commit

Permalink
feat(openthread): disable the rx on when idle in coex scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
zwx1995esp committed Feb 1, 2024
1 parent d117ae0 commit 5c74483
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions components/openthread/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
8 changes: 7 additions & 1 deletion components/openthread/src/port/esp_openthread_radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

0 comments on commit 5c74483

Please sign in to comment.