Cleanup MLE attach names. (#1816)

This commit is contained in:
Jonathan Hui
2017-05-24 08:41:38 -07:00
committed by GitHub
parent b89a9dfbc1
commit 344a78f39f
13 changed files with 59 additions and 68 deletions
+2 -8
View File
@@ -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
+3 -6
View File
@@ -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)
{