From bdb580763b2b7c1a4a4328626b845e6b89121a7c Mon Sep 17 00:00:00 2001 From: Zhangwx Date: Wed, 31 Jan 2024 03:09:17 +0800 Subject: [PATCH] [spinel] fix set rx on when idle for RCP (#9812) In #9554, a new radio capability is introduced: `RX_ON_WHEN_IDLE`. On the RCP scenario, if recoverd, there will be an error: ``` OPENTHREAD:[W] P-RadioSpinel-: Error processing result: NotImplemented OPENTHREAD:[W] P-RadioSpinel-: Error waiting response: NotImplemented ``` When set the rx on when idle on Host to RCP, no `Set property handler` will be found due to the target handler was surround by the macro `OPENTHREAD_MTD || OPENTHREAD_FTD`. This `rx on when idle` capability should not only be used for MTD and FTD, but also used for RADIO on a NCP. This PR fixes it. --- src/ncp/ncp_base_dispatcher.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ncp/ncp_base_dispatcher.cpp b/src/ncp/ncp_base_dispatcher.cpp index e653f8311..48bd97e82 100644 --- a/src/ncp/ncp_base_dispatcher.cpp +++ b/src/ncp/ncp_base_dispatcher.cpp @@ -433,7 +433,9 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey) OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_MAC_PROMISCUOUS_MODE), #if OPENTHREAD_MTD || OPENTHREAD_FTD OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_MAC_DATA_POLL_PERIOD), +#endif OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_MAC_RX_ON_WHEN_IDLE_MODE), +#if OPENTHREAD_MTD || OPENTHREAD_FTD OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_NET_IF_UP), OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_NET_STACK_UP), OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_NET_ROLE),