mirror of
https://github.com/espressif/openthread.git
synced 2026-09-13 04:30:08 +00:00
[api] change type from uint8_t * to otMeshLocalPrefix (#2966)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user