[cert] support partition id configuration for ncp device (#3955)

This commit is contained in:
Rongli Sun
2019-07-02 19:27:09 -07:00
committed by Jonathan Hui
parent 60b01a8a4b
commit 0d75bbe3fa
2 changed files with 16 additions and 0 deletions
+3
View File
@@ -883,6 +883,9 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey)
case SPINEL_PROP_NET_PSKC:
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_NET_PSKC>;
break;
case SPINEL_PROP_NET_PARTITION_ID:
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_NET_PARTITION_ID>;
break;
case SPINEL_PROP_THREAD_NETWORK_ID_TIMEOUT:
handler = &NcpBase::HandlePropertySet<SPINEL_PROP_THREAD_NETWORK_ID_TIMEOUT>;
break;
+13
View File
@@ -331,6 +331,19 @@ exit:
return error;
}
template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_NET_PARTITION_ID>(void)
{
uint32_t partitionId = 0;
otError error = OT_ERROR_NONE;
SuccessOrExit(error = mDecoder.ReadUint32(partitionId));
otThreadSetLocalLeaderPartitionId(mInstance, partitionId);
exit:
return error;
}
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_THREAD_CHILD_COUNT_MAX>(void)
{
return mEncoder.WriteUint8(otThreadGetMaxAllowedChildren(mInstance));