[api] change type from uint8_t * to otMeshLocalPrefix (#2966)

This commit is contained in:
Jonathan Hui
2018-08-17 08:59:37 -07:00
committed by GitHub
parent 37b5a9655c
commit c116441212
17 changed files with 71 additions and 65 deletions
+4 -4
View File
@@ -1671,7 +1671,7 @@ otThreadGetMeshLocalEid(
}
OTAPI
const uint8_t *
const otMeshLocalPrefix *
OTCALL
otThreadGetMeshLocalPrefix(
_In_ otInstance *aInstance
@@ -1685,7 +1685,7 @@ otThreadGetMeshLocalPrefix(
free(Result);
Result = nullptr;
}
return (uint8_t*)Result;
return Result;
}
OTAPI
@@ -1693,11 +1693,11 @@ otError
OTCALL
otThreadSetMeshLocalPrefix(
_In_ otInstance *aInstance,
const uint8_t *aMeshLocalPrefix
const otMeshLocalPrefix *aMeshLocalPrefix
)
{
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_MESH_LOCAL_PREFIX, (const otMeshLocalPrefix*)aMeshLocalPrefix));
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_MESH_LOCAL_PREFIX, aMeshLocalPrefix));
}
OTAPI
+3 -2
View File
@@ -1936,12 +1936,13 @@ otLwfIoCtl_otMeshLocalPrefix(
if (InBufferLength >= sizeof(otMeshLocalPrefix))
{
status = ThreadErrorToNtstatus(otThreadSetMeshLocalPrefix(pFilter->otCtx, InBuffer));
status = ThreadErrorToNtstatus(otThreadSetMeshLocalPrefix(pFilter->otCtx, (otMeshLocalPrefix*)InBuffer));
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(otMeshLocalPrefix))
{
memcpy(OutBuffer, otThreadGetMeshLocalPrefix(pFilter->otCtx), sizeof(otMeshLocalPrefix));
const otMeshLocalPrefix* aMeshLocalPrefix = otThreadGetMeshLocalPrefix(pFilter->otCtx);
memcpy(OutBuffer, aMeshLocalPrefix, sizeof(otMeshLocalPrefix));
*OutBufferLength = sizeof(otMeshLocalPrefix);
status = STATUS_SUCCESS;
}