diff --git a/src/ncp/ncp_base_dispatcher.cpp b/src/ncp/ncp_base_dispatcher.cpp index 9d2e11ffb..7b3af1381 100644 --- a/src/ncp/ncp_base_dispatcher.cpp +++ b/src/ncp/ncp_base_dispatcher.cpp @@ -703,6 +703,9 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey) case SPINEL_PROP_IPV6_ICMP_PING_OFFLOAD_MODE: handler = &NcpBase::HandlePropertySet; break; + case SPINEL_PROP_THREAD_CHILD_TIMEOUT: + handler = &NcpBase::HandlePropertySet; + break; case SPINEL_PROP_THREAD_RLOC16_DEBUG_PASSTHRU: handler = &NcpBase::HandlePropertySet; break; @@ -777,9 +780,6 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey) case SPINEL_PROP_NET_PSKC: handler = &NcpBase::HandlePropertySet; break; - case SPINEL_PROP_THREAD_CHILD_TIMEOUT: - handler = &NcpBase::HandlePropertySet; - break; case SPINEL_PROP_THREAD_NETWORK_ID_TIMEOUT: handler = &NcpBase::HandlePropertySet; break; diff --git a/src/ncp/ncp_base_ftd.cpp b/src/ncp/ncp_base_ftd.cpp index c130fe951..4502498a7 100644 --- a/src/ncp/ncp_base_ftd.cpp +++ b/src/ncp/ncp_base_ftd.cpp @@ -468,19 +468,6 @@ exit: } #endif // #if OPENTHREAD_CONFIG_ENABLE_STEERING_DATA_SET_OOB -template <> otError NcpBase::HandlePropertySet(void) -{ - uint32_t timeout = 0; - otError error = OT_ERROR_NONE; - - SuccessOrExit(error = mDecoder.ReadUint32(timeout)); - - otThreadSetChildTimeout(mInstance, timeout); - -exit: - return error; -} - template <> otError NcpBase::HandlePropertyGet(void) { return mEncoder.WriteUint8(mPreferredRouteId); diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index db204ab9e..e91d719c9 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -2199,6 +2199,19 @@ template <> otError NcpBase::HandlePropertyGet return mEncoder.WriteUint32(otThreadGetChildTimeout(mInstance)); } +template <> otError NcpBase::HandlePropertySet(void) +{ + uint32_t timeout = 0; + otError error = OT_ERROR_NONE; + + SuccessOrExit(error = mDecoder.ReadUint32(timeout)); + + otThreadSetChildTimeout(mInstance, timeout); + +exit: + return error; +} + template <> otError NcpBase::HandlePropertyGet(void) { return mEncoder.WriteUint16(otThreadGetRloc16(mInstance));