mirror of
https://github.com/espressif/openthread.git
synced 2026-09-05 08:40:06 +00:00
Cleanup MLE attach names. (#1816)
This commit is contained in:
@@ -2795,17 +2795,11 @@ OTAPI
|
||||
otError
|
||||
OTCALL
|
||||
otThreadBecomeChild(
|
||||
_In_ otInstance *aInstance,
|
||||
otMleAttachFilter aFilter
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
||||
|
||||
uint8_t Role = kDeviceRoleDetached;
|
||||
uint8_t Filter = (uint8_t)aFilter;
|
||||
|
||||
PackedBuffer3<GUID,uint8_t,uint8_t> Buffer(aInstance->InterfaceGuid, Role, Filter);
|
||||
return DwordToThreadError(SendIOCTL(aInstance->ApiHandle, IOCTL_OTLWF_OT_DEVICE_ROLE, &Buffer, sizeof(Buffer), nullptr, 0));
|
||||
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_DEVICE_ROLE, (uint8_t)kDeviceRoleChild));
|
||||
}
|
||||
|
||||
OTAPI
|
||||
|
||||
@@ -3773,12 +3773,9 @@ otLwfIoCtl_otDeviceRole(
|
||||
}
|
||||
else if (role == kDeviceRoleChild)
|
||||
{
|
||||
if (InBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otThreadBecomeChild(pFilter->otCtx, *(uint8_t*)InBuffer)
|
||||
);
|
||||
}
|
||||
status = ThreadErrorToNtstatus(
|
||||
otThreadBecomeChild(pFilter->otCtx)
|
||||
);
|
||||
}
|
||||
else if (role == kDeviceRoleDetached)
|
||||
{
|
||||
|
||||
@@ -1406,7 +1406,7 @@ OTNODEAPI int32_t OTCALL otNodeSetState(otNode* aNode, const char *aState)
|
||||
}
|
||||
else if (strcmp(aState, "child") == 0)
|
||||
{
|
||||
error = otThreadBecomeChild(aNode->mInstance, kMleAttachAnyPartition);
|
||||
error = otThreadBecomeChild(aNode->mInstance);
|
||||
}
|
||||
else if (strcmp(aState, "router") == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user