mirror of
https://github.com/espressif/openthread.git
synced 2026-09-18 23:20:08 +00:00
[cert] support partition id configuration for ncp device (#3955)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user