mirror of
https://github.com/espressif/openthread.git
synced 2026-09-12 04:00:10 +00:00
[api] change type from uint8_t* to otExtendedPanId (#2960)
This commit is contained in:
@@ -1506,7 +1506,7 @@ otLinkSetExtendedAddress(
|
||||
}
|
||||
|
||||
OTAPI
|
||||
const uint8_t *
|
||||
const otExtendedPanId *
|
||||
OTCALL
|
||||
otThreadGetExtendedPanId(
|
||||
_In_ otInstance *aInstance
|
||||
@@ -1515,12 +1515,13 @@ otThreadGetExtendedPanId(
|
||||
if (aInstance == nullptr) return nullptr;
|
||||
|
||||
otExtendedPanId *Result = (otExtendedPanId*)malloc(sizeof(otExtendedPanId));
|
||||
if (Result && QueryIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_PANID, Result) != ERROR_SUCCESS)
|
||||
if (Result == nullptr) return nullptr;
|
||||
if (QueryIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_PANID, Result) != ERROR_SUCCESS)
|
||||
{
|
||||
free(Result);
|
||||
Result = nullptr;
|
||||
}
|
||||
return (uint8_t*)Result;
|
||||
return Result;
|
||||
}
|
||||
|
||||
OTAPI
|
||||
@@ -1528,11 +1529,11 @@ otError
|
||||
OTCALL
|
||||
otThreadSetExtendedPanId(
|
||||
_In_ otInstance *aInstance,
|
||||
const uint8_t *aExtendedPanId
|
||||
const otExtendedPanId *aExtendedPanId
|
||||
)
|
||||
{
|
||||
if (aInstance == nullptr) return OT_ERROR_INVALID_ARGS;
|
||||
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_PANID, (const otExtendedPanId*)aExtendedPanId));
|
||||
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_EXTENDED_PANID, aExtendedPanId));
|
||||
}
|
||||
|
||||
OTAPI
|
||||
|
||||
@@ -1256,12 +1256,13 @@ otLwfIoCtl_otExtendedPanId(
|
||||
|
||||
if (InBufferLength >= sizeof(otExtendedPanId))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otThreadSetExtendedPanId(pFilter->otCtx, (uint8_t*)InBuffer));
|
||||
status = ThreadErrorToNtstatus(otThreadSetExtendedPanId(pFilter->otCtx, (otExtendedPanId*)InBuffer));
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(otExtendedPanId))
|
||||
{
|
||||
memcpy(OutBuffer, otThreadGetExtendedPanId(pFilter->otCtx), sizeof(otExtendedPanId));
|
||||
const otExtendedPanId* aExtendedPanId = otThreadGetExtendedPanId(pFilter->otCtx);
|
||||
memcpy(OutBuffer, aExtendedPanId, sizeof(otExtendedPanId));
|
||||
*OutBufferLength = sizeof(otExtendedPanId);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user