mirror of
https://github.com/espressif/openthread.git
synced 2026-08-08 03:37:46 +00:00
Thread API cleanup.
This commit is contained in:
@@ -1215,23 +1215,13 @@ otIp6IsEnabled(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otThreadStart(
|
||||
_In_ otInstance *aInstance
|
||||
otThreadSetEnabled(
|
||||
_In_ otInstance *aInstance,
|
||||
bool aEnabled
|
||||
)
|
||||
{
|
||||
if (aInstance == nullptr) return kThreadError_InvalidArgs;
|
||||
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_THREAD, (BOOLEAN)TRUE));
|
||||
}
|
||||
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otThreadStop(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
if (aInstance == nullptr) return kThreadError_InvalidArgs;
|
||||
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_THREAD, (BOOLEAN)FALSE));
|
||||
return DwordToThreadError(SetIOCTL(aInstance, IOCTL_OTLWF_OT_THREAD, (BOOLEAN)aEnabled));
|
||||
}
|
||||
|
||||
OTAPI
|
||||
@@ -1261,7 +1251,7 @@ otThreadGetAutoStart(
|
||||
OTAPI
|
||||
bool
|
||||
OTCALL
|
||||
otIsSingleton(
|
||||
otThreadIsSingleton(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -1341,7 +1331,7 @@ otLinkIsEnergyScanInProgress(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otDiscover(
|
||||
otThreadDiscover(
|
||||
_In_ otInstance *aInstance,
|
||||
uint32_t aScanChannels,
|
||||
uint16_t aScanDuration,
|
||||
@@ -1438,7 +1428,7 @@ otDatasetGetDelayTimerMinimal(
|
||||
OTAPI
|
||||
uint8_t
|
||||
OTCALL
|
||||
otGetMaxAllowedChildren(
|
||||
otThreadGetMaxAllowedChildren(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -1450,7 +1440,7 @@ otGetMaxAllowedChildren(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otSetMaxAllowedChildren(
|
||||
otThreadSetMaxAllowedChildren(
|
||||
_In_ otInstance *aInstance,
|
||||
uint8_t aMaxChildren
|
||||
)
|
||||
@@ -1462,7 +1452,7 @@ otSetMaxAllowedChildren(
|
||||
OTAPI
|
||||
uint32_t
|
||||
OTCALL
|
||||
otGetChildTimeout(
|
||||
otThreadGetChildTimeout(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -1474,7 +1464,7 @@ otGetChildTimeout(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetChildTimeout(
|
||||
otThreadSetChildTimeout(
|
||||
_In_ otInstance *aInstance,
|
||||
uint32_t aTimeout
|
||||
)
|
||||
@@ -1517,7 +1507,7 @@ otLinkSetExtendedAddress(
|
||||
OTAPI
|
||||
const uint8_t *
|
||||
OTCALL
|
||||
otGetExtendedPanId(
|
||||
otThreadGetExtendedPanId(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -1535,7 +1525,7 @@ otGetExtendedPanId(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetExtendedPanId(
|
||||
otThreadSetExtendedPanId(
|
||||
_In_ otInstance *aInstance,
|
||||
const uint8_t *aExtendedPanId
|
||||
)
|
||||
@@ -1570,7 +1560,7 @@ otLinkGetJoinerId(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetLeaderRloc(
|
||||
otThreadGetLeaderRloc(
|
||||
_In_ otInstance *aInstance,
|
||||
_Out_ otIp6Address *aLeaderRloc
|
||||
)
|
||||
@@ -1582,7 +1572,7 @@ otGetLeaderRloc(
|
||||
OTAPI
|
||||
otLinkModeConfig
|
||||
OTCALL
|
||||
otGetLinkMode(
|
||||
otThreadGetLinkMode(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -1595,7 +1585,7 @@ otGetLinkMode(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otSetLinkMode(
|
||||
otThreadSetLinkMode(
|
||||
_In_ otInstance *aInstance,
|
||||
otLinkModeConfig aConfig
|
||||
)
|
||||
@@ -1608,7 +1598,7 @@ otSetLinkMode(
|
||||
OTAPI
|
||||
const uint8_t *
|
||||
OTCALL
|
||||
otGetMasterKey(
|
||||
otThreadGetMasterKey(
|
||||
_In_ otInstance *aInstance,
|
||||
_Out_ uint8_t *aKeyLength
|
||||
)
|
||||
@@ -1639,7 +1629,7 @@ otGetMasterKey(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otSetMasterKey(
|
||||
otThreadSetMasterKey(
|
||||
_In_ otInstance *aInstance,
|
||||
const uint8_t *aKey,
|
||||
uint8_t aKeyLength
|
||||
@@ -1681,7 +1671,7 @@ otLinkSetMaxTransmitPower(
|
||||
OTAPI
|
||||
const otIp6Address *
|
||||
OTCALL
|
||||
otGetMeshLocalEid(
|
||||
otThreadGetMeshLocalEid(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -1697,7 +1687,7 @@ otGetMeshLocalEid(
|
||||
OTAPI
|
||||
const uint8_t *
|
||||
OTCALL
|
||||
otGetMeshLocalPrefix(
|
||||
otThreadGetMeshLocalPrefix(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -1715,7 +1705,7 @@ otGetMeshLocalPrefix(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otSetMeshLocalPrefix(
|
||||
otThreadSetMeshLocalPrefix(
|
||||
_In_ otInstance *aInstance,
|
||||
const uint8_t *aMeshLocalPrefix
|
||||
)
|
||||
@@ -1727,7 +1717,7 @@ otSetMeshLocalPrefix(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetNetworkDataLeader(
|
||||
otThreadGetNetworkDataLeader(
|
||||
_In_ otInstance *aInstance,
|
||||
bool aStable,
|
||||
_Out_ uint8_t *aData,
|
||||
@@ -1745,7 +1735,7 @@ otGetNetworkDataLeader(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetNetworkDataLocal(
|
||||
otThreadGetNetworkDataLocal(
|
||||
_In_ otInstance *aInstance,
|
||||
bool aStable,
|
||||
_Out_ uint8_t *aData,
|
||||
@@ -1763,7 +1753,7 @@ otGetNetworkDataLocal(
|
||||
OTAPI
|
||||
const char *
|
||||
OTCALL
|
||||
otGetNetworkName(
|
||||
otThreadGetNetworkName(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -1781,7 +1771,7 @@ otGetNetworkName(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otSetNetworkName(
|
||||
otThreadSetNetworkName(
|
||||
_In_ otInstance *aInstance,
|
||||
_In_ const char *aNetworkName
|
||||
)
|
||||
@@ -1857,7 +1847,7 @@ otLinkSetPanId(
|
||||
OTAPI
|
||||
bool
|
||||
OTCALL
|
||||
otIsRouterRoleEnabled(
|
||||
otThreadIsRouterRoleEnabled(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -1869,7 +1859,7 @@ otIsRouterRoleEnabled(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetRouterRoleEnabled(
|
||||
otThreadSetRouterRoleEnabled(
|
||||
_In_ otInstance *aInstance,
|
||||
bool aEnabled
|
||||
)
|
||||
@@ -2375,7 +2365,7 @@ otLinkSetPollPeriod(
|
||||
OTAPI
|
||||
uint8_t
|
||||
OTCALL
|
||||
otGetLocalLeaderWeight(
|
||||
otThreadGetLocalLeaderWeight(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2387,7 +2377,7 @@ otGetLocalLeaderWeight(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetLocalLeaderWeight(
|
||||
otThreadSetLocalLeaderWeight(
|
||||
_In_ otInstance *aInstance,
|
||||
uint8_t aWeight
|
||||
)
|
||||
@@ -2398,7 +2388,7 @@ otSetLocalLeaderWeight(
|
||||
OTAPI
|
||||
uint32_t
|
||||
OTCALL
|
||||
otGetLocalLeaderPartitionId(
|
||||
otThreadGetLocalLeaderPartitionId(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2410,7 +2400,7 @@ otGetLocalLeaderPartitionId(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetLocalLeaderPartitionId(
|
||||
otThreadSetLocalLeaderPartitionId(
|
||||
_In_ otInstance *aInstance,
|
||||
uint32_t aPartitionId
|
||||
)
|
||||
@@ -2421,7 +2411,7 @@ otSetLocalLeaderPartitionId(
|
||||
OTAPI
|
||||
uint16_t
|
||||
OTCALL
|
||||
otGetJoinerUdpPort(
|
||||
otThreadGetJoinerUdpPort(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2433,7 +2423,7 @@ otGetJoinerUdpPort(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otSetJoinerUdpPort(
|
||||
otThreadSetJoinerUdpPort(
|
||||
_In_ otInstance *aInstance,
|
||||
uint16_t aJoinerUdpPort
|
||||
)
|
||||
@@ -2504,7 +2494,7 @@ otNetDataRegister(
|
||||
OTAPI
|
||||
uint32_t
|
||||
OTCALL
|
||||
otGetContextIdReuseDelay(
|
||||
otThreadGetContextIdReuseDelay(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2516,7 +2506,7 @@ otGetContextIdReuseDelay(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetContextIdReuseDelay(
|
||||
otThreadSetContextIdReuseDelay(
|
||||
_In_ otInstance *aInstance,
|
||||
uint32_t aDelay
|
||||
)
|
||||
@@ -2527,7 +2517,7 @@ otSetContextIdReuseDelay(
|
||||
OTAPI
|
||||
uint32_t
|
||||
OTCALL
|
||||
otGetKeySequenceCounter(
|
||||
otThreadGetKeySequenceCounter(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2539,7 +2529,7 @@ otGetKeySequenceCounter(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetKeySequenceCounter(
|
||||
otThreadSetKeySequenceCounter(
|
||||
_In_ otInstance *aInstance,
|
||||
uint32_t aKeySequenceCounter
|
||||
)
|
||||
@@ -2550,7 +2540,7 @@ otSetKeySequenceCounter(
|
||||
OTAPI
|
||||
uint32_t
|
||||
OTCALL
|
||||
otGetKeySwitchGuardTime(
|
||||
otThreadGetKeySwitchGuardTime(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2562,7 +2552,7 @@ otGetKeySwitchGuardTime(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetKeySwitchGuardTime(
|
||||
otThreadSetKeySwitchGuardTime(
|
||||
_In_ otInstance *aInstance,
|
||||
uint32_t aKeySwitchGuardTime
|
||||
)
|
||||
@@ -2573,7 +2563,7 @@ otSetKeySwitchGuardTime(
|
||||
OTAPI
|
||||
uint8_t
|
||||
OTCALL
|
||||
otGetNetworkIdTimeout(
|
||||
otThreadGetNetworkIdTimeout(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2585,7 +2575,7 @@ otGetNetworkIdTimeout(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetNetworkIdTimeout(
|
||||
otThreadSetNetworkIdTimeout(
|
||||
_In_ otInstance *aInstance,
|
||||
uint8_t aTimeout
|
||||
)
|
||||
@@ -2596,7 +2586,7 @@ otSetNetworkIdTimeout(
|
||||
OTAPI
|
||||
uint8_t
|
||||
OTCALL
|
||||
otGetRouterUpgradeThreshold(
|
||||
otThreadGetRouterUpgradeThreshold(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2608,7 +2598,7 @@ otGetRouterUpgradeThreshold(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetRouterUpgradeThreshold(
|
||||
otThreadSetRouterUpgradeThreshold(
|
||||
_In_ otInstance *aInstance,
|
||||
uint8_t aThreshold
|
||||
)
|
||||
@@ -2619,7 +2609,7 @@ otSetRouterUpgradeThreshold(
|
||||
OTAPI
|
||||
uint8_t
|
||||
OTCALL
|
||||
otGetRouterDowngradeThreshold(
|
||||
otThreadGetRouterDowngradeThreshold(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2631,7 +2621,7 @@ otGetRouterDowngradeThreshold(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetRouterDowngradeThreshold(
|
||||
otThreadSetRouterDowngradeThreshold(
|
||||
_In_ otInstance *aInstance,
|
||||
uint8_t aThreshold
|
||||
)
|
||||
@@ -2642,7 +2632,7 @@ otSetRouterDowngradeThreshold(
|
||||
OTAPI
|
||||
uint8_t
|
||||
OTCALL
|
||||
otGetRouterSelectionJitter(
|
||||
otThreadGetRouterSelectionJitter(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2654,7 +2644,7 @@ otGetRouterSelectionJitter(
|
||||
OTAPI
|
||||
void
|
||||
OTCALL
|
||||
otSetRouterSelectionJitter(
|
||||
otThreadSetRouterSelectionJitter(
|
||||
_In_ otInstance *aInstance,
|
||||
uint8_t aRouterJitter
|
||||
)
|
||||
@@ -2665,7 +2655,7 @@ otSetRouterSelectionJitter(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otReleaseRouterId(
|
||||
otThreadReleaseRouterId(
|
||||
_In_ otInstance *aInstance,
|
||||
uint8_t aRouterId
|
||||
)
|
||||
@@ -2761,7 +2751,7 @@ otLinkIsWhitelistEnabled(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otBecomeDetached(
|
||||
otThreadBecomeDetached(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2772,7 +2762,7 @@ otBecomeDetached(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otBecomeChild(
|
||||
otThreadBecomeChild(
|
||||
_In_ otInstance *aInstance,
|
||||
otMleAttachFilter aFilter
|
||||
)
|
||||
@@ -2789,7 +2779,7 @@ otBecomeChild(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otBecomeRouter(
|
||||
otThreadBecomeRouter(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2800,7 +2790,7 @@ otBecomeRouter(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otBecomeLeader(
|
||||
otThreadBecomeLeader(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2927,7 +2917,7 @@ otInstanceFactoryReset(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetChildInfoById(
|
||||
otThreadGetChildInfoById(
|
||||
_In_ otInstance *aInstance,
|
||||
uint16_t aChildId,
|
||||
_Out_ otChildInfo *aChildInfo
|
||||
@@ -2940,7 +2930,7 @@ otGetChildInfoById(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetChildInfoByIndex(
|
||||
otThreadGetChildInfoByIndex(
|
||||
_In_ otInstance *aInstance,
|
||||
uint8_t aChildIndex,
|
||||
_Out_ otChildInfo *aChildInfo
|
||||
@@ -2953,7 +2943,7 @@ otGetChildInfoByIndex(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetNextNeighborInfo(
|
||||
otThreadGetNextNeighborInfo(
|
||||
_In_ otInstance *aInstance,
|
||||
_Inout_ otNeighborInfoIterator *aIterator,
|
||||
_Out_ otNeighborInfo *aInfo
|
||||
@@ -2968,7 +2958,7 @@ otGetNextNeighborInfo(
|
||||
OTAPI
|
||||
otDeviceRole
|
||||
OTCALL
|
||||
otGetDeviceRole(
|
||||
otThreadGetDeviceRole(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -2980,7 +2970,7 @@ otGetDeviceRole(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetEidCacheEntry(
|
||||
otThreadGetEidCacheEntry(
|
||||
_In_ otInstance *aInstance,
|
||||
uint8_t aIndex,
|
||||
_Out_ otEidCacheEntry *aEntry
|
||||
@@ -2993,7 +2983,7 @@ otGetEidCacheEntry(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetLeaderData(
|
||||
otThreadGetLeaderData(
|
||||
_In_ otInstance *aInstance,
|
||||
_Out_ otLeaderData *aLeaderData
|
||||
)
|
||||
@@ -3005,7 +2995,7 @@ otGetLeaderData(
|
||||
OTAPI
|
||||
uint8_t
|
||||
OTCALL
|
||||
otGetLeaderRouterId(
|
||||
otThreadGetLeaderRouterId(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -3017,7 +3007,7 @@ otGetLeaderRouterId(
|
||||
OTAPI
|
||||
uint8_t
|
||||
OTCALL
|
||||
otGetLeaderWeight(
|
||||
otThreadGetLeaderWeight(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -3041,7 +3031,7 @@ otNetDataGetVersion(
|
||||
OTAPI
|
||||
uint32_t
|
||||
OTCALL
|
||||
otGetPartitionId(
|
||||
otThreadGetPartitionId(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -3053,7 +3043,7 @@ otGetPartitionId(
|
||||
OTAPI
|
||||
uint16_t
|
||||
OTCALL
|
||||
otGetRloc16(
|
||||
otThreadGetRloc16(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -3065,7 +3055,7 @@ otGetRloc16(
|
||||
OTAPI
|
||||
uint8_t
|
||||
OTCALL
|
||||
otGetRouterIdSequence(
|
||||
otThreadGetRouterIdSequence(
|
||||
_In_ otInstance *aInstance
|
||||
)
|
||||
{
|
||||
@@ -3077,7 +3067,7 @@ otGetRouterIdSequence(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetRouterInfo(
|
||||
otThreadGetRouterInfo(
|
||||
_In_ otInstance *aInstance,
|
||||
uint16_t aRouterId,
|
||||
_Out_ otRouterInfo *aRouterInfo
|
||||
@@ -3090,7 +3080,7 @@ otGetRouterInfo(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otGetParentInfo(
|
||||
otThreadGetParentInfo(
|
||||
_In_ otInstance *aInstance,
|
||||
_Out_ otRouterInfo *aParentInfo
|
||||
)
|
||||
@@ -3439,7 +3429,7 @@ otThreadErrorToString(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otSendDiagnosticGet(
|
||||
otThreadSendDiagnosticGet(
|
||||
_In_ otInstance *aInstance,
|
||||
const otIp6Address *aDestination,
|
||||
const uint8_t aTlvTypes[],
|
||||
@@ -3468,7 +3458,7 @@ otSendDiagnosticGet(
|
||||
OTAPI
|
||||
ThreadError
|
||||
OTCALL
|
||||
otSendDiagnosticReset(
|
||||
otThreadSendDiagnosticReset(
|
||||
_In_ otInstance *aInstance,
|
||||
const otIp6Address *aDestination,
|
||||
const uint8_t aTlvTypes[],
|
||||
|
||||
@@ -567,20 +567,12 @@ otLwfIoCtl_otThread(
|
||||
if (InBufferLength >= sizeof(BOOLEAN))
|
||||
{
|
||||
BOOLEAN IsEnabled = *(BOOLEAN*)InBuffer;
|
||||
if (IsEnabled)
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otThreadStart(pFilter->otCtx));
|
||||
}
|
||||
else
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otThreadStop(pFilter->otCtx));
|
||||
}
|
||||
|
||||
status = ThreadErrorToNtstatus(otThreadSetEnabled(pFilter->otCtx, IsEnabled));
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(BOOLEAN))
|
||||
{
|
||||
*(BOOLEAN*)OutBuffer = (otGetDeviceRole(pFilter->otCtx) > kDeviceRoleDisabled) ? TRUE : FALSE;
|
||||
*(BOOLEAN*)OutBuffer = (otThreadGetDeviceRole(pFilter->otCtx) > kDeviceRoleDisabled) ? TRUE : FALSE;
|
||||
*OutBufferLength = sizeof(BOOLEAN);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -917,7 +909,7 @@ otLwfIoCtl_otDiscover(
|
||||
uint16_t aScanDuration = *(uint16_t*)(InBuffer + sizeof(uint32_t));
|
||||
uint16_t aPanid = *(uint16_t*)(InBuffer + sizeof(uint32_t) + sizeof(uint16_t));
|
||||
status = ThreadErrorToNtstatus(
|
||||
otDiscover(
|
||||
otThreadDiscover(
|
||||
pFilter->otCtx,
|
||||
aScanChannels,
|
||||
aScanDuration,
|
||||
@@ -928,7 +920,7 @@ otLwfIoCtl_otDiscover(
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(BOOLEAN))
|
||||
{
|
||||
*(BOOLEAN*)OutBuffer = otIsDiscoverInProgress(pFilter->otCtx) ? TRUE : FALSE;
|
||||
*(BOOLEAN*)OutBuffer = otThreadIsDiscoverInProgress(pFilter->otCtx) ? TRUE : FALSE;
|
||||
*OutBufferLength = sizeof(BOOLEAN);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1054,13 +1046,13 @@ otLwfIoCtl_otChildTimeout(
|
||||
|
||||
if (InBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
otSetChildTimeout(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
otThreadSetChildTimeout(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
*(uint32_t*)OutBuffer = otGetChildTimeout(pFilter->otCtx);
|
||||
*(uint32_t*)OutBuffer = otThreadGetChildTimeout(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint32_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1253,13 +1245,13 @@ otLwfIoCtl_otExtendedPanId(
|
||||
|
||||
if (InBufferLength >= sizeof(otExtendedPanId))
|
||||
{
|
||||
otSetExtendedPanId(pFilter->otCtx, (uint8_t*)InBuffer);
|
||||
otThreadSetExtendedPanId(pFilter->otCtx, (uint8_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(otExtendedPanId))
|
||||
{
|
||||
memcpy(OutBuffer, otGetExtendedPanId(pFilter->otCtx), sizeof(otExtendedPanId));
|
||||
memcpy(OutBuffer, otThreadGetExtendedPanId(pFilter->otCtx), sizeof(otExtendedPanId));
|
||||
*OutBufferLength = sizeof(otExtendedPanId);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1422,7 +1414,7 @@ otLwfIoCtl_otLeaderRloc(
|
||||
|
||||
if (*OutBufferLength >= sizeof(otIp6Address))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otGetLeaderRloc(pFilter->otCtx, (otIp6Address*)OutBuffer));
|
||||
status = ThreadErrorToNtstatus(otThreadGetLeaderRloc(pFilter->otCtx, (otIp6Address*)OutBuffer));
|
||||
*OutBufferLength = sizeof(otIp6Address);
|
||||
}
|
||||
else
|
||||
@@ -1517,12 +1509,12 @@ otLwfIoCtl_otLinkMode(
|
||||
static_assert(sizeof(otLinkModeConfig) == 4, "The size of otLinkModeConfig should be 4 bytes");
|
||||
if (InBufferLength >= sizeof(otLinkModeConfig))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otSetLinkMode(pFilter->otCtx, *(otLinkModeConfig*)InBuffer));
|
||||
status = ThreadErrorToNtstatus(otThreadSetLinkMode(pFilter->otCtx, *(otLinkModeConfig*)InBuffer));
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(otLinkModeConfig))
|
||||
{
|
||||
*(otLinkModeConfig*)OutBuffer = otGetLinkMode(pFilter->otCtx);
|
||||
*(otLinkModeConfig*)OutBuffer = otThreadGetLinkMode(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(otLinkModeConfig);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1640,13 +1632,13 @@ otLwfIoCtl_otMasterKey(
|
||||
if (InBufferLength >= sizeof(otMasterKey) + sizeof(uint8_t))
|
||||
{
|
||||
uint8_t aKeyLength = *(uint8_t*)(InBuffer + sizeof(otMasterKey));
|
||||
status = ThreadErrorToNtstatus(otSetMasterKey(pFilter->otCtx, InBuffer, aKeyLength));
|
||||
status = ThreadErrorToNtstatus(otThreadSetMasterKey(pFilter->otCtx, InBuffer, aKeyLength));
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(otMasterKey) + sizeof(uint8_t))
|
||||
{
|
||||
uint8_t aKeyLength = 0;
|
||||
const uint8_t* aMasterKey = otGetMasterKey(pFilter->otCtx, &aKeyLength);
|
||||
const uint8_t* aMasterKey = otThreadGetMasterKey(pFilter->otCtx, &aKeyLength);
|
||||
memcpy(OutBuffer, aMasterKey, aKeyLength);
|
||||
memcpy((PUCHAR)OutBuffer + sizeof(otMasterKey), &aKeyLength, sizeof(uint8_t));
|
||||
*OutBufferLength = sizeof(otMasterKey) + sizeof(uint8_t);
|
||||
@@ -1752,7 +1744,7 @@ otLwfIoCtl_otMeshLocalEid(
|
||||
|
||||
if (*OutBufferLength >= sizeof(otIp6Address))
|
||||
{
|
||||
memcpy(OutBuffer, otGetMeshLocalEid(pFilter->otCtx), sizeof(otIp6Address));
|
||||
memcpy(OutBuffer, otThreadGetMeshLocalEid(pFilter->otCtx), sizeof(otIp6Address));
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
@@ -1836,12 +1828,12 @@ otLwfIoCtl_otMeshLocalPrefix(
|
||||
|
||||
if (InBufferLength >= sizeof(otMeshLocalPrefix))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otSetMeshLocalPrefix(pFilter->otCtx, InBuffer));
|
||||
status = ThreadErrorToNtstatus(otThreadSetMeshLocalPrefix(pFilter->otCtx, InBuffer));
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(otMeshLocalPrefix))
|
||||
{
|
||||
memcpy(OutBuffer, otGetMeshLocalPrefix(pFilter->otCtx), sizeof(otMeshLocalPrefix));
|
||||
memcpy(OutBuffer, otThreadGetMeshLocalPrefix(pFilter->otCtx), sizeof(otMeshLocalPrefix));
|
||||
*OutBufferLength = sizeof(otMeshLocalPrefix);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1942,12 +1934,12 @@ otLwfIoCtl_otNetworkName(
|
||||
|
||||
if (InBufferLength >= sizeof(otNetworkName))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otSetNetworkName(pFilter->otCtx, (char*)InBuffer));
|
||||
status = ThreadErrorToNtstatus(otThreadSetNetworkName(pFilter->otCtx, (char*)InBuffer));
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(otNetworkName))
|
||||
{
|
||||
strcpy_s((char*)OutBuffer, sizeof(otNetworkName), otGetNetworkName(pFilter->otCtx));
|
||||
strcpy_s((char*)OutBuffer, sizeof(otNetworkName), otThreadGetNetworkName(pFilter->otCtx));
|
||||
*OutBufferLength = sizeof(otNetworkName);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -2140,13 +2132,13 @@ otLwfIoCtl_otRouterRollEnabled(
|
||||
|
||||
if (InBufferLength >= sizeof(BOOLEAN))
|
||||
{
|
||||
otSetRouterRoleEnabled(pFilter->otCtx, *(BOOLEAN*)InBuffer);
|
||||
otThreadSetRouterRoleEnabled(pFilter->otCtx, *(BOOLEAN*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(BOOLEAN))
|
||||
{
|
||||
*(BOOLEAN*)OutBuffer = otIsRouterRoleEnabled(pFilter->otCtx) ? TRUE : FALSE;
|
||||
*(BOOLEAN*)OutBuffer = otThreadIsRouterRoleEnabled(pFilter->otCtx) ? TRUE : FALSE;
|
||||
*OutBufferLength = sizeof(BOOLEAN);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -2391,13 +2383,13 @@ otLwfIoCtl_otLocalLeaderWeight(
|
||||
|
||||
if (InBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
otSetLocalLeaderWeight(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
otThreadSetLocalLeaderWeight(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = otGetLeaderWeight(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = otThreadGetLeaderWeight(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -2793,13 +2785,13 @@ otLwfIoCtl_otContextIdReuseDelay(
|
||||
|
||||
if (InBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
otSetContextIdReuseDelay(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
otThreadSetContextIdReuseDelay(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
*(uint32_t*)OutBuffer = otGetContextIdReuseDelay(pFilter->otCtx);
|
||||
*(uint32_t*)OutBuffer = otThreadGetContextIdReuseDelay(pFilter->otCtx);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = sizeof(uint32_t);
|
||||
}
|
||||
@@ -2892,13 +2884,13 @@ otLwfIoCtl_otKeySequenceCounter(
|
||||
|
||||
if (InBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
otSetKeySequenceCounter(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
otThreadSetKeySequenceCounter(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
*(uint32_t*)OutBuffer = otGetKeySequenceCounter(pFilter->otCtx);
|
||||
*(uint32_t*)OutBuffer = otThreadGetKeySequenceCounter(pFilter->otCtx);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = sizeof(uint32_t);
|
||||
}
|
||||
@@ -2991,13 +2983,13 @@ otLwfIoCtl_otNetworkIdTimeout(
|
||||
|
||||
if (InBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
otSetNetworkIdTimeout(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
otThreadSetNetworkIdTimeout(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = otGetNetworkIdTimeout(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = otThreadGetNetworkIdTimeout(pFilter->otCtx);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
}
|
||||
@@ -3090,13 +3082,13 @@ otLwfIoCtl_otRouterUpgradeThreshold(
|
||||
|
||||
if (InBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
otSetRouterUpgradeThreshold(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
otThreadSetRouterUpgradeThreshold(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = otGetRouterUpgradeThreshold(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = otThreadGetRouterUpgradeThreshold(pFilter->otCtx);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
}
|
||||
@@ -3189,13 +3181,13 @@ otLwfIoCtl_otRouterDowngradeThreshold(
|
||||
|
||||
if (InBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
otSetRouterDowngradeThreshold(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
otThreadSetRouterDowngradeThreshold(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = otGetRouterDowngradeThreshold(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = otThreadGetRouterDowngradeThreshold(pFilter->otCtx);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
}
|
||||
@@ -3291,7 +3283,7 @@ otLwfIoCtl_otReleaseRouterId(
|
||||
|
||||
if (InBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otReleaseRouterId(pFilter->otCtx, *(uint8_t*)InBuffer));
|
||||
status = ThreadErrorToNtstatus(otThreadReleaseRouterId(pFilter->otCtx, *(uint8_t*)InBuffer));
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -3669,13 +3661,13 @@ otLwfIoCtl_otDeviceRole(
|
||||
if (role == kDeviceRoleLeader)
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otBecomeLeader(pFilter->otCtx)
|
||||
otThreadBecomeLeader(pFilter->otCtx)
|
||||
);
|
||||
}
|
||||
else if (role == kDeviceRoleRouter)
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otBecomeRouter(pFilter->otCtx)
|
||||
otThreadBecomeRouter(pFilter->otCtx)
|
||||
);
|
||||
}
|
||||
else if (role == kDeviceRoleChild)
|
||||
@@ -3683,21 +3675,21 @@ otLwfIoCtl_otDeviceRole(
|
||||
if (InBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otBecomeChild(pFilter->otCtx, *(uint8_t*)InBuffer)
|
||||
otThreadBecomeChild(pFilter->otCtx, *(uint8_t*)InBuffer)
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (role == kDeviceRoleDetached)
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otBecomeDetached(pFilter->otCtx)
|
||||
otThreadBecomeDetached(pFilter->otCtx)
|
||||
);
|
||||
}
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = (uint8_t)otGetDeviceRole(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = (uint8_t)otThreadGetDeviceRole(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -3826,7 +3818,7 @@ otLwfIoCtl_otChildInfoById(
|
||||
*OutBufferLength >= sizeof(otChildInfo))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otGetChildInfoById(
|
||||
otThreadGetChildInfoById(
|
||||
pFilter->otCtx,
|
||||
*(uint16_t*)InBuffer,
|
||||
(otChildInfo*)OutBuffer)
|
||||
@@ -3859,7 +3851,7 @@ otLwfIoCtl_otChildInfoByIndex(
|
||||
*OutBufferLength >= sizeof(otChildInfo))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otGetChildInfoByIndex(
|
||||
otThreadGetChildInfoByIndex(
|
||||
pFilter->otCtx,
|
||||
*(uint8_t*)InBuffer,
|
||||
(otChildInfo*)OutBuffer)
|
||||
@@ -3892,7 +3884,7 @@ otLwfIoCtl_otEidCacheEntry(
|
||||
*OutBufferLength >= sizeof(otEidCacheEntry))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otGetEidCacheEntry(
|
||||
otThreadGetEidCacheEntry(
|
||||
pFilter->otCtx,
|
||||
*(uint8_t*)InBuffer,
|
||||
(otEidCacheEntry*)OutBuffer)
|
||||
@@ -3926,7 +3918,7 @@ otLwfIoCtl_otLeaderData(
|
||||
|
||||
if (*OutBufferLength >= sizeof(otLeaderData))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otGetLeaderData(pFilter->otCtx, (otLeaderData*)OutBuffer));
|
||||
status = ThreadErrorToNtstatus(otThreadGetLeaderData(pFilter->otCtx, (otLeaderData*)OutBuffer));
|
||||
*OutBufferLength = sizeof(otLeaderData);
|
||||
}
|
||||
else
|
||||
@@ -3956,7 +3948,7 @@ otLwfIoCtl_otLeaderRouterId(
|
||||
|
||||
if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = otGetLeaderRouterId(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = otThreadGetLeaderRouterId(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -4042,7 +4034,7 @@ otLwfIoCtl_otLeaderWeight(
|
||||
|
||||
if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = otGetLeaderWeight(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = otThreadGetLeaderWeight(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -4214,7 +4206,7 @@ otLwfIoCtl_otPartitionId(
|
||||
|
||||
if (*OutBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
*(uint32_t*)OutBuffer = otGetPartitionId(pFilter->otCtx);
|
||||
*(uint32_t*)OutBuffer = otThreadGetPartitionId(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint32_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -4300,7 +4292,7 @@ otLwfIoCtl_otRloc16(
|
||||
|
||||
if (*OutBufferLength >= sizeof(uint16_t))
|
||||
{
|
||||
*(uint16_t*)OutBuffer = otGetRloc16(pFilter->otCtx);
|
||||
*(uint16_t*)OutBuffer = otThreadGetRloc16(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint16_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -4386,7 +4378,7 @@ otLwfIoCtl_otRouterIdSequence(
|
||||
|
||||
if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = otGetRouterIdSequence(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = otThreadGetRouterIdSequence(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -4416,7 +4408,7 @@ otLwfIoCtl_otRouterInfo(
|
||||
*OutBufferLength >= sizeof(otRouterInfo))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otGetRouterInfo(
|
||||
otThreadGetRouterInfo(
|
||||
pFilter->otCtx,
|
||||
*(uint16_t*)InBuffer,
|
||||
(otRouterInfo*)OutBuffer)
|
||||
@@ -4785,13 +4777,13 @@ otLwfIoCtl_otLocalLeaderPartitionId(
|
||||
|
||||
if (InBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
otSetLocalLeaderPartitionId(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
otThreadSetLocalLeaderPartitionId(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
*(uint32_t*)OutBuffer = otGetLocalLeaderPartitionId(pFilter->otCtx);
|
||||
*(uint32_t*)OutBuffer = otThreadGetLocalLeaderPartitionId(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint32_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -4943,7 +4935,7 @@ otLwfIoCtl_otParentInfo(
|
||||
static_assert(sizeof(otRouterInfo) == 20, "The size of otRouterInfo should be 20 bytes");
|
||||
if (*OutBufferLength >= sizeof(otRouterInfo))
|
||||
{
|
||||
status = ThreadErrorToNtstatus(otGetParentInfo(pFilter->otCtx, (otRouterInfo*)OutBuffer));
|
||||
status = ThreadErrorToNtstatus(otThreadGetParentInfo(pFilter->otCtx, (otRouterInfo*)OutBuffer));
|
||||
*OutBufferLength = sizeof(otRouterInfo);
|
||||
}
|
||||
else
|
||||
@@ -5030,7 +5022,7 @@ otLwfIoCtl_otSingleton(
|
||||
|
||||
if (*OutBufferLength >= sizeof(BOOLEAN))
|
||||
{
|
||||
*(BOOLEAN*)OutBuffer = otIsSingleton(pFilter->otCtx) ? TRUE : FALSE;
|
||||
*(BOOLEAN*)OutBuffer = otThreadIsSingleton(pFilter->otCtx) ? TRUE : FALSE;
|
||||
*OutBufferLength = sizeof(BOOLEAN);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -5089,13 +5081,13 @@ otLwfIoCtl_otMaxChildren(
|
||||
|
||||
if (InBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
otSetMaxAllowedChildren(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
otThreadSetMaxAllowedChildren(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = otGetMaxAllowedChildren(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = otThreadGetMaxAllowedChildren(pFilter->otCtx);
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
status = STATUS_SUCCESS;
|
||||
}
|
||||
@@ -5391,13 +5383,13 @@ otLwfIoCtl_otRouterSelectionJitter(
|
||||
|
||||
if (InBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
otSetRouterSelectionJitter(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
otThreadSetRouterSelectionJitter(pFilter->otCtx, *(uint8_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint8_t))
|
||||
{
|
||||
*(uint8_t*)OutBuffer = otGetRouterSelectionJitter(pFilter->otCtx);
|
||||
*(uint8_t*)OutBuffer = otThreadGetRouterSelectionJitter(pFilter->otCtx);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = sizeof(uint8_t);
|
||||
}
|
||||
@@ -5490,13 +5482,13 @@ otLwfIoCtl_otJoinerUdpPort(
|
||||
|
||||
if (InBufferLength >= sizeof(uint16_t))
|
||||
{
|
||||
otSetJoinerUdpPort(pFilter->otCtx, *(uint16_t*)InBuffer);
|
||||
otThreadSetJoinerUdpPort(pFilter->otCtx, *(uint16_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint16_t))
|
||||
{
|
||||
*(uint16_t*)OutBuffer = otGetJoinerUdpPort(pFilter->otCtx);
|
||||
*(uint16_t*)OutBuffer = otThreadGetJoinerUdpPort(pFilter->otCtx);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = sizeof(uint16_t);
|
||||
}
|
||||
@@ -5534,7 +5526,7 @@ otLwfIoCtl_otSendDiagnosticGet(
|
||||
if (InBufferLength >= sizeof(otIp6Address) + sizeof(uint8_t) + aCount)
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otSendDiagnosticGet(
|
||||
otThreadSendDiagnosticGet(
|
||||
pFilter->otCtx,
|
||||
aAddress,
|
||||
aTlvTypes,
|
||||
@@ -5572,7 +5564,7 @@ otLwfIoCtl_otSendDiagnosticReset(
|
||||
if (InBufferLength >= sizeof(otIp6Address) + sizeof(uint8_t) + aCount)
|
||||
{
|
||||
status = ThreadErrorToNtstatus(
|
||||
otSendDiagnosticReset(
|
||||
otThreadSendDiagnosticReset(
|
||||
pFilter->otCtx,
|
||||
aAddress,
|
||||
aTlvTypes,
|
||||
@@ -5972,13 +5964,13 @@ otLwfIoCtl_otKeySwitchGuardtime(
|
||||
|
||||
if (InBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
otSetKeySwitchGuardTime(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
otThreadSetKeySwitchGuardTime(pFilter->otCtx, *(uint32_t*)InBuffer);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = 0;
|
||||
}
|
||||
else if (*OutBufferLength >= sizeof(uint32_t))
|
||||
{
|
||||
*(uint32_t*)OutBuffer = otGetKeySwitchGuardTime(pFilter->otCtx);
|
||||
*(uint32_t*)OutBuffer = otThreadGetKeySwitchGuardTime(pFilter->otCtx);
|
||||
status = STATUS_SUCCESS;
|
||||
*OutBufferLength = sizeof(uint32_t);
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ otLwfProcessRoleStateChange(
|
||||
)
|
||||
{
|
||||
otDeviceRole prevRole = pFilter->otCachedRole;
|
||||
pFilter->otCachedRole = otGetDeviceRole(pFilter->otCtx);
|
||||
pFilter->otCachedRole = otThreadGetDeviceRole(pFilter->otCtx);
|
||||
if (prevRole == pFilter->otCachedRole) return;
|
||||
|
||||
LogInfo(DRIVER_DEFAULT, "Interface %!GUID! new role: %!otDeviceRole!", &pFilter->InterfaceGuid, pFilter->otCachedRole);
|
||||
|
||||
@@ -391,7 +391,7 @@ PingHandlerRecvCallback(
|
||||
if (memcmp(RecvDest, &LinkLocalAllRoutersAddress, sizeof(IN6_ADDR)) == 0 ||
|
||||
memcmp(RecvDest, &RealmLocalAllRoutersAddress, sizeof(IN6_ADDR)) == 0)
|
||||
{
|
||||
auto Role = otGetDeviceRole(aPingHandler->mParentNode->mInstance);
|
||||
auto Role = otThreadGetDeviceRole(aPingHandler->mParentNode->mInstance);
|
||||
if (Role != kDeviceRoleLeader && Role != kDeviceRoleRouter)
|
||||
shouldReply = false;
|
||||
}
|
||||
@@ -448,7 +448,7 @@ PingHandlerRecvCallback(
|
||||
|
||||
bool IsMeshLocalEID(otNode *aNode, const otIp6Address *aAddress)
|
||||
{
|
||||
auto ML_EID = otGetMeshLocalEid(aNode->mInstance);
|
||||
auto ML_EID = otThreadGetMeshLocalEid(aNode->mInstance);
|
||||
if (ML_EID == nullptr) return false;
|
||||
bool result = memcmp(ML_EID->mFields.m8, aAddress->mFields.m8, sizeof(otIp6Address)) == 0;
|
||||
otFreeMemory(ML_EID);
|
||||
@@ -710,7 +710,7 @@ void OTCALL otNodeStateChangedCallback(uint32_t aFlags, void *aContext)
|
||||
|
||||
if ((aFlags & OT_NET_ROLE) != 0)
|
||||
{
|
||||
auto Role = otGetDeviceRole(aNode->mInstance);
|
||||
auto Role = otThreadGetDeviceRole(aNode->mInstance);
|
||||
printf("%d: new role: %s\r\n", aNode->mId, otDeviceRoleToString(Role));
|
||||
}
|
||||
|
||||
@@ -944,7 +944,7 @@ OTNODEAPI int32_t OTCALL otNodeSetMode(otNode* aNode, const char *aMode)
|
||||
index++;
|
||||
}
|
||||
|
||||
auto result = otSetLinkMode(aNode->mInstance, linkMode);
|
||||
auto result = otThreadSetLinkMode(aNode->mInstance, linkMode);
|
||||
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
@@ -977,7 +977,7 @@ OTNODEAPI int32_t OTCALL otNodeThreadStart(otNode* aNode)
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: thread start\r\n", aNode->mId);
|
||||
|
||||
auto error = otThreadStart(aNode->mInstance);
|
||||
auto error = otThreadSetEnabled(aNode->mInstance, true);
|
||||
|
||||
otLogFuncExit();
|
||||
return error;
|
||||
@@ -988,7 +988,7 @@ OTNODEAPI int32_t OTCALL otNodeThreadStop(otNode* aNode)
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: thread stop\r\n", aNode->mId);
|
||||
|
||||
(void)otThreadStop(aNode->mInstance);
|
||||
(void)otThreadSetEnabled(aNode->mInstance, false);
|
||||
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
@@ -1134,7 +1134,7 @@ OTNODEAPI int32_t OTCALL otNodeRemoveWhitelist(otNode* aNode, const char *aExtAd
|
||||
OTNODEAPI uint16_t OTCALL otNodeGetAddr16(otNode* aNode)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
auto result = otGetRloc16(aNode->mInstance);
|
||||
auto result = otThreadGetRloc16(aNode->mInstance);
|
||||
printf("%d: rloc16\r\n%04x\r\n", aNode->mId, result);
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
@@ -1205,7 +1205,7 @@ OTNODEAPI int32_t OTCALL otNodeSetMasterkey(otNode* aNode, const char *aMasterke
|
||||
return kThreadError_Parse;
|
||||
}
|
||||
|
||||
auto error = otSetMasterKey(aNode->mInstance, key, (uint8_t)keyLength);
|
||||
auto error = otThreadSetMasterKey(aNode->mInstance, key, (uint8_t)keyLength);
|
||||
otLogFuncExit();
|
||||
return error;
|
||||
}
|
||||
@@ -1214,7 +1214,7 @@ OTNODEAPI const char* OTCALL otNodeGetMasterkey(otNode* aNode)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
uint8_t aKeyLength = 0;
|
||||
auto aMasterKey = otGetMasterKey(aNode->mInstance, &aKeyLength);
|
||||
auto aMasterKey = otThreadGetMasterKey(aNode->mInstance, &aKeyLength);
|
||||
uint8_t strLength = 2*aKeyLength + 1;
|
||||
char* str = (char*)malloc(strLength);
|
||||
if (str != nullptr)
|
||||
@@ -1232,7 +1232,7 @@ OTNODEAPI const char* OTCALL otNodeGetMasterkey(otNode* aNode)
|
||||
OTNODEAPI uint32_t OTCALL otNodeGetKeySequenceCounter(otNode* aNode)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
auto result = otGetKeySequenceCounter(aNode->mInstance);
|
||||
auto result = otThreadGetKeySequenceCounter(aNode->mInstance);
|
||||
printf("%d: keysequence\r\n%d\r\n", aNode->mId, result);
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
@@ -1242,7 +1242,7 @@ OTNODEAPI int32_t OTCALL otNodeSetKeySequenceCounter(otNode* aNode, uint32_t aSe
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: keysequence counter %d\r\n", aNode->mId, aSequence);
|
||||
otSetKeySequenceCounter(aNode->mInstance, aSequence);
|
||||
otThreadSetKeySequenceCounter(aNode->mInstance, aSequence);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1251,7 +1251,7 @@ OTNODEAPI int32_t OTCALL otNodeSetKeySwitchGuardTime(otNode* aNode, uint32_t aKe
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: keysequence guardtime %d\r\n", aNode->mId, aKeySwitchGuardTime);
|
||||
otSetKeySwitchGuardTime(aNode->mInstance, aKeySwitchGuardTime);
|
||||
otThreadSetKeySwitchGuardTime(aNode->mInstance, aKeySwitchGuardTime);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1260,7 +1260,7 @@ OTNODEAPI int32_t OTCALL otNodeSetNetworkIdTimeout(otNode* aNode, uint8_t aTimeo
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: networkidtimeout %d\r\n", aNode->mId, aTimeout);
|
||||
otSetNetworkIdTimeout(aNode->mInstance, aTimeout);
|
||||
otThreadSetNetworkIdTimeout(aNode->mInstance, aTimeout);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1269,7 +1269,7 @@ OTNODEAPI int32_t OTCALL otNodeSetNetworkName(otNode* aNode, const char *aName)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: networkname %s\r\n", aNode->mId, aName);
|
||||
auto result = otSetNetworkName(aNode->mInstance, aName);
|
||||
auto result = otThreadSetNetworkName(aNode->mInstance, aName);
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
}
|
||||
@@ -1277,7 +1277,7 @@ OTNODEAPI int32_t OTCALL otNodeSetNetworkName(otNode* aNode, const char *aName)
|
||||
OTNODEAPI const char* OTCALL otNodeGetNetworkName(otNode* aNode)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
auto result = otGetNetworkName(aNode->mInstance);
|
||||
auto result = otThreadGetNetworkName(aNode->mInstance);
|
||||
aNode->mMemoryToFree.push_back((char*)result);
|
||||
printf("%d: networkname\r\n%s\r\n", aNode->mId, result);
|
||||
otLogFuncExit();
|
||||
@@ -1305,7 +1305,7 @@ OTNODEAPI int32_t OTCALL otNodeSetPanId(otNode* aNode, uint16_t aPanId)
|
||||
OTNODEAPI uint32_t OTCALL otNodeGetPartitionId(otNode* aNode)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
auto result = otGetLocalLeaderPartitionId(aNode->mInstance);
|
||||
auto result = otThreadGetLocalLeaderPartitionId(aNode->mInstance);
|
||||
printf("%d: leaderpartitionid\r\n0x%04x\r\n", aNode->mId, result);
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
@@ -1315,7 +1315,7 @@ OTNODEAPI int32_t OTCALL otNodeSetPartitionId(otNode* aNode, uint32_t aPartition
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: leaderpartitionid 0x%04x\r\n", aNode->mId, aPartitionId);
|
||||
otSetLocalLeaderPartitionId(aNode->mInstance, aPartitionId);
|
||||
otThreadSetLocalLeaderPartitionId(aNode->mInstance, aPartitionId);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1324,7 +1324,7 @@ OTNODEAPI int32_t OTCALL otNodeSetRouterUpgradeThreshold(otNode* aNode, uint8_t
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: routerupgradethreshold %d\r\n", aNode->mId, aThreshold);
|
||||
otSetRouterUpgradeThreshold(aNode->mInstance, aThreshold);
|
||||
otThreadSetRouterUpgradeThreshold(aNode->mInstance, aThreshold);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1333,7 +1333,7 @@ OTNODEAPI int32_t OTCALL otNodeSetRouterDowngradeThreshold(otNode* aNode, uint8_
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: routerdowngradethreshold %d\r\n", aNode->mId, aThreshold);
|
||||
otSetRouterDowngradeThreshold(aNode->mInstance, aThreshold);
|
||||
otThreadSetRouterDowngradeThreshold(aNode->mInstance, aThreshold);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1342,7 +1342,7 @@ OTNODEAPI int32_t OTCALL otNodeReleaseRouterId(otNode* aNode, uint8_t aRouterId)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: releaserouterid %d\r\n", aNode->mId, aRouterId);
|
||||
auto result = otReleaseRouterId(aNode->mInstance, aRouterId);
|
||||
auto result = otThreadReleaseRouterId(aNode->mInstance, aRouterId);
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
}
|
||||
@@ -1350,7 +1350,7 @@ OTNODEAPI int32_t OTCALL otNodeReleaseRouterId(otNode* aNode, uint8_t aRouterId)
|
||||
OTNODEAPI const char* OTCALL otNodeGetState(otNode* aNode)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
auto role = otGetDeviceRole(aNode->mInstance);
|
||||
auto role = otThreadGetDeviceRole(aNode->mInstance);
|
||||
auto result = _strdup(otDeviceRoleToString(role));
|
||||
aNode->mMemoryToFree.push_back(result);
|
||||
printf("%d: state\r\n%s\r\n", aNode->mId, result);
|
||||
@@ -1366,19 +1366,19 @@ OTNODEAPI int32_t OTCALL otNodeSetState(otNode* aNode, const char *aState)
|
||||
ThreadError error;
|
||||
if (strcmp(aState, "detached") == 0)
|
||||
{
|
||||
error = otBecomeDetached(aNode->mInstance);
|
||||
error = otThreadBecomeDetached(aNode->mInstance);
|
||||
}
|
||||
else if (strcmp(aState, "child") == 0)
|
||||
{
|
||||
error = otBecomeChild(aNode->mInstance, kMleAttachAnyPartition);
|
||||
error = otThreadBecomeChild(aNode->mInstance, kMleAttachAnyPartition);
|
||||
}
|
||||
else if (strcmp(aState, "router") == 0)
|
||||
{
|
||||
error = otBecomeRouter(aNode->mInstance);
|
||||
error = otThreadBecomeRouter(aNode->mInstance);
|
||||
}
|
||||
else if (strcmp(aState, "leader") == 0)
|
||||
{
|
||||
error = otBecomeLeader(aNode->mInstance);
|
||||
error = otThreadBecomeLeader(aNode->mInstance);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1391,7 +1391,7 @@ OTNODEAPI int32_t OTCALL otNodeSetState(otNode* aNode, const char *aState)
|
||||
OTNODEAPI uint32_t OTCALL otNodeGetTimeout(otNode* aNode)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
auto result = otGetChildTimeout(aNode->mInstance);
|
||||
auto result = otThreadGetChildTimeout(aNode->mInstance);
|
||||
printf("%d: childtimeout\r\n%d\r\n", aNode->mId, result);
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
@@ -1401,7 +1401,7 @@ OTNODEAPI int32_t OTCALL otNodeSetTimeout(otNode* aNode, uint32_t aTimeout)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: childtimeout %d\r\n", aNode->mId, aTimeout);
|
||||
otSetChildTimeout(aNode->mInstance, aTimeout);
|
||||
otThreadSetChildTimeout(aNode->mInstance, aTimeout);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1409,7 +1409,7 @@ OTNODEAPI int32_t OTCALL otNodeSetTimeout(otNode* aNode, uint32_t aTimeout)
|
||||
OTNODEAPI uint8_t OTCALL otNodeGetWeight(otNode* aNode)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
auto result = otGetLeaderWeight(aNode->mInstance);
|
||||
auto result = otThreadGetLeaderWeight(aNode->mInstance);
|
||||
printf("%d: leaderweight\r\n%d\r\n", aNode->mId, result);
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
@@ -1419,7 +1419,7 @@ OTNODEAPI int32_t OTCALL otNodeSetWeight(otNode* aNode, uint8_t aWeight)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: leaderweight %d\r\n", aNode->mId, aWeight);
|
||||
otSetLocalLeaderWeight(aNode->mInstance, aWeight);
|
||||
otThreadSetLocalLeaderWeight(aNode->mInstance, aWeight);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1500,7 +1500,7 @@ OTNODEAPI const char* OTCALL otNodeGetAddrs(otNode* aNode)
|
||||
OTNODEAPI uint32_t OTCALL otNodeGetContextReuseDelay(otNode* aNode)
|
||||
{
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
auto result = otGetContextIdReuseDelay(aNode->mInstance);
|
||||
auto result = otThreadGetContextIdReuseDelay(aNode->mInstance);
|
||||
printf("%d: contextreusedelay\r\n%d\r\n", aNode->mId, result);
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
@@ -1510,7 +1510,7 @@ OTNODEAPI int32_t OTCALL otNodeSetContextReuseDelay(otNode* aNode, uint32_t aDel
|
||||
{
|
||||
otLogFuncEntryMsg("[%d] %d", aNode->mId, aDelay);
|
||||
printf("%d: contextreusedelay %d\r\n", aNode->mId, aDelay);
|
||||
otSetContextIdReuseDelay(aNode->mInstance, aDelay);
|
||||
otThreadSetContextIdReuseDelay(aNode->mInstance, aDelay);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1741,7 +1741,7 @@ OTNODEAPI uint32_t OTCALL otNodePing(otNode* aNode, const char *aAddr, uint16_t
|
||||
}
|
||||
|
||||
// Get ML-EID as source address for ping
|
||||
auto otSourceAddress = otGetMeshLocalEid(aNode->mInstance);
|
||||
auto otSourceAddress = otThreadGetMeshLocalEid(aNode->mInstance);
|
||||
|
||||
sockaddr_in6 SourceAddress = { AF_INET6, (USHORT)(CertificationPingPort + 1) };
|
||||
sockaddr_in6 DestinationAddress = { AF_INET6, CertificationPingPort };
|
||||
@@ -1891,7 +1891,7 @@ OTNODEAPI int32_t OTCALL otNodeSetRouterSelectionJitter(otNode* aNode, uint8_t a
|
||||
{
|
||||
otLogFuncEntryMsg("[%d] %d", aNode->mId, aRouterJitter);
|
||||
printf("%d: routerselectionjitter %d\r\n", aNode->mId, aRouterJitter);
|
||||
otSetRouterSelectionJitter(aNode->mInstance, aRouterJitter);
|
||||
otThreadSetRouterSelectionJitter(aNode->mInstance, aRouterJitter);
|
||||
otLogFuncExit();
|
||||
return 0;
|
||||
}
|
||||
@@ -2147,7 +2147,7 @@ OTNODEAPI int32_t OTCALL otNodeSetMaxChildren(otNode* aNode, uint8_t aMaxChildre
|
||||
{
|
||||
otLogFuncEntryMsg("[%d] %d", aNode->mId, aMaxChildren);
|
||||
printf("%d: childmax %d\r\n", aNode->mId, aMaxChildren);
|
||||
auto result = otSetMaxAllowedChildren(aNode->mInstance, aMaxChildren);
|
||||
auto result = otThreadSetMaxAllowedChildren(aNode->mInstance, aMaxChildren);
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user