mirror of
https://github.com/espressif/openthread.git
synced 2026-09-08 02:00:12 +00:00
Clean up error names. (#1764)
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
|
||||
#include <openthread/types.h>
|
||||
|
||||
__inline LONG ThreadErrorToNtstatus(ThreadError error) { return (LONG)-((int)error); }
|
||||
__inline LONG ThreadErrorToNtstatus(otError error) { return (LONG)-((int)error); }
|
||||
|
||||
// User-mode IOCTL path for CreateFile
|
||||
#define OTLWF_IOCLT_PATH TEXT("\\\\.\\\\otlwf")
|
||||
@@ -128,7 +128,7 @@ typedef enum _OTLWF_NOTIF_TYPE
|
||||
// Payload for OTLWF_NOTIF_JOINER_COMPLETE
|
||||
struct
|
||||
{
|
||||
ThreadError Error;
|
||||
otError Error;
|
||||
} JoinerCompletePayload;
|
||||
};
|
||||
} OTLWF_NOTIFICATION, *POTLWF_NOTIFICATION;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -62,14 +62,14 @@ int main(int argc, char *argv[])
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
EXTERN_C ThreadError otPlatUartEnable(void)
|
||||
EXTERN_C otError otPlatUartEnable(void)
|
||||
{
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
EXTERN_C ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
EXTERN_C otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
if (!skipNextLine)
|
||||
{
|
||||
|
||||
@@ -343,11 +343,11 @@ otLwfEventProcessingAddressChanged(
|
||||
LogInfo(DRIVER_DEFAULT, "Filter %p trying to add/update address: %!IPV6ADDR!", pFilter, pAddr);
|
||||
|
||||
// Add (or update) the address to OpenThread
|
||||
ThreadError otError = otIp6AddUnicastAddress(pFilter->otCtx, &otAddr);
|
||||
if (otError != kThreadError_None)
|
||||
otError otError = otIp6AddUnicastAddress(pFilter->otCtx, &otAddr);
|
||||
if (otError != OT_ERROR_NONE)
|
||||
{
|
||||
LogError(DRIVER_DEFAULT, "otIp6AddUnicastAddress failed, %!otError!", otError);
|
||||
ShouldDelete = otError == kThreadError_NoBufs ? TRUE : FALSE;
|
||||
ShouldDelete = otError == OT_ERROR_NO_BUFS ? TRUE : FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -899,7 +899,7 @@ otLwfCmdSendMacFrameComplete(
|
||||
{
|
||||
UNREFERENCED_PARAMETER(Context);
|
||||
|
||||
pFilter->otLastTransmitError = kThreadError_Abort;
|
||||
pFilter->otLastTransmitError = OT_ERROR_ABORT;
|
||||
|
||||
if (Data && Command == SPINEL_CMD_PROP_VALUE_IS)
|
||||
{
|
||||
@@ -911,7 +911,7 @@ otLwfCmdSendMacFrameComplete(
|
||||
{
|
||||
if (spinel_status == SPINEL_STATUS_OK)
|
||||
{
|
||||
pFilter->otLastTransmitError = kThreadError_None;
|
||||
pFilter->otLastTransmitError = OT_ERROR_NONE;
|
||||
(void)spinel_datatype_unpack(
|
||||
Data + packed_len,
|
||||
DataLength - (spinel_size_t)packed_len,
|
||||
@@ -961,7 +961,7 @@ otLwfCmdSendMacFrameAsync(
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
LogError(DRIVER_DEFAULT, "Set SPINEL_PROP_STREAM_RAW failed, %!STATUS!", status);
|
||||
pFilter->otLastTransmitError = kThreadError_Abort;
|
||||
pFilter->otLastTransmitError = OT_ERROR_ABORT;
|
||||
KeSetEvent(&pFilter->SendNetBufferListComplete, IO_NO_INCREMENT, FALSE);
|
||||
}
|
||||
}
|
||||
@@ -1015,7 +1015,7 @@ otLwfGetPropHandler(
|
||||
}
|
||||
else
|
||||
{
|
||||
ThreadError errorCode = SpinelStatusToThreadError(spinel_status);
|
||||
otError errorCode = SpinelStatusToThreadError(spinel_status);
|
||||
LogVerbose(DRIVER_DEFAULT, "Get key=%u failed with %!otError!", CmdContext->Key, errorCode);
|
||||
CmdContext->Status = ThreadErrorToNtstatus(errorCode);
|
||||
}
|
||||
@@ -1170,7 +1170,7 @@ otLwfSetPropHandler(
|
||||
}
|
||||
else
|
||||
{
|
||||
ThreadError errorCode = SpinelStatusToThreadError(spinel_status);
|
||||
otError errorCode = SpinelStatusToThreadError(spinel_status);
|
||||
LogVerbose(DRIVER_DEFAULT, "Set key=%u failed with %!otError!", CmdContext->Key, errorCode);
|
||||
CmdContext->Status = ThreadErrorToNtstatus(errorCode);
|
||||
}
|
||||
@@ -1333,75 +1333,75 @@ otLwfCmdRemoveProp(
|
||||
// General Spinel Helpers
|
||||
//
|
||||
|
||||
ThreadError
|
||||
otError
|
||||
SpinelStatusToThreadError(
|
||||
spinel_status_t error
|
||||
)
|
||||
{
|
||||
ThreadError ret;
|
||||
otError ret;
|
||||
|
||||
switch (error)
|
||||
{
|
||||
case SPINEL_STATUS_OK:
|
||||
ret = kThreadError_None;
|
||||
ret = OT_ERROR_NONE;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_FAILURE:
|
||||
ret = kThreadError_Failed;
|
||||
ret = OT_ERROR_FAILED;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_DROPPED:
|
||||
ret = kThreadError_Drop;
|
||||
ret = OT_ERROR_DROP;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_NOMEM:
|
||||
ret = kThreadError_NoBufs;
|
||||
ret = OT_ERROR_NO_BUFS;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_BUSY:
|
||||
ret = kThreadError_Busy;
|
||||
ret = OT_ERROR_BUSY;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_PARSE_ERROR:
|
||||
ret = kThreadError_Parse;
|
||||
ret = OT_ERROR_PARSE;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_INVALID_ARGUMENT:
|
||||
ret = kThreadError_InvalidArgs;
|
||||
ret = OT_ERROR_INVALID_ARGS;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_UNIMPLEMENTED:
|
||||
ret = kThreadError_NotImplemented;
|
||||
ret = OT_ERROR_NOT_IMPLEMENTED;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_INVALID_STATE:
|
||||
ret = kThreadError_InvalidState;
|
||||
ret = OT_ERROR_INVALID_STATE;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_NO_ACK:
|
||||
ret = kThreadError_NoAck;
|
||||
ret = OT_ERROR_NO_ACK;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_CCA_FAILURE:
|
||||
ret = kThreadError_ChannelAccessFailure;
|
||||
ret = OT_ERROR_CHANNEL_ACCESS_FAILURE;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_ALREADY:
|
||||
ret = kThreadError_Already;
|
||||
ret = OT_ERROR_ALREADY;
|
||||
break;
|
||||
|
||||
case SPINEL_STATUS_ITEM_NOT_FOUND:
|
||||
ret = kThreadError_NotFound;
|
||||
ret = OT_ERROR_NOT_FOUND;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (error >= SPINEL_STATUS_STACK_NATIVE__BEGIN && error <= SPINEL_STATUS_STACK_NATIVE__END)
|
||||
{
|
||||
ret = (ThreadError)(error - SPINEL_STATUS_STACK_NATIVE__BEGIN);
|
||||
ret = (otError)(error - SPINEL_STATUS_STACK_NATIVE__BEGIN);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = kThreadError_Failed;
|
||||
ret = OT_ERROR_FAILED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ otLwfCmdRemoveProp(
|
||||
// General Spinel Helpers
|
||||
//
|
||||
|
||||
ThreadError
|
||||
otError
|
||||
SpinelStatusToThreadError(
|
||||
spinel_status_t error
|
||||
);
|
||||
|
||||
@@ -901,7 +901,7 @@ otLwfEventWorkerThread(
|
||||
// Copy NB data into message
|
||||
if (NT_SUCCESS(CopyDataBuffer(CurrNb, NET_BUFFER_DATA_LENGTH(CurrNb), MessageBuffer)))
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
// Create a new message
|
||||
otMessage *message = otIp6NewMessage(pFilter->otCtx, TRUE);
|
||||
@@ -909,7 +909,7 @@ otLwfEventWorkerThread(
|
||||
{
|
||||
// Write to the message
|
||||
error = otMessageAppend(message, MessageBuffer, (uint16_t)NET_BUFFER_DATA_LENGTH(CurrNb));
|
||||
if (error != kThreadError_None)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
LogError(DRIVER_DATA_PATH, "otAppendMessage failed with %!otError!", error);
|
||||
otMessageFree(message);
|
||||
@@ -928,7 +928,7 @@ otLwfEventWorkerThread(
|
||||
|
||||
// Send message (it will free 'message')
|
||||
error = otIp6Send(pFilter->otCtx, message);
|
||||
if (error != kThreadError_None)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
LogError(DRIVER_DATA_PATH, "otSendIp6Datagram failed with %!otError!", error);
|
||||
}
|
||||
@@ -1003,7 +1003,7 @@ otLwfEventWorkerThread(
|
||||
length -= pFilter->otReceiveFrame.mLength;
|
||||
}
|
||||
|
||||
ThreadError errorCode;
|
||||
otError errorCode;
|
||||
int8_t noiseFloor = -128;
|
||||
uint16_t flags = 0;
|
||||
if (try_spinel_datatype_unpack(
|
||||
|
||||
@@ -255,7 +255,7 @@ typedef struct _MS_FILTER
|
||||
uint8_t otTransmitMessage[kMaxPHYPacketSize];
|
||||
RadioPacket otReceiveFrame;
|
||||
RadioPacket otTransmitFrame;
|
||||
ThreadError otLastTransmitError;
|
||||
otError otLastTransmitError;
|
||||
BOOLEAN otLastTransmitFramePending;
|
||||
CHAR otLastEnergyScanMaxRssi;
|
||||
|
||||
|
||||
@@ -296,14 +296,14 @@ bool otPlatRadioIsEnabled(_In_ otInstance *otCtx)
|
||||
return pFilter->otPhyState != kStateDisabled;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnable(_In_ otInstance *otCtx)
|
||||
otError otPlatRadioEnable(_In_ otInstance *otCtx)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
NTSTATUS status;
|
||||
|
||||
NT_ASSERT(pFilter->otPhyState <= kStateSleep);
|
||||
if (pFilter->otPhyState > kStateSleep) return kThreadError_Busy;
|
||||
if (pFilter->otPhyState > kStateSleep) return OT_ERROR_BUSY;
|
||||
|
||||
pFilter->otPhyState = kStateSleep;
|
||||
|
||||
@@ -351,10 +351,10 @@ ThreadError otPlatRadioEnable(_In_ otInstance *otCtx)
|
||||
LogError(DRIVER_DEFAULT, "Set SPINEL_PROP_MAC_15_4_SADDR failed, %!STATUS!", status);
|
||||
}
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioDisable(_In_ otInstance *otCtx)
|
||||
otError otPlatRadioDisable(_In_ otInstance *otCtx)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -383,10 +383,10 @@ ThreadError otPlatRadioDisable(_In_ otInstance *otCtx)
|
||||
|
||||
LogInfo(DRIVER_DEFAULT, "Filter %p PhyState = kStateDisabled.", pFilter);
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioSleep(_In_ otInstance *otCtx)
|
||||
otError otPlatRadioSleep(_In_ otInstance *otCtx)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -394,7 +394,7 @@ ThreadError otPlatRadioSleep(_In_ otInstance *otCtx)
|
||||
// If we were in the transmit state, cancel the transmit
|
||||
if (pFilter->otPhyState == kStateTransmit)
|
||||
{
|
||||
pFilter->otLastTransmitError = kThreadError_Abort;
|
||||
pFilter->otLastTransmitError = OT_ERROR_ABORT;
|
||||
otLwfRadioTransmitFrameDone(pFilter);
|
||||
}
|
||||
|
||||
@@ -417,16 +417,16 @@ ThreadError otPlatRadioSleep(_In_ otInstance *otCtx)
|
||||
}
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioReceive(_In_ otInstance *otCtx, uint8_t aChannel)
|
||||
otError otPlatRadioReceive(_In_ otInstance *otCtx, uint8_t aChannel)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
|
||||
NT_ASSERT(pFilter->otPhyState != kStateDisabled);
|
||||
if (pFilter->otPhyState == kStateDisabled) return kThreadError_Busy;
|
||||
if (pFilter->otPhyState == kStateDisabled) return OT_ERROR_BUSY;
|
||||
|
||||
LogFuncEntryMsg(DRIVER_DATA_PATH, "Filter: %p", pFilter);
|
||||
|
||||
@@ -479,7 +479,7 @@ ThreadError otPlatRadioReceive(_In_ otInstance *otCtx, uint8_t aChannel)
|
||||
|
||||
LogFuncExit(DRIVER_DATA_PATH);
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
RadioPacket *otPlatRadioGetTransmitBuffer(_In_ otInstance *otCtx)
|
||||
@@ -513,7 +513,7 @@ bool otPlatRadioGetPromiscuous(_In_ otInstance *otCtx)
|
||||
VOID
|
||||
otLwfRadioReceiveFrame(
|
||||
_In_ PMS_FILTER pFilter,
|
||||
_In_ ThreadError errorCode
|
||||
_In_ otError errorCode
|
||||
)
|
||||
{
|
||||
NT_ASSERT(pFilter->otReceiveFrame.mChannel >= 11 && pFilter->otReceiveFrame.mChannel <= 26);
|
||||
@@ -534,11 +534,11 @@ otLwfRadioReceiveFrame(
|
||||
LogFuncExit(DRIVER_DATA_PATH);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioTransmit(_In_ otInstance *otCtx, _In_ RadioPacket *aPacket)
|
||||
otError otPlatRadioTransmit(_In_ otInstance *otCtx, _In_ RadioPacket *aPacket)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
|
||||
UNREFERENCED_PARAMETER(aPacket);
|
||||
|
||||
@@ -547,7 +547,7 @@ ThreadError otPlatRadioTransmit(_In_ otInstance *otCtx, _In_ RadioPacket *aPacke
|
||||
NT_ASSERT(pFilter->otPhyState == kStateReceive);
|
||||
if (pFilter->otPhyState == kStateReceive)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
pFilter->otPhyState = kStateTransmit;
|
||||
|
||||
LogInfo(DRIVER_DEFAULT, "Filter %p PhyState = kStateTransmit.", pFilter);
|
||||
@@ -587,11 +587,11 @@ otLwfRadioTransmitFrameDone(
|
||||
LogInfo(DRIVER_DEFAULT, "Filter %p PhyState = kStateReceive.", pFilter);
|
||||
KeSetEvent(&pFilter->EventWorkerThreadProcessNBLs, 0, FALSE);
|
||||
|
||||
if (pFilter->otLastTransmitError != kThreadError_None &&
|
||||
pFilter->otLastTransmitError != kThreadError_ChannelAccessFailure &&
|
||||
pFilter->otLastTransmitError != kThreadError_NoAck)
|
||||
if (pFilter->otLastTransmitError != OT_ERROR_NONE &&
|
||||
pFilter->otLastTransmitError != OT_ERROR_CHANNEL_ACCESS_FAILURE &&
|
||||
pFilter->otLastTransmitError != OT_ERROR_NO_ACK)
|
||||
{
|
||||
pFilter->otLastTransmitError = kThreadError_Abort;
|
||||
pFilter->otLastTransmitError = OT_ERROR_ABORT;
|
||||
}
|
||||
|
||||
otPlatRadioTransmitDone(pFilter->otCtx, &pFilter->otTransmitFrame, pFilter->otLastTransmitFramePending, pFilter->otLastTransmitError);
|
||||
@@ -625,7 +625,7 @@ void otPlatRadioEnableSrcMatch(_In_ otInstance *otCtx, bool aEnable)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(_In_ otInstance *otCtx, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(_In_ otInstance *otCtx, const uint16_t aShortAddress)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -643,10 +643,10 @@ ThreadError otPlatRadioAddSrcMatchShortEntry(_In_ otInstance *otCtx, const uint1
|
||||
LogError(DRIVER_DEFAULT, "Insert SPINEL_PROP_MAC_SRC_MATCH_SHORT_ADDRESSES failed, %!STATUS!", status);
|
||||
}
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(_In_ otInstance *otCtx, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioAddSrcMatchExtEntry(_In_ otInstance *otCtx, const uint8_t *aExtAddress)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -664,10 +664,10 @@ ThreadError otPlatRadioAddSrcMatchExtEntry(_In_ otInstance *otCtx, const uint8_t
|
||||
LogError(DRIVER_DEFAULT, "Insert SPINEL_PROP_MAC_SRC_MATCH_EXTENDED_ADDRESSES failed, %!STATUS!", status);
|
||||
}
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(_In_ otInstance *otCtx, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(_In_ otInstance *otCtx, const uint16_t aShortAddress)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -685,10 +685,10 @@ ThreadError otPlatRadioClearSrcMatchShortEntry(_In_ otInstance *otCtx, const uin
|
||||
LogError(DRIVER_DEFAULT, "Remove SPINEL_PROP_MAC_SRC_MATCH_SHORT_ADDRESSES failed, %!STATUS!", status);
|
||||
}
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(_In_ otInstance *otCtx, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioClearSrcMatchExtEntry(_In_ otInstance *otCtx, const uint8_t *aExtAddress)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -706,7 +706,7 @@ ThreadError otPlatRadioClearSrcMatchExtEntry(_In_ otInstance *otCtx, const uint8
|
||||
LogError(DRIVER_DEFAULT, "Remove SPINEL_PROP_MAC_SRC_MATCH_EXTENDED_ADDRESSES failed, %!STATUS!", status);
|
||||
}
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(_In_ otInstance *otCtx)
|
||||
@@ -745,7 +745,7 @@ void otPlatRadioClearSrcMatchExtEntries(_In_ otInstance *otCtx)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnergyScan(_In_ otInstance *otCtx, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
otError otPlatRadioEnergyScan(_In_ otInstance *otCtx, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -791,7 +791,7 @@ ThreadError otPlatRadioEnergyScan(_In_ otInstance *otCtx, uint8_t aScanChannel,
|
||||
|
||||
error:
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
void otPlatRadioSetDefaultTxPower(_In_ otInstance *otCtx, int8_t aPower)
|
||||
|
||||
@@ -81,7 +81,7 @@ enum
|
||||
VOID otLwfRadioInit(_In_ PMS_FILTER pFilter);
|
||||
|
||||
// Indicates a received frame from the radio layer
|
||||
VOID otLwfRadioReceiveFrame(_In_ PMS_FILTER pFilter, _In_ ThreadError errorCode);
|
||||
VOID otLwfRadioReceiveFrame(_In_ PMS_FILTER pFilter, _In_ otError errorCode);
|
||||
|
||||
// Indicates the transmit frame is ready to send to the radio layer
|
||||
VOID otLwfRadioTransmitFrame(_In_ PMS_FILTER pFilter);
|
||||
|
||||
@@ -439,25 +439,25 @@ error:
|
||||
return status;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsBeginChange(otInstance *otCtx)
|
||||
otError otPlatSettingsBeginChange(otInstance *otCtx)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(otCtx);
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsCommitChange(otInstance *otCtx)
|
||||
otError otPlatSettingsCommitChange(otInstance *otCtx)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(otCtx);
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsAbandonChange(otInstance *otCtx)
|
||||
otError otPlatSettingsAbandonChange(otInstance *otCtx)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(otCtx);
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsGet(otInstance *otCtx, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
|
||||
otError otPlatSettingsGet(otInstance *otCtx, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -470,10 +470,10 @@ ThreadError otPlatSettingsGet(otInstance *otCtx, uint16_t aKey, int aIndex, uint
|
||||
aValue,
|
||||
aValueLength);
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_NotFound;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_NOT_FOUND;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsSet(otInstance *otCtx, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
otError otPlatSettingsSet(otInstance *otCtx, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -486,10 +486,10 @@ ThreadError otPlatSettingsSet(otInstance *otCtx, uint16_t aKey, const uint8_t *a
|
||||
aValue,
|
||||
aValueLength);
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsAdd(otInstance *otCtx, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
otError otPlatSettingsAdd(otInstance *otCtx, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -504,10 +504,10 @@ ThreadError otPlatSettingsAdd(otInstance *otCtx, uint16_t aKey, const uint8_t *a
|
||||
aValue,
|
||||
aValueLength);
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsDelete(otInstance *otCtx, uint16_t aKey, int aIndex)
|
||||
otError otPlatSettingsDelete(otInstance *otCtx, uint16_t aKey, int aIndex)
|
||||
{
|
||||
NT_ASSERT(otCtx);
|
||||
PMS_FILTER pFilter = otCtxToFilter(otCtx);
|
||||
@@ -518,7 +518,7 @@ ThreadError otPlatSettingsDelete(otInstance *otCtx, uint16_t aKey, int aIndex)
|
||||
aKey,
|
||||
aIndex);
|
||||
|
||||
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
|
||||
return NT_SUCCESS(status) ? OT_ERROR_NONE : OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
void otPlatSettingsWipe(otInstance *otCtx)
|
||||
|
||||
@@ -430,7 +430,7 @@ uint32_t otPlatRandomGet()
|
||||
return (uint32_t)RtlRandomEx(&Counter.LowPart);
|
||||
}
|
||||
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
// Just use the system-preferred random number generator algorithm
|
||||
NTSTATUS status =
|
||||
@@ -444,10 +444,10 @@ ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
LogError(DRIVER_DEFAULT, "BCryptGenRandom failed, %!STATUS!", status);
|
||||
return kThreadError_Failed;
|
||||
return OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
void otTaskletsSignalPending(_In_ otInstance *otCtx)
|
||||
@@ -705,7 +705,7 @@ void otLwfCommissionerPanIdConflictCallback(uint16_t aPanId, uint32_t aChannelMa
|
||||
LogFuncExit(DRIVER_DEFAULT);
|
||||
}
|
||||
|
||||
void otLwfJoinerCallback(ThreadError aError, _In_ void *aContext)
|
||||
void otLwfJoinerCallback(otError aError, _In_ void *aContext)
|
||||
{
|
||||
LogFuncEntry(DRIVER_DEFAULT);
|
||||
|
||||
|
||||
@@ -162,7 +162,7 @@ void otLwfEnergyScanCallback(_In_ otEnergyScanResult *aResult, _In_ void *aConte
|
||||
void otLwfDiscoverCallback(_In_ otActiveScanResult *aResult, _In_ void *aContext);
|
||||
void otLwfCommissionerEnergyReportCallback(uint32_t aChannelMask, const uint8_t *aEnergyList, uint8_t aEnergyListLength, void *aContext);
|
||||
void otLwfCommissionerPanIdConflictCallback(uint16_t aPanId, uint32_t aChannelMask, _In_ void *aContext);
|
||||
void otLwfJoinerCallback(ThreadError aError, _In_ void *aContext);
|
||||
void otLwfJoinerCallback(otError aError, _In_ void *aContext);
|
||||
|
||||
//
|
||||
// Value Callbacks
|
||||
|
||||
@@ -66,8 +66,8 @@ HANDLE gDeviceArrivalEvent = nullptr;
|
||||
|
||||
otApiInstance *gApiInstance = nullptr;
|
||||
|
||||
_Success_(return == kThreadError_None)
|
||||
ThreadError otNodeParsePrefix(const char *aStrPrefix, _Out_ otIp6Prefix *aPrefix)
|
||||
_Success_(return == OT_ERROR_NONE)
|
||||
otError otNodeParsePrefix(const char *aStrPrefix, _Out_ otIp6Prefix *aPrefix)
|
||||
{
|
||||
char *prefixLengthStr;
|
||||
char *endptr;
|
||||
@@ -75,13 +75,13 @@ ThreadError otNodeParsePrefix(const char *aStrPrefix, _Out_ otIp6Prefix *aPrefix
|
||||
if ((prefixLengthStr = (char*)strchr(aStrPrefix, '/')) == NULL)
|
||||
{
|
||||
printf("invalid prefix (%s)!\r\n", aStrPrefix);
|
||||
return kThreadError_InvalidArgs;
|
||||
return OT_ERROR_INVALID_ARGS;
|
||||
}
|
||||
|
||||
*prefixLengthStr++ = '\0';
|
||||
|
||||
auto error = otIp6AddressFromString(aStrPrefix, &aPrefix->mPrefix);
|
||||
if (error != kThreadError_None)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
printf("ipaddr (%s) to string failed, 0x%x!\r\n", aStrPrefix, error);
|
||||
return error;
|
||||
@@ -92,10 +92,10 @@ ThreadError otNodeParsePrefix(const char *aStrPrefix, _Out_ otIp6Prefix *aPrefix
|
||||
if (*endptr != '\0')
|
||||
{
|
||||
printf("invalid prefix ending (%s)!\r\n", aStrPrefix);
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
void OTCALL otNodeDeviceAvailabilityChanged(bool aAdded, const GUID *, void *)
|
||||
@@ -1012,7 +1012,7 @@ OTNODEAPI int32_t OTCALL otNodeCommissionerJoinerAdd(otNode* aNode, const char *
|
||||
|
||||
const uint32_t kDefaultJoinerTimeout = 120;
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
|
||||
if (strcmp(aExtAddr, "*") == 0)
|
||||
{
|
||||
@@ -1022,7 +1022,7 @@ OTNODEAPI int32_t OTCALL otNodeCommissionerJoinerAdd(otNode* aNode, const char *
|
||||
{
|
||||
otExtAddress extAddr;
|
||||
if (Hex2Bin(aExtAddr, extAddr.m8, sizeof(extAddr)) != sizeof(extAddr))
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
|
||||
error = otCommissionerAddJoiner(aNode->mInstance, &extAddr, aPSKd, kDefaultJoinerTimeout);
|
||||
}
|
||||
@@ -1104,9 +1104,9 @@ OTNODEAPI int32_t OTCALL otNodeAddWhitelist(otNode* aNode, const char *aExtAddr,
|
||||
|
||||
uint8_t extAddr[8];
|
||||
if (Hex2Bin(aExtAddr, extAddr, sizeof(extAddr)) != sizeof(extAddr))
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
if (aRssi == 0)
|
||||
{
|
||||
error = otLinkAddWhitelist(aNode->mInstance, extAddr);
|
||||
@@ -1126,7 +1126,7 @@ OTNODEAPI int32_t OTCALL otNodeRemoveWhitelist(otNode* aNode, const char *aExtAd
|
||||
|
||||
uint8_t extAddr[8];
|
||||
if (Hex2Bin(aExtAddr, extAddr, sizeof(extAddr)) != sizeof(extAddr))
|
||||
return kThreadError_InvalidArgs;
|
||||
return OT_ERROR_INVALID_ARGS;
|
||||
|
||||
otLinkRemoveWhitelist(aNode->mInstance, extAddr);
|
||||
otLogFuncExit();
|
||||
@@ -1204,7 +1204,7 @@ OTNODEAPI int32_t OTCALL otNodeSetMasterkey(otNode* aNode, const char *aMasterke
|
||||
if ((keyLength = Hex2Bin(aMasterkey, key.m8, sizeof(key.m8))) != OT_MASTER_KEY_SIZE)
|
||||
{
|
||||
printf("invalid length key %d\r\n", keyLength);
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
}
|
||||
|
||||
auto error = otThreadSetMasterKey(aNode->mInstance, &key);
|
||||
@@ -1239,7 +1239,7 @@ OTNODEAPI int32_t OTCALL otNodeSetPSKc(otNode* aNode, const char *aPSKc)
|
||||
if (Hex2Bin(aPSKc, pskc, sizeof(pskc)) != OT_PSKC_MAX_SIZE)
|
||||
{
|
||||
printf("invalid pskc %s\r\n", aPSKc);
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
}
|
||||
|
||||
auto error = otThreadSetPSKc(aNode->mInstance, pskc);
|
||||
@@ -1399,7 +1399,7 @@ OTNODEAPI int32_t OTCALL otNodeSetState(otNode* aNode, const char *aState)
|
||||
otLogFuncEntryMsg("[%d]", aNode->mId);
|
||||
printf("%d: state %s\r\n", aNode->mId, aState);
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
if (strcmp(aState, "detached") == 0)
|
||||
{
|
||||
error = otThreadBecomeDetached(aNode->mInstance);
|
||||
@@ -1418,7 +1418,7 @@ OTNODEAPI int32_t OTCALL otNodeSetState(otNode* aNode, const char *aState)
|
||||
}
|
||||
else
|
||||
{
|
||||
error = kThreadError_InvalidArgs;
|
||||
error = OT_ERROR_INVALID_ARGS;
|
||||
}
|
||||
otLogFuncExit();
|
||||
return error;
|
||||
@@ -1467,7 +1467,7 @@ OTNODEAPI int32_t OTCALL otNodeAddIpAddr(otNode* aNode, const char *aAddr)
|
||||
|
||||
otNetifAddress aAddress;
|
||||
auto error = otIp6AddressFromString(aAddr, &aAddress.mAddress);
|
||||
if (error != kThreadError_None) return error;
|
||||
if (error != OT_ERROR_NONE) return error;
|
||||
|
||||
aAddress.mPrefixLength = 64;
|
||||
aAddress.mPreferred = true;
|
||||
@@ -1559,7 +1559,7 @@ OTNODEAPI int32_t OTCALL otNodeAddPrefix(otNode* aNode, const char *aPrefix, con
|
||||
otBorderRouterConfig config = {0};
|
||||
|
||||
auto error = otNodeParsePrefix(aPrefix, &config.mPrefix);
|
||||
if (error != kThreadError_None) return error;
|
||||
if (error != OT_ERROR_NONE) return error;
|
||||
|
||||
const char *index = aFlags;
|
||||
while (*index)
|
||||
@@ -1588,7 +1588,7 @@ OTNODEAPI int32_t OTCALL otNodeAddPrefix(otNode* aNode, const char *aPrefix, con
|
||||
config.mStable = true;
|
||||
break;
|
||||
default:
|
||||
return kThreadError_InvalidArgs;
|
||||
return OT_ERROR_INVALID_ARGS;
|
||||
}
|
||||
|
||||
index++;
|
||||
@@ -1608,7 +1608,7 @@ OTNODEAPI int32_t OTCALL otNodeAddPrefix(otNode* aNode, const char *aPrefix, con
|
||||
}
|
||||
else
|
||||
{
|
||||
return kThreadError_InvalidArgs;
|
||||
return OT_ERROR_INVALID_ARGS;
|
||||
}
|
||||
|
||||
auto result = otNetDataAddPrefixInfo(aNode->mInstance, &config);
|
||||
@@ -1622,7 +1622,7 @@ OTNODEAPI int32_t OTCALL otNodeRemovePrefix(otNode* aNode, const char *aPrefix)
|
||||
|
||||
otIp6Prefix prefix;
|
||||
auto error = otNodeParsePrefix(aPrefix, &prefix);
|
||||
if (error != kThreadError_None) return error;
|
||||
if (error != OT_ERROR_NONE) return error;
|
||||
|
||||
auto result = otNetDataRemovePrefixInfo(aNode->mInstance, &prefix);
|
||||
otLogFuncExit();
|
||||
@@ -1635,7 +1635,7 @@ OTNODEAPI int32_t OTCALL otNodeAddRoute(otNode* aNode, const char *aPrefix, cons
|
||||
otExternalRouteConfig config = {0};
|
||||
|
||||
auto error = otNodeParsePrefix(aPrefix, &config.mPrefix);
|
||||
if (error != kThreadError_None) return error;
|
||||
if (error != OT_ERROR_NONE) return error;
|
||||
|
||||
if (strcmp(aPreference, "high") == 0)
|
||||
{
|
||||
@@ -1651,7 +1651,7 @@ OTNODEAPI int32_t OTCALL otNodeAddRoute(otNode* aNode, const char *aPrefix, cons
|
||||
}
|
||||
else
|
||||
{
|
||||
return kThreadError_InvalidArgs;
|
||||
return OT_ERROR_INVALID_ARGS;
|
||||
}
|
||||
|
||||
auto result = otNetDataAddRoute(aNode->mInstance, &config);
|
||||
@@ -1665,7 +1665,7 @@ OTNODEAPI int32_t OTCALL otNodeRemoveRoute(otNode* aNode, const char *aPrefix)
|
||||
|
||||
otIp6Prefix prefix;
|
||||
auto error = otNodeParsePrefix(aPrefix, &prefix);
|
||||
if (error != kThreadError_None) return error;
|
||||
if (error != OT_ERROR_NONE) return error;
|
||||
|
||||
auto result = otNetDataRemoveRoute(aNode->mInstance, &prefix);
|
||||
otLogFuncExit();
|
||||
@@ -1700,7 +1700,7 @@ OTNODEAPI int32_t OTCALL otNodeEnergyScan(otNode* aNode, uint32_t aMask, uint8_t
|
||||
|
||||
otIp6Address address = {0};
|
||||
auto error = otIp6AddressFromString(aAddr, &address);
|
||||
if (error != kThreadError_None)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
printf("otIp6AddressFromString(%s) failed, 0x%x!\r\n", aAddr, error);
|
||||
return error;
|
||||
@@ -1709,13 +1709,13 @@ OTNODEAPI int32_t OTCALL otNodeEnergyScan(otNode* aNode, uint32_t aMask, uint8_t
|
||||
ResetEvent(aNode->mEnergyScanEvent);
|
||||
|
||||
error = otCommissionerEnergyScan(aNode->mInstance, aMask, aCount, aPeriod, aDuration, &address, otNodeCommissionerEnergyReportCallback, aNode);
|
||||
if (error != kThreadError_None)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
printf("otCommissionerEnergyScan failed, 0x%x!\r\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
auto result = WaitForSingleObject(aNode->mEnergyScanEvent, 8000) == WAIT_OBJECT_0 ? kThreadError_None : kThreadError_NotFound;
|
||||
auto result = WaitForSingleObject(aNode->mEnergyScanEvent, 8000) == WAIT_OBJECT_0 ? OT_ERROR_NONE : OT_ERROR_NOT_FOUND;
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
}
|
||||
@@ -1734,7 +1734,7 @@ OTNODEAPI int32_t OTCALL otNodePanIdQuery(otNode* aNode, uint16_t aPanId, uint32
|
||||
|
||||
otIp6Address address = {0};
|
||||
auto error = otIp6AddressFromString(aAddr, &address);
|
||||
if (error != kThreadError_None)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
printf("otIp6AddressFromString(%s) failed, 0x%x!\r\n", aAddr, error);
|
||||
return error;
|
||||
@@ -1743,13 +1743,13 @@ OTNODEAPI int32_t OTCALL otNodePanIdQuery(otNode* aNode, uint16_t aPanId, uint32
|
||||
ResetEvent(aNode->mPanIdConflictEvent);
|
||||
|
||||
error = otCommissionerPanIdQuery(aNode->mInstance, aPanId, aMask, &address, otNodeCommissionerPanIdConflictCallback, aNode);
|
||||
if (error != kThreadError_None)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
printf("otCommissionerPanIdQuery failed, 0x%x!\r\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
auto result = WaitForSingleObject(aNode->mPanIdConflictEvent, 8000) == WAIT_OBJECT_0 ? kThreadError_None : kThreadError_NotFound;
|
||||
auto result = WaitForSingleObject(aNode->mPanIdConflictEvent, 8000) == WAIT_OBJECT_0 ? OT_ERROR_NONE : OT_ERROR_NOT_FOUND;
|
||||
otLogFuncExit();
|
||||
return result;
|
||||
}
|
||||
@@ -1770,7 +1770,7 @@ OTNODEAPI uint32_t OTCALL otNodePing(otNode* aNode, const char *aAddr, uint16_t
|
||||
// Convert string to destination address
|
||||
otIp6Address otDestinationAddress = {0};
|
||||
auto error = otIp6AddressFromString(aAddr, &otDestinationAddress);
|
||||
if (error != kThreadError_None)
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
printf("otIp6AddressFromString(%s) failed!\r\n", aAddr);
|
||||
return 0;
|
||||
@@ -1940,7 +1940,7 @@ OTNODEAPI int32_t OTCALL otNodeCommissionerAnnounceBegin(otNode* aNode, uint32_t
|
||||
|
||||
otIp6Address aAddress;
|
||||
auto error = otIp6AddressFromString(aAddr, &aAddress);
|
||||
if (error != kThreadError_None) return error;
|
||||
if (error != OT_ERROR_NONE) return error;
|
||||
|
||||
auto result = otCommissionerAnnounceBegin(aNode->mInstance, aChannelMask, aCount, aPeriod, &aAddress);
|
||||
otLogFuncExit();
|
||||
@@ -1981,7 +1981,7 @@ OTNODEAPI int32_t OTCALL otNodeSetActiveDataset(otNode* aNode, uint64_t aTimesta
|
||||
if ((keyLength = Hex2Bin(aMasterKey, aDataset.mMasterKey.m8, sizeof(aDataset.mMasterKey))) != OT_MASTER_KEY_SIZE)
|
||||
{
|
||||
printf("invalid length key %d\r\n", keyLength);
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
}
|
||||
aDataset.mIsMasterKeySet = true;
|
||||
}
|
||||
@@ -2070,7 +2070,7 @@ OTNODEAPI int32_t OTCALL otNodeSendPendingSet(otNode* aNode, uint64_t aActiveTim
|
||||
if ((keyLength = Hex2Bin(aMasterKey, aDataset.mMasterKey.m8, sizeof(aDataset.mMasterKey))) != OT_MASTER_KEY_SIZE)
|
||||
{
|
||||
printf("invalid length key %d\r\n", keyLength);
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
}
|
||||
aDataset.mIsMasterKeySet = true;
|
||||
}
|
||||
@@ -2079,7 +2079,7 @@ OTNODEAPI int32_t OTCALL otNodeSendPendingSet(otNode* aNode, uint64_t aActiveTim
|
||||
{
|
||||
otIp6Address prefix;
|
||||
auto error = otIp6AddressFromString(aMeshLocal, &prefix);
|
||||
if (error != kThreadError_None) return error;
|
||||
if (error != OT_ERROR_NONE) return error;
|
||||
memcpy(aDataset.mMeshLocalPrefix.m8, prefix.mFields.m8, sizeof(aDataset.mMeshLocalPrefix.m8));
|
||||
aDataset.mIsMeshLocalPrefixSet = true;
|
||||
}
|
||||
@@ -2133,7 +2133,7 @@ OTNODEAPI int32_t OTCALL otNodeSendActiveSet(otNode* aNode, uint64_t aActiveTime
|
||||
if ((keyLength = Hex2Bin(aExtPanId, aDataset.mExtendedPanId.m8, sizeof(aDataset.mExtendedPanId))) != OT_EXT_PAN_ID_SIZE)
|
||||
{
|
||||
printf("invalid length ext pan id %d\r\n", keyLength);
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
}
|
||||
aDataset.mIsExtendedPanIdSet = true;
|
||||
}
|
||||
@@ -2144,7 +2144,7 @@ OTNODEAPI int32_t OTCALL otNodeSendActiveSet(otNode* aNode, uint64_t aActiveTime
|
||||
if ((keyLength = Hex2Bin(aMasterKey, aDataset.mMasterKey.m8, sizeof(aDataset.mMasterKey))) != OT_MASTER_KEY_SIZE)
|
||||
{
|
||||
printf("invalid length key %d\r\n", keyLength);
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
}
|
||||
aDataset.mIsMasterKeySet = true;
|
||||
}
|
||||
@@ -2153,7 +2153,7 @@ OTNODEAPI int32_t OTCALL otNodeSendActiveSet(otNode* aNode, uint64_t aActiveTime
|
||||
{
|
||||
otIp6Address prefix;
|
||||
auto error = otIp6AddressFromString(aMeshLocal, &prefix);
|
||||
if (error != kThreadError_None) return error;
|
||||
if (error != OT_ERROR_NONE) return error;
|
||||
memcpy(aDataset.mMeshLocalPrefix.m8, prefix.mFields.m8, sizeof(aDataset.mMeshLocalPrefix.m8));
|
||||
aDataset.mIsMeshLocalPrefixSet = true;
|
||||
}
|
||||
@@ -2170,7 +2170,7 @@ OTNODEAPI int32_t OTCALL otNodeSendActiveSet(otNode* aNode, uint64_t aActiveTime
|
||||
if ((length = Hex2Bin(aBinary,tlvs, sizeof(tlvs))) < 0)
|
||||
{
|
||||
printf("invalid length tlvs %d\r\n", length);
|
||||
return kThreadError_Parse;
|
||||
return OT_ERROR_PARSE;
|
||||
}
|
||||
tlvsLength = (uint8_t)length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user