Link API cleanup.

This commit is contained in:
Jonathan Hui
2017-03-02 10:24:55 -08:00
parent 98da7f3166
commit 0746a44a7c
25 changed files with 1127 additions and 1116 deletions
+39 -57
View File
@@ -1273,7 +1273,7 @@ otIsSingleton(
OTAPI
ThreadError
OTCALL
otActiveScan(
otLinkActiveScan(
_In_ otInstance *aInstance,
uint32_t aScanChannels,
uint16_t aScanDuration,
@@ -1295,7 +1295,7 @@ otActiveScan(
OTAPI
bool
OTCALL
otIsActiveScanInProgress(
otLinkIsActiveScanInProgress(
_In_ otInstance *aInstance
)
{
@@ -1307,7 +1307,7 @@ otIsActiveScanInProgress(
OTAPI
ThreadError
OTCALL
otEnergyScan(
otLinkEnergyScan(
_In_ otInstance *aInstance,
uint32_t aScanChannels,
uint16_t aScanDuration,
@@ -1329,7 +1329,7 @@ otEnergyScan(
OTAPI
bool
OTCALL
otIsEnergyScanInProgress(
otLinkIsEnergyScanInProgress(
_In_ otInstance *aInstance
)
{
@@ -1388,7 +1388,7 @@ otSendMacDataRequest(
OTAPI
uint8_t
OTCALL
otGetChannel(
otLinkGetChannel(
_In_ otInstance *aInstance
)
{
@@ -1400,7 +1400,7 @@ otGetChannel(
OTAPI
ThreadError
OTCALL
otSetChannel(
otLinkSetChannel(
_In_ otInstance *aInstance,
uint8_t aChannel
)
@@ -1487,7 +1487,7 @@ OTAPI
const
uint8_t *
OTCALL
otGetExtendedAddress(
otLinkGetExtendedAddress(
_In_ otInstance *aInstance
)
{
@@ -1505,7 +1505,7 @@ otGetExtendedAddress(
OTAPI
ThreadError
OTCALL
otSetExtendedAddress(
otLinkSetExtendedAddress(
_In_ otInstance *aInstance,
const otExtAddress *aExtendedAddress
)
@@ -1546,7 +1546,7 @@ otSetExtendedPanId(
OTAPI
void
OTCALL
otGetFactoryAssignedIeeeEui64(
otLinkGetFactoryAssignedIeeeEui64(
_In_ otInstance *aInstance,
_Out_ otExtAddress *aEui64
)
@@ -1558,7 +1558,7 @@ otGetFactoryAssignedIeeeEui64(
OTAPI
void
OTCALL
otGetHashMacAddress(
otLinkGetJoinerId(
_In_ otInstance *aInstance,
_Out_ otExtAddress *aHashMacAddress
)
@@ -1658,7 +1658,7 @@ otSetMasterKey(
OTAPI
int8_t
OTCALL
otGetMaxTransmitPower(
otLinkGetMaxTransmitPower(
_In_ otInstance *aInstance
)
{
@@ -1670,7 +1670,7 @@ otGetMaxTransmitPower(
OTAPI
void
OTCALL
otSetMaxTransmitPower(
otLinkSetMaxTransmitPower(
_In_ otInstance *aInstance,
int8_t aPower
)
@@ -1833,7 +1833,7 @@ otGetNextOnMeshPrefix(
OTAPI
otPanId
OTCALL
otGetPanId(
otLinkGetPanId(
_In_ otInstance *aInstance
)
{
@@ -1845,7 +1845,7 @@ otGetPanId(
OTAPI
ThreadError
OTCALL
otSetPanId(
otLinkSetPanId(
_In_ otInstance *aInstance,
otPanId aPanId
)
@@ -1880,7 +1880,7 @@ otSetRouterRoleEnabled(
OTAPI
otShortAddress
OTCALL
otGetShortAddress(
otLinkGetShortAddress(
_In_ otInstance *aInstance
)
{
@@ -2352,7 +2352,7 @@ otSendPendingSet(
OTAPI
uint32_t
OTCALL
otGetPollPeriod(
otLinkGetPollPeriod(
_In_ otInstance *aInstance
)
{
@@ -2364,7 +2364,7 @@ otGetPollPeriod(
OTAPI
void
OTCALL
otSetPollPeriod(
otLinkSetPollPeriod(
_In_ otInstance *aInstance,
uint32_t aPollPeriod
)
@@ -2677,7 +2677,7 @@ otReleaseRouterId(
OTAPI
ThreadError
OTCALL
otAddMacWhitelist(
otLinkAddWhitelist(
_In_ otInstance *aInstance,
const uint8_t *aExtAddr
)
@@ -2689,7 +2689,7 @@ otAddMacWhitelist(
OTAPI
ThreadError
OTCALL
otAddMacWhitelistRssi(
otLinkAddWhitelistRssi(
_In_ otInstance *aInstance,
const uint8_t *aExtAddr,
int8_t aRssi
@@ -2704,7 +2704,7 @@ otAddMacWhitelistRssi(
OTAPI
void
OTCALL
otRemoveMacWhitelist(
otLinkRemoveWhitelist(
_In_ otInstance *aInstance,
const uint8_t *aExtAddr
)
@@ -2715,7 +2715,7 @@ otRemoveMacWhitelist(
OTAPI
ThreadError
OTCALL
otGetMacWhitelistEntry(
otLinkGetWhitelistEntry(
_In_ otInstance *aInstance,
uint8_t aIndex,
_Out_ otMacWhitelistEntry *aEntry
@@ -2728,7 +2728,7 @@ otGetMacWhitelistEntry(
OTAPI
void
OTCALL
otClearMacWhitelist(
otLinkClearWhitelist(
_In_ otInstance *aInstance
)
{
@@ -2738,27 +2738,18 @@ otClearMacWhitelist(
OTAPI
void
OTCALL
otDisableMacWhitelist(
_In_ otInstance *aInstance
otLinkSetWhitelistEnabled(
_In_ otInstance *aInstance,
bool aEnabled
)
{
if (aInstance) (void)SetIOCTL(aInstance, IOCTL_OTLWF_OT_MAC_WHITELIST_ENABLED, (BOOLEAN)FALSE);
}
OTAPI
void
OTCALL
otEnableMacWhitelist(
_In_ otInstance *aInstance
)
{
if (aInstance) (void)SetIOCTL(aInstance, IOCTL_OTLWF_OT_MAC_WHITELIST_ENABLED, (BOOLEAN)TRUE);
if (aInstance) (void)SetIOCTL(aInstance, IOCTL_OTLWF_OT_MAC_WHITELIST_ENABLED, (BOOLEAN)aEnabled);
}
OTAPI
bool
OTCALL
otIsMacWhitelistEnabled(
otLinkIsWhitelistEnabled(
_In_ otInstance *aInstance
)
{
@@ -2820,7 +2811,7 @@ otBecomeLeader(
OTAPI
ThreadError
OTCALL
otAddMacBlacklist(
otLinkAddBlacklist(
_In_ otInstance *aInstance,
const uint8_t *aExtAddr
)
@@ -2832,7 +2823,7 @@ otAddMacBlacklist(
OTAPI
void
OTCALL
otRemoveMacBlacklist(
otLinkRemoveBlacklist(
_In_ otInstance *aInstance,
const uint8_t *aExtAddr
)
@@ -2843,7 +2834,7 @@ otRemoveMacBlacklist(
OTAPI
ThreadError
OTCALL
otGetMacBlacklistEntry(
otLinkGetBlacklistEntry(
_In_ otInstance *aInstance,
uint8_t aIndex,
_Out_ otMacBlacklistEntry *aEntry
@@ -2856,7 +2847,7 @@ otGetMacBlacklistEntry(
OTAPI
void
OTCALL
otClearMacBlacklist(
otLinkClearBlacklist(
_In_ otInstance *aInstance
)
{
@@ -2866,27 +2857,18 @@ otClearMacBlacklist(
OTAPI
void
OTCALL
otDisableMacBlacklist(
_In_ otInstance *aInstance
otLinkSetBlacklistEnabled(
_In_ otInstance *aInstance,
bool aEnabled
)
{
if (aInstance) (void)SetIOCTL(aInstance, IOCTL_OTLWF_OT_MAC_BLACKLIST_ENABLED, (BOOLEAN)FALSE);
}
OTAPI
void
OTCALL
otEnableMacBlacklist(
_In_ otInstance *aInstance
)
{
if (aInstance) (void)SetIOCTL(aInstance, IOCTL_OTLWF_OT_MAC_BLACKLIST_ENABLED, (BOOLEAN)TRUE);
if (aInstance) (void)SetIOCTL(aInstance, IOCTL_OTLWF_OT_MAC_BLACKLIST_ENABLED, (BOOLEAN)aEnabled);
}
OTAPI
bool
OTCALL
otIsMacBlacklistEnabled(
otLinkIsBlacklistEnabled(
_In_ otInstance *aInstance
)
{
@@ -2898,7 +2880,7 @@ otIsMacBlacklistEnabled(
OTAPI
ThreadError
OTCALL
otGetAssignLinkQuality(
otLinkGetAssignLinkQuality(
_In_ otInstance *aInstance,
const uint8_t *aExtAddr,
_Out_ uint8_t *aLinkQuality
@@ -2911,7 +2893,7 @@ otGetAssignLinkQuality(
OTAPI
void
OTCALL
otSetAssignLinkQuality(
otLinkSetAssignLinkQuality(
_In_ otInstance *aInstance,
const uint8_t *aExtAddr,
uint8_t aLinkQuality
@@ -3133,7 +3115,7 @@ otGetStableNetworkDataVersion(
OTAPI
const otMacCounters*
OTCALL
otGetMacCounters(
otLinkGetCounters(
_In_ otInstance *aInstance
)
{
+37 -51
View File
@@ -134,8 +134,8 @@ OTLWF_IOCTL_HANDLER IoCtls[] =
{ "IOCTL_OTLWF_OT_SEND_ACTIVE_SET", REF_IOCTL_FUNC(otSendActiveSet) },
{ "IOCTL_OTLWF_OT_SEND_PENDING_GET", REF_IOCTL_FUNC(otSendPendingGet) },
{ "IOCTL_OTLWF_OT_SEND_PENDING_SET", REF_IOCTL_FUNC(otSendPendingSet) },
{ "IOCTL_OTLWF_OT_SEND_MGMT_COMMISSIONER_GET", REF_IOCTL_FUNC(otCommissionerSendMgmtGet) },
{ "IOCTL_OTLWF_OT_SEND_MGMT_COMMISSIONER_SET", REF_IOCTL_FUNC(otCommissionerSendMgmtSet) },
{ "IOCTL_OTLWF_OT_SEND_MGMT_COMMISSIONER_GET", REF_IOCTL_FUNC(otSendMgmtCommissionerGet) },
{ "IOCTL_OTLWF_OT_SEND_MGMT_COMMISSIONER_SET", REF_IOCTL_FUNC(otSendMgmtCommissionerSet) },
{ "IOCTL_OTLWF_OT_KEY_SWITCH_GUARDTIME", REF_IOCTL_FUNC_WITH_TUN(otKeySwitchGuardtime) },
{ "IOCTL_OTLWF_OT_FACTORY_RESET", REF_IOCTL_FUNC(otFactoryReset) },
{ "IOCTL_OTLWF_OT_THREAD_AUTO_START", REF_IOCTL_FUNC(otThreadAutoStart) }
@@ -676,7 +676,7 @@ otLwfIoCtl_otActiveScan(
uint32_t aScanChannels = *(uint32_t*)InBuffer;
uint16_t aScanDuration = *(uint16_t*)(InBuffer + sizeof(uint32_t));
status = ThreadErrorToNtstatus(
otActiveScan(
otLinkActiveScan(
pFilter->otCtx,
aScanChannels,
aScanDuration,
@@ -687,7 +687,7 @@ otLwfIoCtl_otActiveScan(
}
else if (*OutBufferLength >= sizeof(BOOLEAN))
{
*(BOOLEAN*)OutBuffer = otIsActiveScanInProgress(pFilter->otCtx) ? TRUE : FALSE;
*(BOOLEAN*)OutBuffer = otLinkIsActiveScanInProgress(pFilter->otCtx) ? TRUE : FALSE;
*OutBufferLength = sizeof(BOOLEAN);
status = STATUS_SUCCESS;
}
@@ -796,7 +796,7 @@ otLwfIoCtl_otEnergyScan(
uint32_t aScanChannels = *(uint32_t*)InBuffer;
uint16_t aScanDuration = *(uint16_t*)(InBuffer + sizeof(uint32_t));
status = ThreadErrorToNtstatus(
otEnergyScan(
otLinkEnergyScan(
pFilter->otCtx,
aScanChannels,
aScanDuration,
@@ -807,7 +807,7 @@ otLwfIoCtl_otEnergyScan(
}
else if (*OutBufferLength >= sizeof(BOOLEAN))
{
*(BOOLEAN*)OutBuffer = otIsEnergyScanInProgress(pFilter->otCtx) ? TRUE : FALSE;
*(BOOLEAN*)OutBuffer = otLinkIsEnergyScanInProgress(pFilter->otCtx) ? TRUE : FALSE;
*OutBufferLength = sizeof(BOOLEAN);
status = STATUS_SUCCESS;
}
@@ -956,12 +956,12 @@ otLwfIoCtl_otChannel(
if (InBufferLength >= sizeof(uint8_t))
{
status = ThreadErrorToNtstatus(otSetChannel(pFilter->otCtx, *(uint8_t*)InBuffer));
status = ThreadErrorToNtstatus(otLinkSetChannel(pFilter->otCtx, *(uint8_t*)InBuffer));
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(uint8_t))
{
*(uint8_t*)OutBuffer = otGetChannel(pFilter->otCtx);
*(uint8_t*)OutBuffer = otLinkGetChannel(pFilter->otCtx);
*OutBufferLength = sizeof(uint8_t);
status = STATUS_SUCCESS;
}
@@ -1153,12 +1153,12 @@ otLwfIoCtl_otExtendedAddress(
if (InBufferLength >= sizeof(otExtAddress))
{
status = ThreadErrorToNtstatus(otSetExtendedAddress(pFilter->otCtx, (otExtAddress*)InBuffer));
status = ThreadErrorToNtstatus(otLinkSetExtendedAddress(pFilter->otCtx, (otExtAddress*)InBuffer));
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(otExtAddress))
{
memcpy(OutBuffer, otGetExtendedAddress(pFilter->otCtx), sizeof(otExtAddress));
memcpy(OutBuffer, otLinkGetExtendedAddress(pFilter->otCtx), sizeof(otExtAddress));
*OutBufferLength = sizeof(otExtAddress);
status = STATUS_SUCCESS;
}
@@ -1360,7 +1360,7 @@ otLwfIoCtl_otFactoryAssignedIeeeEui64(
if (*OutBufferLength >= sizeof(otExtAddress))
{
otGetFactoryAssignedIeeeEui64(pFilter->otCtx, (otExtAddress*)OutBuffer);
otLinkGetFactoryAssignedIeeeEui64(pFilter->otCtx, (otExtAddress*)OutBuffer);
*OutBufferLength = sizeof(otExtAddress);
status = STATUS_SUCCESS;
}
@@ -1391,7 +1391,7 @@ otLwfIoCtl_otHashMacAddress(
if (*OutBufferLength >= sizeof(otExtAddress))
{
otGetHashMacAddress(pFilter->otCtx, (otExtAddress*)OutBuffer);
otLinkGetJoinerId(pFilter->otCtx, (otExtAddress*)OutBuffer);
*OutBufferLength = sizeof(otExtAddress);
status = STATUS_SUCCESS;
}
@@ -2042,12 +2042,12 @@ otLwfIoCtl_otPanId(
if (InBufferLength >= sizeof(otPanId))
{
status = ThreadErrorToNtstatus(otSetPanId(pFilter->otCtx, *(otPanId*)InBuffer));
status = ThreadErrorToNtstatus(otLinkSetPanId(pFilter->otCtx, *(otPanId*)InBuffer));
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(otPanId))
{
*(otPanId*)OutBuffer = otGetPanId(pFilter->otCtx);
*(otPanId*)OutBuffer = otLinkGetPanId(pFilter->otCtx);
*OutBufferLength = sizeof(otPanId);
status = STATUS_SUCCESS;
}
@@ -2242,7 +2242,7 @@ otLwfIoCtl_otShortAddress(
if (*OutBufferLength >= sizeof(otShortAddress))
{
*(otShortAddress*)OutBuffer = otGetShortAddress(pFilter->otCtx);
*(otShortAddress*)OutBuffer = otLinkGetShortAddress(pFilter->otCtx);
*OutBufferLength = sizeof(otShortAddress);
status = STATUS_SUCCESS;
}
@@ -3346,20 +3346,13 @@ otLwfIoCtl_otMacWhitelistEnabled(
if (InBufferLength >= sizeof(BOOLEAN))
{
BOOLEAN aEnabled = *(BOOLEAN*)InBuffer;
if (aEnabled)
{
otEnableMacWhitelist(pFilter->otCtx);
}
else
{
otDisableMacWhitelist(pFilter->otCtx);
}
otLinkSetWhitelistEnabled(pFilter->otCtx, aEnabled);
status = STATUS_SUCCESS;
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(BOOLEAN))
{
*(BOOLEAN*)OutBuffer = otIsMacWhitelistEnabled(pFilter->otCtx) ? TRUE : FALSE;
*(BOOLEAN*)OutBuffer = otLinkIsWhitelistEnabled(pFilter->otCtx) ? TRUE : FALSE;
status = STATUS_SUCCESS;
*OutBufferLength = sizeof(BOOLEAN);
}
@@ -3456,11 +3449,11 @@ otLwfIoCtl_otAddMacWhitelist(
if (InBufferLength >= sizeof(otExtAddress) + sizeof(int8_t))
{
int8_t aRssi = *(int8_t*)(InBuffer + sizeof(otExtAddress));
status = ThreadErrorToNtstatus(otAddMacWhitelistRssi(pFilter->otCtx, (uint8_t*)InBuffer, aRssi));
status = ThreadErrorToNtstatus(otLinkAddWhitelistRssi(pFilter->otCtx, (uint8_t*)InBuffer, aRssi));
}
else if (InBufferLength >= sizeof(otExtAddress))
{
status = ThreadErrorToNtstatus(otAddMacWhitelist(pFilter->otCtx, (uint8_t*)InBuffer));
status = ThreadErrorToNtstatus(otLinkAddWhitelist(pFilter->otCtx, (uint8_t*)InBuffer));
}
return status;
@@ -3526,7 +3519,7 @@ otLwfIoCtl_otRemoveMacWhitelist(
if (InBufferLength >= sizeof(otExtAddress))
{
otRemoveMacWhitelist(pFilter->otCtx, (uint8_t*)InBuffer);
otLinkRemoveWhitelist(pFilter->otCtx, (uint8_t*)InBuffer);
status = STATUS_SUCCESS;
}
@@ -3583,7 +3576,7 @@ otLwfIoCtl_otMacWhitelistEntry(
*OutBufferLength >= sizeof(otMacWhitelistEntry))
{
status = ThreadErrorToNtstatus(
otGetMacWhitelistEntry(
otLinkGetWhitelistEntry(
pFilter->otCtx,
*(uint8_t*)InBuffer,
(otMacWhitelistEntry*)OutBuffer)
@@ -3617,7 +3610,7 @@ otLwfIoCtl_otClearMacWhitelist(
UNREFERENCED_PARAMETER(OutBuffer);
*OutBufferLength = 0;
otClearMacWhitelist(pFilter->otCtx);
otLinkClearWhitelist(pFilter->otCtx);
return status;
}
@@ -4541,20 +4534,13 @@ otLwfIoCtl_otMacBlacklistEnabled(
if (InBufferLength >= sizeof(BOOLEAN))
{
BOOLEAN aEnabled = *(BOOLEAN*)InBuffer;
if (aEnabled)
{
otEnableMacBlacklist(pFilter->otCtx);
}
else
{
otDisableMacBlacklist(pFilter->otCtx);
}
otLinkSetBlacklistEnabled(pFilter->otCtx, aEnabled);
status = STATUS_SUCCESS;
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(BOOLEAN))
{
*(BOOLEAN*)OutBuffer = otIsMacBlacklistEnabled(pFilter->otCtx) ? TRUE : FALSE;
*(BOOLEAN*)OutBuffer = otLinkIsBlacklistEnabled(pFilter->otCtx) ? TRUE : FALSE;
status = STATUS_SUCCESS;
*OutBufferLength = sizeof(BOOLEAN);
}
@@ -4585,7 +4571,7 @@ otLwfIoCtl_otAddMacBlacklist(
if (InBufferLength >= sizeof(otExtAddress))
{
status = ThreadErrorToNtstatus(otAddMacBlacklist(pFilter->otCtx, (uint8_t*)InBuffer));
status = ThreadErrorToNtstatus(otLinkAddBlacklist(pFilter->otCtx, (uint8_t*)InBuffer));
}
return status;
@@ -4610,7 +4596,7 @@ otLwfIoCtl_otRemoveMacBlacklist(
if (InBufferLength >= sizeof(otExtAddress))
{
otRemoveMacBlacklist(pFilter->otCtx, (uint8_t*)InBuffer);
otLinkRemoveBlacklist(pFilter->otCtx, (uint8_t*)InBuffer);
status = STATUS_SUCCESS;
}
@@ -4635,7 +4621,7 @@ otLwfIoCtl_otMacBlacklistEntry(
*OutBufferLength >= sizeof(otMacBlacklistEntry))
{
status = ThreadErrorToNtstatus(
otGetMacBlacklistEntry(
otLinkGetBlacklistEntry(
pFilter->otCtx,
*(uint8_t*)InBuffer,
(otMacBlacklistEntry*)OutBuffer)
@@ -4669,7 +4655,7 @@ otLwfIoCtl_otClearMacBlacklist(
UNREFERENCED_PARAMETER(OutBuffer);
*OutBufferLength = 0;
otClearMacBlacklist(pFilter->otCtx);
otLinkClearBlacklist(pFilter->otCtx);
return status;
}
@@ -4690,13 +4676,13 @@ otLwfIoCtl_otMaxTransmitPower(
if (InBufferLength >= sizeof(int8_t))
{
otSetMaxTransmitPower(pFilter->otCtx, *(int8_t*)InBuffer);
otLinkSetMaxTransmitPower(pFilter->otCtx, *(int8_t*)InBuffer);
status = STATUS_SUCCESS;
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(int8_t))
{
*(int8_t*)OutBuffer = otGetMaxTransmitPower(pFilter->otCtx);
*(int8_t*)OutBuffer = otLinkGetMaxTransmitPower(pFilter->otCtx);
*OutBufferLength = sizeof(int8_t);
status = STATUS_SUCCESS;
}
@@ -4765,13 +4751,13 @@ otLwfIoCtl_otPollPeriod(
if (InBufferLength >= sizeof(uint32_t))
{
otSetPollPeriod(pFilter->otCtx, *(uint32_t*)InBuffer);
otLinkSetPollPeriod(pFilter->otCtx, *(uint32_t*)InBuffer);
status = STATUS_SUCCESS;
*OutBufferLength = 0;
}
else if (*OutBufferLength >= sizeof(uint32_t))
{
*(uint32_t*)OutBuffer = otGetPollPeriod(pFilter->otCtx);
*(uint32_t*)OutBuffer = otLinkGetPollPeriod(pFilter->otCtx);
*OutBufferLength = sizeof(uint32_t);
status = STATUS_SUCCESS;
}
@@ -4833,7 +4819,7 @@ otLwfIoCtl_otAssignLinkQuality(
if (InBufferLength >= sizeof(otExtAddress) + sizeof(uint8_t))
{
otSetAssignLinkQuality(
otLinkSetAssignLinkQuality(
pFilter->otCtx,
(uint8_t*)InBuffer,
*(uint8_t*)(InBuffer + sizeof(otExtAddress)));
@@ -4844,7 +4830,7 @@ otLwfIoCtl_otAssignLinkQuality(
*OutBufferLength >= sizeof(uint8_t))
{
status = ThreadErrorToNtstatus(
otGetAssignLinkQuality(
otLinkGetAssignLinkQuality(
pFilter->otCtx,
(uint8_t*)InBuffer,
(uint8_t*)OutBuffer)
@@ -5075,7 +5061,7 @@ otLwfIoCtl_otMacCounters(
if (*OutBufferLength >= sizeof(otMacCounters))
{
memcpy_s(OutBuffer, *OutBufferLength, otGetMacCounters(pFilter->otCtx), sizeof(otMacCounters));
memcpy_s(OutBuffer, *OutBufferLength, otLinkGetCounters(pFilter->otCtx), sizeof(otMacCounters));
*OutBufferLength = sizeof(otMacCounters);
status = STATUS_SUCCESS;
}
@@ -5898,7 +5884,7 @@ otLwfIoCtl_otSendPendingSet(
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
otLwfIoCtl_otCommissionerSendMgmtGet(
otLwfIoCtl_otSendMgmtCommissionerGet(
_In_ PMS_FILTER pFilter,
_In_reads_bytes_(InBufferLength)
PUCHAR InBuffer,
@@ -5934,7 +5920,7 @@ otLwfIoCtl_otCommissionerSendMgmtGet(
_IRQL_requires_max_(PASSIVE_LEVEL)
NTSTATUS
otLwfIoCtl_otCommissionerSendMgmtSet(
otLwfIoCtl_otSendMgmtCommissionerSet(
_In_ PMS_FILTER pFilter,
_In_reads_bytes_(InBufferLength)
PUCHAR InBuffer,
+2 -2
View File
@@ -220,8 +220,8 @@ DECL_IOCTL_FUNC(otSendActiveGet);
DECL_IOCTL_FUNC(otSendActiveSet);
DECL_IOCTL_FUNC(otSendPendingGet);
DECL_IOCTL_FUNC(otSendPendingSet);
DECL_IOCTL_FUNC(otCommissionerSendMgmtGet);
DECL_IOCTL_FUNC(otCommissionerSendMgmtSet);
DECL_IOCTL_FUNC(otSendMgmtCommissionerGet);
DECL_IOCTL_FUNC(otSendMgmtCommissionerSet);
DECL_IOCTL_FUNC_WITH_TUN2(otKeySwitchGuardtime);
DECL_IOCTL_FUNC(otFactoryReset);
DECL_IOCTL_FUNC(otThreadAutoStart);
+1 -1
View File
@@ -1 +1 @@
#include "precomp.h"
#include "precomp.h"
@@ -1068,7 +1068,7 @@ OTNODEAPI int32_t OTCALL otNodeClearWhitelist(otNode* aNode)
otLogFuncEntryMsg("[%d]", aNode->mId);
printf("%d: whitelist clear\r\n", aNode->mId);
otClearMacWhitelist(aNode->mInstance);
otLinkClearWhitelist(aNode->mInstance);
otLogFuncExit();
return 0;
}
@@ -1078,7 +1078,7 @@ OTNODEAPI int32_t OTCALL otNodeEnableWhitelist(otNode* aNode)
otLogFuncEntryMsg("[%d]", aNode->mId);
printf("%d: whitelist enable\r\n", aNode->mId);
otEnableMacWhitelist(aNode->mInstance);
otLinkSetWhitelistEnabled(aNode->mInstance, true);
otLogFuncExit();
return 0;
}
@@ -1088,7 +1088,7 @@ OTNODEAPI int32_t OTCALL otNodeDisableWhitelist(otNode* aNode)
otLogFuncEntryMsg("[%d]", aNode->mId);
printf("%d: whitelist disable\r\n", aNode->mId);
otDisableMacWhitelist(aNode->mInstance);
otLinkSetWhitelistEnabled(aNode->mInstance, false);
otLogFuncExit();
return 0;
}
@@ -1107,11 +1107,11 @@ OTNODEAPI int32_t OTCALL otNodeAddWhitelist(otNode* aNode, const char *aExtAddr,
ThreadError error;
if (aRssi == 0)
{
error = otAddMacWhitelist(aNode->mInstance, extAddr);
error = otLinkAddWhitelist(aNode->mInstance, extAddr);
}
else
{
error = otAddMacWhitelistRssi(aNode->mInstance, extAddr, aRssi);
error = otLinkAddWhitelistRssi(aNode->mInstance, extAddr, aRssi);
}
otLogFuncExit();
return error;
@@ -1126,7 +1126,7 @@ OTNODEAPI int32_t OTCALL otNodeRemoveWhitelist(otNode* aNode, const char *aExtAd
if (Hex2Bin(aExtAddr, extAddr, sizeof(extAddr)) != sizeof(extAddr))
return kThreadError_InvalidArgs;
otRemoveMacWhitelist(aNode->mInstance, extAddr);
otLinkRemoveWhitelist(aNode->mInstance, extAddr);
otLogFuncExit();
return 0;
}
@@ -1144,7 +1144,7 @@ OTNODEAPI const char* OTCALL otNodeGetHashMacAddress(otNode* aNode)
{
otLogFuncEntryMsg("[%d]", aNode->mId);
otExtAddress aHashMacAddress = {};
otGetHashMacAddress(aNode->mInstance, &aHashMacAddress);
otLinkGetJoinerId(aNode->mInstance, &aHashMacAddress);
char* str = (char*)malloc(18);
if (str != nullptr)
{
@@ -1160,7 +1160,7 @@ OTNODEAPI const char* OTCALL otNodeGetHashMacAddress(otNode* aNode)
OTNODEAPI const char* OTCALL otNodeGetAddr64(otNode* aNode)
{
otLogFuncEntryMsg("[%d]", aNode->mId);
auto extAddr = otGetExtendedAddress(aNode->mInstance);
auto extAddr = otLinkGetExtendedAddress(aNode->mInstance);
char* str = (char*)malloc(18);
if (str != nullptr)
{
@@ -1178,7 +1178,7 @@ OTNODEAPI int32_t OTCALL otNodeSetChannel(otNode* aNode, uint8_t aChannel)
{
otLogFuncEntryMsg("[%d]", aNode->mId);
printf("%d: channel %d\r\n", aNode->mId, aChannel);
auto result = otSetChannel(aNode->mInstance, aChannel);
auto result = otLinkSetChannel(aNode->mInstance, aChannel);
otLogFuncExit();
return result;
}
@@ -1186,7 +1186,7 @@ OTNODEAPI int32_t OTCALL otNodeSetChannel(otNode* aNode, uint8_t aChannel)
OTNODEAPI uint8_t OTCALL otNodeGetChannel(otNode* aNode)
{
otLogFuncEntryMsg("[%d]", aNode->mId);
auto result = otGetChannel(aNode->mInstance);
auto result = otLinkGetChannel(aNode->mInstance);
printf("%d: channel\r\n%d\r\n", aNode->mId, result);
otLogFuncExit();
return result;
@@ -1287,7 +1287,7 @@ OTNODEAPI const char* OTCALL otNodeGetNetworkName(otNode* aNode)
OTNODEAPI uint16_t OTCALL otNodeGetPanId(otNode* aNode)
{
otLogFuncEntryMsg("[%d]", aNode->mId);
auto result = otGetPanId(aNode->mInstance);
auto result = otLinkGetPanId(aNode->mInstance);
printf("%d: panid\r\n0x%04x\r\n", aNode->mId, result);
otLogFuncExit();
return result;
@@ -1297,7 +1297,7 @@ OTNODEAPI int32_t OTCALL otNodeSetPanId(otNode* aNode, uint16_t aPanId)
{
otLogFuncEntryMsg("[%d]", aNode->mId);
printf("%d: panid 0x%04x\r\n", aNode->mId, aPanId);
auto result = otSetPanId(aNode->mInstance, aPanId);
auto result = otLinkSetPanId(aNode->mInstance, aPanId);
otLogFuncExit();
return result;
}