mirror of
https://github.com/espressif/openthread.git
synced 2026-08-13 06:07:48 +00:00
Clean up error names. (#1764)
This commit is contained in:
@@ -169,7 +169,7 @@ void MainPage::ShowInterfaceDetails(otAdapter^ adapter)
|
||||
{
|
||||
uint8_t index = 0;
|
||||
otChildInfo childInfo;
|
||||
while (kThreadError_None == otThreadGetChildInfoByIndex((otInstance*)(void*)adapter->RawHandle, index, &childInfo))
|
||||
while (OT_ERROR_NONE == otThreadGetChildInfoByIndex((otInstance*)(void*)adapter->RawHandle, index, &childInfo))
|
||||
{
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -581,23 +581,23 @@ private:
|
||||
|
||||
static HRESULT
|
||||
TheadErrorToHResult(
|
||||
int /* ThreadError */ error
|
||||
int /* otError */ error
|
||||
)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
case kThreadError_NoBufs: return E_OUTOFMEMORY;
|
||||
case kThreadError_Drop:
|
||||
case kThreadError_NoRoute: return HRESULT_FROM_WIN32(ERROR_NETWORK_UNREACHABLE);
|
||||
case kThreadError_InvalidArgs: return E_INVALIDARG;
|
||||
case kThreadError_Security: return E_ACCESSDENIED;
|
||||
case kThreadError_NotCapable:
|
||||
case kThreadError_NotImplemented: return E_NOTIMPL;
|
||||
case kThreadError_InvalidState: return E_NOT_VALID_STATE;
|
||||
case kThreadError_NotFound: return HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
|
||||
case kThreadError_Already: return HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS);
|
||||
case kThreadError_ResponseTimeout: return HRESULT_FROM_WIN32(ERROR_TIMEOUT);
|
||||
default: return E_FAIL;
|
||||
case OT_ERROR_NO_BUFS: return E_OUTOFMEMORY;
|
||||
case OT_ERROR_DROP:
|
||||
case OT_ERROR_NO_ROUTE: return HRESULT_FROM_WIN32(ERROR_NETWORK_UNREACHABLE);
|
||||
case OT_ERROR_INVALID_ARGS: return E_INVALIDARG;
|
||||
case OT_ERROR_SECURITY: return E_ACCESSDENIED;
|
||||
case OT_ERROR_NOT_CAPABLE:
|
||||
case OT_ERROR_NOT_IMPLEMENTED: return E_NOTIMPL;
|
||||
case OT_ERROR_INVALID_STATE: return E_NOT_VALID_STATE;
|
||||
case OT_ERROR_NOT_FOUND: return HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
|
||||
case OT_ERROR_ALREADY: return HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS);
|
||||
case OT_ERROR_RESPONSE_TIMEOUT: return HRESULT_FROM_WIN32(ERROR_TIMEOUT);
|
||||
default: return E_FAIL;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
(void) aTxPower;
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, ThreadError aError)
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, otError aError)
|
||||
{
|
||||
(void) aInstance;
|
||||
(void) aFrame;
|
||||
|
||||
@@ -46,34 +46,34 @@ enum
|
||||
FLASH_PAGE_SIZE = 0x800,
|
||||
};
|
||||
|
||||
static ThreadError romStatusToThread(int32_t aStatus)
|
||||
static otError romStatusToThread(int32_t aStatus)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
switch (aStatus)
|
||||
{
|
||||
case 0:
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
break;
|
||||
|
||||
case -1:
|
||||
error = kThreadError_Failed;
|
||||
error = OT_ERROR_FAILED;
|
||||
break;
|
||||
|
||||
case -2:
|
||||
error = kThreadError_InvalidArgs;
|
||||
error = OT_ERROR_INVALID_ARGS;
|
||||
break;
|
||||
|
||||
default:
|
||||
error = kThreadError_Abort;
|
||||
error = OT_ERROR_ABORT;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashInit(void)
|
||||
otError utilsFlashInit(void)
|
||||
{
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashGetSize(void)
|
||||
@@ -83,13 +83,13 @@ uint32_t utilsFlashGetSize(void)
|
||||
return reg ? (0x20000 * reg) : 0x10000;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int32_t status;
|
||||
uint32_t address;
|
||||
|
||||
otEXPECT_ACTION(aAddress < utilsFlashGetSize(), error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(aAddress < utilsFlashGetSize(), error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
address = FLASH_BASE + aAddress - (aAddress & (FLASH_PAGE_SIZE - 1));
|
||||
status = ROM_PageErase(address, FLASH_PAGE_SIZE);
|
||||
@@ -99,9 +99,9 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint32_t start = otPlatAlarmGetNow();
|
||||
uint32_t busy = 1;
|
||||
|
||||
@@ -110,7 +110,7 @@ ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
busy = HWREG(FLASH_CTRL_FCTL) & FLASH_CTRL_FCTL_BUSY;
|
||||
}
|
||||
|
||||
otEXPECT_ACTION(!busy, error = kThreadError_Busy);
|
||||
otEXPECT_ACTION(!busy, error = OT_ERROR_BUSY);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -137,7 +137,7 @@ uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
busy = HWREG(FLASH_CTRL_FCTL) & FLASH_CTRL_FCTL_BUSY;
|
||||
}
|
||||
|
||||
otEXPECT(romStatusToThread(status) == kThreadError_None);
|
||||
otEXPECT(romStatusToThread(status) == OT_ERROR_NONE);
|
||||
size += 4;
|
||||
data++;
|
||||
aAddress += 4;
|
||||
|
||||
@@ -93,8 +93,8 @@ static const TxPowerTable sTxPowerTable[] =
|
||||
|
||||
static RadioPacket sTransmitFrame;
|
||||
static RadioPacket sReceiveFrame;
|
||||
static ThreadError sTransmitError;
|
||||
static ThreadError sReceiveError;
|
||||
static otError sTransmitError;
|
||||
static otError sReceiveError;
|
||||
|
||||
static uint8_t sTransmitPsdu[IEEE802154_MAX_LENGTH];
|
||||
static uint8_t sReceivePsdu[IEEE802154_MAX_LENGTH];
|
||||
@@ -269,7 +269,7 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
return (sState != kStateDisabled) ? true : false;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
if (!otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
@@ -277,10 +277,10 @@ ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
sState = kStateSleep;
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
if (otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
@@ -288,18 +288,18 @@ ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
sState = kStateDisabled;
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
ThreadError error = kThreadError_InvalidState;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState == kStateSleep || sState == kStateReceive)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "State=kStateSleep", NULL);
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
sState = kStateSleep;
|
||||
disableReceiver();
|
||||
}
|
||||
@@ -307,16 +307,16 @@ ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
ThreadError error = kThreadError_InvalidState;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState != kStateDisabled)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "State=kStateReceive", NULL);
|
||||
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
sState = kStateReceive;
|
||||
setChannel(aChannel);
|
||||
sReceiveFrame.mChannel = aChannel;
|
||||
@@ -326,18 +326,18 @@ ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
{
|
||||
ThreadError error = kThreadError_InvalidState;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState == kStateReceive)
|
||||
{
|
||||
int i;
|
||||
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
sState = kStateTransmit;
|
||||
sTransmitError = kThreadError_None;
|
||||
sTransmitError = OT_ERROR_NONE;
|
||||
|
||||
while (HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE);
|
||||
|
||||
@@ -364,7 +364,7 @@ ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
|
||||
otEXPECT_ACTION(((HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_CCA) &&
|
||||
!((HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_SFD))),
|
||||
sTransmitError = kThreadError_ChannelAccessFailure);
|
||||
sTransmitError = OT_ERROR_CHANNEL_ACCESS_FAILURE);
|
||||
|
||||
// begin transmit
|
||||
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_TXON;
|
||||
@@ -495,9 +495,9 @@ void cc2538RadioProcess(otInstance *aInstance)
|
||||
|
||||
if (sState == kStateTransmit)
|
||||
{
|
||||
if (sTransmitError != kThreadError_None || (sTransmitFrame.mPsdu[0] & IEEE802154_ACK_REQUEST) == 0)
|
||||
if (sTransmitError != OT_ERROR_NONE || (sTransmitFrame.mPsdu[0] & IEEE802154_ACK_REQUEST) == 0)
|
||||
{
|
||||
if (sTransmitError != kThreadError_None)
|
||||
if (sTransmitError != OT_ERROR_NONE)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Transmit failed ErrorCode=%d", sTransmitError);
|
||||
}
|
||||
@@ -725,16 +725,16 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = findSrcMatchAvailEntry(true);
|
||||
uint32_t *addr = (uint32_t *)RFCORE_FFSM_SRCADDRESS_TABLE;
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Add ShortAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0, error = kThreadError_NoBufs);
|
||||
otEXPECT_ACTION(entry >= 0, error = OT_ERROR_NO_BUFS);
|
||||
|
||||
addr += (entry * RFCORE_XREG_SRCMATCH_SHORT_ENTRY_OFFSET);
|
||||
|
||||
@@ -749,16 +749,16 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = findSrcMatchAvailEntry(false);
|
||||
uint32_t *addr = (uint32_t *)RFCORE_FFSM_SRCADDRESS_TABLE;
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Add ExtAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0, error = kThreadError_NoBufs);
|
||||
otEXPECT_ACTION(entry >= 0, error = OT_ERROR_NO_BUFS);
|
||||
|
||||
addr += (entry * RFCORE_XREG_SRCMATCH_EXT_ENTRY_OFFSET);
|
||||
|
||||
@@ -773,15 +773,15 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = findSrcMatchShortEntry(aShortAddress);
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Clear ShortAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0, error = kThreadError_NoAddress);
|
||||
otEXPECT_ACTION(entry >= 0, error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
setSrcMatchEntryEnableStatus(true, (uint8_t)(entry), false);
|
||||
|
||||
@@ -789,15 +789,15 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = findSrcMatchExtEntry(aExtAddress);
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Clear ExtAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0, error = kThreadError_NoAddress);
|
||||
otEXPECT_ACTION(entry >= 0, error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
setSrcMatchEntryEnableStatus(false, (uint8_t)(entry), false);
|
||||
|
||||
@@ -835,12 +835,12 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void otPlatRadioSetDefaultTxPower(otInstance *aInstance, int8_t aPower)
|
||||
|
||||
@@ -91,12 +91,12 @@ uint32_t otPlatRandomGet(void)
|
||||
return random;
|
||||
}
|
||||
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint8_t channel = 0;
|
||||
|
||||
otEXPECT_ACTION(aOutput, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(aOutput, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
if (otPlatRadioIsEnabled(sInstance))
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ typedef struct RecvBuffer
|
||||
|
||||
static RecvBuffer sReceive;
|
||||
|
||||
ThreadError otPlatUartEnable(void)
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
uint32_t div;
|
||||
|
||||
@@ -108,19 +108,19 @@ ThreadError otPlatUartEnable(void)
|
||||
// enable interrupts
|
||||
HWREG(NVIC_EN0) = 1 << ((INT_UART0 - 16) & 31);
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartDisable(void)
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = kThreadError_Busy);
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = OT_ERROR_BUSY);
|
||||
|
||||
sTransmitBuffer = aBuf;
|
||||
sTransmitLength = aBufLength;
|
||||
|
||||
@@ -70,7 +70,7 @@ void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
(void) aTxPower;
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, ThreadError aError)
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, otError aError)
|
||||
{
|
||||
(void) aInstance;
|
||||
(void) aFrame;
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
* not enough space on the cc2650 to support NV as an SoC.
|
||||
*/
|
||||
|
||||
ThreadError utilsFlashInit(void)
|
||||
otError utilsFlashInit(void)
|
||||
{
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashGetSize(void)
|
||||
@@ -43,16 +43,16 @@ uint32_t utilsFlashGetSize(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
(void)aAddress;
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
(void)aTimeout;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
|
||||
@@ -136,8 +136,8 @@ static dataQueue_t sRxDataQueue = { 0 };
|
||||
/* openthread data primatives */
|
||||
static RadioPacket sTransmitFrame;
|
||||
static RadioPacket sReceiveFrame;
|
||||
static ThreadError sTransmitError;
|
||||
static ThreadError sReceiveError;
|
||||
static otError sTransmitError;
|
||||
static otError sReceiveError;
|
||||
|
||||
static uint8_t sTransmitPsdu[kMaxPHYPacketSize] __attribute__((aligned(4))) ;
|
||||
static uint8_t sReceivePsdu[kMaxPHYPacketSize] __attribute__((aligned(4))) ;
|
||||
@@ -1059,7 +1059,7 @@ void RFCCPE0IntHandler(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
sTransmitError = kThreadError_NoAck;
|
||||
sTransmitError = OT_ERROR_NO_ACK;
|
||||
/* signal polling function we are done transmitting, we failed to send the packet */
|
||||
sState = cc2650_stateTransmitComplete;
|
||||
}
|
||||
@@ -1068,20 +1068,20 @@ void RFCCPE0IntHandler(void)
|
||||
|
||||
case IEEE_DONE_ACK:
|
||||
sReceivedAckPendingBit = false;
|
||||
sTransmitError = kThreadError_None;
|
||||
sTransmitError = OT_ERROR_NONE;
|
||||
/* signal polling function we are done transmitting */
|
||||
sState = cc2650_stateTransmitComplete;
|
||||
break;
|
||||
|
||||
case IEEE_DONE_ACKPEND:
|
||||
sReceivedAckPendingBit = true;
|
||||
sTransmitError = kThreadError_None;
|
||||
sTransmitError = OT_ERROR_NONE;
|
||||
/* signal polling function we are done transmitting */
|
||||
sState = cc2650_stateTransmitComplete;
|
||||
break;
|
||||
|
||||
default:
|
||||
sTransmitError = kThreadError_Failed;
|
||||
sTransmitError = OT_ERROR_FAILED;
|
||||
/* signal polling function we are done transmitting */
|
||||
sState = cc2650_stateTransmitComplete;
|
||||
break;
|
||||
@@ -1095,25 +1095,25 @@ void RFCCPE0IntHandler(void)
|
||||
{
|
||||
case IEEE_DONE_OK:
|
||||
sReceivedAckPendingBit = false;
|
||||
sTransmitError = kThreadError_None;
|
||||
sTransmitError = OT_ERROR_NONE;
|
||||
break;
|
||||
|
||||
case IEEE_DONE_TIMEOUT:
|
||||
sTransmitError = kThreadError_ChannelAccessFailure;
|
||||
sTransmitError = OT_ERROR_CHANNEL_ACCESS_FAILURE;
|
||||
break;
|
||||
|
||||
case IEEE_ERROR_NO_SETUP:
|
||||
case IEEE_ERROR_NO_FS:
|
||||
case IEEE_ERROR_SYNTH_PROG:
|
||||
sTransmitError = kThreadError_InvalidState;
|
||||
sTransmitError = OT_ERROR_INVALID_STATE;
|
||||
break;
|
||||
|
||||
case IEEE_ERROR_TXUNF:
|
||||
sTransmitError = kThreadError_NoBufs;
|
||||
sTransmitError = OT_ERROR_NO_BUFS;
|
||||
break;
|
||||
|
||||
default:
|
||||
sTransmitError = kThreadError_Error;
|
||||
sTransmitError = OT_ERROR_GENERIC;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1138,25 +1138,25 @@ void cc2650RadioInit(void)
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState == cc2650_stateSleep)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else if (sState == cc2650_stateDisabled)
|
||||
{
|
||||
otEXPECT_ACTION(rfCorePowerOn() == CMDSTA_Done, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(rfCoreSendEnableCmd() == DONE_OK, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(rfCorePowerOn() == CMDSTA_Done, error = OT_ERROR_FAILED);
|
||||
otEXPECT_ACTION(rfCoreSendEnableCmd() == DONE_OK, error = OT_ERROR_FAILED);
|
||||
sState = cc2650_stateSleep;
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (error == kThreadError_Failed)
|
||||
if (error == OT_ERROR_FAILED)
|
||||
{
|
||||
rfCorePowerOff();
|
||||
sState = cc2650_stateDisabled;
|
||||
@@ -1177,14 +1177,14 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState == cc2650_stateDisabled)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else if (sState == cc2650_stateSleep)
|
||||
{
|
||||
@@ -1194,7 +1194,7 @@ ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
*/
|
||||
rfCorePowerOff();
|
||||
sState = cc2650_stateDisabled;
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -1203,16 +1203,16 @@ ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState == cc2650_stateSleep)
|
||||
{
|
||||
sState = cc2650_stateEdScan;
|
||||
otEXPECT_ACTION(rfCoreSendEdScanCmd(aScanChannel, aScanDuration) == CMDSTA_Done, error = kThreadError_Failed);
|
||||
error = kThreadError_None;
|
||||
otEXPECT_ACTION(rfCoreSendEdScanCmd(aScanChannel, aScanDuration) == CMDSTA_Done, error = OT_ERROR_FAILED);
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
exit:
|
||||
@@ -1246,9 +1246,9 @@ void otPlatRadioSetDefaultTxPower(otInstance *aInstance, int8_t aPower)
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState == cc2650_stateSleep)
|
||||
@@ -1260,8 +1260,8 @@ ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
* may have changed some values in the rx command
|
||||
*/
|
||||
sReceiveCmd.channel = aChannel;
|
||||
otEXPECT_ACTION(rfCoreSendReceiveCmd() == CMDSTA_Done, error = kThreadError_Failed);
|
||||
error = kThreadError_None;
|
||||
otEXPECT_ACTION(rfCoreSendReceiveCmd() == CMDSTA_Done, error = OT_ERROR_FAILED);
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else if (sState == cc2650_stateReceive)
|
||||
{
|
||||
@@ -1269,7 +1269,7 @@ ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
/* we are already running on the right channel */
|
||||
sState = cc2650_stateReceive;
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1277,16 +1277,16 @@ ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
* we are running on the wrong channel. Either way assume the
|
||||
* caller correctly called us and abort all running commands.
|
||||
*/
|
||||
otEXPECT_ACTION(rfCoreExecuteAbortCmd() == CMDSTA_Done, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(rfCoreExecuteAbortCmd() == CMDSTA_Done, error = OT_ERROR_FAILED);
|
||||
|
||||
/* any frames in the queue will be for the old channel */
|
||||
otEXPECT_ACTION(rfCoreClearReceiveQueue(&sRxDataQueue) == CMDSTA_Done, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(rfCoreClearReceiveQueue(&sRxDataQueue) == CMDSTA_Done, error = OT_ERROR_FAILED);
|
||||
|
||||
sReceiveCmd.channel = aChannel;
|
||||
otEXPECT_ACTION(rfCoreSendReceiveCmd() == CMDSTA_Done, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(rfCoreSendReceiveCmd() == CMDSTA_Done, error = OT_ERROR_FAILED);
|
||||
|
||||
sState = cc2650_stateReceive;
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1297,20 +1297,20 @@ exit:
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState == cc2650_stateSleep)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else if (sState == cc2650_stateReceive)
|
||||
{
|
||||
if (rfCoreExecuteAbortCmd() != CMDSTA_Done)
|
||||
{
|
||||
error = kThreadError_Busy;
|
||||
error = OT_ERROR_BUSY;
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1333,9 +1333,9 @@ RadioPacket *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
{
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
|
||||
if (sState == cc2650_stateReceive)
|
||||
{
|
||||
@@ -1345,14 +1345,14 @@ ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
*/
|
||||
error = otPlatRadioReceive(aInstance, aPacket->mChannel);
|
||||
|
||||
if (error == kThreadError_None)
|
||||
if (error == OT_ERROR_NONE)
|
||||
{
|
||||
sState = cc2650_stateTransmit;
|
||||
|
||||
/* removing 2 bytes of CRC placeholder because we generate that in hardware */
|
||||
otEXPECT_ACTION(rfCoreSendTransmitCmd(aPacket->mPsdu, aPacket->mLength - 2) == CMDSTA_Done,
|
||||
error = kThreadError_Failed);
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_FAILED);
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1401,9 +1401,9 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx = rfCoreFindShortSrcMatchIdx(aShortAddress);
|
||||
|
||||
@@ -1411,7 +1411,7 @@ ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16
|
||||
{
|
||||
/* the entry does not exist already, add it */
|
||||
otEXPECT_ACTION((idx = rfCoreFindEmptyShortSrcMatchIdx()) != CC2650_SRC_MATCH_NONE,
|
||||
error = kThreadError_NoBufs);
|
||||
error = OT_ERROR_NO_BUFS);
|
||||
sSrcMatchShortData.extAddrEnt[idx].shortAddr = aShortAddress;
|
||||
sSrcMatchShortData.extAddrEnt[idx].panId = sReceiveCmd.localPanID;
|
||||
}
|
||||
@@ -1420,7 +1420,7 @@ ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16
|
||||
{
|
||||
/* we have a running or backgrounded rx command */
|
||||
otEXPECT_ACTION(rfCoreModifySourceMatchEntry(idx, SHORT_ADDRESS, true) == CMDSTA_Done,
|
||||
error = kThreadError_Failed);
|
||||
error = OT_ERROR_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1436,19 +1436,19 @@ exit:
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx;
|
||||
otEXPECT_ACTION((idx = rfCoreFindShortSrcMatchIdx(aShortAddress)) != CC2650_SRC_MATCH_NONE,
|
||||
error = kThreadError_NoAddress);
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
/* we have a running or backgrounded rx command */
|
||||
otEXPECT_ACTION(rfCoreModifySourceMatchEntry(idx, SHORT_ADDRESS, false) == CMDSTA_Done,
|
||||
error = kThreadError_Failed);
|
||||
error = OT_ERROR_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1464,16 +1464,16 @@ exit:
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress);
|
||||
|
||||
if (idx == CC2650_SRC_MATCH_NONE)
|
||||
{
|
||||
/* the entry does not exist already, add it */
|
||||
otEXPECT_ACTION((idx = rfCoreFindEmptyExtSrcMatchIdx()) != CC2650_SRC_MATCH_NONE, error = kThreadError_NoBufs);
|
||||
otEXPECT_ACTION((idx = rfCoreFindEmptyExtSrcMatchIdx()) != CC2650_SRC_MATCH_NONE, error = OT_ERROR_NO_BUFS);
|
||||
sSrcMatchExtData.extAddrEnt[idx] = *((uint64_t *)aExtAddress);
|
||||
}
|
||||
|
||||
@@ -1481,7 +1481,7 @@ ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t
|
||||
{
|
||||
/* we have a running or backgrounded rx command */
|
||||
otEXPECT_ACTION(rfCoreModifySourceMatchEntry(idx, EXT_ADDRESS, true) == CMDSTA_Done,
|
||||
error = kThreadError_Failed);
|
||||
error = OT_ERROR_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1497,19 +1497,19 @@ exit:
|
||||
/**
|
||||
* Function documented in platform/radio.h
|
||||
*/
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx;
|
||||
otEXPECT_ACTION((idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress)) != CC2650_SRC_MATCH_NONE,
|
||||
error = kThreadError_NoAddress);
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
/* we have a running or backgrounded rx command */
|
||||
otEXPECT_ACTION(rfCoreModifySourceMatchEntry(idx, EXT_ADDRESS, false) == CMDSTA_Done,
|
||||
error = kThreadError_Failed);
|
||||
error = OT_ERROR_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1779,11 +1779,11 @@ static void readFrame(void)
|
||||
sReceiveFrame.mChannel = sReceiveCmd.channel;
|
||||
sReceiveFrame.mPower = rssi;
|
||||
sReceiveFrame.mLqi = crcCorr->status.corr;
|
||||
sReceiveError = kThreadError_None;
|
||||
sReceiveError = OT_ERROR_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
sReceiveError = kThreadError_FcsErr;
|
||||
sReceiveError = OT_ERROR_FCS;
|
||||
}
|
||||
|
||||
curEntry->status = DATA_ENTRY_PENDING;
|
||||
@@ -1818,7 +1818,7 @@ void cc2650RadioProcess(otInstance *aInstance)
|
||||
}
|
||||
}
|
||||
|
||||
if (sState == cc2650_stateTransmitComplete || sTransmitError != kThreadError_None)
|
||||
if (sState == cc2650_stateTransmitComplete || sTransmitError != OT_ERROR_NONE)
|
||||
{
|
||||
/* we are not looking for an ACK packet, or failed */
|
||||
sState = cc2650_stateReceive;
|
||||
|
||||
@@ -122,16 +122,15 @@ static int TRNGPoll(unsigned char *aOutput, size_t aLen)
|
||||
/**
|
||||
* Function documented in platform/random.h
|
||||
*/
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
size_t length = aOutputLength;
|
||||
|
||||
otEXPECT_ACTION(aOutput, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(aOutput, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
otEXPECT_ACTION(TRNGPoll((unsigned char *)aOutput, length) != 0, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(TRNGPoll((unsigned char *)aOutput, length) != 0, error = OT_ERROR_FAILED);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ void UART0_intHandler(void);
|
||||
/**
|
||||
* Function documented in platform/uart.h
|
||||
*/
|
||||
ThreadError otPlatUartEnable(void)
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
PRCMPowerDomainOn(PRCM_DOMAIN_SERIAL);
|
||||
|
||||
@@ -81,13 +81,13 @@ ThreadError otPlatUartEnable(void)
|
||||
UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
|
||||
UARTIntRegister(UART0_BASE, UART0_intHandler);
|
||||
UARTEnable(UART0_BASE);
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function documented in platform/uart.h
|
||||
*/
|
||||
ThreadError otPlatUartDisable(void)
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
UARTDisable(UART0_BASE);
|
||||
UARTIntUnregister(UART0_BASE);
|
||||
@@ -104,16 +104,16 @@ ThreadError otPlatUartDisable(void)
|
||||
* serial power domain
|
||||
*/
|
||||
PRCMPowerDomainOff(PRCM_DOMAIN_SERIAL);
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function documented in platform/uart.h
|
||||
*/
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otEXPECT_ACTION(sSendBuffer == NULL, error = kThreadError_Busy);
|
||||
otError error = OT_ERROR_NONE;
|
||||
otEXPECT_ACTION(sSendBuffer == NULL, error = OT_ERROR_BUSY);
|
||||
|
||||
sSendBuffer = aBuf;
|
||||
sSendLen = aBufLength;
|
||||
|
||||
@@ -53,14 +53,14 @@ QSPI_SECTION static uint8_t qspi_get_erase_status(void)
|
||||
volatile bool DisableErase = false;
|
||||
|
||||
// Erase QSPI memory section as non-blocking function. Remember to check utilsFlashStatusWait before write or read!!
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
|
||||
uint32_t flash_offset = (aAddress) & ~(FLASH_SECTOR_SIZE - 1);
|
||||
|
||||
if (DisableErase)
|
||||
{
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
qspi_automode_init();
|
||||
@@ -68,7 +68,7 @@ ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
|
||||
CACHE->CACHE_CTRL1_REG = CACHE_CACHE_CTRL1_REG_CACHE_FLUSH_Msk;
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ uint32_t utilsFlashGetSize(void)
|
||||
return (uint32_t)FLASH_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
|
||||
sWaitStatusTimeout = otPlatAlarmGetNow();
|
||||
@@ -87,25 +87,25 @@ ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
|
||||
if (qspi_get_erase_status())
|
||||
{
|
||||
return kThreadError_Busy;
|
||||
return OT_ERROR_BUSY;
|
||||
}
|
||||
else
|
||||
{
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError utilsFlashInit(void)
|
||||
otError utilsFlashInit(void)
|
||||
{
|
||||
qspi_automode_flash_power_up();
|
||||
|
||||
if (utilsFlashStatusWait(1000) == kThreadError_Busy)
|
||||
if (utilsFlashStatusWait(1000) == OT_ERROR_BUSY)
|
||||
{
|
||||
return kThreadError_Failed;
|
||||
return OT_ERROR_FAILED;
|
||||
}
|
||||
else
|
||||
{
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ static uint8_t sTransmitPsdu[kMaxPHYPacketSize];
|
||||
static uint8_t sReceivePsdu[kMaxPHYPacketSize];
|
||||
static RadioPacket sTransmitFrame;
|
||||
static RadioPacket sReceiveFrame;
|
||||
static ThreadError sTransmitStatus;
|
||||
static otError sTransmitStatus;
|
||||
|
||||
static bool sFramePending = false;
|
||||
static bool sSendFrameDone = false;
|
||||
@@ -139,13 +139,13 @@ void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t address)
|
||||
FTDF_setValue(FTDF_PIB_SHORT_ADDRESS, &address);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
uint8_t defaultChannel;
|
||||
uint8_t maxRetries;
|
||||
|
||||
ThreadError error = kThreadError_None;
|
||||
otEXPECT_ACTION(sRadioState == kStateDisabled, error = kThreadError_InvalidState);
|
||||
otError error = OT_ERROR_NONE;
|
||||
otEXPECT_ACTION(sRadioState == kStateDisabled, error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
sThreadInstance = aInstance;
|
||||
sTransmitFrame.mPsdu = sTransmitPsdu;
|
||||
@@ -170,13 +170,13 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
sRadioState = kStateDisabled;
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
@@ -186,23 +186,23 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
return (sRadioState != kStateDisabled);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
if (sRadioState == kStateReceive && sSleepInitDelay == 0)
|
||||
{
|
||||
sSleepInitDelay = otPlatAlarmGetNow();
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
else if ((otPlatAlarmGetNow() - sSleepInitDelay) < 3000)
|
||||
{
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otEXPECT_ACTION(((sRadioState == kStateReceive) || (sRadioState == kStateSleep)),
|
||||
error = kThreadError_InvalidState);
|
||||
error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
sGoSleep = true;
|
||||
sRadioState = kStateSleep;
|
||||
@@ -211,12 +211,12 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
(void)aInstance;
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(sRadioState != kStateDisabled, error = kThreadError_InvalidState);
|
||||
otEXPECT_ACTION(sRadioState != kStateDisabled, error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
ad_ftdf_wake_up();
|
||||
sChannel = aChannel;
|
||||
@@ -236,7 +236,7 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
(void)aEnable;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
@@ -244,10 +244,10 @@ ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16
|
||||
uint8_t entryIdx;
|
||||
|
||||
// check if address already stored
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otEXPECT(!FTDF_fpprLookupShortAddress(aShortAddress, &entry, &entryIdx));
|
||||
|
||||
otEXPECT_ACTION(FTDF_fpprGetFreeShortAddress(&entry, &entryIdx), error = kThreadError_NoBufs);
|
||||
otEXPECT_ACTION(FTDF_fpprGetFreeShortAddress(&entry, &entryIdx), error = OT_ERROR_NO_BUFS);
|
||||
|
||||
FTDF_fpprSetShortAddress(entry, entryIdx, aShortAddress);
|
||||
FTDF_fpprSetShortAddressValid(entry, entryIdx, FTDF_TRUE);
|
||||
@@ -257,7 +257,7 @@ exit:
|
||||
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
@@ -271,10 +271,10 @@ ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t
|
||||
addr = addrL | (addrH << 32);
|
||||
|
||||
// check if address already stored
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otEXPECT(!FTDF_fpprLookupExtAddress(addr, &entry));
|
||||
|
||||
otEXPECT_ACTION(FTDF_fpprGetFreeExtAddress(&entry), error = kThreadError_NoBufs);
|
||||
otEXPECT_ACTION(FTDF_fpprGetFreeExtAddress(&entry), error = OT_ERROR_NO_BUFS);
|
||||
|
||||
FTDF_fpprSetExtAddress(entry, addr);
|
||||
FTDF_fpprSetExtAddressValid(entry, FTDF_TRUE);
|
||||
@@ -283,15 +283,15 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
uint8_t entry;
|
||||
uint8_t entryIdx;
|
||||
|
||||
ThreadError error = kThreadError_None;
|
||||
otEXPECT_ACTION(FTDF_fpprLookupShortAddress(aShortAddress, &entry, &entryIdx), error = kThreadError_NoAddress);
|
||||
otError error = OT_ERROR_NONE;
|
||||
otEXPECT_ACTION(FTDF_fpprLookupShortAddress(aShortAddress, &entry, &entryIdx), error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
FTDF_fpprSetShortAddress(entry, entryIdx, 0);
|
||||
FTDF_fpprSetShortAddressValid(entry, entryIdx, FTDF_FALSE);
|
||||
@@ -300,7 +300,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
@@ -313,8 +313,8 @@ ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_
|
||||
addrH = (aExtAddress[0] << 24) | (aExtAddress[1] << 16) | (aExtAddress[2] << 8) | (aExtAddress[3] << 0);
|
||||
addr = addrL | (addrH << 32);
|
||||
|
||||
ThreadError error = kThreadError_None;
|
||||
otEXPECT_ACTION(FTDF_fpprLookupExtAddress(addr, &entry), error = kThreadError_NoAddress);
|
||||
otError error = OT_ERROR_NONE;
|
||||
otEXPECT_ACTION(FTDF_fpprLookupExtAddress(addr, &entry), error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
FTDF_fpprSetExtAddress(entry, 0);
|
||||
FTDF_fpprSetExtAddressValid(entry, FTDF_FALSE);
|
||||
@@ -363,14 +363,14 @@ RadioPacket *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
uint8_t csmaSuppress;
|
||||
|
||||
ThreadError error = kThreadError_None;
|
||||
otEXPECT_ACTION(sRadioState != kStateDisabled, error = kThreadError_InvalidState);
|
||||
otError error = OT_ERROR_NONE;
|
||||
otEXPECT_ACTION(sRadioState != kStateDisabled, error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
csmaSuppress = 0;
|
||||
ad_ftdf_send_frame_simple(aPacket->mLength, aPacket->mPsdu, aPacket->mChannel, 0, csmaSuppress); //Prio 0 for all.
|
||||
@@ -409,13 +409,13 @@ void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
sRadioPromiscuous = aEnable;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void otPlatRadioSetDefaultTxPower(otInstance *aInstance, int8_t aPower)
|
||||
@@ -460,20 +460,20 @@ void FTDF_sendFrameTransparentConfirm(void *handle, FTDF_Bitmap32 status)
|
||||
switch (status)
|
||||
{
|
||||
case FTDF_TRANSPARENT_SEND_SUCCESSFUL:
|
||||
sTransmitStatus = kThreadError_None;
|
||||
sTransmitStatus = OT_ERROR_NONE;
|
||||
break;
|
||||
|
||||
case FTDF_TRANSPARENT_CSMACA_FAILURE:
|
||||
sTransmitStatus = kThreadError_ChannelAccessFailure;
|
||||
sTransmitStatus = OT_ERROR_CHANNEL_ACCESS_FAILURE;
|
||||
break;
|
||||
|
||||
case FTDF_TRANSPARENT_NO_ACK:
|
||||
sTransmitStatus = kThreadError_NoAck;
|
||||
sTransmitStatus = OT_ERROR_NO_ACK;
|
||||
sSleepInitDelay = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
sTransmitStatus = kThreadError_Abort;
|
||||
sTransmitStatus = OT_ERROR_ABORT;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -494,11 +494,11 @@ void FTDF_rcvFrameTransparent(FTDF_DataLength frameLength,
|
||||
|
||||
if (status == FTDF_TRANSPARENT_RCV_SUCCESSFUL)
|
||||
{
|
||||
otPlatRadioReceiveDone(sThreadInstance, &sReceiveFrame, kThreadError_None);
|
||||
otPlatRadioReceiveDone(sThreadInstance, &sReceiveFrame, OT_ERROR_NONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
otPlatRadioReceiveDone(sThreadInstance, &sReceiveFrame, kThreadError_Abort);
|
||||
otPlatRadioReceiveDone(sThreadInstance, &sReceiveFrame, OT_ERROR_ABORT);
|
||||
}
|
||||
|
||||
if (sRadioState != kStateDisabled)
|
||||
|
||||
@@ -93,7 +93,7 @@ uint32_t otPlatRandomGet(void)
|
||||
return mlcg;
|
||||
}
|
||||
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
|
||||
for (uint16_t length = 0; length < aOutputLength; length++)
|
||||
@@ -101,5 +101,5 @@ ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
aOutput[length] = (uint8_t)otPlatRandomGet();
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ static int sInFd;
|
||||
static int sOutFd;
|
||||
void UartBuffClear(void);
|
||||
|
||||
ThreadError otPlatUartEnable(void)
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
uart_config uart_init =
|
||||
{
|
||||
.baud_rate = HW_UART_BAUDRATE_9600,
|
||||
@@ -76,9 +76,9 @@ ThreadError otPlatUartEnable(void)
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartDisable(void)
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
close(sInFd);
|
||||
close(sOutFd);
|
||||
@@ -117,9 +117,9 @@ void UartBuffClear(void)
|
||||
}
|
||||
|
||||
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
hw_uart_write_buffer(HW_UART1, aBuf, aBufLength);
|
||||
|
||||
otPlatUartSendDone();
|
||||
|
||||
@@ -77,7 +77,7 @@ void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
(void) aTxPower;
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, ThreadError aError)
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, otError aError)
|
||||
{
|
||||
(void) aInstance;
|
||||
(void) aFrame;
|
||||
|
||||
@@ -48,32 +48,32 @@ static inline uint32_t mapAddress(uint32_t aAddress)
|
||||
return aAddress + FLASH_DATA_START_ADDR;
|
||||
}
|
||||
|
||||
static ThreadError returnTypeConvert(int32_t aStatus)
|
||||
static otError returnTypeConvert(int32_t aStatus)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
switch (aStatus)
|
||||
{
|
||||
case mscReturnOk:
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
break;
|
||||
|
||||
case mscReturnInvalidAddr:
|
||||
case mscReturnUnaligned:
|
||||
error = kThreadError_InvalidArgs;
|
||||
error = OT_ERROR_INVALID_ARGS;
|
||||
break;
|
||||
|
||||
default:
|
||||
error = kThreadError_Failed;
|
||||
error = OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashInit(void)
|
||||
otError utilsFlashInit(void)
|
||||
{
|
||||
MSC_Init();
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashGetSize(void)
|
||||
@@ -81,7 +81,7 @@ uint32_t utilsFlashGetSize(void)
|
||||
return FLASH_DATA_END_ADDR - FLASH_DATA_START_ADDR;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
int32_t status;
|
||||
|
||||
@@ -90,16 +90,16 @@ ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
return returnTypeConvert(status);
|
||||
}
|
||||
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
uint32_t start = otPlatAlarmGetNow();
|
||||
|
||||
do
|
||||
{
|
||||
if (MSC->STATUS & MSC_STATUS_WDATAREADY)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -118,7 +118,7 @@ uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
(!(aAddress & 3)) && (!(aSize & 3)), rval = 0);
|
||||
|
||||
status = MSC_WriteWord((uint32_t *)mapAddress(aAddress), aData, aSize);
|
||||
otEXPECT_ACTION(returnTypeConvert(status) == kThreadError_None, rval = 0);
|
||||
otEXPECT_ACTION(returnTypeConvert(status) == OT_ERROR_NONE, rval = 0);
|
||||
|
||||
exit:
|
||||
return rval;
|
||||
|
||||
@@ -77,11 +77,11 @@ static PhyState sState = kStateDisabled;
|
||||
static uint8_t sReceiveBuffer[IEEE802154_MAX_LENGTH + 1 + sizeof(RAIL_RxPacketInfo_t)];
|
||||
static uint8_t sReceivePsdu[IEEE802154_MAX_LENGTH];
|
||||
static RadioPacket sReceiveFrame;
|
||||
static ThreadError sReceiveError;
|
||||
static otError sReceiveError;
|
||||
|
||||
static RadioPacket sTransmitFrame;
|
||||
static uint8_t sTransmitPsdu[IEEE802154_MAX_LENGTH];
|
||||
static ThreadError sTransmitError;
|
||||
static otError sTransmitError;
|
||||
|
||||
typedef struct srcMatchEntry
|
||||
{
|
||||
@@ -226,7 +226,7 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
return (sState != kStateDisabled);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
CORE_ENTER_CRITICAL();
|
||||
@@ -238,10 +238,10 @@ ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
|
||||
exit:
|
||||
CORE_EXIT_CRITICAL();
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
CORE_ENTER_CRITICAL();
|
||||
@@ -253,19 +253,19 @@ ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
|
||||
exit:
|
||||
CORE_EXIT_CRITICAL();
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
CORE_ENTER_CRITICAL();
|
||||
|
||||
otEXPECT_ACTION((sState != kStateTransmit) && (sState != kStateDisabled),
|
||||
error = kThreadError_InvalidState);
|
||||
error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
otLogInfoPlat(sInstance, "State=kStateSleep", NULL);
|
||||
sState = kStateSleep;
|
||||
@@ -281,15 +281,15 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
CORE_ENTER_CRITICAL();
|
||||
|
||||
otEXPECT_ACTION(sState != kStateDisabled, error = kThreadError_InvalidState);
|
||||
otEXPECT_ACTION(sState != kStateDisabled, error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
otLogInfoPlat(sInstance, "State=kStateReceive", NULL);
|
||||
sState = kStateReceive;
|
||||
@@ -311,9 +311,9 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
RAIL_CsmaConfig_t csmaConfig = RAIL_CSMA_CONFIG_802_15_4_2003_2p4_GHz_OQPSK_CSMA;
|
||||
RAIL_TxData_t tx_data;
|
||||
uint8_t frame[IEEE802154_MAX_LENGTH + 1];
|
||||
@@ -323,10 +323,10 @@ ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
CORE_ENTER_CRITICAL();
|
||||
|
||||
otEXPECT_ACTION((sState != kStateDisabled) && (sState != kStateTransmit),
|
||||
error = kThreadError_InvalidState);
|
||||
error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
sState = kStateTransmit;
|
||||
sTransmitError = kThreadError_None;
|
||||
sTransmitError = OT_ERROR_NONE;
|
||||
sTransmitBusy = true;
|
||||
|
||||
frame[0] = aPacket->mLength;
|
||||
@@ -502,10 +502,10 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
CORE_EXIT_CRITICAL();
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = -1;
|
||||
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
@@ -515,7 +515,7 @@ ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16
|
||||
otLogDebgPlat(sInstance, "Add ShortAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0 && entry < RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM,
|
||||
error = kThreadError_NoBufs);
|
||||
error = OT_ERROR_NO_BUFS);
|
||||
|
||||
addToSrcMatchShortIndirect(entry, aShortAddress);
|
||||
|
||||
@@ -524,9 +524,9 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = -1;
|
||||
(void)aInstance;
|
||||
|
||||
@@ -537,7 +537,7 @@ ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t
|
||||
otLogDebgPlat(sInstance, "Add ExtAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0 && entry < RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM,
|
||||
error = kThreadError_NoBufs);
|
||||
error = OT_ERROR_NO_BUFS);
|
||||
|
||||
addToSrcMatchExtIndirect(entry, aExtAddress);
|
||||
|
||||
@@ -546,9 +546,9 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = -1;
|
||||
(void)aInstance;
|
||||
|
||||
@@ -559,7 +559,7 @@ ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint
|
||||
otLogDebgPlat(sInstance, "Clear ShortAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0 && entry < RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM,
|
||||
error = kThreadError_NoAddress);
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
removeFromSrcMatchShortIndirect(entry);
|
||||
|
||||
@@ -568,9 +568,9 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = -1;
|
||||
(void)aInstance;
|
||||
|
||||
@@ -581,7 +581,7 @@ ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_
|
||||
otLogDebgPlat(sInstance, "Clear ExtAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0 && entry < RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM,
|
||||
error = kThreadError_NoAddress);
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
removeFromSrcMatchExtIndirect(entry);
|
||||
|
||||
@@ -627,12 +627,12 @@ void RAILCb_IEEE802154_DataRequestCommand(RAIL_IEEE802154_Address_t *aAddress)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void RAILCb_TxRadioStatus(uint8_t aStatus)
|
||||
@@ -640,12 +640,12 @@ void RAILCb_TxRadioStatus(uint8_t aStatus)
|
||||
switch (aStatus)
|
||||
{
|
||||
case RAIL_TX_CONFIG_CHANNEL_BUSY:
|
||||
sTransmitError = kThreadError_ChannelAccessFailure;
|
||||
sTransmitError = OT_ERROR_CHANNEL_ACCESS_FAILURE;
|
||||
sTransmitBusy = false;
|
||||
break;
|
||||
|
||||
case RAIL_TX_CONFIG_TX_ABORTED:
|
||||
sTransmitError = kThreadError_Abort;
|
||||
sTransmitError = OT_ERROR_ABORT;
|
||||
sTransmitBusy = false;
|
||||
break;
|
||||
|
||||
@@ -657,7 +657,7 @@ void RAILCb_TxRadioStatus(uint8_t aStatus)
|
||||
void RAILCb_TxPacketSent(RAIL_TxPacketInfo_t *aTxPacketInfo)
|
||||
{
|
||||
(void)aTxPacketInfo;
|
||||
sTransmitError = kThreadError_None;
|
||||
sTransmitError = OT_ERROR_NONE;
|
||||
sTransmitBusy = false;
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ void RAILCb_RxPacketReceived(void *aRxPacketHandle)
|
||||
sReceiveFrame.mPower = rxPacketInfo->appendedInfo.rssiLatch;
|
||||
sReceiveFrame.mLqi = rxPacketInfo->appendedInfo.lqi;
|
||||
sReceiveFrame.mLength = length;
|
||||
sReceiveError = kThreadError_None;
|
||||
sReceiveError = OT_ERROR_NONE;
|
||||
|
||||
exit:
|
||||
return;
|
||||
@@ -722,9 +722,9 @@ void efr32RadioProcess(otInstance *aInstance)
|
||||
|
||||
if (sState == kStateTransmit && sTransmitBusy == false)
|
||||
{
|
||||
if (sTransmitError != kThreadError_None || (sTransmitFrame.mPsdu[0] & IEEE802154_ACK_REQUEST) == 0)
|
||||
if (sTransmitError != OT_ERROR_NONE || (sTransmitFrame.mPsdu[0] & IEEE802154_ACK_REQUEST) == 0)
|
||||
{
|
||||
if (sTransmitError != kThreadError_None)
|
||||
if (sTransmitError != OT_ERROR_NONE)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Transmit failed ErrorCode=%d", sTransmitError);
|
||||
}
|
||||
|
||||
@@ -91,11 +91,11 @@ uint32_t otPlatRandomGet(void)
|
||||
return random;
|
||||
}
|
||||
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(aOutput, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(aOutput, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
for (uint16_t length = 0; length < aOutputLength; length++)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ typedef struct RecvBuffer
|
||||
|
||||
static RecvBuffer sReceive;
|
||||
|
||||
ThreadError otPlatUartEnable(void)
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
USART_TypeDef *usart = USART0;
|
||||
USART_InitAsync_TypeDef init = USART_INITASYNC_DEFAULT;
|
||||
@@ -114,7 +114,7 @@ ThreadError otPlatUartEnable(void)
|
||||
/* Finally enable it */
|
||||
USART_Enable(usart, usartEnable);
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
void USART0_RX_IRQHandler(void)
|
||||
@@ -132,16 +132,16 @@ void USART0_RX_IRQHandler(void)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError otPlatUartDisable(void)
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = kThreadError_Busy);
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = OT_ERROR_BUSY);
|
||||
|
||||
sTransmitBuffer = aBuf;
|
||||
sTransmitLength = aBufLength;
|
||||
|
||||
@@ -74,10 +74,10 @@
|
||||
#endif // SETTINGS_CONFIG_PAGE_NUM
|
||||
#define SETTINGS_CONFIG_PAGE_NUM 1
|
||||
|
||||
ThreadError utilsFlashInit(void)
|
||||
otError utilsFlashInit(void)
|
||||
{
|
||||
flash_init();
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashGetSize(void)
|
||||
@@ -85,26 +85,26 @@ uint32_t utilsFlashGetSize(void)
|
||||
return (uint32_t)FLASH_SECTOR_SIZE;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int32_t status;
|
||||
|
||||
otEXPECT_ACTION((aAddress >= OPENTHREAD_FLASH_BASE) && (aAddress < (OPENTHREAD_FLASH_BASE + OPENTHREAD_FLASH_SIZE - 1)),
|
||||
error = kThreadError_InvalidArgs);
|
||||
error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
/* Use 2 sectors in the implementation, cannot erase the address over the boundry */
|
||||
status = flash_erase(aAddress, FLASH_SECTOR_SIZE);
|
||||
|
||||
otEXPECT_ACTION(status != -1, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(status != -1, error = OT_ERROR_FAILED);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint32_t start = otPlatAlarmGetNow();
|
||||
bool busy = true;
|
||||
uint32_t status = 0x01;
|
||||
@@ -115,7 +115,7 @@ ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
busy = status & 0x01;
|
||||
}
|
||||
|
||||
otEXPECT_ACTION(!busy, error = kThreadError_Busy);
|
||||
otEXPECT_ACTION(!busy, error = OT_ERROR_BUSY);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
|
||||
@@ -103,8 +103,8 @@ static RadioPacket sTransmitFrame;
|
||||
static RadioPacket sReceiveFrame;
|
||||
static RadioPacket sAckFrame;
|
||||
|
||||
static ThreadError sTransmitError;
|
||||
static ThreadError sReceiveError;
|
||||
static otError sTransmitError;
|
||||
static otError sReceiveError;
|
||||
|
||||
static uint8_t sTransmitPsdu[IEEE802154_MAX_LENGTH];
|
||||
static uint8_t sReceivePsdu[IEEE802154_MAX_LENGTH];
|
||||
@@ -326,34 +326,34 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
return (sState != kStateDisabled);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
if (!otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
sState = kStateSleep;
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
if (otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
sState = kStateDisabled;
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
ThreadError error = kThreadError_InvalidState;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState == kStateSleep || sState == kStateReceive)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
sState = kStateSleep;
|
||||
disableReceiver();
|
||||
}
|
||||
@@ -361,14 +361,14 @@ ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
ThreadError error = kThreadError_InvalidState;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState != kStateDisabled)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
sState = kStateReceive;
|
||||
setChannel(aChannel);
|
||||
sReceiveFrame.mChannel = aChannel;
|
||||
@@ -378,15 +378,15 @@ ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
{
|
||||
ThreadError error = kThreadError_InvalidState;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
(void)aPacket;
|
||||
|
||||
if (sState == kStateReceive)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
sState = kStateTransmit;
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ void radioTransmitMessage(otInstance *aInstance)
|
||||
(void)aInstance;
|
||||
uint8_t header_len = 0;
|
||||
|
||||
sTransmitError = kThreadError_None;
|
||||
sTransmitError = OT_ERROR_NONE;
|
||||
setChannel(sTransmitFrame.mChannel);
|
||||
|
||||
uint8_t reg = mrf24j40_read_short_ctrl_reg(MRF24J40_TXNCON);
|
||||
@@ -547,7 +547,7 @@ void emskRadioProcess(otInstance *aInstance)
|
||||
{
|
||||
radioTransmitMessage(aInstance);
|
||||
|
||||
if (sTransmitError != kThreadError_None || (sTransmitFrame.mPsdu[0] & IEEE802154_ACK_REQUEST) == 0)
|
||||
if (sTransmitError != OT_ERROR_NONE || (sTransmitFrame.mPsdu[0] & IEEE802154_ACK_REQUEST) == 0)
|
||||
{
|
||||
sState = kStateReceive;
|
||||
otPlatRadioTransmitDone(aInstance, &sTransmitFrame, false, sTransmitError);
|
||||
@@ -620,32 +620,32 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
(void)aEnable;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aShortAddress;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aExtAddress;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aShortAddress;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aExtAddress;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
@@ -658,12 +658,12 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void otPlatRadioSetDefaultTxPower(otInstance *aInstance, int8_t aPower)
|
||||
|
||||
@@ -64,12 +64,12 @@ uint32_t otPlatRandomGet(void)
|
||||
return (uint32_t)rand();
|
||||
}
|
||||
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint8_t channel = 0;
|
||||
|
||||
otEXPECT_ACTION(aOutput && aOutputLength, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(aOutput && aOutputLength, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
/* disable radio*/
|
||||
if (otPlatRadioIsEnabled(sInstance))
|
||||
@@ -85,7 +85,7 @@ ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
* Please see Note in `<path-to-openthread>/examples/platforms/emsk/README.md`
|
||||
* for TRNG features on EMSK.
|
||||
*/
|
||||
otEXPECT_ACTION(aOutput && aOutputLength, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(aOutput && aOutputLength, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
for (uint16_t length = 0; length < aOutputLength; length++)
|
||||
{
|
||||
|
||||
@@ -60,10 +60,10 @@ static uint16_t sReceiveHead = 0;
|
||||
|
||||
static DEV_UART *consoleUart;
|
||||
|
||||
ThreadError otPlatUartEnable(void)
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
int32_t stateUart = 0;
|
||||
ThreadError error = kThreadError_Drop;
|
||||
otError error = OT_ERROR_DROP;
|
||||
|
||||
/* UART in embARC */
|
||||
consoleUart = uart_get_dev(BOARD_CONSOLE_UART_ID);
|
||||
@@ -75,12 +75,12 @@ ThreadError otPlatUartEnable(void)
|
||||
if (stateUart == E_OPNED)
|
||||
{
|
||||
consoleUart->uart_control(UART_CMD_SET_BAUD, (void *)(BOARD_CONSOLE_UART_BAUD));
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
DBG("Set Console UART Baudrate to %d.\r\n", BOARD_CONSOLE_UART_BAUD);
|
||||
}
|
||||
else if (stateUart == E_OK)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
DBG("Open Console UART Successfully.\r\n");
|
||||
}
|
||||
else
|
||||
@@ -94,16 +94,16 @@ exit:
|
||||
|
||||
}
|
||||
|
||||
ThreadError otPlatUartDisable(void)
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = kThreadError_Busy);
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = OT_ERROR_BUSY);
|
||||
|
||||
sTransmitBuffer = aBuf;
|
||||
sTransmitLength = aBufLength;
|
||||
|
||||
@@ -75,7 +75,7 @@ void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
(void) aTxPower;
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, ThreadError aError)
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, otError aError)
|
||||
{
|
||||
(void) aInstance;
|
||||
(void) aFrame;
|
||||
|
||||
@@ -35,13 +35,13 @@
|
||||
|
||||
static flash_config_t sFlashConfig;
|
||||
|
||||
ThreadError utilsFlashInit(void)
|
||||
otError utilsFlashInit(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
if (FLASH_Init(&sFlashConfig) != kStatus_FLASH_Success)
|
||||
{
|
||||
error = kThreadError_Failed;
|
||||
error = OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -52,39 +52,39 @@ uint32_t utilsFlashGetSize(void)
|
||||
return FSL_FEATURE_FLASH_PFLASH_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
ThreadError error;
|
||||
otError error;
|
||||
status_t status;
|
||||
|
||||
status = FLASH_Erase(&sFlashConfig, aAddress, FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE, kFLASH_ApiEraseKey);
|
||||
|
||||
if (status == kStatus_FLASH_Success)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else if (status == kStatus_FLASH_AlignmentError)
|
||||
{
|
||||
error = kThreadError_InvalidArgs;
|
||||
error = OT_ERROR_INVALID_ARGS;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = kThreadError_Failed;
|
||||
error = OT_ERROR_FAILED;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
uint32_t start = otPlatAlarmGetNow();
|
||||
|
||||
do
|
||||
{
|
||||
if (FTFA->FSTAT & FTFA_FSTAT_CCIF_MASK)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ static bool sTxDone = false;
|
||||
static bool sRxDone = false;
|
||||
static bool sEdScanDone = false;
|
||||
static bool sAckFpState;
|
||||
static ThreadError sTxStatus;
|
||||
static otError sTxStatus;
|
||||
|
||||
static RadioPacket sTxPacket;
|
||||
static RadioPacket sRxPacket;
|
||||
@@ -102,9 +102,9 @@ static int8_t rf_lqi_to_rssi(uint8_t lqi);
|
||||
static uint32_t rf_get_timestamp(void);
|
||||
static void rf_set_timeout(uint32_t abs_timeout);
|
||||
static uint16_t rf_get_addr_checksum(uint8_t *pAddr, bool ExtendedAddr, uint16_t PanId);
|
||||
static ThreadError rf_add_addr_table_entry(uint16_t checksum, bool extendedAddr);
|
||||
static ThreadError rf_remove_addr_table_entry(uint16_t checksum);
|
||||
static ThreadError rf_remove_addr_table_entry_index(uint8_t index);
|
||||
static otError rf_add_addr_table_entry(uint16_t checksum, bool extendedAddr);
|
||||
static otError rf_remove_addr_table_entry(uint16_t checksum);
|
||||
static otError rf_remove_addr_table_entry_index(uint8_t index);
|
||||
|
||||
PhyState otPlatRadioGetState(otInstance *aInstance)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aShortAddress)
|
||||
ZLL->MACSHORTADDRS0 |= ZLL_MACSHORTADDRS0_MACSHORTADDRS0(aShortAddress);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
otEXPECT(!otPlatRadioIsEnabled(aInstance));
|
||||
|
||||
@@ -174,10 +174,10 @@ ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
sState = kStateSleep;
|
||||
|
||||
exit:
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
otEXPECT(otPlatRadioIsEnabled(aInstance));
|
||||
|
||||
@@ -186,7 +186,7 @@ ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
sState = kStateDisabled;
|
||||
|
||||
exit:
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
@@ -195,12 +195,12 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
return sState != kStateDisabled;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
ThreadError status = kThreadError_None;
|
||||
otError status = OT_ERROR_NONE;
|
||||
(void) aInstance;
|
||||
|
||||
otEXPECT_ACTION(((sState != kStateTransmit) && (sState != kStateDisabled)), status = kThreadError_InvalidState);
|
||||
otEXPECT_ACTION(((sState != kStateTransmit) && (sState != kStateDisabled)), status = OT_ERROR_INVALID_STATE);
|
||||
|
||||
rf_abort();
|
||||
sState = kStateSleep;
|
||||
@@ -209,12 +209,12 @@ exit:
|
||||
return status;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
ThreadError status = kThreadError_None;
|
||||
otError status = OT_ERROR_NONE;
|
||||
(void) aInstance;
|
||||
|
||||
otEXPECT_ACTION(((sState != kStateTransmit) && (sState != kStateDisabled)), status = kThreadError_InvalidState);
|
||||
otEXPECT_ACTION(((sState != kStateTransmit) && (sState != kStateDisabled)), status = OT_ERROR_INVALID_STATE);
|
||||
|
||||
sState = kStateReceive;
|
||||
|
||||
@@ -253,7 +253,7 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void) aInstance;
|
||||
uint16_t checksum = sPanId + aShortAddress;
|
||||
@@ -261,7 +261,7 @@ ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16
|
||||
return rf_add_addr_table_entry(checksum, false);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void) aInstance;
|
||||
uint16_t checksum = rf_get_addr_checksum((uint8_t *)aExtAddress, true, sPanId);
|
||||
@@ -269,7 +269,7 @@ ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t
|
||||
return rf_add_addr_table_entry(checksum, true);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void) aInstance;
|
||||
uint16_t checksum = sPanId + aShortAddress;
|
||||
@@ -277,7 +277,7 @@ ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint
|
||||
return rf_remove_addr_table_entry(checksum);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void) aInstance;
|
||||
uint16_t checksum = rf_get_addr_checksum((uint8_t *)aExtAddress, true, sPanId);
|
||||
@@ -321,14 +321,14 @@ RadioPacket *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
return &sTxPacket;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
{
|
||||
ThreadError status = kThreadError_None;
|
||||
otError status = OT_ERROR_NONE;
|
||||
uint32_t timeout;
|
||||
|
||||
(void) aInstance;
|
||||
|
||||
otEXPECT_ACTION(((sState != kStateTransmit) && (sState != kStateDisabled)), status = kThreadError_InvalidState);
|
||||
otEXPECT_ACTION(((sState != kStateTransmit) && (sState != kStateDisabled)), status = OT_ERROR_INVALID_STATE);
|
||||
|
||||
if (rf_get_state() != XCVR_Idle_c)
|
||||
{
|
||||
@@ -418,13 +418,13 @@ void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
ThreadError status = kThreadError_None;
|
||||
otError status = OT_ERROR_NONE;
|
||||
uint32_t timeout;
|
||||
(void) aInstance;
|
||||
|
||||
otEXPECT_ACTION(((sState != kStateTransmit) && (sState != kStateDisabled)), status = kThreadError_InvalidState);
|
||||
otEXPECT_ACTION(((sState != kStateTransmit) && (sState != kStateDisabled)), status = OT_ERROR_INVALID_STATE);
|
||||
|
||||
if (rf_get_state() != XCVR_Idle_c)
|
||||
{
|
||||
@@ -585,10 +585,10 @@ static uint16_t rf_get_addr_checksum(uint8_t *pAddr, bool ExtendedAddr, uint16_t
|
||||
return checksum;
|
||||
}
|
||||
|
||||
static ThreadError rf_add_addr_table_entry(uint16_t checksum, bool extendedAddr)
|
||||
static otError rf_add_addr_table_entry(uint16_t checksum, bool extendedAddr)
|
||||
{
|
||||
uint8_t index;
|
||||
ThreadError status;
|
||||
otError status;
|
||||
|
||||
/* Find first free index */
|
||||
ZLL->SAM_TABLE = ZLL_SAM_TABLE_FIND_FREE_IDX_MASK;
|
||||
@@ -599,7 +599,7 @@ static ThreadError rf_add_addr_table_entry(uint16_t checksum, bool extendedAddr)
|
||||
|
||||
index = (ZLL->SAM_FREE_IDX & ZLL_SAM_FREE_IDX_SAP0_1ST_FREE_IDX_MASK) >> ZLL_SAM_FREE_IDX_SAP0_1ST_FREE_IDX_SHIFT;
|
||||
|
||||
otEXPECT_ACTION((index < RADIO_CONFIG_SRC_MATCH_ENTRY_NUM), status = kThreadError_NoBufs);
|
||||
otEXPECT_ACTION((index < RADIO_CONFIG_SRC_MATCH_ENTRY_NUM), status = OT_ERROR_NO_BUFS);
|
||||
|
||||
/* Insert the checksum at the index found */
|
||||
ZLL->SAM_TABLE = ((uint32_t)index << ZLL_SAM_TABLE_SAM_INDEX_SHIFT) |
|
||||
@@ -612,15 +612,15 @@ static ThreadError rf_add_addr_table_entry(uint16_t checksum, bool extendedAddr)
|
||||
sExtSrcAddrBitmap[index >> 3] |= 1 << (index & 7);
|
||||
}
|
||||
|
||||
status = kThreadError_None;
|
||||
status = OT_ERROR_NONE;
|
||||
|
||||
exit:
|
||||
return status;
|
||||
}
|
||||
|
||||
static ThreadError rf_remove_addr_table_entry(uint16_t checksum)
|
||||
static otError rf_remove_addr_table_entry(uint16_t checksum)
|
||||
{
|
||||
ThreadError status = kThreadError_NoAddress;
|
||||
otError status = OT_ERROR_NO_ADDRESS;
|
||||
uint32_t i, temp;
|
||||
|
||||
/* Search for an entry to match the provided checksum */
|
||||
@@ -641,11 +641,11 @@ static ThreadError rf_remove_addr_table_entry(uint16_t checksum)
|
||||
return status;
|
||||
}
|
||||
|
||||
static ThreadError rf_remove_addr_table_entry_index(uint8_t index)
|
||||
static otError rf_remove_addr_table_entry_index(uint8_t index)
|
||||
{
|
||||
ThreadError status = kThreadError_None;
|
||||
otError status = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(index < RADIO_CONFIG_SRC_MATCH_ENTRY_NUM, status = kThreadError_NoAddress);
|
||||
otEXPECT_ACTION(index < RADIO_CONFIG_SRC_MATCH_ENTRY_NUM, status = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
ZLL->SAM_TABLE = ((uint32_t)0xFFFF << ZLL_SAM_TABLE_SAM_CHECKSUM_SHIFT) |
|
||||
((uint32_t)index << ZLL_SAM_TABLE_SAM_INDEX_SHIFT) |
|
||||
@@ -726,7 +726,7 @@ void Radio_1_IRQHandler(void)
|
||||
{
|
||||
rf_abort();
|
||||
sState = kStateReceive;
|
||||
sTxStatus = kThreadError_NoAck;
|
||||
sTxStatus = OT_ERROR_NO_ACK;
|
||||
sTxDone = true;
|
||||
}
|
||||
}
|
||||
@@ -757,12 +757,12 @@ void Radio_1_IRQHandler(void)
|
||||
|
||||
if ((ZLL->PHY_CTRL & ZLL_PHY_CTRL_CCABFRTX_MASK) && (irqStatus & ZLL_IRQSTS_CCA_MASK))
|
||||
{
|
||||
sTxStatus = kThreadError_ChannelAccessFailure;
|
||||
sTxStatus = OT_ERROR_CHANNEL_ACCESS_FAILURE;
|
||||
}
|
||||
else
|
||||
{
|
||||
sAckFpState = (irqStatus & ZLL_IRQSTS_RX_FRM_PEND_MASK) > 0;
|
||||
sTxStatus = kThreadError_None;
|
||||
sTxStatus = OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
sTxDone = true;
|
||||
@@ -881,12 +881,12 @@ void kw41zRadioProcess(otInstance *aInstance)
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioReceiveDone(aInstance, &sRxPacket, kThreadError_None);
|
||||
otPlatDiagRadioReceiveDone(aInstance, &sRxPacket, OT_ERROR_NONE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioReceiveDone(aInstance, &sRxPacket, kThreadError_None);
|
||||
otPlatRadioReceiveDone(aInstance, &sRxPacket, OT_ERROR_NONE);
|
||||
}
|
||||
|
||||
sRxDone = false;
|
||||
|
||||
@@ -66,13 +66,13 @@ uint32_t otPlatRandomGet(void)
|
||||
return (uint32_t)rand();
|
||||
}
|
||||
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
ThreadError status = kThreadError_None;
|
||||
otError status = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION((aOutput != NULL), status = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION((aOutput != NULL), status = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
otEXPECT_ACTION(TRNG_GetRandomData(TRNG0, aOutput, aOutputLength) == kStatus_Success, status = kThreadError_Failed);
|
||||
otEXPECT_ACTION(TRNG_GetRandomData(TRNG0, aOutput, aOutputLength) == kStatus_Success, status = OT_ERROR_FAILED);
|
||||
|
||||
exit:
|
||||
return status;
|
||||
|
||||
@@ -71,7 +71,7 @@ typedef struct RecvBuffer
|
||||
|
||||
static RecvBuffer sReceive;
|
||||
|
||||
ThreadError otPlatUartEnable(void)
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
lpuart_config_t config;
|
||||
|
||||
@@ -96,20 +96,20 @@ ThreadError otPlatUartEnable(void)
|
||||
NVIC_ClearPendingIRQ(LPUART0_IRQn);
|
||||
NVIC_EnableIRQ(LPUART0_IRQn);
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartDisable(void)
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
NVIC_DisableIRQ(LPUART0_IRQn);
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = kThreadError_Busy);
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = OT_ERROR_BUSY);
|
||||
|
||||
sTransmitBuffer = aBuf + 1;
|
||||
sTransmitLength = aBufLength - 1;
|
||||
|
||||
@@ -68,16 +68,16 @@ static int32_t sTxRequestedCount = 1;
|
||||
static int16_t sID = -1;
|
||||
static struct PlatformDiagMessage sDiagMessage = {.mMessageDescriptor = "DiagMessage", .mChannel = 0, .mID = 0, .mCnt = 0};
|
||||
|
||||
static ThreadError parseLong(char *argv, long *aValue)
|
||||
static otError parseLong(char *argv, long *aValue)
|
||||
{
|
||||
char *endptr;
|
||||
*aValue = strtol(argv, &endptr, 0);
|
||||
return (*endptr == '\0') ? kThreadError_None : kThreadError_Parse;
|
||||
return (*endptr == '\0') ? OT_ERROR_NONE : OT_ERROR_PARSE;
|
||||
}
|
||||
|
||||
static void appendErrorResult(ThreadError aError, char *aOutput, size_t aOutputMaxLen)
|
||||
static void appendErrorResult(otError aError, char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
if (aError != kThreadError_None)
|
||||
if (aError != OT_ERROR_NONE)
|
||||
{
|
||||
snprintf(aOutput, aOutputMaxLen, "failed\r\nstatus %#x\r\n", aError);
|
||||
}
|
||||
@@ -86,9 +86,9 @@ static void appendErrorResult(ThreadError aError, char *aOutput, size_t aOutputM
|
||||
static void processListen(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
(void) aInstance;
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(otPlatDiagModeGet(), error = kThreadError_InvalidState);
|
||||
otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
@@ -99,7 +99,7 @@ static void processListen(otInstance *aInstance, int argc, char *argv[], char *a
|
||||
long value;
|
||||
|
||||
error = parseLong(argv[0], &value);
|
||||
otEXPECT(error == kThreadError_None);
|
||||
otEXPECT(error == OT_ERROR_NONE);
|
||||
sListen = (bool)(value);
|
||||
snprintf(aOutput, aOutputMaxLen, "set listen to %s\r\nstatus 0x%02x\r\n", sListen == true ? "yes" : "no", error);
|
||||
}
|
||||
@@ -112,9 +112,9 @@ static void processID(otInstance *aInstance, int argc, char *argv[], char *aOutp
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(otPlatDiagModeGet(), error = kThreadError_InvalidState);
|
||||
otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
@@ -125,8 +125,8 @@ static void processID(otInstance *aInstance, int argc, char *argv[], char *aOutp
|
||||
long value;
|
||||
|
||||
error = parseLong(argv[0], &value);
|
||||
otEXPECT(error == kThreadError_None);
|
||||
otEXPECT_ACTION(value >= 0, error = kThreadError_InvalidArgs);
|
||||
otEXPECT(error == OT_ERROR_NONE);
|
||||
otEXPECT_ACTION(value >= 0, error = OT_ERROR_INVALID_ARGS);
|
||||
sID = (int16_t)(value);
|
||||
snprintf(aOutput, aOutputMaxLen, "set ID to %" PRId16 "\r\nstatus 0x%02x\r\n", sID, error);
|
||||
}
|
||||
@@ -138,9 +138,9 @@ exit:
|
||||
static void processTransmit(otInstance *aInstance, int argc, char *argv[], char *aOutput,
|
||||
size_t aOutputMaxLen)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(otPlatDiagModeGet(), error = kThreadError_InvalidState);
|
||||
otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
@@ -169,11 +169,11 @@ static void processTransmit(otInstance *aInstance, int argc, char *argv[], char
|
||||
{
|
||||
long value;
|
||||
|
||||
otEXPECT_ACTION(argc == 2, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(argc == 2, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
error = parseLong(argv[1], &value);
|
||||
otEXPECT(error == kThreadError_None);
|
||||
otEXPECT_ACTION(value > 0, error = kThreadError_InvalidArgs);
|
||||
otEXPECT(error == OT_ERROR_NONE);
|
||||
otEXPECT_ACTION(value > 0, error = OT_ERROR_INVALID_ARGS);
|
||||
sTxPeriod = (uint32_t)(value);
|
||||
snprintf(aOutput, aOutputMaxLen, "set diagnostic messages interval to %" PRIu32 " ms\r\nstatus 0x%02x\r\n", sTxPeriod,
|
||||
error);
|
||||
@@ -182,11 +182,11 @@ static void processTransmit(otInstance *aInstance, int argc, char *argv[], char
|
||||
{
|
||||
long value;
|
||||
|
||||
otEXPECT_ACTION(argc == 2, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(argc == 2, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
error = parseLong(argv[1], &value);
|
||||
otEXPECT(error == kThreadError_None);
|
||||
otEXPECT_ACTION((value > 0) || (value == -1), error = kThreadError_InvalidArgs);
|
||||
otEXPECT(error == OT_ERROR_NONE);
|
||||
otEXPECT_ACTION((value > 0) || (value == -1), error = OT_ERROR_INVALID_ARGS);
|
||||
sTxRequestedCount = (uint32_t)(value);
|
||||
snprintf(aOutput, aOutputMaxLen, "set diagnostic messages count to %" PRId32 "\r\nstatus 0x%02x\r\n", sTxRequestedCount,
|
||||
error);
|
||||
@@ -242,11 +242,11 @@ void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
sTxPower = aTxPower;
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, ThreadError aError)
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, otError aError)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
if (sListen && (aError == kThreadError_None))
|
||||
if (sListen && (aError == OT_ERROR_NONE))
|
||||
{
|
||||
if (aFrame->mLength == sizeof(struct PlatformDiagMessage))
|
||||
{
|
||||
|
||||
@@ -51,13 +51,13 @@ static inline uint32_t mapAddress(uint32_t aAddress)
|
||||
return aAddress + FLASH_START_ADDR;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashInit(void)
|
||||
otError utilsFlashInit(void)
|
||||
{
|
||||
// Just ensure that the start and end addresses are page-aligned.
|
||||
assert((FLASH_START_ADDR % FLASH_PAGE_SIZE) == 0);
|
||||
assert((FLASH_END_ADDR % FLASH_PAGE_SIZE) == 0);
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashGetSize(void)
|
||||
@@ -65,10 +65,10 @@ uint32_t utilsFlashGetSize(void)
|
||||
return FLASH_END_ADDR - FLASH_START_ADDR;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otEXPECT_ACTION(aAddress < utilsFlashGetSize(), error = kThreadError_InvalidArgs);
|
||||
otError error = OT_ERROR_NONE;
|
||||
otEXPECT_ACTION(aAddress < utilsFlashGetSize(), error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
nrf_nvmc_page_erase(mapAddress(aAddress & FLASH_PAGE_ADDR_MASK));
|
||||
|
||||
@@ -76,15 +76,15 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
ThreadError error = kThreadError_Busy;
|
||||
otError error = OT_ERROR_BUSY;
|
||||
|
||||
if (aTimeout == 0)
|
||||
{
|
||||
if (NRF_NVMC->READY == NVMC_READY_READY_Ready)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -95,7 +95,7 @@ ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
if (NRF_NVMC->READY == NVMC_READY_READY_Ready)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,39 +236,39 @@ PhyState otPlatRadioGetState(otInstance *aInstance)
|
||||
return kStateReceive; // It is the default state. Return it in case of unknown.
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
|
||||
if (sDisabled)
|
||||
{
|
||||
sDisabled = false;
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = kThreadError_InvalidState;
|
||||
error = OT_ERROR_INVALID_STATE;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
|
||||
if (!sDisabled)
|
||||
{
|
||||
sDisabled = true;
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = kThreadError_InvalidState;
|
||||
error = OT_ERROR_INVALID_STATE;
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -281,7 +281,7 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
return !sDisabled;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
@@ -295,20 +295,20 @@ ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
setPendingEvent(kPendingEventSleep);
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
nrf_drv_radio802154_receive(aChannel);
|
||||
clearPendingEvents();
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
@@ -324,7 +324,7 @@ ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
setPendingEvent(kPendingEventChannelAccessFailure);
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
RadioPacket *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
@@ -369,79 +369,79 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
nrf_drv_radio802154_auto_pending_bit_set(aEnable);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
|
||||
uint8_t shortAddress[SHORT_ADDRESS_SIZE];
|
||||
convertShortAddress(shortAddress, aShortAddress);
|
||||
|
||||
if (nrf_drv_radio802154_pending_bit_for_addr_set(shortAddress, false))
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = kThreadError_NoBufs;
|
||||
error = OT_ERROR_NO_BUFS;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
|
||||
if (nrf_drv_radio802154_pending_bit_for_addr_set(aExtAddress, true))
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = kThreadError_NoBufs;
|
||||
error = OT_ERROR_NO_BUFS;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
|
||||
uint8_t shortAddress[SHORT_ADDRESS_SIZE];
|
||||
convertShortAddress(shortAddress, aShortAddress);
|
||||
|
||||
if (nrf_drv_radio802154_pending_bit_for_addr_clear(shortAddress, false))
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = kThreadError_NoAddress;
|
||||
error = OT_ERROR_NO_ADDRESS;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
|
||||
if (nrf_drv_radio802154_pending_bit_for_addr_clear(aExtAddress, true))
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = kThreadError_NoAddress;
|
||||
error = OT_ERROR_NO_ADDRESS;
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -461,7 +461,7 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
nrf_drv_radio802154_pending_bit_for_addr_reset(true);
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void) aInstance;
|
||||
|
||||
@@ -479,7 +479,7 @@ ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, u
|
||||
setPendingEvent(kPendingEventEnergyDetectionStart);
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
void otPlatRadioSetDefaultTxPower(otInstance *aInstance, int8_t aPower)
|
||||
@@ -499,12 +499,12 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioReceiveDone(aInstance, &sReceivedFrames[i], kThreadError_None);
|
||||
otPlatDiagRadioReceiveDone(aInstance, &sReceivedFrames[i], OT_ERROR_NONE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioReceiveDone(aInstance, &sReceivedFrames[i], kThreadError_None);
|
||||
otPlatRadioReceiveDone(aInstance, &sReceivedFrames[i], OT_ERROR_NONE);
|
||||
}
|
||||
|
||||
uint8_t *bufferAddress = &sReceivedFrames[i].mPsdu[-1];
|
||||
@@ -519,12 +519,12 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, sTransmitPendingBit, kThreadError_None);
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, sTransmitPendingBit, OT_ERROR_NONE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioTransmitDone(aInstance, &sTransmitFrame, sTransmitPendingBit, kThreadError_None);
|
||||
otPlatRadioTransmitDone(aInstance, &sTransmitFrame, sTransmitPendingBit, OT_ERROR_NONE);
|
||||
}
|
||||
|
||||
resetPendingEvent(kPendingEventFrameTransmitted);
|
||||
@@ -536,12 +536,12 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, false, kThreadError_ChannelAccessFailure);
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, false, OT_ERROR_CHANNEL_ACCESS_FAILURE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioTransmitDone(aInstance, &sTransmitFrame, false, kThreadError_ChannelAccessFailure);
|
||||
otPlatRadioTransmitDone(aInstance, &sTransmitFrame, false, OT_ERROR_CHANNEL_ACCESS_FAILURE);
|
||||
}
|
||||
|
||||
resetPendingEvent(kPendingEventChannelAccessFailure);
|
||||
|
||||
@@ -150,12 +150,12 @@ uint32_t otPlatRandomGet(void)
|
||||
return (uint32_t)rand();
|
||||
}
|
||||
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(aOutput, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(!bufferIsEmpty(), error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(aOutput, error = OT_ERROR_INVALID_ARGS);
|
||||
otEXPECT_ACTION(!bufferIsEmpty(), error = OT_ERROR_FAILED);
|
||||
|
||||
uint16_t copyLength = (uint16_t)bufferCount();
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ void nrf5UartDeinit(void)
|
||||
nrf_uart_int_disable(UART_INSTANCE, NRF_UART_INT_MASK_RXDRDY | NRF_UART_INT_MASK_ERROR);
|
||||
}
|
||||
|
||||
ThreadError otPlatUartEnable(void)
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
// Start HFCLK
|
||||
nrf_drv_clock_hfclk_request(NULL);
|
||||
@@ -202,10 +202,10 @@ ThreadError otPlatUartEnable(void)
|
||||
nrf_uart_enable(UART_INSTANCE);
|
||||
nrf_uart_task_trigger(UART_INSTANCE, NRF_UART_TASK_STARTRX);
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartDisable(void)
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
// Disable UART instance.
|
||||
nrf_uart_disable(UART_INSTANCE);
|
||||
@@ -213,14 +213,14 @@ ThreadError otPlatUartDisable(void)
|
||||
// Release HF clock.
|
||||
nrf_drv_clock_hfclk_release();
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = kThreadError_Busy);
|
||||
otEXPECT_ACTION(sTransmitBuffer == NULL, error = OT_ERROR_BUSY);
|
||||
|
||||
// Set up transmit buffer and its size without counting first triggered byte.
|
||||
sTransmitBuffer = aBuf;
|
||||
|
||||
@@ -72,7 +72,7 @@ void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
(void) aTxPower;
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, ThreadError aError)
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, otError aError)
|
||||
{
|
||||
(void) aInstance;
|
||||
(void) aFrame;
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
|
||||
#include "platform-posix.h"
|
||||
|
||||
ThreadError utilsFlashInit(void)
|
||||
otError utilsFlashInit(void)
|
||||
{
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashGetSize(void)
|
||||
@@ -38,14 +38,14 @@ uint32_t utilsFlashGetSize(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
|
||||
@@ -50,9 +50,9 @@ enum
|
||||
FLASH_PAGE_NUM = 128,
|
||||
};
|
||||
|
||||
ThreadError utilsFlashInit(void)
|
||||
otError utilsFlashInit(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
char fileName[20];
|
||||
struct stat st;
|
||||
bool create = false;
|
||||
@@ -77,14 +77,14 @@ ThreadError utilsFlashInit(void)
|
||||
sFlashFd = open(fileName, O_RDWR | O_CREAT, 0666);
|
||||
lseek(sFlashFd, 0, SEEK_SET);
|
||||
|
||||
otEXPECT_ACTION(sFlashFd >= 0, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(sFlashFd >= 0, error = OT_ERROR_FAILED);
|
||||
|
||||
if (create)
|
||||
{
|
||||
for (uint16_t index = 0; index < FLASH_PAGE_NUM; index++)
|
||||
{
|
||||
error = utilsFlashErasePage(index * FLASH_PAGE_SIZE);
|
||||
otEXPECT(error == kThreadError_None);
|
||||
otEXPECT(error == OT_ERROR_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,14 +97,14 @@ uint32_t utilsFlashGetSize(void)
|
||||
return FLASH_SIZE;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint32_t address;
|
||||
uint8_t dummyPage[ FLASH_SIZE ];
|
||||
|
||||
otEXPECT_ACTION(sFlashFd >= 0, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(aAddress < FLASH_SIZE, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(sFlashFd >= 0, error = OT_ERROR_FAILED);
|
||||
otEXPECT_ACTION(aAddress < FLASH_SIZE, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
// Get start address of the flash page that includes aAddress
|
||||
address = aAddress & (~(uint32_t)(FLASH_PAGE_SIZE - 1));
|
||||
@@ -115,17 +115,17 @@ ThreadError utilsFlashErasePage(uint32_t aAddress)
|
||||
// Write the page
|
||||
ssize_t r;
|
||||
r = pwrite(sFlashFd, &(dummyPage[0]), FLASH_PAGE_SIZE, address);
|
||||
otEXPECT_ACTION(((int)r) == ((int)(FLASH_PAGE_SIZE)), error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(((int)r) == ((int)(FLASH_PAGE_SIZE)), error = OT_ERROR_FAILED);
|
||||
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
(void)aTimeout;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
|
||||
@@ -386,48 +386,48 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
return (sState != kStateDisabled) ? true : false;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnable(otInstance *aInstance)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
if (!otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
sState = kStateSleep;
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
if (otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
sState = kStateDisabled;
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
ThreadError error = kThreadError_InvalidState;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState == kStateSleep || sState == kStateReceive)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
sState = kStateSleep;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
ThreadError error = kThreadError_InvalidState;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
if (sState != kStateDisabled)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
sState = kStateReceive;
|
||||
sAckWait = false;
|
||||
sReceiveFrame.mChannel = aChannel;
|
||||
@@ -436,15 +436,15 @@ ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket)
|
||||
{
|
||||
ThreadError error = kThreadError_InvalidState;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
(void)aPacket;
|
||||
|
||||
if (sState == kStateReceive)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
sState = kStateTransmit;
|
||||
}
|
||||
|
||||
@@ -499,12 +499,12 @@ void radioReceive(otInstance *aInstance)
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, isFramePending(sReceiveFrame.mPsdu), kThreadError_None);
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, isFramePending(sReceiveFrame.mPsdu), OT_ERROR_NONE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioTransmitDone(aInstance, &sTransmitFrame, isFramePending(sReceiveFrame.mPsdu), kThreadError_None);
|
||||
otPlatRadioTransmitDone(aInstance, &sTransmitFrame, isFramePending(sReceiveFrame.mPsdu), OT_ERROR_NONE);
|
||||
}
|
||||
}
|
||||
else if ((sState == kStateReceive || sState == kStateTransmit) &&
|
||||
@@ -530,12 +530,12 @@ void radioSendMessage(otInstance *aInstance)
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, false, kThreadError_None);
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, false, OT_ERROR_NONE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioTransmitDone(aInstance, &sTransmitFrame, false, kThreadError_None);
|
||||
otPlatRadioTransmitDone(aInstance, &sTransmitFrame, false, OT_ERROR_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -640,12 +640,12 @@ void radioSendAck(void)
|
||||
|
||||
void radioProcessFrame(otInstance *aInstance)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otPanId dstpan;
|
||||
otShortAddress short_address;
|
||||
otExtAddress ext_address;
|
||||
|
||||
otEXPECT_ACTION(sPromiscuous == false, error = kThreadError_None);
|
||||
otEXPECT_ACTION(sPromiscuous == false, error = OT_ERROR_NONE);
|
||||
|
||||
switch (sReceiveFrame.mPsdu[1] & IEEE802154_DST_ADDR_MASK)
|
||||
{
|
||||
@@ -657,7 +657,7 @@ void radioProcessFrame(otInstance *aInstance)
|
||||
short_address = getShortAddress(sReceiveFrame.mPsdu);
|
||||
otEXPECT_ACTION((dstpan == IEEE802154_BROADCAST || dstpan == sPanid) &&
|
||||
(short_address == IEEE802154_BROADCAST || short_address == sShortAddress),
|
||||
error = kThreadError_Abort);
|
||||
error = OT_ERROR_ABORT);
|
||||
break;
|
||||
|
||||
case IEEE802154_DST_ADDR_EXT:
|
||||
@@ -665,11 +665,11 @@ void radioProcessFrame(otInstance *aInstance)
|
||||
getExtAddress(sReceiveFrame.mPsdu, &ext_address);
|
||||
otEXPECT_ACTION((dstpan == IEEE802154_BROADCAST || dstpan == sPanid) &&
|
||||
memcmp(&ext_address, sExtendedAddress, sizeof(ext_address)) == 0,
|
||||
error = kThreadError_Abort);
|
||||
error = OT_ERROR_ABORT);
|
||||
break;
|
||||
|
||||
default:
|
||||
error = kThreadError_Abort;
|
||||
error = OT_ERROR_ABORT;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -688,12 +688,12 @@ exit:
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioReceiveDone(aInstance, error == kThreadError_None ? &sReceiveFrame : NULL, error);
|
||||
otPlatDiagRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otPlatRadioReceiveDone(aInstance, error == kThreadError_None ? &sReceiveFrame : NULL, error);
|
||||
otPlatRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,32 +703,32 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
(void)aEnable;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aShortAddress;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aExtAddress;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aShortAddress;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aExtAddress;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
@@ -741,12 +741,12 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void otPlatRadioSetDefaultTxPower(otInstance *aInstance, int8_t aPower)
|
||||
|
||||
@@ -48,10 +48,10 @@ void platformRandomInit(void)
|
||||
{
|
||||
#if __SANITIZE_ADDRESS__ == 0
|
||||
|
||||
ThreadError error;
|
||||
otError error;
|
||||
|
||||
error = otPlatRandomGetTrue((uint8_t *)&sState, sizeof(sState));
|
||||
assert(error == kThreadError_None);
|
||||
assert(error == OT_ERROR_NONE);
|
||||
|
||||
#else // __SANITIZE_ADDRESS__
|
||||
|
||||
@@ -83,22 +83,22 @@ uint32_t otPlatRandomGet(void)
|
||||
return mlcg;
|
||||
}
|
||||
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
#if __SANITIZE_ADDRESS__ == 0
|
||||
|
||||
FILE *file = NULL;
|
||||
size_t readLength;
|
||||
|
||||
otEXPECT_ACTION(aOutput && aOutputLength, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(aOutput && aOutputLength, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
file = fopen("/dev/urandom", "rb");
|
||||
otEXPECT_ACTION(file != NULL, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(file != NULL, error = OT_ERROR_FAILED);
|
||||
|
||||
readLength = fread(aOutput, 1, aOutputLength, file);
|
||||
otEXPECT_ACTION(readLength == aOutputLength, error = kThreadError_Failed);
|
||||
otEXPECT_ACTION(readLength == aOutputLength, error = OT_ERROR_FAILED);
|
||||
|
||||
exit:
|
||||
|
||||
@@ -117,7 +117,7 @@ exit:
|
||||
* implementation below is only used to enable continuous
|
||||
* integration checks with Address Sanitizer enabled.
|
||||
*/
|
||||
otEXPECT_ACTION(aOutput && aOutputLength, error = kThreadError_InvalidArgs);
|
||||
otEXPECT_ACTION(aOutput && aOutputLength, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
for (uint16_t length = 0; length < aOutputLength; length++)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
// Spi-slave stubs
|
||||
|
||||
ThreadError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aCallback, void *aContext)
|
||||
otError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aCallback, void *aContext)
|
||||
{
|
||||
(void)aCallback;
|
||||
(void)aContext;
|
||||
@@ -44,14 +44,14 @@ ThreadError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aCall
|
||||
fprintf(stderr, "\nNo SPI support for posix platform.");
|
||||
exit(0);
|
||||
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void otPlatSpiSlaveDisable(void)
|
||||
{
|
||||
}
|
||||
|
||||
ThreadError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf, uint16_t aOutputBufLen, uint8_t *aInputBuf,
|
||||
otError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf, uint16_t aOutputBufLen, uint8_t *aInputBuf,
|
||||
uint16_t aInputBufLen, bool aRequestTransactionFlag)
|
||||
{
|
||||
(void)aOutputBuf;
|
||||
@@ -60,7 +60,7 @@ ThreadError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf, uint16_t aOutp
|
||||
(void)aInputBufLen;
|
||||
(void)aRequestTransactionFlag;
|
||||
|
||||
return kThreadError_NotImplemented;
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
// Uart
|
||||
|
||||
@@ -69,9 +69,9 @@ static void restore_stdout_termios(void)
|
||||
tcsetattr(s_out_fd, TCSAFLUSH, &original_stdout_termios);
|
||||
}
|
||||
|
||||
ThreadError otPlatUartEnable(void)
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
struct termios termios;
|
||||
|
||||
#ifdef OPENTHREAD_TARGET_LINUX
|
||||
@@ -103,7 +103,7 @@ ThreadError otPlatUartEnable(void)
|
||||
if (isatty(s_in_fd))
|
||||
{
|
||||
// get current configuration
|
||||
otEXPECT_ACTION(tcgetattr(s_in_fd, &termios) == 0, perror("tcgetattr"); error = kThreadError_Error);
|
||||
otEXPECT_ACTION(tcgetattr(s_in_fd, &termios) == 0, perror("tcgetattr"); error = OT_ERROR_GENERIC);
|
||||
|
||||
// Set up the termios settings for raw mode. This turns
|
||||
// off input/output processing, line processing, and character processing.
|
||||
@@ -119,16 +119,16 @@ ThreadError otPlatUartEnable(void)
|
||||
termios.c_cc[VTIME] = 0;
|
||||
|
||||
// configure baud rate
|
||||
otEXPECT_ACTION(cfsetispeed(&termios, B115200) == 0, perror("cfsetispeed"); error = kThreadError_Error);
|
||||
otEXPECT_ACTION(cfsetispeed(&termios, B115200) == 0, perror("cfsetispeed"); error = OT_ERROR_GENERIC);
|
||||
|
||||
// set configuration
|
||||
otEXPECT_ACTION(tcsetattr(s_in_fd, TCSANOW, &termios) == 0, perror("tcsetattr"); error = kThreadError_Error);
|
||||
otEXPECT_ACTION(tcsetattr(s_in_fd, TCSANOW, &termios) == 0, perror("tcsetattr"); error = OT_ERROR_GENERIC);
|
||||
}
|
||||
|
||||
if (isatty(s_out_fd))
|
||||
{
|
||||
// get current configuration
|
||||
otEXPECT_ACTION(tcgetattr(s_out_fd, &termios) == 0, perror("tcgetattr"); error = kThreadError_Error);
|
||||
otEXPECT_ACTION(tcgetattr(s_out_fd, &termios) == 0, perror("tcgetattr"); error = OT_ERROR_GENERIC);
|
||||
|
||||
// Set up the termios settings for raw mode. This turns
|
||||
// off input/output processing, line processing, and character processing.
|
||||
@@ -141,10 +141,10 @@ ThreadError otPlatUartEnable(void)
|
||||
termios.c_cflag |= HUPCL | CREAD | CLOCAL;
|
||||
|
||||
// configure baud rate
|
||||
otEXPECT_ACTION(cfsetospeed(&termios, B115200) == 0, perror("cfsetospeed"); error = kThreadError_Error);
|
||||
otEXPECT_ACTION(cfsetospeed(&termios, B115200) == 0, perror("cfsetospeed"); error = OT_ERROR_GENERIC);
|
||||
|
||||
// set configuration
|
||||
otEXPECT_ACTION(tcsetattr(s_out_fd, TCSANOW, &termios) == 0, perror("tcsetattr"); error = kThreadError_Error);
|
||||
otEXPECT_ACTION(tcsetattr(s_out_fd, TCSANOW, &termios) == 0, perror("tcsetattr"); error = OT_ERROR_GENERIC);
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -155,9 +155,9 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartDisable(void)
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
close(s_in_fd);
|
||||
close(s_out_fd);
|
||||
@@ -165,11 +165,11 @@ ThreadError otPlatUartDisable(void)
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(s_write_length == 0, error = kThreadError_Busy);
|
||||
otEXPECT_ACTION(s_write_length == 0, error = OT_ERROR_BUSY);
|
||||
|
||||
s_write_buffer = aBuf;
|
||||
s_write_length = aBufLength;
|
||||
|
||||
@@ -74,16 +74,16 @@ windowsUartWorkerThread(
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartEnable(void)
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
// Create the worker thread stop event
|
||||
otEXPECT_ACTION((s_StopWorkerEvent = CreateEvent(NULL, TRUE, FALSE, NULL)) != NULL, error = kThreadError_Error);
|
||||
otEXPECT_ACTION((s_StopWorkerEvent = CreateEvent(NULL, TRUE, FALSE, NULL)) != NULL, error = OT_ERROR_GENERIC);
|
||||
|
||||
// Start the worker thread
|
||||
otEXPECT_ACTION((s_WorkerThread = CreateThread(NULL, 0, windowsUartWorkerThread, NULL, 0, NULL)) != NULL,
|
||||
error = kThreadError_Error);
|
||||
error = OT_ERROR_GENERIC);
|
||||
|
||||
return error;
|
||||
|
||||
@@ -93,9 +93,9 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartDisable(void)
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
// Set the shutdown event
|
||||
SetEvent(s_StopWorkerEvent);
|
||||
@@ -112,13 +112,13 @@ ThreadError otPlatUartDisable(void)
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
DWORD dwNumCharsWritten = 0;
|
||||
otEXPECT_ACTION(WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), aBuf, aBufLength, &dwNumCharsWritten, NULL),
|
||||
error = kThreadError_Error);
|
||||
error = OT_ERROR_GENERIC);
|
||||
|
||||
otPlatUartSendDone();
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ extern "C" {
|
||||
/**
|
||||
* Perform any initialization for flash driver.
|
||||
*
|
||||
* @retval ::kThreadError_None Initialize flash driver success.
|
||||
* @retval ::kThreadError_Failed Initialize flash driver fail.
|
||||
* @retval ::OT_ERROR_NONE Initialize flash driver success.
|
||||
* @retval ::OT_ERROR_FAILED Initialize flash driver fail.
|
||||
*/
|
||||
ThreadError utilsFlashInit(void);
|
||||
otError utilsFlashInit(void);
|
||||
|
||||
/**
|
||||
* Get the size of flash that can be read/write by the caller.
|
||||
@@ -69,11 +69,11 @@ uint32_t utilsFlashGetSize(void);
|
||||
*
|
||||
* @param[in] aAddress The start address of the flash to erase.
|
||||
*
|
||||
* @retval kThreadError_None Erase flash operation is started.
|
||||
* @retval kThreadError_Failed Erase flash operation is not started.
|
||||
* @retval kThreadError_InvalidArgs aAddress is out of range of flash or not aligend.
|
||||
* @retval OT_ERROR_NONE Erase flash operation is started.
|
||||
* @retval OT_ERROR_FAILED Erase flash operation is not started.
|
||||
* @retval OT_ERROR_INVALID_ARGS aAddress is out of range of flash or not aligend.
|
||||
*/
|
||||
ThreadError utilsFlashErasePage(uint32_t aAddress);
|
||||
otError utilsFlashErasePage(uint32_t aAddress);
|
||||
|
||||
/**
|
||||
* Check whether flash is ready or busy.
|
||||
@@ -82,10 +82,10 @@ ThreadError utilsFlashErasePage(uint32_t aAddress);
|
||||
* zero indicates that it is a polling function, and returns current status of flash immediately.
|
||||
* non-zero indicates that it is blocking there until the operation is done and become ready, or timeout expires.
|
||||
*
|
||||
* @retval kThreadError_None Flash is ready for any operation.
|
||||
* @retval kThreadError_Busy Flash is busy.
|
||||
* @retval OT_ERROR_NONE Flash is ready for any operation.
|
||||
* @retval OT_ERROR_BUSY Flash is busy.
|
||||
*/
|
||||
ThreadError utilsFlashStatusWait(uint32_t aTimeout);
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout);
|
||||
|
||||
/**
|
||||
* Write flash. The write operation only clears bits, but never set bits.
|
||||
|
||||
@@ -216,10 +216,10 @@ exit:
|
||||
return settingsSize - sSettingsUsedSize;
|
||||
}
|
||||
|
||||
static ThreadError addSetting(otInstance *aInstance, uint16_t aKey, bool aIndex0, const uint8_t *aValue,
|
||||
uint16_t aValueLength)
|
||||
static otError addSetting(otInstance *aInstance, uint16_t aKey, bool aIndex0, const uint8_t *aValue,
|
||||
uint16_t aValueLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
OT_TOOL_PACKED_BEGIN
|
||||
struct addSettingsBlock
|
||||
{
|
||||
@@ -245,7 +245,7 @@ static ThreadError addSetting(otInstance *aInstance, uint16_t aKey, bool aIndex0
|
||||
settingsSize)
|
||||
{
|
||||
otEXPECT_ACTION(swapSettingsBlock(aInstance) >= (getAlignLength(addBlock.block.length) + sizeof(struct settingsBlock)),
|
||||
error = kThreadError_NoBufs);
|
||||
error = OT_ERROR_NO_BUFS);
|
||||
}
|
||||
|
||||
utilsFlashWrite(sSettingsBaseAddress + sSettingsUsedSize,
|
||||
@@ -320,27 +320,27 @@ void otPlatSettingsInit(otInstance *aInstance)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsBeginChange(otInstance *aInstance)
|
||||
otError otPlatSettingsBeginChange(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsCommitChange(otInstance *aInstance)
|
||||
otError otPlatSettingsCommitChange(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsAbandonChange(otInstance *aInstance)
|
||||
otError otPlatSettingsAbandonChange(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
|
||||
otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
|
||||
{
|
||||
ThreadError error = kThreadError_NotFound;
|
||||
otError error = OT_ERROR_NOT_FOUND;
|
||||
uint32_t address = sSettingsBaseAddress + kSettingsFlagSize;
|
||||
uint16_t valueLength = 0;
|
||||
int index = 0;
|
||||
@@ -379,7 +379,7 @@ ThreadError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex,
|
||||
}
|
||||
|
||||
valueLength = block.length;
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
index++;
|
||||
@@ -397,23 +397,23 @@ ThreadError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex,
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
otError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
{
|
||||
return addSetting(aInstance, aKey, true, aValue, aValueLength);
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
otError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength)
|
||||
{
|
||||
uint16_t length;
|
||||
bool index0;
|
||||
|
||||
index0 = (otPlatSettingsGet(aInstance, aKey, 0, NULL, &length) == kThreadError_NotFound ? true : false);
|
||||
index0 = (otPlatSettingsGet(aInstance, aKey, 0, NULL, &length) == OT_ERROR_NOT_FOUND ? true : false);
|
||||
return addSetting(aInstance, aKey, index0, aValue, aValueLength);
|
||||
}
|
||||
|
||||
ThreadError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex)
|
||||
otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex)
|
||||
{
|
||||
ThreadError error = kThreadError_NotFound;
|
||||
otError error = OT_ERROR_NOT_FOUND;
|
||||
uint32_t address = sSettingsBaseAddress + kSettingsFlagSize;
|
||||
int index = 0;
|
||||
|
||||
@@ -436,7 +436,7 @@ ThreadError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aInde
|
||||
{
|
||||
if (aIndex == index || aIndex == -1)
|
||||
{
|
||||
error = kThreadError_None;
|
||||
error = OT_ERROR_NONE;
|
||||
block.flag &= (~kBlockDeleteFlag);
|
||||
utilsFlashWrite(address, reinterpret_cast<uint8_t *>(&block), sizeof(block));
|
||||
}
|
||||
|
||||
@@ -73,22 +73,22 @@ typedef void (*otBorderAgentProxyStreamHandler)(otMessage *aMessage, uint16_t aL
|
||||
* @param[in] aHandler A pointer to a function called to deliver packet to border agent.
|
||||
* @param[in] aContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadError_None Successfully started the border agent proxy.
|
||||
* @retval kThreadError_Already Border agent proxy has been started before.
|
||||
* @retval OT_ERROR_NONE Successfully started the border agent proxy.
|
||||
* @retval OT_ERROR_ALREADY Border agent proxy has been started before.
|
||||
*
|
||||
*/
|
||||
ThreadError otBorderAgentProxyStart(otInstance *aInstance, otBorderAgentProxyStreamHandler aHandler, void *aContext);
|
||||
otError otBorderAgentProxyStart(otInstance *aInstance, otBorderAgentProxyStreamHandler aHandler, void *aContext);
|
||||
|
||||
/**
|
||||
* Stop the border agent proxy.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None Successfully stopped the border agent proxy.
|
||||
* @retval kThreadError_Already Border agent proxy is already stopped.
|
||||
* @retval OT_ERROR_NONE Successfully stopped the border agent proxy.
|
||||
* @retval OT_ERROR_ALREADY Border agent proxy is already stopped.
|
||||
*
|
||||
*/
|
||||
ThreadError otBorderAgentProxyStop(otInstance *aInstance);
|
||||
otError otBorderAgentProxyStop(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Send packet through border agent proxy.
|
||||
@@ -98,14 +98,14 @@ ThreadError otBorderAgentProxyStop(otInstance *aInstance);
|
||||
* @param[in] aLocator Rloc of destination.
|
||||
* @param[in] aPort Port of destination.
|
||||
*
|
||||
* @retval kThreadError_None Successfully send the message.
|
||||
* @retval kThreadError_InvalidState Border agent proxy is not started.
|
||||
* @retval OT_ERROR_NONE Successfully send the message.
|
||||
* @retval OT_ERROR_INVALID_STATE Border agent proxy is not started.
|
||||
*
|
||||
* @warning No matter the call success or fail, the message is freed.
|
||||
*
|
||||
*/
|
||||
ThreadError otBorderAgentProxySend(otInstance *aInstance, otMessage *aMessage,
|
||||
uint16_t aLocator, uint16_t aPort);
|
||||
otError otBorderAgentProxySend(otInstance *aInstance, otMessage *aMessage,
|
||||
uint16_t aLocator, uint16_t aPort);
|
||||
|
||||
/**
|
||||
* Get the border agent proxy status (enabled/disabled)
|
||||
|
||||
+44
-44
@@ -186,13 +186,13 @@ typedef struct otCoapHeader
|
||||
* @param[in] aMessageInfo A pointer to the message info for @p aMessage. NULL if no response was received.
|
||||
* @param[in] aResult A result of the CoAP transaction.
|
||||
*
|
||||
* @retval kThreadError_None A response was received successfully.
|
||||
* @retval kThreadError_Abort A CoAP transaction was reseted by peer.
|
||||
* @retval kThreadError_ResponseTimeout No response or acknowledgment received during timeout period.
|
||||
* @retval OT_ERROR_NONE A response was received successfully.
|
||||
* @retval OT_ERROR_ABORT A CoAP transaction was reseted by peer.
|
||||
* @retval OT_ERROR_RESPONSE_TIMEOUT No response or acknowledgment received during timeout period.
|
||||
*
|
||||
*/
|
||||
typedef void (*otCoapResponseHandler)(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo, ThreadError aResult);
|
||||
const otMessageInfo *aMessageInfo, otError aResult);
|
||||
|
||||
/**
|
||||
* This function pointer is called when a CoAP request with a given Uri-Path is received.
|
||||
@@ -254,12 +254,12 @@ void otCoapHeaderGenerateToken(otCoapHeader *aHeader, uint8_t aTokenLength);
|
||||
* @param[inout] aHeader A pointer to the CoAP header.
|
||||
* @param[in] aOption A pointer to the CoAP option.
|
||||
*
|
||||
* @retval kThreadError_None Successfully appended the option.
|
||||
* @retval kThreadError_InvalidArgs The option type is not equal or greater than the last option type.
|
||||
* @retval kThreadError_NoBufs The option length exceeds the buffer size.
|
||||
* @retval OT_ERROR_NONE Successfully appended the option.
|
||||
* @retval OT_ERROR_INVALID_ARGS The option type is not equal or greater than the last option type.
|
||||
* @retval OT_ERROR_NO_BUFS The option length exceeds the buffer size.
|
||||
*
|
||||
*/
|
||||
ThreadError otCoapHeaderAppendOption(otCoapHeader *aHeader, const otCoapOption *aOption);
|
||||
otError otCoapHeaderAppendOption(otCoapHeader *aHeader, const otCoapOption *aOption);
|
||||
|
||||
/**
|
||||
* This function appends an unsigned integer CoAP option as specified in
|
||||
@@ -269,12 +269,12 @@ ThreadError otCoapHeaderAppendOption(otCoapHeader *aHeader, const otCoapOption *
|
||||
* @param[in] aNumber The CoAP Option number.
|
||||
* @param[in] aValue The CoAP Option unsigned integer value.
|
||||
*
|
||||
* @retval kThreadError_None Successfully appended the option.
|
||||
* @retval kThreadError_InvalidArgs The option type is not equal or greater than the last option type.
|
||||
* @retval kThreadError_NoBufs The option length exceeds the buffer size.
|
||||
* @retval OT_ERROR_NONE Successfully appended the option.
|
||||
* @retval OT_ERROR_INVALID_ARGS The option type is not equal or greater than the last option type.
|
||||
* @retval OT_ERROR_NO_BUFS The option length exceeds the buffer size.
|
||||
*
|
||||
*/
|
||||
ThreadError otCoapHeaderAppendUintOption(otCoapHeader *aHeader, uint16_t aNumber, uint32_t aValue);
|
||||
otError otCoapHeaderAppendUintOption(otCoapHeader *aHeader, uint16_t aNumber, uint32_t aValue);
|
||||
|
||||
/**
|
||||
* This function appends an Observe option.
|
||||
@@ -282,11 +282,11 @@ ThreadError otCoapHeaderAppendUintOption(otCoapHeader *aHeader, uint16_t aNumber
|
||||
* @param[inout] aHeader A pointer to the CoAP header.
|
||||
* @param[in] aObserve Observe field value.
|
||||
*
|
||||
* @retval kThreadError_None Successfully appended the option.
|
||||
* @retval kThreadError_InvalidArgs The option type is not equal or greater than the last option type.
|
||||
* @retval kThreadError_NoBufs The option length exceeds the buffer size.
|
||||
* @retval OT_ERROR_NONE Successfully appended the option.
|
||||
* @retval OT_ERROR_INVALID_ARGS The option type is not equal or greater than the last option type.
|
||||
* @retval OT_ERROR_NO_BUFS The option length exceeds the buffer size.
|
||||
*/
|
||||
ThreadError otCoapHeaderAppendObserveOption(otCoapHeader *aHeader, uint32_t aObserve);
|
||||
otError otCoapHeaderAppendObserveOption(otCoapHeader *aHeader, uint32_t aObserve);
|
||||
|
||||
/**
|
||||
* This function appends an Uri-Path option.
|
||||
@@ -294,12 +294,12 @@ ThreadError otCoapHeaderAppendObserveOption(otCoapHeader *aHeader, uint32_t aObs
|
||||
* @param[inout] aHeader A pointer to the CoAP header.
|
||||
* @param[in] aUriPath A pointer to a NULL-terminated string.
|
||||
*
|
||||
* @retval kThreadError_None Successfully appended the option.
|
||||
* @retval kThreadError_InvalidArgs The option type is not equal or greater than the last option type.
|
||||
* @retval kThreadError_NoBufs The option length exceeds the buffer size.
|
||||
* @retval OT_ERROR_NONE Successfully appended the option.
|
||||
* @retval OT_ERROR_INVALID_ARGS The option type is not equal or greater than the last option type.
|
||||
* @retval OT_ERROR_NO_BUFS The option length exceeds the buffer size.
|
||||
*
|
||||
*/
|
||||
ThreadError otCoapHeaderAppendUriPathOptions(otCoapHeader *aHeader, const char *aUriPath);
|
||||
otError otCoapHeaderAppendUriPathOptions(otCoapHeader *aHeader, const char *aUriPath);
|
||||
|
||||
/**
|
||||
* This function appends a Max-Age option.
|
||||
@@ -307,11 +307,11 @@ ThreadError otCoapHeaderAppendUriPathOptions(otCoapHeader *aHeader, const char *
|
||||
* @param[inout] aHeader A pointer to the CoAP header.
|
||||
* @param[in] aMaxAge The Max-Age value.
|
||||
*
|
||||
* @retval kThreadError_None Successfully appended the option.
|
||||
* @retval kThreadError_InvalidArgs The option type is not equal or greater than the last option type.
|
||||
* @retval kThreadError_NoBufs The option length exceeds the buffer size.
|
||||
* @retval OT_ERROR_NONE Successfully appended the option.
|
||||
* @retval OT_ERROR_INVALID_ARGS The option type is not equal or greater than the last option type.
|
||||
* @retval OT_ERROR_NO_BUFS The option length exceeds the buffer size.
|
||||
*/
|
||||
ThreadError otCoapHeaderAppendMaxAgeOption(otCoapHeader *aHeader, uint32_t aMaxAge);
|
||||
otError otCoapHeaderAppendMaxAgeOption(otCoapHeader *aHeader, uint32_t aMaxAge);
|
||||
|
||||
/**
|
||||
* This function appends a single Uri-Query option.
|
||||
@@ -319,19 +319,19 @@ ThreadError otCoapHeaderAppendMaxAgeOption(otCoapHeader *aHeader, uint32_t aMaxA
|
||||
* @param[inout] aHeader A pointer to the CoAP header.
|
||||
* @param[in] aUriQuery A pointer to NULL-terminated string, which should contain a single key=value pair.
|
||||
*
|
||||
* @retval kThreadError_None Successfully appended the option.
|
||||
* @retval kThreadError_InvalidArgs The option type is not equal or greater than the last option type.
|
||||
* @retval kThreadError_NoBufs The option length exceeds the buffer size.
|
||||
* @retval OT_ERROR_NONE Successfully appended the option.
|
||||
* @retval OT_ERROR_INVALID_ARGS The option type is not equal or greater than the last option type.
|
||||
* @retval OT_ERROR_NO_BUFS The option length exceeds the buffer size.
|
||||
*/
|
||||
ThreadError otCoapHeaderAppendUriQueryOption(otCoapHeader *aHeader, const char *aUriQuery);
|
||||
otError otCoapHeaderAppendUriQueryOption(otCoapHeader *aHeader, const char *aUriQuery);
|
||||
|
||||
/**
|
||||
* This function adds Payload Marker indicating beginning of the payload to the CoAP header.
|
||||
*
|
||||
* @param[inout] aHeader A pointer to the CoAP header.
|
||||
*
|
||||
* @retval kThreadError_None Payload Marker successfully added.
|
||||
* @retval kThreadError_NoBufs Header Payload Marker exceeds the buffer size.
|
||||
* @retval OT_ERROR_NONE Payload Marker successfully added.
|
||||
* @retval OT_ERROR_NO_BUFS Header Payload Marker exceeds the buffer size.
|
||||
*
|
||||
*/
|
||||
void otCoapHeaderSetPayloadMarker(otCoapHeader *aHeader);
|
||||
@@ -438,12 +438,12 @@ otMessage *otCoapNewMessage(otInstance *aInstance, const otCoapHeader *aHeader);
|
||||
* @param[in] aHandler A function pointer that shall be called on response reception or timeout.
|
||||
* @param[in] aContext A pointer to arbitrary context information. May be NULL if not used.
|
||||
*
|
||||
* @retval kThreadError_None Successfully sent CoAP message.
|
||||
* @retval kThreadError_NoBufs Failed to allocate retransmission data.
|
||||
* @retval OT_ERROR_NONE Successfully sent CoAP message.
|
||||
* @retval OT_ERROR_NO_BUFS Failed to allocate retransmission data.
|
||||
*
|
||||
*/
|
||||
ThreadError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo,
|
||||
otCoapResponseHandler aHandler, void *aContext);
|
||||
otError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo,
|
||||
otCoapResponseHandler aHandler, void *aContext);
|
||||
|
||||
/**
|
||||
* This function starts the CoAP server.
|
||||
@@ -451,20 +451,20 @@ ThreadError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPort The local UDP port to bind to.
|
||||
*
|
||||
* @retval kThreadError_None Successfully started the CoAP server.
|
||||
* @retval OT_ERROR_NONE Successfully started the CoAP server.
|
||||
*
|
||||
*/
|
||||
ThreadError otCoapStart(otInstance *aInstance, uint16_t aPort);
|
||||
otError otCoapStart(otInstance *aInstance, uint16_t aPort);
|
||||
|
||||
/**
|
||||
* This function stops the CoAP server.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None Successfully stopped the CoAP server.
|
||||
* @retval OT_ERROR_NONE Successfully stopped the CoAP server.
|
||||
*
|
||||
*/
|
||||
ThreadError otCoapStop(otInstance *aInstance);
|
||||
otError otCoapStop(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function adds a resource to the CoAP server.
|
||||
@@ -472,11 +472,11 @@ ThreadError otCoapStop(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aResource A pointer to the resource.
|
||||
*
|
||||
* @retval kThreadError_None Successfully added @p aResource.
|
||||
* @retval kThreadError_Already The @p aResource was already added.
|
||||
* @retval OT_ERROR_NONE Successfully added @p aResource.
|
||||
* @retval OT_ERROR_ALREADY The @p aResource was already added.
|
||||
*
|
||||
*/
|
||||
ThreadError otCoapAddResource(otInstance *aInstance, otCoapResource *aResource);
|
||||
otError otCoapAddResource(otInstance *aInstance, otCoapResource *aResource);
|
||||
|
||||
/**
|
||||
* This function removes a resource from the CoAP server.
|
||||
@@ -503,11 +503,11 @@ void otCoapSetDefaultHandler(otInstance *aInstance, otCoapRequestHandler aHandle
|
||||
* @param[in] aMessage A pointer to the CoAP response to send.
|
||||
* @param[in] aMessageInfo A pointer to the message info associated with @p aMessage.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enqueued the CoAP response message.
|
||||
* @retval kThreadError_NoBufs Insufficient buffers available to send the CoAP response.
|
||||
* @retval OT_ERROR_NONE Successfully enqueued the CoAP response message.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffers available to send the CoAP response.
|
||||
*
|
||||
*/
|
||||
ThreadError otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo);
|
||||
otError otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo);
|
||||
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,20 +57,20 @@ extern "C" {
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None Successfully started the Commissioner role.
|
||||
* @retval OT_ERROR_NONE Successfully started the Commissioner role.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerStart(otInstance *aInstance);
|
||||
OTAPI otError OTCALL otCommissionerStart(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function disables the Thread Commissioner role.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None Successfully stopped the Commissioner role.
|
||||
* @retval OT_ERROR_NONE Successfully stopped the Commissioner role.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerStop(otInstance *aInstance);
|
||||
OTAPI otError OTCALL otCommissionerStop(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function adds a Joiner entry.
|
||||
@@ -80,16 +80,16 @@ OTAPI ThreadError OTCALL otCommissionerStop(otInstance *aInstance);
|
||||
* @param[in] aPSKd A pointer to the PSKd.
|
||||
* @param[in] aTimeout A time after which a Joiner is automatically removed, in seconds.
|
||||
*
|
||||
* @retval kThreadError_None Successfully added the Joiner.
|
||||
* @retval kThreadError_NoBufs No buffers available to add the Joiner.
|
||||
* @retval kThreadError_InvalidArgs @p aExtAddress or @p aPSKd is invalid.
|
||||
* @retval kThreadError_InvalidState The commissioner is not active.
|
||||
* @retval OT_ERROR_NONE Successfully added the Joiner.
|
||||
* @retval OT_ERROR_NO_BUFS No buffers available to add the Joiner.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aExtAddress or @p aPSKd is invalid.
|
||||
* @retval OT_ERROR_INVALID_STATE The commissioner is not active.
|
||||
*
|
||||
* @note Only use this after successfully started the Commissioner role by otCommissionerStart().
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerAddJoiner(otInstance *aInstance, const otExtAddress *aExtAddress,
|
||||
const char *aPSKd, uint32_t aTimeout);
|
||||
OTAPI otError OTCALL otCommissionerAddJoiner(otInstance *aInstance, const otExtAddress *aExtAddress,
|
||||
const char *aPSKd, uint32_t aTimeout);
|
||||
|
||||
/**
|
||||
* This function removes a Joiner entry.
|
||||
@@ -97,15 +97,15 @@ OTAPI ThreadError OTCALL otCommissionerAddJoiner(otInstance *aInstance, const ot
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aExtAddress A pointer to the Joiner's extended address or NULL for any Joiner.
|
||||
*
|
||||
* @retval kThreadError_None Successfully removed the Joiner.
|
||||
* @retval kThreadError_NotFound The Joiner specified by @p aExtAddress was not found.
|
||||
* @retval kThreadError_InvalidArgs @p aExtAddress is invalid.
|
||||
* @retval kThreadError_InvalidState The commissioner is not active.
|
||||
* @retval OT_ERROR_NONE Successfully removed the Joiner.
|
||||
* @retval OT_ERROR_NOT_FOUND The Joiner specified by @p aExtAddress was not found.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aExtAddress is invalid.
|
||||
* @retval OT_ERROR_INVALID_STATE The commissioner is not active.
|
||||
*
|
||||
* @note Only use this after successfully started the Commissioner role by otCommissionerStart().
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerRemoveJoiner(otInstance *aInstance, const otExtAddress *aExtAddress);
|
||||
OTAPI otError OTCALL otCommissionerRemoveJoiner(otInstance *aInstance, const otExtAddress *aExtAddress);
|
||||
|
||||
/**
|
||||
* This function sets the Provisioning URL.
|
||||
@@ -113,11 +113,11 @@ OTAPI ThreadError OTCALL otCommissionerRemoveJoiner(otInstance *aInstance, const
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aProvisioningUrl A pointer to the Provisioning URL (may be NULL).
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the Provisioning URL.
|
||||
* @retval kThreadError_InvalidArgs @p aProvisioningUrl is invalid.
|
||||
* @retval OT_ERROR_NONE Successfully set the Provisioning URL.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aProvisioningUrl is invalid.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerSetProvisioningUrl(otInstance *aInstance, const char *aProvisioningUrl);
|
||||
OTAPI otError OTCALL otCommissionerSetProvisioningUrl(otInstance *aInstance, const char *aProvisioningUrl);
|
||||
|
||||
/**
|
||||
* This function sends an Announce Begin message.
|
||||
@@ -128,16 +128,16 @@ OTAPI ThreadError OTCALL otCommissionerSetProvisioningUrl(otInstance *aInstance,
|
||||
* @param[in] aPeriod The time between energy measurements (milliseconds).
|
||||
* @param[in] aAddress A pointer to the IPv6 destination.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enqueued the Announce Begin message.
|
||||
* @retval kThreadError_NoBufs Insufficient buffers to generate an Announce Begin message.
|
||||
* @retval kThreadError_InvalidState The commissioner is not active.
|
||||
* @retval OT_ERROR_NONE Successfully enqueued the Announce Begin message.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffers to generate an Announce Begin message.
|
||||
* @retval OT_ERROR_INVALID_STATE The commissioner is not active.
|
||||
*
|
||||
* @note Only use this after successfully started the Commissioner role by otCommissionerStart().
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerAnnounceBegin(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount,
|
||||
uint16_t aPeriod,
|
||||
const otIp6Address *aAddress);
|
||||
OTAPI otError OTCALL otCommissionerAnnounceBegin(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount,
|
||||
uint16_t aPeriod,
|
||||
const otIp6Address *aAddress);
|
||||
|
||||
/**
|
||||
* This function pointer is called when the Commissioner receives an Energy Report.
|
||||
@@ -163,16 +163,16 @@ typedef void (OTCALL *otCommissionerEnergyReportCallback)(uint32_t aChannelMask,
|
||||
* @param[in] aCallback A pointer to a function called on receiving an Energy Report message.
|
||||
* @param[in] aContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enqueued the Energy Scan Query message.
|
||||
* @retval kThreadError_NoBufs Insufficient buffers to generate an Energy Scan Query message.
|
||||
* @retval kThreadError_InvalidState The commissioner is not active.
|
||||
* @retval OT_ERROR_NONE Successfully enqueued the Energy Scan Query message.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffers to generate an Energy Scan Query message.
|
||||
* @retval OT_ERROR_INVALID_STATE The commissioner is not active.
|
||||
*
|
||||
* @note Only use this after successfully started the Commissioner role by otCommissionerStart().
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerEnergyScan(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount,
|
||||
uint16_t aPeriod, uint16_t aScanDuration, const otIp6Address *aAddress,
|
||||
otCommissionerEnergyReportCallback aCallback, void *aContext);
|
||||
OTAPI otError OTCALL otCommissionerEnergyScan(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount,
|
||||
uint16_t aPeriod, uint16_t aScanDuration, const otIp6Address *aAddress,
|
||||
otCommissionerEnergyReportCallback aCallback, void *aContext);
|
||||
|
||||
/**
|
||||
* This function pointer is called when the Commissioner receives a PAN ID Conflict message.
|
||||
@@ -194,16 +194,16 @@ typedef void (OTCALL *otCommissionerPanIdConflictCallback)(uint16_t aPanId, uint
|
||||
* @param[in] aCallback A pointer to a function called on receiving an Energy Report message.
|
||||
* @param[in] aContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enqueued the PAN ID Query message.
|
||||
* @retval kThreadError_NoBufs Insufficient buffers to generate a PAN ID Query message.
|
||||
* @retval kThreadError_InvalidState The commissioner is not active.
|
||||
* @retval OT_ERROR_NONE Successfully enqueued the PAN ID Query message.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffers to generate a PAN ID Query message.
|
||||
* @retval OT_ERROR_INVALID_STATE The commissioner is not active.
|
||||
*
|
||||
* @note Only use this after successfully started the Commissioner role by otCommissionerStart().
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerPanIdQuery(otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask,
|
||||
const otIp6Address *aAddress,
|
||||
otCommissionerPanIdConflictCallback aCallback, void *aContext);
|
||||
OTAPI otError OTCALL otCommissionerPanIdQuery(otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask,
|
||||
const otIp6Address *aAddress,
|
||||
otCommissionerPanIdConflictCallback aCallback, void *aContext);
|
||||
|
||||
/**
|
||||
* This function sends MGMT_COMMISSIONER_GET.
|
||||
@@ -212,11 +212,11 @@ OTAPI ThreadError OTCALL otCommissionerPanIdQuery(otInstance *aInstance, uint16_
|
||||
* @param[in] aTlvs A pointer to TLVs.
|
||||
* @param[in] aLength The length of TLVs.
|
||||
*
|
||||
* @retval kThreadError_None Successfully send the meshcop dataset command.
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to send.
|
||||
* @retval OT_ERROR_NONE Successfully send the meshcop dataset command.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to send.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerSendMgmtGet(otInstance *aInstance, const uint8_t *aTlvs, uint8_t aLength);
|
||||
OTAPI otError OTCALL otCommissionerSendMgmtGet(otInstance *aInstance, const uint8_t *aTlvs, uint8_t aLength);
|
||||
|
||||
/**
|
||||
* This function sends MGMT_COMMISSIONER_SET.
|
||||
@@ -226,12 +226,12 @@ OTAPI ThreadError OTCALL otCommissionerSendMgmtGet(otInstance *aInstance, const
|
||||
* @param[in] aTlvs A pointer to TLVs.
|
||||
* @param[in] aLength The length of TLVs.
|
||||
*
|
||||
* @retval kThreadError_None Successfully send the meshcop dataset command.
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to send.
|
||||
* @retval OT_ERROR_NONE Successfully send the meshcop dataset command.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to send.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerSendMgmtSet(otInstance *aInstance, const otCommissioningDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength);
|
||||
OTAPI otError OTCALL otCommissionerSendMgmtSet(otInstance *aInstance, const otCommissioningDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength);
|
||||
|
||||
/**
|
||||
* This function returns the Commissioner Session ID.
|
||||
@@ -266,13 +266,13 @@ OTAPI otCommissionerState OTCALL otCommissionerGetState(otInstance *aInstance);
|
||||
* @param[in] aExtPanId The extended pan id for PSKc computation.
|
||||
* @param[out] aPSKc A pointer to where the generated PSKc will be placed.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully generate PSKc.
|
||||
* @retval kThreadError_InvalidArgs If any of the input arguments is invalid.
|
||||
* @retval OT_ERROR_NONE Successfully generate PSKc.
|
||||
* @retval OT_ERROR_INVALID_ARGS If any of the input arguments is invalid.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otCommissionerGeneratePSKc(otInstance *aInstance, const char *aPassPhrase,
|
||||
const char *aNetworkName, const uint8_t *aExtPanId,
|
||||
uint8_t *aPSKc);
|
||||
OTAPI otError OTCALL otCommissionerGeneratePSKc(otInstance *aInstance, const char *aPassPhrase,
|
||||
const char *aNetworkName, const uint8_t *aExtPanId,
|
||||
uint8_t *aPSKc);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -64,11 +64,11 @@ OTAPI bool OTCALL otDatasetIsCommissioned(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[out] aDataset A pointer to where the Active Operational Dataset will be placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully retrieved the Active Operational Dataset.
|
||||
* @retval kThreadError_InvalidArgs @p aDataset was NULL.
|
||||
* @retval OT_ERROR_NONE Successfully retrieved the Active Operational Dataset.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aDataset was NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otDatasetGetActive(otInstance *aInstance, otOperationalDataset *aDataset);
|
||||
OTAPI otError OTCALL otDatasetGetActive(otInstance *aInstance, otOperationalDataset *aDataset);
|
||||
|
||||
/**
|
||||
* This function gets the Pending Operational Dataset.
|
||||
@@ -76,11 +76,11 @@ OTAPI ThreadError OTCALL otDatasetGetActive(otInstance *aInstance, otOperational
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[out] aDataset A pointer to where the Pending Operational Dataset will be placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully retrieved the Pending Operational Dataset.
|
||||
* @retval kThreadError_InvalidArgs @p aDataset was NULL.
|
||||
* @retval OT_ERROR_NONE Successfully retrieved the Pending Operational Dataset.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aDataset was NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otDatasetGetPending(otInstance *aInstance, otOperationalDataset *aDataset);
|
||||
OTAPI otError OTCALL otDatasetGetPending(otInstance *aInstance, otOperationalDataset *aDataset);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -54,12 +54,12 @@ extern "C" {
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aDataset A pointer to the Active Operational Dataset.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the Active Operational Dataset.
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to set the Active Operational Datset.
|
||||
* @retval kThreadError_InvalidArgs @p aDataset was NULL.
|
||||
* @retval OT_ERROR_NONE Successfully set the Active Operational Dataset.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to set the Active Operational Datset.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aDataset was NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otDatasetSetActive(otInstance *aInstance, const otOperationalDataset *aDataset);
|
||||
OTAPI otError OTCALL otDatasetSetActive(otInstance *aInstance, const otOperationalDataset *aDataset);
|
||||
|
||||
/**
|
||||
* This function sets the Pending Operational Dataset.
|
||||
@@ -67,12 +67,12 @@ OTAPI ThreadError OTCALL otDatasetSetActive(otInstance *aInstance, const otOpera
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aDataset A pointer to the Pending Operational Dataset.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the Pending Operational Dataset.
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to set the Pending Operational Dataset.
|
||||
* @retval kThreadError_InvalidArgs @p aDataset was NULL.
|
||||
* @retval OT_ERROR_NONE Successfully set the Pending Operational Dataset.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to set the Pending Operational Dataset.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aDataset was NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otDatasetSetPending(otInstance *aInstance, const otOperationalDataset *aDataset);
|
||||
OTAPI otError OTCALL otDatasetSetPending(otInstance *aInstance, const otOperationalDataset *aDataset);
|
||||
|
||||
/**
|
||||
* This function sends MGMT_ACTIVE_GET.
|
||||
@@ -82,12 +82,12 @@ OTAPI ThreadError OTCALL otDatasetSetPending(otInstance *aInstance, const otOper
|
||||
* @param[in] aLength The length of TLV Types.
|
||||
* @param[in] aAddress A pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default.
|
||||
*
|
||||
* @retval kThreadError_None Successfully send the meshcop dataset command.
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to send.
|
||||
* @retval OT_ERROR_NONE Successfully send the meshcop dataset command.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to send.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otDatasetSendMgmtActiveGet(otInstance *aInstance, const uint8_t *aTlvTypes, uint8_t aLength,
|
||||
const otIp6Address *aAddress);
|
||||
OTAPI otError OTCALL otDatasetSendMgmtActiveGet(otInstance *aInstance, const uint8_t *aTlvTypes, uint8_t aLength,
|
||||
const otIp6Address *aAddress);
|
||||
|
||||
/**
|
||||
* This function sends MGMT_ACTIVE_SET.
|
||||
@@ -97,12 +97,12 @@ OTAPI ThreadError OTCALL otDatasetSendMgmtActiveGet(otInstance *aInstance, const
|
||||
* @param[in] aTlvs A pointer to TLVs.
|
||||
* @param[in] aLength The length of TLVs.
|
||||
*
|
||||
* @retval kThreadError_None Successfully send the meshcop dataset command.
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to send.
|
||||
* @retval OT_ERROR_NONE Successfully send the meshcop dataset command.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to send.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otDatasetSendMgmtActiveSet(otInstance *aInstance, const otOperationalDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength);
|
||||
OTAPI otError OTCALL otDatasetSendMgmtActiveSet(otInstance *aInstance, const otOperationalDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength);
|
||||
|
||||
/**
|
||||
* This function sends MGMT_PENDING_GET.
|
||||
@@ -112,12 +112,12 @@ OTAPI ThreadError OTCALL otDatasetSendMgmtActiveSet(otInstance *aInstance, const
|
||||
* @param[in] aLength The length of TLV Types.
|
||||
* @param[in] aAddress A pointer to the IPv6 destination, if it is NULL, will use Leader ALOC as default.
|
||||
*
|
||||
* @retval kThreadError_None Successfully send the meshcop dataset command.
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to send.
|
||||
* @retval OT_ERROR_NONE Successfully send the meshcop dataset command.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to send.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otDatasetSendMgmtPendingGet(otInstance *aInstance, const uint8_t *aTlvTypes, uint8_t aLength,
|
||||
const otIp6Address *aAddress);
|
||||
OTAPI otError OTCALL otDatasetSendMgmtPendingGet(otInstance *aInstance, const uint8_t *aTlvTypes, uint8_t aLength,
|
||||
const otIp6Address *aAddress);
|
||||
|
||||
/**
|
||||
* This function sends MGMT_PENDING_SET.
|
||||
@@ -127,12 +127,12 @@ OTAPI ThreadError OTCALL otDatasetSendMgmtPendingGet(otInstance *aInstance, cons
|
||||
* @param[in] aTlvs A pointer to TLVs.
|
||||
* @param[in] aLength The length of TLVs.
|
||||
*
|
||||
* @retval kThreadError_None Successfully send the meshcop dataset command.
|
||||
* @retval kThreadError_NoBufs Insufficient buffer space to send.
|
||||
* @retval OT_ERROR_NONE Successfully send the meshcop dataset command.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffer space to send.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otDatasetSendMgmtPendingSet(otInstance *aInstance, const otOperationalDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength);
|
||||
OTAPI otError OTCALL otDatasetSendMgmtPendingSet(otInstance *aInstance, const otOperationalDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength);
|
||||
|
||||
/**
|
||||
* Get minimal delay timer.
|
||||
@@ -150,11 +150,11 @@ OTAPI uint32_t OTCALL otDatasetGetDelayTimerMinimal(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aDelayTimerMinimal The value of minimal delay timer (in ms).
|
||||
*
|
||||
* @retval kThreadError_None Successfully set minimal delay timer.
|
||||
* @retval kThreadError_InvalidArgs If @p aDelayTimerMinimal is not valid.
|
||||
* @retval OT_ERROR_NONE Successfully set minimal delay timer.
|
||||
* @retval OT_ERROR_INVALID_ARGS If @p aDelayTimerMinimal is not valid.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otDatasetSetDelayTimerMinimal(otInstance *aInstance, uint32_t aDelayTimerMinimal);
|
||||
OTAPI otError OTCALL otDatasetSetDelayTimerMinimal(otInstance *aInstance, uint32_t aDelayTimerMinimal);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -83,16 +83,16 @@ typedef struct otDnsQuery
|
||||
* @param[in] aTtl Specifies the maximum time in seconds that the resource record may be cached.
|
||||
* @param[in] aResult A result of the DNS transaction.
|
||||
*
|
||||
* @retval kThreadError_None A response was received successfully and IPv6 address is provided
|
||||
* in @p aAddress.
|
||||
* @retval kThreadError_Abort A DNS transaction was aborted by stack.
|
||||
* @retval kThreadError_ResponseTimeout No DNS response has been received within timeout.
|
||||
* @retval kThreadError_NotFound A response was received but no IPv6 address has been found.
|
||||
* @retval kThreadError_Failed A response was received but status code is different than success.
|
||||
* @retval OT_ERROR_NONE A response was received successfully and IPv6 address is provided
|
||||
* in @p aAddress.
|
||||
* @retval OT_ERROR_ABORT A DNS transaction was aborted by stack.
|
||||
* @retval OT_ERROR_RESPONSE_TIMEOUT No DNS response has been received within timeout.
|
||||
* @retval OT_ERROR_NOT_FOUND A response was received but no IPv6 address has been found.
|
||||
* @retval OT_ERROR_FAILED A response was received but status code is different than success.
|
||||
*
|
||||
*/
|
||||
typedef void (*otDnsResponseHandler)(void *aContext, const char *aHostname, otIp6Address *aAddress,
|
||||
uint32_t aTtl, ThreadError aResult);
|
||||
uint32_t aTtl, otError aResult);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DNS_CLIENT
|
||||
/**
|
||||
@@ -104,8 +104,8 @@ typedef void (*otDnsResponseHandler)(void *aContext, const char *aHostname, otIp
|
||||
* @param[in] aContext A pointer to arbitrary context information.
|
||||
*
|
||||
*/
|
||||
ThreadError otDnsClientQuery(otInstance *aInstance, const otDnsQuery *aQuery, otDnsResponseHandler aHandler,
|
||||
void *aContext);
|
||||
otError otDnsClientQuery(otInstance *aInstance, const otDnsQuery *aQuery, otDnsResponseHandler aHandler,
|
||||
void *aContext);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,7 +83,7 @@ void otIcmp6SetEchoEnabled(otInstance *aInstance, bool aEnabled);
|
||||
* an ICMPv6 message is received.
|
||||
*
|
||||
*/
|
||||
ThreadError otIcmp6RegisterHandler(otInstance *aInstance, otIcmp6Handler *aHandler);
|
||||
otError otIcmp6RegisterHandler(otInstance *aInstance, otIcmp6Handler *aHandler);
|
||||
|
||||
/**
|
||||
* This function sends an ICMPv6 Echo Request via the Thread interface.
|
||||
@@ -95,8 +95,8 @@ ThreadError otIcmp6RegisterHandler(otInstance *aInstance, otIcmp6Handler *aHandl
|
||||
* May be zero.
|
||||
*
|
||||
*/
|
||||
ThreadError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo, uint16_t aIdentifier);
|
||||
otError otIcmp6SendEchoRequest(otInstance *aInstance, otMessage *aMessage,
|
||||
const otMessageInfo *aMessageInfo, uint16_t aIdentifier);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -215,12 +215,12 @@ typedef void (OTCALL *otStateChangedCallback)(uint32_t aFlags, void *aContext);
|
||||
* @param[in] aCallback A pointer to a function that is called with certain configuration or state changes.
|
||||
* @param[in] aContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadError_None Added the callback to the list of callbacks.
|
||||
* @retval kThreadError_NoBufs Could not add the callback due to resource constraints.
|
||||
* @retval OT_ERROR_NONE Added the callback to the list of callbacks.
|
||||
* @retval OT_ERROR_NO_BUFS Could not add the callback due to resource constraints.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otSetStateChangedCallback(otInstance *aInstance, otStateChangedCallback aCallback,
|
||||
void *aContext);
|
||||
OTAPI otError OTCALL otSetStateChangedCallback(otInstance *aInstance, otStateChangedCallback aCallback,
|
||||
void *aContext);
|
||||
|
||||
/**
|
||||
* This function removes a callback to indicate when certain configuration or state changes within OpenThread.
|
||||
@@ -256,11 +256,11 @@ OTAPI void OTCALL otInstanceFactoryReset(otInstance *aInstance);
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None All persistent info/state was erased successfully.
|
||||
* @retval kThreadError_InvalidState Device is not in `disabled` state/role.
|
||||
* @retval OT_ERROR_NONE All persistent info/state was erased successfully.
|
||||
* @retval OT_ERROR_INVALID_STATE Device is not in `disabled` state/role.
|
||||
*
|
||||
*/
|
||||
ThreadError otInstanceErasePersistentInfo(otInstance *aInstance);
|
||||
otError otInstanceErasePersistentInfo(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function returns the current dynamic log level.
|
||||
@@ -278,11 +278,11 @@ otLogLevel otGetDynamicLogLevel(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aLogLevel The dynamic log level.
|
||||
*
|
||||
* @retval kThreadError_None The log level was changed successfully.
|
||||
* @retval kThreadError_NotCapable The dynamic log level is not supported.
|
||||
* @retval OT_ERROR_NONE The log level was changed successfully.
|
||||
* @retval OT_ERROR_NOT_CAPABLE The dynamic log level is not supported.
|
||||
*
|
||||
*/
|
||||
ThreadError otSetDynamicLogLevel(otInstance *aInstance, otLogLevel aLogLevel);
|
||||
otError otSetDynamicLogLevel(otInstance *aInstance, otLogLevel aLogLevel);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
+39
-39
@@ -60,11 +60,11 @@ extern "C" {
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aEnabled TRUE to enable IPv6, FALSE otherwise.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enabled the IPv6 interface,
|
||||
* or the interface was already enabled.
|
||||
* @retval OT_ERROR_NONE Successfully enabled the IPv6 interface,
|
||||
* or the interface was already enabled.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otIp6SetEnabled(otInstance *aInstance, bool aEnabled);
|
||||
OTAPI otError OTCALL otIp6SetEnabled(otInstance *aInstance, bool aEnabled);
|
||||
|
||||
/**
|
||||
* This function indicates whether or not the IPv6 interface is up.
|
||||
@@ -86,11 +86,11 @@ OTAPI bool OTCALL otIp6IsEnabled(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aAddress A pointer to a Network Interface Address.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully added (or updated) the Network Interface Address.
|
||||
* @retval kThreadError_InvalidArgs The IP Address indicated by @p aAddress is an internal address.
|
||||
* @retval kThreadError_NoBufs The Network Interface is already storing the maximum allowed external addresses.
|
||||
* @retval OT_ERROR_NONE Successfully added (or updated) the Network Interface Address.
|
||||
* @retval OT_ERROR_INVALID_ARGS The IP Address indicated by @p aAddress is an internal address.
|
||||
* @retval OT_ERROR_NO_BUFS The Network Interface is already storing the maximum allowed external addresses.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otIp6AddUnicastAddress(otInstance *aInstance, const otNetifAddress *aAddress);
|
||||
OTAPI otError OTCALL otIp6AddUnicastAddress(otInstance *aInstance, const otNetifAddress *aAddress);
|
||||
|
||||
/**
|
||||
* Remove a Network Interface Address from the Thread interface.
|
||||
@@ -98,11 +98,11 @@ OTAPI ThreadError OTCALL otIp6AddUnicastAddress(otInstance *aInstance, const otN
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aAddress A pointer to an IP Address.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully removed the Network Interface Address.
|
||||
* @retval kThreadError_InvalidArgs The IP Address indicated by @p aAddress is an internal address.
|
||||
* @retval kThreadError_NotFound The IP Address indicated by @p aAddress was not found.
|
||||
* @retval OT_ERROR_NONE Successfully removed the Network Interface Address.
|
||||
* @retval OT_ERROR_INVALID_ARGS The IP Address indicated by @p aAddress is an internal address.
|
||||
* @retval OT_ERROR_NOT_FOUND The IP Address indicated by @p aAddress was not found.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otIp6RemoveUnicastAddress(otInstance *aInstance, const otIp6Address *aAddress);
|
||||
OTAPI otError OTCALL otIp6RemoveUnicastAddress(otInstance *aInstance, const otIp6Address *aAddress);
|
||||
|
||||
/**
|
||||
* Get the list of IPv6 addresses assigned to the Thread interface.
|
||||
@@ -122,11 +122,11 @@ OTAPI const otNetifAddress *OTCALL otIp6GetUnicastAddresses(otInstance *aInstanc
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aAddress A pointer to an IP Address.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully subscribed to the Network Interface Multicast Address.
|
||||
* @retval kThreadError_InvalidArgs The IP Address indicated by @p aAddress is invalid address.
|
||||
* @retval kThreadError_NoBufs The Network Interface is already storing the maximum allowed external multicast addresses.
|
||||
* @retval OT_ERROR_NONE Successfully subscribed to the Network Interface Multicast Address.
|
||||
* @retval OT_ERROR_INVALID_ARGS The IP Address indicated by @p aAddress is invalid address.
|
||||
* @retval OT_ERROR_NO_BUFS The Network Interface is already storing the maximum allowed external multicast addresses.
|
||||
*/
|
||||
ThreadError otIp6SubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress);
|
||||
otError otIp6SubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress);
|
||||
|
||||
/**
|
||||
* Unsubscribe the Thread interface to a Network Interface Multicast Address.
|
||||
@@ -134,11 +134,11 @@ ThreadError otIp6SubscribeMulticastAddress(otInstance *aInstance, const otIp6Add
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aAddress A pointer to an IP Address.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully unsubscribed to the Network Interface Multicast Address.
|
||||
* @retval kThreadError_InvalidArgs The IP Address indicated by @p aAddress is an internal address.
|
||||
* @retval kThreadError_NotFound The IP Address indicated by @p aAddress was not found.
|
||||
* @retval OT_ERROR_NONE Successfully unsubscribed to the Network Interface Multicast Address.
|
||||
* @retval OT_ERROR_INVALID_ARGS The IP Address indicated by @p aAddress is an internal address.
|
||||
* @retval OT_ERROR_NOT_FOUND The IP Address indicated by @p aAddress was not found.
|
||||
*/
|
||||
ThreadError otIp6UnsubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress);
|
||||
otError otIp6UnsubscribeMulticastAddress(otInstance *aInstance, const otIp6Address *aAddress);
|
||||
|
||||
/**
|
||||
* Get the list of IPv6 multicast addresses subscribed to the Thread interface.
|
||||
@@ -175,11 +175,11 @@ void otIp6SetMulticastPromiscuousEnabled(otInstance *aInstance, bool aEnabled);
|
||||
* @param[inout] aAddress A pointer to structure containing IPv6 address for which IID is being created.
|
||||
* @param[inout] aContext A pointer to creator-specific context.
|
||||
*
|
||||
* @retval kThreadError_None Created valid IID for given IPv6 address.
|
||||
* @retval kThreadError_Ipv6AddressCreationFailure Creation of valid IID for given IPv6 address failed.
|
||||
* @retval OT_ERROR_NONE Created valid IID for given IPv6 address.
|
||||
* @retval OT_ERROR_IP6_ADDRESS_CREATION_FAILURE Creation of valid IID for given IPv6 address failed.
|
||||
*
|
||||
*/
|
||||
typedef ThreadError(*otIp6SlaacIidCreate)(otInstance *aInstance, otNetifAddress *aAddress, void *aContext);
|
||||
typedef otError(*otIp6SlaacIidCreate)(otInstance *aInstance, otNetifAddress *aAddress, void *aContext);
|
||||
|
||||
/**
|
||||
* Update all automatically created IPv6 addresses for prefixes from current Network Data with SLAAC procedure.
|
||||
@@ -201,10 +201,10 @@ void otIp6SlaacUpdate(otInstance *aInstance, otNetifAddress *aAddresses, uint32_
|
||||
* @param[inout] aAddresses A pointer to structure containing IPv6 address for which IID is being created.
|
||||
* @param[in] aContext A pointer to unused data.
|
||||
*
|
||||
* @retval kThreadError_None Created valid IID for given IPv6 address.
|
||||
* @retval OT_ERROR_NONE Created valid IID for given IPv6 address.
|
||||
*
|
||||
*/
|
||||
ThreadError otIp6CreateRandomIid(otInstance *aInstance, otNetifAddress *aAddresses, void *aContext);
|
||||
otError otIp6CreateRandomIid(otInstance *aInstance, otNetifAddress *aAddresses, void *aContext);
|
||||
|
||||
/**
|
||||
* Create IID for given IPv6 address using extended MAC address.
|
||||
@@ -213,10 +213,10 @@ ThreadError otIp6CreateRandomIid(otInstance *aInstance, otNetifAddress *aAddress
|
||||
* @param[inout] aAddresses A pointer to structure containing IPv6 address for which IID is being created.
|
||||
* @param[in] aContext A pointer to unused data.
|
||||
*
|
||||
* @retval kThreadError_None Created valid IID for given IPv6 address.
|
||||
* @retval OT_ERROR_NONE Created valid IID for given IPv6 address.
|
||||
*
|
||||
*/
|
||||
ThreadError otIp6CreateMacIid(otInstance *aInstance, otNetifAddress *aAddresses, void *aContext);
|
||||
otError otIp6CreateMacIid(otInstance *aInstance, otNetifAddress *aAddresses, void *aContext);
|
||||
|
||||
/**
|
||||
* Create semantically opaque IID for given IPv6 address.
|
||||
@@ -225,11 +225,11 @@ ThreadError otIp6CreateMacIid(otInstance *aInstance, otNetifAddress *aAddresses,
|
||||
* @param[inout] aAddresses A pointer to structure containing IPv6 address for which IID is being created.
|
||||
* @param[inout] aContext A pointer to a otSemanticallyOpaqueIidGeneratorData structure.
|
||||
*
|
||||
* @retval kThreadError_None Created valid IID for given IPv6 address.
|
||||
* @retval kThreadError_Ipv6AddressCreationFailure Could not create valid IID for given IPv6 address.
|
||||
* @retval OT_ERROR_NONE Created valid IID for given IPv6 address.
|
||||
* @retval OT_ERROR_IP6_ADDRESS_CREATION_FAILURE Could not create valid IID for given IPv6 address.
|
||||
*
|
||||
*/
|
||||
ThreadError otIp6CreateSemanticallyOpaqueIid(otInstance *aInstance, otNetifAddress *aAddresses, void *aContext);
|
||||
otError otIp6CreateSemanticallyOpaqueIid(otInstance *aInstance, otNetifAddress *aAddresses, void *aContext);
|
||||
|
||||
/**
|
||||
* Allocate a new message buffer for sending an IPv6 message.
|
||||
@@ -303,7 +303,7 @@ void otIp6SetReceiveFilterEnabled(otInstance *aInstance, bool aEnabled);
|
||||
* @param[in] aMessage A pointer to the message buffer containing the IPv6 datagram.
|
||||
*
|
||||
*/
|
||||
ThreadError otIp6Send(otInstance *aInstance, otMessage *aMessage);
|
||||
otError otIp6Send(otInstance *aInstance, otMessage *aMessage);
|
||||
|
||||
/**
|
||||
* This function adds a port to the allowed unsecured port list.
|
||||
@@ -311,11 +311,11 @@ ThreadError otIp6Send(otInstance *aInstance, otMessage *aMessage);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPort The port value.
|
||||
*
|
||||
* @retval kThreadError_None The port was successfully added to the allowed unsecure port list.
|
||||
* @retval kThreadError_NoBufs The unsecure port list is full.
|
||||
* @retval OT_ERROR_NONE The port was successfully added to the allowed unsecure port list.
|
||||
* @retval OT_ERROR_NO_BUFS The unsecure port list is full.
|
||||
*
|
||||
*/
|
||||
ThreadError otIp6AddUnsecurePort(otInstance *aInstance, uint16_t aPort);
|
||||
otError otIp6AddUnsecurePort(otInstance *aInstance, uint16_t aPort);
|
||||
|
||||
/**
|
||||
* This function removes a port from the allowed unsecure port list.
|
||||
@@ -323,11 +323,11 @@ ThreadError otIp6AddUnsecurePort(otInstance *aInstance, uint16_t aPort);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPort The port value.
|
||||
*
|
||||
* @retval kThreadError_None The port was successfully removed from the allowed unsecure port list.
|
||||
* @retval kThreadError_NotFound The port was not found in the unsecure port list.
|
||||
* @retval OT_ERROR_NONE The port was successfully removed from the allowed unsecure port list.
|
||||
* @retval OT_ERROR_NOT_FOUND The port was not found in the unsecure port list.
|
||||
*
|
||||
*/
|
||||
ThreadError otIp6RemoveUnsecurePort(otInstance *aInstance, uint16_t aPort);
|
||||
otError otIp6RemoveUnsecurePort(otInstance *aInstance, uint16_t aPort);
|
||||
|
||||
/**
|
||||
* This function returns a pointer to the unsecure port list.
|
||||
@@ -359,10 +359,10 @@ OTAPI bool OTCALL otIp6IsAddressEqual(const otIp6Address *a, const otIp6Address
|
||||
* @param[in] aString A pointer to a NULL-terminated string.
|
||||
* @param[out] aAddress A pointer to an IPv6 address.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully parsed the string.
|
||||
* @retval kThreadErrorInvalidArg Failed to parse the string.
|
||||
* @retval OT_ERROR_NONE Successfully parsed the string.
|
||||
* @retval OT_ERROR_INVALID_ARGS Failed to parse the string.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otIp6AddressFromString(const char *aString, otIp6Address *aAddress);
|
||||
OTAPI otError OTCALL otIp6AddressFromString(const char *aString, otIp6Address *aAddress);
|
||||
|
||||
/**
|
||||
* This function returns the prefix match length (bits) for two IPv6 addresses.
|
||||
|
||||
@@ -74,10 +74,10 @@ typedef void (*otJamDetectionCallback)(bool aJamState, void *aContext);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aRssiThreshold The RSSI threshold.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully set the threshold.
|
||||
* @retval OT_ERROR_NONE Successfully set the threshold.
|
||||
*
|
||||
*/
|
||||
ThreadError otJamDetectionSetRssiThreshold(otInstance *aInstance, int8_t aRssiThreshold);
|
||||
otError otJamDetectionSetRssiThreshold(otInstance *aInstance, int8_t aRssiThreshold);
|
||||
|
||||
/**
|
||||
* Get the Jam Detection RSSI Threshold (in dBm).
|
||||
@@ -94,11 +94,11 @@ int8_t otJamDetectionGetRssiThreshold(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aWindow The Jam Detection window (valid range is 1 to 63)
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully set the window.
|
||||
* @retval kThreadErrorInvalidArgs The given input parameter not within valid range (1-63)
|
||||
* @retval OT_ERROR_NONE Successfully set the window.
|
||||
* @retval OT_ERROR_INVALID_ARGS The given input parameter not within valid range (1-63)
|
||||
*
|
||||
*/
|
||||
ThreadError otJamDetectionSetWindow(otInstance *aInstance, uint8_t aWindow);
|
||||
otError otJamDetectionSetWindow(otInstance *aInstance, uint8_t aWindow);
|
||||
|
||||
/**
|
||||
* Get the Jam Detection Detection Window (in seconds).
|
||||
@@ -119,11 +119,11 @@ uint8_t otJamDetectionGetWindow(otInstance *aInstance);
|
||||
* @param[in] aBusyPeriod The Jam Detection busy period (should be non-zero and
|
||||
less than or equal to Jam Detection Window)
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully set the window.
|
||||
* @retval kThreadErrorInvalidArgs The given input is not within the valid range.
|
||||
* @retval OT_ERROR_NONE Successfully set the window.
|
||||
* @retval OT_ERROR_INVALID_ARGS The given input is not within the valid range.
|
||||
*
|
||||
*/
|
||||
ThreadError otJamDetectionSetBusyPeriod(otInstance *aInstance, uint8_t aBusyPeriod);
|
||||
otError otJamDetectionSetBusyPeriod(otInstance *aInstance, uint8_t aBusyPeriod);
|
||||
|
||||
/**
|
||||
* Get the Jam Detection Busy Period (in seconds)
|
||||
@@ -141,22 +141,22 @@ uint8_t otJamDetectionGetBusyPeriod(otInstance *aInstance);
|
||||
* @param[in] aCallback A pointer to a function called to notify of jamming state change.
|
||||
* @param[in] aContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully started the jamming detection.
|
||||
* @retval kThreadErrorAlready Jam detection has been started before.
|
||||
* @retval OT_ERROR_NONE Successfully started the jamming detection.
|
||||
* @retval OT_ERROR_ALREADY Jam detection has been started before.
|
||||
*
|
||||
*/
|
||||
ThreadError otJamDetectionStart(otInstance *aInstance, otJamDetectionCallback aCallback, void *aContext);
|
||||
otError otJamDetectionStart(otInstance *aInstance, otJamDetectionCallback aCallback, void *aContext);
|
||||
|
||||
/**
|
||||
* Stop the jamming detection.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully stopped the jamming detection.
|
||||
* @retval kThreadErrorAlready Jam detection is already stopped.
|
||||
* @retval OT_ERROR_NONE Successfully stopped the jamming detection.
|
||||
* @retval OT_ERROR_ALREADY Jam detection is already stopped.
|
||||
*
|
||||
*/
|
||||
ThreadError otJamDetectionStop(otInstance *aInstance);
|
||||
otError otJamDetectionStop(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Get the Jam Detection Status (enabled/disabled)
|
||||
|
||||
+12
-12
@@ -55,14 +55,14 @@ extern "C" {
|
||||
/**
|
||||
* This function pointer is called to notify the completion of a join operation.
|
||||
*
|
||||
* @param[in] aError kThreadError_None if the join process succeeded.
|
||||
* kThreadError_Security if the join process failed due to security credentials.
|
||||
* kThreadError_NotFound if no joinable network was discovered.
|
||||
* kThreadError_ResponseTimeout if a response timed out.
|
||||
* @param[in] aError OT_ERROR_NONE if the join process succeeded.
|
||||
* OT_ERROR_SECURITY if the join process failed due to security credentials.
|
||||
* OT_ERROR_NOT_FOUND if no joinable network was discovered.
|
||||
* OT_ERROR_RESPONSE_TIMEOUT if a response timed out.
|
||||
* @param[in] aContext A pointer to application-specific context.
|
||||
*
|
||||
*/
|
||||
typedef void (OTCALL *otJoinerCallback)(ThreadError aError, void *aContext);
|
||||
typedef void (OTCALL *otJoinerCallback)(otError aError, void *aContext);
|
||||
|
||||
/**
|
||||
* This function enables the Thread Joiner role.
|
||||
@@ -77,14 +77,14 @@ typedef void (OTCALL *otJoinerCallback)(ThreadError aError, void *aContext);
|
||||
* @param[in] aCallback A pointer to a function that is called when the join operation completes.
|
||||
* @param[in] aContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadError_None Successfully started the Commissioner role.
|
||||
* @retval kThreadError_InvalidArgs @p aPSKd or @p aProvisioningUrl is invalid.
|
||||
* @retval OT_ERROR_NONE Successfully started the Commissioner role.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aPSKd or @p aProvisioningUrl is invalid.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otJoinerStart(otInstance *aInstance, const char *aPSKd, const char *aProvisioningUrl,
|
||||
const char *aVendorName, const char *aVendorModel,
|
||||
const char *aVendorSwVersion, const char *aVendorData,
|
||||
otJoinerCallback aCallback, void *aContext);
|
||||
OTAPI otError OTCALL otJoinerStart(otInstance *aInstance, const char *aPSKd, const char *aProvisioningUrl,
|
||||
const char *aVendorName, const char *aVendorModel,
|
||||
const char *aVendorSwVersion, const char *aVendorData,
|
||||
otJoinerCallback aCallback, void *aContext);
|
||||
|
||||
/**
|
||||
* This function disables the Thread Joiner role.
|
||||
@@ -92,7 +92,7 @@ OTAPI ThreadError OTCALL otJoinerStart(otInstance *aInstance, const char *aPSKd,
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otJoinerStop(otInstance *aInstance);
|
||||
OTAPI otError OTCALL otJoinerStop(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
+48
-48
@@ -71,12 +71,12 @@ typedef void (OTCALL *otHandleActiveScanResult)(otActiveScanResult *aResult, voi
|
||||
* @param[in] aCallback A pointer to a function called on receiving a beacon or scan completes.
|
||||
* @param[in] aCallbackContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadError_None Accepted the Active Scan request.
|
||||
* @retval kThreadError_Busy Already performing an Active Scan.
|
||||
* @retval OT_ERROR_NONE Accepted the Active Scan request.
|
||||
* @retval OT_ERROR_BUSY Already performing an Active Scan.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkActiveScan(otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration,
|
||||
otHandleActiveScanResult aCallback, void *aCallbackContext);
|
||||
OTAPI otError OTCALL otLinkActiveScan(otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration,
|
||||
otHandleActiveScanResult aCallback, void *aCallbackContext);
|
||||
|
||||
/**
|
||||
* This function indicates whether or not an IEEE 802.15.4 Active Scan is currently in progress.
|
||||
@@ -106,12 +106,12 @@ typedef void (OTCALL *otHandleEnergyScanResult)(otEnergyScanResult *aResult, voi
|
||||
* @param[in] aCallback A pointer to a function called to pass on scan result on indicate scan completion.
|
||||
* @param[in] aCallbackContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadError_None Accepted the Energy Scan request.
|
||||
* @retval kThreadError_Busy Could not start the energy scan.
|
||||
* @retval OT_ERROR_NONE Accepted the Energy Scan request.
|
||||
* @retval OT_ERROR_BUSY Could not start the energy scan.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkEnergyScan(otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration,
|
||||
otHandleEnergyScanResult aCallback, void *aCallbackContext);
|
||||
OTAPI otError OTCALL otLinkEnergyScan(otInstance *aInstance, uint32_t aScanChannels, uint16_t aScanDuration,
|
||||
otHandleEnergyScanResult aCallback, void *aCallbackContext);
|
||||
|
||||
/**
|
||||
* This function indicates whether or not an IEEE 802.15.4 Energy Scan is currently in progress.
|
||||
@@ -128,13 +128,13 @@ OTAPI bool OTCALL otLinkIsEnergyScanInProgress(otInstance *aInstance);
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enqueued an IEEE 802.15.4 Data Request message.
|
||||
* @retval kThreadError_Already An IEEE 802.15.4 Data Request message is already enqueued.
|
||||
* @retval kThreadError_InvalidState Device is not in rx-off-when-idle mode.
|
||||
* @retval kThreadError_NoBufs Insufficient message buffers available.
|
||||
* @retval OT_ERROR_NONE Successfully enqueued an IEEE 802.15.4 Data Request message.
|
||||
* @retval OT_ERROR_ALREADY An IEEE 802.15.4 Data Request message is already enqueued.
|
||||
* @retval OT_ERROR_INVALID_STATE Device is not in rx-off-when-idle mode.
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient message buffers available.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkSendDataRequest(otInstance *aInstance);
|
||||
OTAPI otError OTCALL otLinkSendDataRequest(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function indicates whether or not an IEEE 802.15.4 MAC is in the transmit state.
|
||||
@@ -171,13 +171,13 @@ OTAPI uint8_t OTCALL otLinkGetChannel(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aChannel The IEEE 802.15.4 channel.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully set the channel.
|
||||
* @retval kThreadErrorInvalidArgs If @p aChnanel is not in the range [11, 26].
|
||||
* @retval kThreadError_InvalidState Thread protocols are enabled.
|
||||
* @retval OT_ERROR_NONE Successfully set the channel.
|
||||
* @retval OT_ERROR_INVALID_ARGS If @p aChnanel is not in the range [11, 26].
|
||||
* @retval OT_ERROR_INVALID_STATE Thread protocols are enabled.
|
||||
*
|
||||
* @sa otLinkGetChannel
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkSetChannel(otInstance *aInstance, uint8_t aChannel);
|
||||
OTAPI otError OTCALL otLinkSetChannel(otInstance *aInstance, uint8_t aChannel);
|
||||
|
||||
/**
|
||||
* Get the IEEE 802.15.4 Extended Address.
|
||||
@@ -196,12 +196,12 @@ OTAPI const uint8_t *OTCALL otLinkGetExtendedAddress(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aExtendedAddress A pointer to the IEEE 802.15.4 Extended Address.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the IEEE 802.15.4 Extended Address.
|
||||
* @retval kThreadError_InvalidArgs @p aExtendedAddress was NULL.
|
||||
* @retval kThraedError_InvalidState Thread protocols are enabled.
|
||||
* @retval OT_ERROR_NONE Successfully set the IEEE 802.15.4 Extended Address.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aExtendedAddress was NULL.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread protocols are enabled.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtendedAddress);
|
||||
OTAPI otError OTCALL otLinkSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtendedAddress);
|
||||
|
||||
/**
|
||||
* Get the factory-assigned IEEE EUI-64.
|
||||
@@ -264,13 +264,13 @@ OTAPI otPanId OTCALL otLinkGetPanId(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPanId The IEEE 802.15.4 PAN ID.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the PAN ID.
|
||||
* @retval kThreadError_InvalidArgs If aPanId is not in the range [0, 65534].
|
||||
* @retval kThreadError_InvalidState Thread protocols are enabled.
|
||||
* @retval OT_ERROR_NONE Successfully set the PAN ID.
|
||||
* @retval OT_ERROR_INVALID_ARGS If aPanId is not in the range [0, 65534].
|
||||
* @retval OT_ERROR_INVALID_STATE Thread protocols are enabled.
|
||||
*
|
||||
* @sa otLinkGetPanId
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkSetPanId(otInstance *aInstance, otPanId aPanId);
|
||||
OTAPI otError OTCALL otLinkSetPanId(otInstance *aInstance, otPanId aPanId);
|
||||
|
||||
/**
|
||||
* Get the data poll period of sleepy end device.
|
||||
@@ -311,8 +311,8 @@ OTAPI otShortAddress OTCALL otLinkGetShortAddress(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aExtAddr A pointer to the IEEE 802.15.4 Extended Address.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully added to the MAC whitelist.
|
||||
* @retval kThreadErrorNoBufs No buffers available for a new MAC whitelist entry.
|
||||
* @retval OT_ERROR_NONE Successfully added to the MAC whitelist.
|
||||
* @retval OT_ERROR_NO_BUFS No buffers available for a new MAC whitelist entry.
|
||||
*
|
||||
* @sa otLinkAddWhitelistRssi
|
||||
* @sa otLinkRemoveWhitelist
|
||||
@@ -320,7 +320,7 @@ OTAPI otShortAddress OTCALL otLinkGetShortAddress(otInstance *aInstance);
|
||||
* @sa otLinkGetWhitelistEntry
|
||||
* @sa otLinkSetWhitelistEnabled
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkAddWhitelist(otInstance *aInstance, const uint8_t *aExtAddr);
|
||||
OTAPI otError OTCALL otLinkAddWhitelist(otInstance *aInstance, const uint8_t *aExtAddr);
|
||||
|
||||
/**
|
||||
* Add an IEEE 802.15.4 Extended Address to the MAC whitelist and fix the RSSI value.
|
||||
@@ -329,8 +329,8 @@ OTAPI ThreadError OTCALL otLinkAddWhitelist(otInstance *aInstance, const uint8_t
|
||||
* @param[in] aExtAddr A pointer to the IEEE 802.15.4 Extended Address.
|
||||
* @param[in] aRssi The RSSI in dBm to use when receiving messages from aExtAddr.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully added to the MAC whitelist.
|
||||
* @retval kThreadErrorNoBufs No buffers available for a new MAC whitelist entry.
|
||||
* @retval OT_ERROR_NONE Successfully added to the MAC whitelist.
|
||||
* @retval OT_ERROR_NO_BUFS No buffers available for a new MAC whitelist entry.
|
||||
*
|
||||
* @sa otLinkAddWhitelistRssi
|
||||
* @sa otLinkRemoveWhitelist
|
||||
@@ -339,7 +339,7 @@ OTAPI ThreadError OTCALL otLinkAddWhitelist(otInstance *aInstance, const uint8_t
|
||||
* @sa otLinkIsWhitelistEnabled
|
||||
* @sa otLinkSetWhitelistEnabled
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkAddWhitelistRssi(otInstance *aInstance, const uint8_t *aExtAddr, int8_t aRssi);
|
||||
OTAPI otError OTCALL otLinkAddWhitelistRssi(otInstance *aInstance, const uint8_t *aExtAddr, int8_t aRssi);
|
||||
|
||||
/**
|
||||
* Remove an IEEE 802.15.4 Extended Address from the MAC whitelist.
|
||||
@@ -363,11 +363,11 @@ OTAPI void OTCALL otLinkRemoveWhitelist(otInstance *aInstance, const uint8_t *aE
|
||||
* @param[in] aIndex An index into the MAC whitelist table.
|
||||
* @param[out] aEntry A pointer to where the information is placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully retrieved the MAC whitelist entry.
|
||||
* @retval kThreadError_InvalidArgs @p aIndex is out of bounds or @p aEntry is NULL.
|
||||
* @retval OT_ERROR_NONE Successfully retrieved the MAC whitelist entry.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aIndex is out of bounds or @p aEntry is NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkGetWhitelistEntry(otInstance *aInstance, uint8_t aIndex, otMacWhitelistEntry *aEntry);
|
||||
OTAPI otError OTCALL otLinkGetWhitelistEntry(otInstance *aInstance, uint8_t aIndex, otMacWhitelistEntry *aEntry);
|
||||
|
||||
/**
|
||||
* Remove all entries from the MAC whitelist.
|
||||
@@ -420,8 +420,8 @@ OTAPI bool OTCALL otLinkIsWhitelistEnabled(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aExtAddr A pointer to the IEEE 802.15.4 Extended Address.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully added to the MAC blacklist.
|
||||
* @retval kThreadErrorNoBufs No buffers available for a new MAC blacklist entry.
|
||||
* @retval OT_ERROR_NONE Successfully added to the MAC blacklist.
|
||||
* @retval OT_ERROR_NO_BUFS No buffers available for a new MAC blacklist entry.
|
||||
*
|
||||
* @sa otLinkRemoveBlacklist
|
||||
* @sa otLinkClearBlacklist
|
||||
@@ -429,7 +429,7 @@ OTAPI bool OTCALL otLinkIsWhitelistEnabled(otInstance *aInstance);
|
||||
* @sa otLinkIsBlacklistEnabled
|
||||
* @sa otLinkSetBlacklistEnabled
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkAddBlacklist(otInstance *aInstance, const uint8_t *aExtAddr);
|
||||
OTAPI otError OTCALL otLinkAddBlacklist(otInstance *aInstance, const uint8_t *aExtAddr);
|
||||
|
||||
/**
|
||||
* Remove an IEEE 802.15.4 Extended Address from the MAC blacklist.
|
||||
@@ -452,11 +452,11 @@ OTAPI void OTCALL otLinkRemoveBlacklist(otInstance *aInstance, const uint8_t *aE
|
||||
* @param[in] aIndex An index into the MAC Blacklist table.
|
||||
* @param[out] aEntry A pointer to where the information is placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully retrieved the MAC Blacklist entry.
|
||||
* @retval kThreadError_InvalidArgs @p aIndex is out of bounds or @p aEntry is NULL.
|
||||
* @retval OT_ERROR_NONE Successfully retrieved the MAC Blacklist entry.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aIndex is out of bounds or @p aEntry is NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkGetBlacklistEntry(otInstance *aInstance, uint8_t aIndex, otMacBlacklistEntry *aEntry);
|
||||
OTAPI otError OTCALL otLinkGetBlacklistEntry(otInstance *aInstance, uint8_t aIndex, otMacBlacklistEntry *aEntry);
|
||||
|
||||
/**
|
||||
* Remove all entries from the MAC Blacklist.
|
||||
@@ -508,13 +508,13 @@ OTAPI bool OTCALL otLinkIsBlacklistEnabled(otInstance *aInstance);
|
||||
* @param[in] aExtAddr A pointer to the IEEE 802.15.4 Extended Address.
|
||||
* @param[in] aLinkQuality A pointer to the assigned link quality.
|
||||
*
|
||||
* @retval kThreadError_None Successfully retrieved the link quality to aLinkQuality.
|
||||
* @retval kThreadError_InvalidState No attached child matches with a given extended address.
|
||||
* @retval OT_ERROR_NONE Successfully retrieved the link quality to aLinkQuality.
|
||||
* @retval OT_ERROR_INVALID_STATE No attached child matches with a given extended address.
|
||||
*
|
||||
* @sa otLinkSetAssignLinkQuality
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otLinkGetAssignLinkQuality(otInstance *aInstance, const uint8_t *aExtAddr,
|
||||
uint8_t *aLinkQuality);
|
||||
OTAPI otError OTCALL otLinkGetAssignLinkQuality(otInstance *aInstance, const uint8_t *aExtAddr,
|
||||
uint8_t *aLinkQuality);
|
||||
|
||||
/**
|
||||
* Set the link quality which is on the link to a given extended address.
|
||||
@@ -580,12 +580,12 @@ bool otLinkIsPromiscuous(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPromiscuous true to enable promiscuous mode, or false otherwise.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enabled promiscuous mode.
|
||||
* @retval kThreadError_InvalidState Could not enable promiscuous mode because
|
||||
* the Thread interface is enabled.
|
||||
* @retval OT_ERROR_NONE Successfully enabled promiscuous mode.
|
||||
* @retval OT_ERROR_INVALID_STATE Could not enable promiscuous mode because
|
||||
* the Thread interface is enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkSetPromiscuous(otInstance *aInstance, bool aPromiscuous);
|
||||
otError otLinkSetPromiscuous(otInstance *aInstance, bool aPromiscuous);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -58,11 +58,11 @@ extern "C" {
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aEnabled TRUE to enable raw link-layer, FALSE otherwise.
|
||||
*
|
||||
* @retval kThreadError_None If the enable state was successfully set.
|
||||
* @retval kThreadError_InvalidState If the OpenThread Ip6 interface is already enabled.
|
||||
* @retval OT_ERROR_NONE If the enable state was successfully set.
|
||||
* @retval OT_ERROR_INVALID_STATE If the OpenThread Ip6 interface is already enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSetEnable(otInstance *aInstance, bool aEnabled);
|
||||
otError otLinkRawSetEnable(otInstance *aInstance, bool aEnabled);
|
||||
|
||||
/**
|
||||
* This function indicates whether or not the raw link-layer is enabled.
|
||||
@@ -81,11 +81,11 @@ bool otLinkRawIsEnabled(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPanId The IEEE 802.15.4 PAN ID.
|
||||
*
|
||||
* @retval kThreadError_None If successful.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE If successful.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSetPanId(otInstance *aInstance, uint16_t aPanId);
|
||||
otError otLinkRawSetPanId(otInstance *aInstance, uint16_t aPanId);
|
||||
|
||||
/**
|
||||
* This function sets the IEEE 802.15.4 Extended Address.
|
||||
@@ -93,11 +93,11 @@ ThreadError otLinkRawSetPanId(otInstance *aInstance, uint16_t aPanId);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aExtendedAddress A pointer to the IEEE 802.15.4 Extended Address.
|
||||
*
|
||||
* @retval kThreadError_None If successful.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE If successful.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtendedAddress);
|
||||
otError otLinkRawSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtendedAddress);
|
||||
|
||||
/**
|
||||
* Set the Short Address for address filtering.
|
||||
@@ -105,11 +105,11 @@ ThreadError otLinkRawSetExtendedAddress(otInstance *aInstance, const otExtAddres
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aShortAddress The IEEE 802.15.4 Short Address.
|
||||
*
|
||||
* @retval kThreadError_None If successful.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE If successful.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSetShortAddress(otInstance *aInstance, uint16_t aShortAddress);
|
||||
otError otLinkRawSetShortAddress(otInstance *aInstance, uint16_t aShortAddress);
|
||||
|
||||
/**
|
||||
* This function gets the status of promiscuous mode.
|
||||
@@ -128,11 +128,11 @@ bool otLinkRawGetPromiscuous(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aEnable A value to enable or disable promiscuous mode.
|
||||
*
|
||||
* @retval kThreadError_None If successful.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE If successful.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSetPromiscuous(otInstance *aInstance, bool aEnable);
|
||||
otError otLinkRawSetPromiscuous(otInstance *aInstance, bool aEnable);
|
||||
|
||||
/**
|
||||
* Transition the radio from Receive to Sleep.
|
||||
@@ -140,23 +140,23 @@ ThreadError otLinkRawSetPromiscuous(otInstance *aInstance, bool aEnable);
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None Successfully transitioned to Sleep.
|
||||
* @retval kThreadError_Busy The radio was transmitting
|
||||
* @retval kThreadError_InvalidState The radio was disabled
|
||||
* @retval OT_ERROR_NONE Successfully transitioned to Sleep.
|
||||
* @retval OT_ERROR_BUSY The radio was transmitting
|
||||
* @retval OT_ERROR_INVALID_STATE The radio was disabled
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSleep(otInstance *aInstance);
|
||||
otError otLinkRawSleep(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function pointer on receipt of a IEEE 802.15.4 frame.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPacket A pointer to the received packet or NULL if the receive operation was aborted.
|
||||
* @param[in] aaError kThreadError_None when successfully received a frame.
|
||||
* kThreadError_Abort when reception was aborted and a frame was not received.
|
||||
* @param[in] aError OT_ERROR_NONE when successfully received a frame.
|
||||
* OT_ERROR_ABORT when reception was aborted and a frame was not received.
|
||||
*
|
||||
*/
|
||||
typedef void (OTCALL *otLinkRawReceiveDone)(otInstance *aInstance, RadioPacket *aPacket, ThreadError aError);
|
||||
typedef void (OTCALL *otLinkRawReceiveDone)(otInstance *aInstance, RadioPacket *aPacket, otError aError);
|
||||
|
||||
/**
|
||||
* Transitioning the radio from Sleep to Receive.
|
||||
@@ -166,11 +166,11 @@ typedef void (OTCALL *otLinkRawReceiveDone)(otInstance *aInstance, RadioPacket *
|
||||
* @param[in] aChannel The channel to use for receiving.
|
||||
* @param[in] aCallback A pointer to a function called on receipt of a IEEE 802.15.4 frame.
|
||||
*
|
||||
* @retval kThreadError_None Successfully transitioned to Receive.
|
||||
* @retval kThreadError_InvalidState The radio was disabled or transmitting.
|
||||
* @retval OT_ERROR_NONE Successfully transitioned to Receive.
|
||||
* @retval OT_ERROR_INVALID_STATE The radio was disabled or transmitting.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawReceive(otInstance *aInstance, uint8_t aChannel, otLinkRawReceiveDone aCallback);
|
||||
otError otLinkRawReceive(otInstance *aInstance, uint8_t aChannel, otLinkRawReceiveDone aCallback);
|
||||
|
||||
/**
|
||||
* The radio transitions from Transmit to Receive.
|
||||
@@ -192,15 +192,15 @@ RadioPacket *otLinkRawGetTransmitBuffer(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPacket A pointer to the packet that was transmitted.
|
||||
* @param[in] aFramePending TRUE if an ACK frame was received and the Frame Pending bit was set.
|
||||
* @param[in] aError kThreadError_None when the frame was transmitted.
|
||||
* kThreadError_NoAck when the frame was transmitted but no ACK was received
|
||||
* kThreadError_ChannelAccessFailure when the transmission could not take place
|
||||
* @param[in] aError OT_ERROR_NONE when the frame was transmitted.
|
||||
* OT_ERROR_NO_ACK when the frame was transmitted but no ACK was received
|
||||
* OT_ERROR_CHANNEL_ACCESS_FAILURE when the transmission could not take place
|
||||
due to activity on the channel.
|
||||
* kThreadError_Abort when transmission was aborted for other reasons.
|
||||
* OT_ERROR_ABORT when transmission was aborted for other reasons.
|
||||
*
|
||||
*/
|
||||
typedef void (*otLinkRawTransmitDone)(otInstance *aInstance, RadioPacket *aPacket, bool aFramePending,
|
||||
ThreadError aError);
|
||||
otError aError);
|
||||
|
||||
/**
|
||||
* This method begins the transmit sequence on the radio.
|
||||
@@ -216,11 +216,11 @@ typedef void (*otLinkRawTransmitDone)(otInstance *aInstance, RadioPacket *aPacke
|
||||
* @param[in] aPacket A pointer to the packet that was transmitted.
|
||||
* @param[in] aCallback A pointer to a function called on completion of the transmission.
|
||||
*
|
||||
* @retval kThreadError_None Successfully transitioned to Transmit.
|
||||
* @retval kThreadError_InvalidState The radio was not in the Receive state.
|
||||
* @retval OT_ERROR_NONE Successfully transitioned to Transmit.
|
||||
* @retval OT_ERROR_INVALID_STATE The radio was not in the Receive state.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawTransmit(otInstance *aInstance, RadioPacket *aPacket, otLinkRawTransmitDone aCallback);
|
||||
otError otLinkRawTransmit(otInstance *aInstance, RadioPacket *aPacket, otLinkRawTransmitDone aCallback);
|
||||
|
||||
/**
|
||||
* Get the most recent RSSI measurement.
|
||||
@@ -259,13 +259,13 @@ typedef void (*otLinkRawEnergyScanDone)(otInstance *aInstance, int8_t aEnergySca
|
||||
* @param[in] aScanDuration The duration, in milliseconds, for the channel to be scanned.
|
||||
* @param[in] aCallback A pointer to a function called on completion of a scanned channel.
|
||||
*
|
||||
* @retval kThreadError_None Successfully started scanning the channel.
|
||||
* @retval kThreadError_NotImplemented The radio doesn't support energy scanning.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE Successfully started scanning the channel.
|
||||
* @retval OT_ERROR_NOT_IMPLEMENTED The radio doesn't support energy scanning.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration,
|
||||
otLinkRawEnergyScanDone aCallback);
|
||||
otError otLinkRawEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration,
|
||||
otLinkRawEnergyScanDone aCallback);
|
||||
|
||||
/**
|
||||
* Enable/Disable source match for AutoPend.
|
||||
@@ -273,11 +273,11 @@ ThreadError otLinkRawEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uin
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aEnable Enable/disable source match for automatical pending.
|
||||
*
|
||||
* @retval kThreadError_None If successful.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE If successful.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSrcMatchEnable(otInstance *aInstance, bool aEnable);
|
||||
otError otLinkRawSrcMatchEnable(otInstance *aInstance, bool aEnable);
|
||||
|
||||
/**
|
||||
* Adding short address to the source match table.
|
||||
@@ -285,12 +285,12 @@ ThreadError otLinkRawSrcMatchEnable(otInstance *aInstance, bool aEnable);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aShortAddress The short address to be added.
|
||||
*
|
||||
* @retval kThreadError_None Successfully added short address to the source match table.
|
||||
* @retval kThreadError_NoBufs No available entry in the source match table.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE Successfully added short address to the source match table.
|
||||
* @retval OT_ERROR_NO_BUFS No available entry in the source match table.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSrcMatchAddShortEntry(otInstance *aInstance, const uint16_t aShortAddress);
|
||||
otError otLinkRawSrcMatchAddShortEntry(otInstance *aInstance, const uint16_t aShortAddress);
|
||||
|
||||
/**
|
||||
* Adding extended address to the source match table.
|
||||
@@ -298,12 +298,12 @@ ThreadError otLinkRawSrcMatchAddShortEntry(otInstance *aInstance, const uint16_t
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aExtAddress The extended address to be added.
|
||||
*
|
||||
* @retval kThreadError_None Successfully added extended address to the source match table.
|
||||
* @retval kThreadError_NoBufs No available entry in the source match table.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE Successfully added extended address to the source match table.
|
||||
* @retval OT_ERROR_NO_BUFS No available entry in the source match table.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSrcMatchAddExtEntry(otInstance *aInstance, const uint8_t *aExtAddress);
|
||||
otError otLinkRawSrcMatchAddExtEntry(otInstance *aInstance, const uint8_t *aExtAddress);
|
||||
|
||||
/**
|
||||
* Removing short address to the source match table.
|
||||
@@ -311,12 +311,12 @@ ThreadError otLinkRawSrcMatchAddExtEntry(otInstance *aInstance, const uint8_t *a
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aShortAddress The short address to be removed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully removed short address from the source match table.
|
||||
* @retval kThreadError_NoAddress The short address is not in source match table.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE Successfully removed short address from the source match table.
|
||||
* @retval OT_ERROR_NO_ADDRESS The short address is not in source match table.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSrcMatchClearShortEntry(otInstance *aInstance, const uint16_t aShortAddress);
|
||||
otError otLinkRawSrcMatchClearShortEntry(otInstance *aInstance, const uint16_t aShortAddress);
|
||||
|
||||
/**
|
||||
* Removing extended address to the source match table of the radio.
|
||||
@@ -324,34 +324,34 @@ ThreadError otLinkRawSrcMatchClearShortEntry(otInstance *aInstance, const uint16
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aExtAddress The extended address to be removed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully removed the extended address from the source match table.
|
||||
* @retval kThreadError_NoAddress The extended address is not in source match table.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE Successfully removed the extended address from the source match table.
|
||||
* @retval OT_ERROR_NO_ADDRESS The extended address is not in source match table.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSrcMatchClearExtEntry(otInstance *aInstance, const uint8_t *aExtAddress);
|
||||
otError otLinkRawSrcMatchClearExtEntry(otInstance *aInstance, const uint8_t *aExtAddress);
|
||||
|
||||
/**
|
||||
* Removing all the short addresses from the source match table.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None If successful.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE If successful.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSrcMatchClearShortEntries(otInstance *aInstance);
|
||||
otError otLinkRawSrcMatchClearShortEntries(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Removing all the extended addresses from the source match table.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None If successful.
|
||||
* @retval kThreadError_InvalidState If the raw link-layer isn't enabled.
|
||||
* @retval OT_ERROR_NONE If successful.
|
||||
* @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled.
|
||||
*
|
||||
*/
|
||||
ThreadError otLinkRawSrcMatchClearExtEntries(otInstance *aInstance);
|
||||
otError otLinkRawSrcMatchClearExtEntries(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -56,7 +56,7 @@ extern "C" {
|
||||
*
|
||||
* @param[in] aMessage A pointer to a message buffer.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully freed the message buffer.
|
||||
* @retval OT_ERROR_NONE Successfully freed the message buffer.
|
||||
*
|
||||
* @sa otMessageAppend
|
||||
* @sa otMessageGetLength
|
||||
@@ -66,7 +66,7 @@ extern "C" {
|
||||
* @sa otMessageRead
|
||||
* @sa otMessageWrite
|
||||
*/
|
||||
ThreadError otMessageFree(otMessage *aMessage);
|
||||
otError otMessageFree(otMessage *aMessage);
|
||||
|
||||
/**
|
||||
* Get the message length in bytes.
|
||||
@@ -92,8 +92,8 @@ uint16_t otMessageGetLength(otMessage *aMessage);
|
||||
* @param[in] aMessage A pointer to a message buffer.
|
||||
* @param[in] aLength A length in bytes.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully set the message length.
|
||||
* @retval kThreadErrorNoBufs No available buffers to grow the message.
|
||||
* @retval OT_ERROR_NONE Successfully set the message length.
|
||||
* @retval OT_ERROR_NO_BUFS No available buffers to grow the message.
|
||||
*
|
||||
* @sa otMessageFree
|
||||
* @sa otMessageAppend
|
||||
@@ -103,7 +103,7 @@ uint16_t otMessageGetLength(otMessage *aMessage);
|
||||
* @sa otMessageRead
|
||||
* @sa otMessageWrite
|
||||
*/
|
||||
ThreadError otMessageSetLength(otMessage *aMessage, uint16_t aLength);
|
||||
otError otMessageSetLength(otMessage *aMessage, uint16_t aLength);
|
||||
|
||||
/**
|
||||
* Get the message offset in bytes.
|
||||
@@ -128,8 +128,8 @@ uint16_t otMessageGetOffset(otMessage *aMessage);
|
||||
* @param[in] aMessage A pointer to a message buffer.
|
||||
* @param[in] aOffset An offset in bytes.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully set the message offset.
|
||||
* @retval kThreadErrorInvalidArg The offset is beyond the message length.
|
||||
* @retval OT_ERROR_NONE Successfully set the message offset.
|
||||
* @retval OT_ERROR_INVALID_ARGS The offset is beyond the message length.
|
||||
*
|
||||
* @sa otMessageFree
|
||||
* @sa otMessageAppend
|
||||
@@ -139,7 +139,7 @@ uint16_t otMessageGetOffset(otMessage *aMessage);
|
||||
* @sa otMessageRead
|
||||
* @sa otMessageWrite
|
||||
*/
|
||||
ThreadError otMessageSetOffset(otMessage *aMessage, uint16_t aOffset);
|
||||
otError otMessageSetOffset(otMessage *aMessage, uint16_t aOffset);
|
||||
|
||||
/**
|
||||
* This function indicates whether or not link security is enabled for the message.
|
||||
@@ -170,8 +170,8 @@ void otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled);
|
||||
* @param[in] aBuf A pointer to the data to append.
|
||||
* @param[in] aLength Number of bytes to append.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully appended to the message
|
||||
* @retval kThreadErrorNoBufs No available buffers to grow the message.
|
||||
* @retval OT_ERROR_NONE Successfully appended to the message
|
||||
* @retval OT_ERROR_NO_BUFS No available buffers to grow the message.
|
||||
*
|
||||
* @sa otMessageFree
|
||||
* @sa otMessageGetLength
|
||||
@@ -181,7 +181,7 @@ void otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled);
|
||||
* @sa otMessageRead
|
||||
* @sa otMessageWrite
|
||||
*/
|
||||
ThreadError otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength);
|
||||
otError otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength);
|
||||
|
||||
/**
|
||||
* Read bytes from a message.
|
||||
@@ -250,11 +250,11 @@ void otMessageQueueInit(otMessageQueue *aQueue);
|
||||
* @param[in] aQueue A pointer to the message queue.
|
||||
* @param[in] aMessage The message to add.
|
||||
*
|
||||
* @retval kThreadError_None Successfully added the message to the queue.
|
||||
* @retval kThreadError_Already The message is already enqueued in a queue.
|
||||
* @retval OT_ERROR_NONE Successfully added the message to the queue.
|
||||
* @retval OT_ERROR_ALREADY The message is already enqueued in a queue.
|
||||
*
|
||||
*/
|
||||
ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage *aMessage);
|
||||
otError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage *aMessage);
|
||||
|
||||
/**
|
||||
* This function removes a message from the given message queue.
|
||||
@@ -262,11 +262,11 @@ ThreadError otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage *aMessage);
|
||||
* @param[in] aQueue A pointer to the message queue.
|
||||
* @param[in] aMessage The message to remove.
|
||||
*
|
||||
* @retval kThreadError_None Successfully removed the message from the queue.
|
||||
* @retval kThreadError_NotFound The message is not enqueued in this queue.
|
||||
* @retval OT_ERROR_NONE Successfully removed the message from the queue.
|
||||
* @retval OT_ERROR_NOT_FOUND The message is not enqueued in this queue.
|
||||
*
|
||||
*/
|
||||
ThreadError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage *aMessage);
|
||||
otError otMessageQueueDequeue(otMessageQueue *aQueue, otMessage *aMessage);
|
||||
|
||||
/**
|
||||
* This function returns a pointer to the message at the head of the queue.
|
||||
|
||||
@@ -76,12 +76,12 @@ void otNcpInit(otInstance *aInstance);
|
||||
* If aDataLen is non-zero, this param MUST NOT be NULL.
|
||||
* @param[in] aDataLen The number of bytes of data from aDataPtr to send.
|
||||
*
|
||||
* @retval kThreadError_None The data was queued for delivery to the host.
|
||||
* @retval kThreadError_Busy There are not enough resources to complete this
|
||||
* request. This is usually a temporary condition.
|
||||
* @retval kThreadError_InvalidArgs The given aStreamId was invalid.
|
||||
* @retval OT_ERROR_NONE The data was queued for delivery to the host.
|
||||
* @retval OT_ERROR_BUSY There are not enough resources to complete this
|
||||
* request. This is usually a temporary condition.
|
||||
* @retval OT_ERROR_INVALID_ARGS The given aStreamId was invalid.
|
||||
*/
|
||||
ThreadError otNcpStreamWrite(int aStreamId, const uint8_t *aDataPtr, int aDataLen);
|
||||
otError otNcpStreamWrite(int aStreamId, const uint8_t *aDataPtr, int aDataLen);
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
||||
@@ -57,8 +57,8 @@ extern "C" {
|
||||
* @param[inout] aDataLength On entry, size of the data buffer pointed to by @p aData.
|
||||
* On exit, number of copied bytes.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otNetDataGetLeader(otInstance *aInstance, bool aStable, uint8_t *aData,
|
||||
uint8_t *aDataLength);
|
||||
OTAPI otError OTCALL otNetDataGetLeader(otInstance *aInstance, bool aStable, uint8_t *aData,
|
||||
uint8_t *aDataLength);
|
||||
|
||||
/**
|
||||
* This method provides a full or stable copy of the local Thread Network Data.
|
||||
@@ -69,8 +69,8 @@ OTAPI ThreadError OTCALL otNetDataGetLeader(otInstance *aInstance, bool aStable,
|
||||
* @param[inout] aDataLength On entry, size of the data buffer pointed to by @p aData.
|
||||
* On exit, number of copied bytes.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otNetDataGetLocal(otInstance *aInstance, bool aStable, uint8_t *aData,
|
||||
uint8_t *aDataLength);
|
||||
OTAPI otError OTCALL otNetDataGetLocal(otInstance *aInstance, bool aStable, uint8_t *aData,
|
||||
uint8_t *aDataLength);
|
||||
|
||||
/**
|
||||
* This function gets the next On Mesh Prefix in the Network Data.
|
||||
@@ -81,12 +81,12 @@ OTAPI ThreadError OTCALL otNetDataGetLocal(otInstance *aInstance, bool aStable,
|
||||
it should be set to OT_NETWORK_DATA_ITERATOR_INIT.
|
||||
* @param[out] aConfig A pointer to where the On Mesh Prefix information will be placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully found the next On Mesh prefix.
|
||||
* @retval kThreadError_NotFound No subsequent On Mesh prefix exists in the Thread Network Data.
|
||||
* @retval OT_ERROR_NONE Successfully found the next On Mesh prefix.
|
||||
* @retval OT_ERROR_NOT_FOUND No subsequent On Mesh prefix exists in the Thread Network Data.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otNetDataGetNextPrefixInfo(otInstance *aInstance, bool aLocal,
|
||||
otNetworkDataIterator *aIterator, otBorderRouterConfig *aConfig);
|
||||
OTAPI otError OTCALL otNetDataGetNextPrefixInfo(otInstance *aInstance, bool aLocal,
|
||||
otNetworkDataIterator *aIterator, otBorderRouterConfig *aConfig);
|
||||
|
||||
/**
|
||||
* Add a border router configuration to the local network data.
|
||||
@@ -94,14 +94,14 @@ OTAPI ThreadError OTCALL otNetDataGetNextPrefixInfo(otInstance *aInstance, bool
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aConfig A pointer to the border router configuration.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully added the configuration to the local network data.
|
||||
* @retval kThreadErrorInvalidArgs One or more configuration parameters were invalid.
|
||||
* @retval kThreadErrorSize Not enough room is available to add the configuration to the local network data.
|
||||
* @retval OT_ERROR_NONE Successfully added the configuration to the local network data.
|
||||
* @retval OT_ERROR_INVALID_ARGS One or more configuration parameters were invalid.
|
||||
* @retval OT_ERROR_NO_BUFS Not enough room is available to add the configuration to the local network data.
|
||||
*
|
||||
* @sa otRemoveBorderRouter
|
||||
* @sa otSendServerData
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otNetDataAddPrefixInfo(otInstance *aInstance, const otBorderRouterConfig *aConfig);
|
||||
OTAPI otError OTCALL otNetDataAddPrefixInfo(otInstance *aInstance, const otBorderRouterConfig *aConfig);
|
||||
|
||||
/**
|
||||
* Remove a border router configuration from the local network data.
|
||||
@@ -109,12 +109,12 @@ OTAPI ThreadError OTCALL otNetDataAddPrefixInfo(otInstance *aInstance, const otB
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPrefix A pointer to an IPv6 prefix.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully removed the configuration from the local network data.
|
||||
* @retval OT_ERROR_NONE Successfully removed the configuration from the local network data.
|
||||
*
|
||||
* @sa otAddBorderRouter
|
||||
* @sa otSendServerData
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otNetDataRemovePrefixInfo(otInstance *aInstance, const otIp6Prefix *aPrefix);
|
||||
OTAPI otError OTCALL otNetDataRemovePrefixInfo(otInstance *aInstance, const otIp6Prefix *aPrefix);
|
||||
|
||||
/**
|
||||
* Add an external route configuration to the local network data.
|
||||
@@ -122,14 +122,14 @@ OTAPI ThreadError OTCALL otNetDataRemovePrefixInfo(otInstance *aInstance, const
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aConfig A pointer to the external route configuration.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully added the configuration to the local network data.
|
||||
* @retval kThreadErrorInvalidArgs One or more configuration parameters were invalid.
|
||||
* @retval kThreadErrorSize Not enough room is available to add the configuration to the local network data.
|
||||
* @retval OT_ERROR_NONE Successfully added the configuration to the local network data.
|
||||
* @retval OT_ERROR_INVALID_ARGS One or more configuration parameters were invalid.
|
||||
* @retval OT_ERROR_NO_BUFS Not enough room is available to add the configuration to the local network data.
|
||||
*
|
||||
* @sa otRemoveExternalRoute
|
||||
* @sa otSendServerData
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otNetDataAddRoute(otInstance *aInstance, const otExternalRouteConfig *aConfig);
|
||||
OTAPI otError OTCALL otNetDataAddRoute(otInstance *aInstance, const otExternalRouteConfig *aConfig);
|
||||
|
||||
/**
|
||||
* Remove an external route configuration from the local network data.
|
||||
@@ -137,12 +137,12 @@ OTAPI ThreadError OTCALL otNetDataAddRoute(otInstance *aInstance, const otExtern
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPrefix A pointer to an IPv6 prefix.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully removed the configuration from the local network data.
|
||||
* @retval OT_ERROR_NONE Successfully removed the configuration from the local network data.
|
||||
*
|
||||
* @sa otAddExternalRoute
|
||||
* @sa otSendServerData
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otNetDataRemoveRoute(otInstance *aInstance, const otIp6Prefix *aPrefix);
|
||||
OTAPI otError OTCALL otNetDataRemoveRoute(otInstance *aInstance, const otIp6Prefix *aPrefix);
|
||||
|
||||
/**
|
||||
* This function gets the next external route in the Network Data.
|
||||
@@ -153,26 +153,26 @@ OTAPI ThreadError OTCALL otNetDataRemoveRoute(otInstance *aInstance, const otIp6
|
||||
it should be set to OT_NETWORK_DATA_ITERATOR_INIT.
|
||||
* @param[out] aConfig A pointer to where the External Route information will be placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully found the next External Route.
|
||||
* @retval kThreadError_NotFound No subsequent external route entry exists in the Thread Network Data.
|
||||
* @retval OT_ERROR_NONE Successfully found the next External Route.
|
||||
* @retval OT_ERROR_NOT_FOUND No subsequent external route entry exists in the Thread Network Data.
|
||||
*
|
||||
*/
|
||||
ThreadError otNetDataGetNextRoute(otInstance *aInstance, bool aLocal, otNetworkDataIterator *aIterator,
|
||||
otExternalRouteConfig *aConfig);
|
||||
otError otNetDataGetNextRoute(otInstance *aInstance, bool aLocal, otNetworkDataIterator *aIterator,
|
||||
otExternalRouteConfig *aConfig);
|
||||
|
||||
/**
|
||||
* Immediately register the local network data with the Leader.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* retval kThreadErrorNone Successfully queued a Server Data Request message for delivery.
|
||||
* retval OT_ERROR_NONE Successfully queued a Server Data Request message for delivery.
|
||||
*
|
||||
* @sa otAddBorderRouter
|
||||
* @sa otRemoveBorderRouter
|
||||
* @sa otAddExternalRoute
|
||||
* @sa otRemoveExternalRoute
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otNetDataRegister(otInstance *aInstance);
|
||||
OTAPI otError OTCALL otNetDataRegister(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Get the Network Data Version.
|
||||
|
||||
@@ -154,14 +154,14 @@ extern "C" {
|
||||
OTAPI const char *OTCALL otGetVersionString(void);
|
||||
|
||||
/**
|
||||
* This function converts a ThreadError enum into a string.
|
||||
* This function converts a otError enum into a string.
|
||||
*
|
||||
* @param[in] aError A ThreadError enum.
|
||||
* @param[in] aError A otError enum.
|
||||
*
|
||||
* @returns A string representation of a ThreadError.
|
||||
*
|
||||
*/
|
||||
OTAPI const char *OTCALL otThreadErrorToString(ThreadError aError);
|
||||
OTAPI const char *OTCALL otThreadErrorToString(otError aError);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -108,7 +108,7 @@ void otPlatDiagTxPowerSet(int8_t aTxPower);
|
||||
* @param[in] aError The received radio frame status.
|
||||
*
|
||||
*/
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, ThreadError aError);
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, RadioPacket *aFrame, otError aError);
|
||||
|
||||
/**
|
||||
* This function processes the alarm event.
|
||||
|
||||
@@ -219,19 +219,19 @@ PhyState otPlatRadioGetState(otInstance *aInstance);
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enabled.
|
||||
* @retval kThreadError_Failure The radio could not be enabled.
|
||||
* @retval OT_ERROR_NONE Successfully enabled.
|
||||
* @retval OT_ERROR_FAILED The radio could not be enabled.
|
||||
*/
|
||||
ThreadError otPlatRadioEnable(otInstance *aInstance);
|
||||
otError otPlatRadioEnable(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Disable the radio.
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
*
|
||||
* @retval kThreadError_None Successfully transitioned to Disabled.
|
||||
* @retval OT_ERROR_NONE Successfully transitioned to Disabled.
|
||||
*/
|
||||
ThreadError otPlatRadioDisable(otInstance *aInstance);
|
||||
otError otPlatRadioDisable(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Check whether radio is enabled or not.
|
||||
@@ -249,11 +249,11 @@ bool otPlatRadioIsEnabled(otInstance *aInstance);
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
*
|
||||
* @retval kThreadError_None Successfully transitioned to Sleep.
|
||||
* @retval kThreadError_Busy The radio was transmitting
|
||||
* @retval kThreadError_InvalidState The radio was disabled
|
||||
* @retval OT_ERROR_NONE Successfully transitioned to Sleep.
|
||||
* @retval OT_ERROR_BUSY The radio was transmitting
|
||||
* @retval OT_ERROR_INVALID_STATE The radio was disabled
|
||||
*/
|
||||
ThreadError otPlatRadioSleep(otInstance *aInstance);
|
||||
otError otPlatRadioSleep(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Transitioning the radio from Sleep to Receive.
|
||||
@@ -262,10 +262,10 @@ ThreadError otPlatRadioSleep(otInstance *aInstance);
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aChannel The channel to use for receiving.
|
||||
*
|
||||
* @retval kThreadError_None Successfully transitioned to Receive.
|
||||
* @retval kThreadError_InvalidState The radio was disabled or transmitting.
|
||||
* @retval OT_ERROR_NONE Successfully transitioned to Receive.
|
||||
* @retval OT_ERROR_INVALID_STATE The radio was disabled or transmitting.
|
||||
*/
|
||||
ThreadError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel);
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel);
|
||||
|
||||
/**
|
||||
* Enable/Disable source address match feature.
|
||||
@@ -292,10 +292,10 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable);
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aShortAddress The short address to be added.
|
||||
*
|
||||
* @retval kThreadError_None Successfully added short address to the source match table.
|
||||
* @retval kThreadError_NoBufs No available entry in the source match table.
|
||||
* @retval OT_ERROR_NONE Successfully added short address to the source match table.
|
||||
* @retval OT_ERROR_NO_BUFS No available entry in the source match table.
|
||||
*/
|
||||
ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress);
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress);
|
||||
|
||||
/**
|
||||
* Add an extended address to the source address match table.
|
||||
@@ -303,10 +303,10 @@ ThreadError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aExtAddress The extended address to be added.
|
||||
*
|
||||
* @retval kThreadError_None Successfully added extended address to the source match table.
|
||||
* @retval kThreadError_NoBufs No available entry in the source match table.
|
||||
* @retval OT_ERROR_NONE Successfully added extended address to the source match table.
|
||||
* @retval OT_ERROR_NO_BUFS No available entry in the source match table.
|
||||
*/
|
||||
ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress);
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress);
|
||||
|
||||
/**
|
||||
* Remove a short address from the source address match table.
|
||||
@@ -314,10 +314,10 @@ ThreadError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const uint8_t
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aShortAddress The short address to be removed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully removed short address from the source match table.
|
||||
* @retval kThreadError_NoAddress The short address is not in source address match table.
|
||||
* @retval OT_ERROR_NONE Successfully removed short address from the source match table.
|
||||
* @retval OT_ERROR_NO_ADDRESS The short address is not in source address match table.
|
||||
*/
|
||||
ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress);
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress);
|
||||
|
||||
/**
|
||||
* Remove an extended address from the source address match table.
|
||||
@@ -325,10 +325,10 @@ ThreadError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aExtAddress The extended address to be removed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully removed the extended address from the source match table.
|
||||
* @retval kThreadError_NoAddress The extended address is not in source address match table.
|
||||
* @retval OT_ERROR_NONE Successfully removed the extended address from the source match table.
|
||||
* @retval OT_ERROR_NO_ADDRESS The extended address is not in source address match table.
|
||||
*/
|
||||
ThreadError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress);
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const uint8_t *aExtAddress);
|
||||
|
||||
/**
|
||||
* Clear all short addresses from the source address match table.
|
||||
@@ -351,12 +351,12 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance);
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aPacket A pointer to the received packet or NULL if the receive operation failed.
|
||||
* @param[in] aError kThreadError_None when successfully received a frame, kThreadError_Abort when reception
|
||||
* was aborted and a frame was not received, kThreadError_NoBufs when a frame could not be
|
||||
* @param[in] aError OT_ERROR_NONE when successfully received a frame, OT_ERROR_ABORT when reception
|
||||
* was aborted and a frame was not received, OT_ERROR_NO_BUFS when a frame could not be
|
||||
* received due to lack of rx buffer space.
|
||||
*
|
||||
*/
|
||||
extern void otPlatRadioReceiveDone(otInstance *aInstance, RadioPacket *aPacket, ThreadError aError);
|
||||
extern void otPlatRadioReceiveDone(otInstance *aInstance, RadioPacket *aPacket, otError aError);
|
||||
|
||||
/**
|
||||
* The radio transitions from Transmit to Receive.
|
||||
@@ -384,10 +384,10 @@ RadioPacket *otPlatRadioGetTransmitBuffer(otInstance *aInstance);
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aPacket A pointer to the packet that will be transmitted.
|
||||
*
|
||||
* @retval kThreadError_None Successfully transitioned to Transmit.
|
||||
* @retval kThreadError_InvalidState The radio was not in the Receive state.
|
||||
* @retval OT_ERROR_NONE Successfully transitioned to Transmit.
|
||||
* @retval OT_ERROR_INVALID_STATE The radio was not in the Receive state.
|
||||
*/
|
||||
ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket);
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket);
|
||||
|
||||
/**
|
||||
* The radio driver calls this method to notify OpenThread that the transmission has completed.
|
||||
@@ -395,14 +395,14 @@ ThreadError otPlatRadioTransmit(otInstance *aInstance, RadioPacket *aPacket);
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aPacket A pointer to the packet that was transmitted.
|
||||
* @param[in] aFramePending TRUE if an ACK frame was received and the Frame Pending bit was set.
|
||||
* @param[in] aError kThreadError_None when the frame was transmitted, kThreadError_NoAck when the frame was
|
||||
* transmitted but no ACK was received, kThreadError_ChannelAccessFailure when the transmission
|
||||
* could not take place due to activity on the channel, kThreadError_Abort when transmission was
|
||||
* @param[in] aError OT_ERROR_NONE when the frame was transmitted, OT_ERROR_NO_ACK when the frame was
|
||||
* transmitted but no ACK was received, OT_ERROR_CHANNEL_ACCESS_FAILURE when the transmission
|
||||
* could not take place due to activity on the channel, OT_ERROR_ABORT when transmission was
|
||||
* aborted for other reasons.
|
||||
*
|
||||
*/
|
||||
extern void otPlatRadioTransmitDone(otInstance *aInstance, RadioPacket *aPacket, bool aFramePending,
|
||||
ThreadError aError);
|
||||
otError aError);
|
||||
|
||||
/**
|
||||
* Get the most recent RSSI measurement.
|
||||
@@ -455,26 +455,26 @@ void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable);
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aPacket A pointer to the packet that was transmitted.
|
||||
* @param[in] aFramePending TRUE if an ACK frame was received and the Frame Pending bit was set.
|
||||
* @param[in] aError kThreadError_None when the frame was transmitted, kThreadError_NoAck when the frame was
|
||||
* transmitted but no ACK was received, kThreadError_ChannelAccessFailure when the transmission
|
||||
* could not take place due to activity on the channel, kThreadError_Abort when transmission was
|
||||
* @param[in] aError OT_ERROR_NONE when the frame was transmitted, OT_ERROR_NO_ACK when the frame was
|
||||
* transmitted but no ACK was received, OT_ERROR_CHANNEL_ACCESS_FAILURE when the transmission
|
||||
* could not take place due to activity on the channel, OT_ERROR_ABORT when transmission was
|
||||
* aborted for other reasons.
|
||||
*
|
||||
*/
|
||||
extern void otPlatDiagRadioTransmitDone(otInstance *aInstance, RadioPacket *aPacket, bool aFramePending,
|
||||
ThreadError aError);
|
||||
otError aError);
|
||||
|
||||
/**
|
||||
* The radio driver calls this method to notify OpenThread diagnostics module of a received packet.
|
||||
*
|
||||
* @param[in] aInstance The OpenThread instance structure.
|
||||
* @param[in] aPacket A pointer to the received packet or NULL if the receive operation failed.
|
||||
* @param[in] aError kThreadError_None when successfully received a frame, kThreadError_Abort when reception
|
||||
* was aborted and a frame was not received, kThreadError_NoBufs when a frame could not be
|
||||
* @param[in] aError OT_ERROR_NONE when successfully received a frame, OT_ERROR_ABORT when reception
|
||||
* was aborted and a frame was not received, OT_ERROR_NO_BUFS when a frame could not be
|
||||
* received due to lack of rx buffer space.
|
||||
*
|
||||
*/
|
||||
extern void otPlatDiagRadioReceiveDone(otInstance *aInstance, RadioPacket *aPacket, ThreadError aError);
|
||||
extern void otPlatDiagRadioReceiveDone(otInstance *aInstance, RadioPacket *aPacket, otError aError);
|
||||
|
||||
/**
|
||||
* This method begins the energy scan sequence on the radio.
|
||||
@@ -483,10 +483,10 @@ extern void otPlatDiagRadioReceiveDone(otInstance *aInstance, RadioPacket *aPack
|
||||
* @param[in] aScanChannel The channel to perform the energy scan on.
|
||||
* @param[in] aScanDuration The duration, in milliseconds, for the channel to be scanned.
|
||||
*
|
||||
* @retval kThreadError_None Successfully started scanning the channel.
|
||||
* @retval kThreadError_NotImplemented The radio doesn't support energy scanning.
|
||||
* @retval OT_ERROR_NONE Successfully started scanning the channel.
|
||||
* @retval OT_ERROR_NOT_IMPLEMENTED The radio doesn't support energy scanning.
|
||||
*/
|
||||
ThreadError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration);
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration);
|
||||
|
||||
/**
|
||||
* The radio driver calls this method to notify OpenThread that the energy scan is complete.
|
||||
|
||||
@@ -71,12 +71,12 @@ uint32_t otPlatRandomGet(void);
|
||||
* @param[out] aOutput A pointer to where the true random values are placed. Must not be NULL.
|
||||
* @param[in] aOutputLength Size of @p aBuffer.
|
||||
*
|
||||
* @retval kThreadError_None Successfully filled @p aBuffer with true random values.
|
||||
* @retval kThreadError_Fail Failed to fill @p aBuffer with true random values.
|
||||
* @retval kThreadError_InvalidArgs @p aBuffer was set to NULL.
|
||||
* @retval OT_ERROR_NONE Successfully filled @p aBuffer with true random values.
|
||||
* @retval OT_ERROR_FAILED Failed to fill @p aBuffer with true random values.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aBuffer was set to NULL.
|
||||
*
|
||||
*/
|
||||
ThreadError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength);
|
||||
otError otPlatRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -71,38 +71,38 @@ void otPlatSettingsInit(otInstance *aInstance);
|
||||
* called.
|
||||
*
|
||||
* The implementation of this function is optional. If not
|
||||
* implemented, it should return kThreadError_None.
|
||||
* implemented, it should return OT_ERROR_NONE.
|
||||
*
|
||||
* @param[in] aInstance
|
||||
* The OpenThread instance structure.
|
||||
*
|
||||
* @retval kThreadError_None The settings commit lock has been set.
|
||||
* @retval kThreadError_Already The commit lock is already set.
|
||||
* @retval OT_ERROR_NONE The settings commit lock has been set.
|
||||
* @retval OT_ERROR_ALREADY The commit lock is already set.
|
||||
*
|
||||
* @sa otPlatSettingsCommitChange(), otPlatSettingsAbandonChange()
|
||||
*/
|
||||
ThreadError otPlatSettingsBeginChange(otInstance *aInstance);
|
||||
otError otPlatSettingsBeginChange(otInstance *aInstance);
|
||||
|
||||
/// Commit all settings changes since previous call to otPlatSettingsBeginChange()
|
||||
/** This function is called at the end of a sequence of changes.
|
||||
* The implementation of this function is optional. If not
|
||||
* implemented, it should return kThreadError_NotImplemented.
|
||||
* implemented, it should return OT_ERROR_NOT_IMPLEMENTED.
|
||||
*
|
||||
* @param[in] aInstance
|
||||
* The OpenThread instance structure.
|
||||
*
|
||||
* @retval kThreadError_None
|
||||
* @retval OT_ERROR_NONE
|
||||
* The changes made since the last call to
|
||||
* otPlatSettingsBeginChange() have been successfully
|
||||
* committed.
|
||||
* @retval kThreadError_InvalidState
|
||||
* @retval OT_ERROR_INVALID_STATE
|
||||
* otPlatSettingsBeginChange() has not been called.
|
||||
* @retval kThreadError_NotImplemented
|
||||
* @retval OT_ERROR_NOT_IMPLEMENTED
|
||||
* This function is not implemented on this platform.
|
||||
*
|
||||
* @sa otPlatSettingsBeginChange(), otPlatSettingsAbandonChange()
|
||||
*/
|
||||
ThreadError otPlatSettingsCommitChange(otInstance *aInstance);
|
||||
otError otPlatSettingsCommitChange(otInstance *aInstance);
|
||||
|
||||
/// Abandon all settings changes since previous call to otPlatSettingsBeginChange()
|
||||
/** This function may be called at the end of a sequence of changes.
|
||||
@@ -111,23 +111,23 @@ ThreadError otPlatSettingsCommitChange(otInstance *aInstance);
|
||||
* rolled back and abandoned.
|
||||
*
|
||||
* The implementation of this function is optional. If not
|
||||
* implemented, it should return kThreadError_NotImplemented.
|
||||
* implemented, it should return OT_ERROR_NOT_IMPLEMENTED.
|
||||
*
|
||||
* @param[in] aInstance
|
||||
* The OpenThread instance structure.
|
||||
*
|
||||
* @retval kThreadError_None
|
||||
* @retval OT_ERROR_NONE
|
||||
* The changes made since the last call to
|
||||
* otPlatSettingsBeginChange() have been successfully
|
||||
* rolled back.
|
||||
* @retval kThreadError_InvalidState
|
||||
* @retval OT_ERROR_INVALID_STATE
|
||||
* otPlatSettingsBeginChange() has not been called.
|
||||
* @retval kThreadError_NotImplemented
|
||||
* @retval OT_ERROR_NOT_IMPLEMENTED
|
||||
* This function is not implemented on this platform.
|
||||
*
|
||||
* @sa otPlatSettingsBeginChange(), otPlatSettingsCommitChange()
|
||||
*/
|
||||
ThreadError otPlatSettingsAbandonChange(otInstance *aInstance);
|
||||
otError otPlatSettingsAbandonChange(otInstance *aInstance);
|
||||
|
||||
/// Fetches the value of a setting
|
||||
/** This function fetches the value of the setting identified
|
||||
@@ -165,15 +165,15 @@ ThreadError otPlatSettingsAbandonChange(otInstance *aInstance);
|
||||
* length of the setting is written. This may be
|
||||
* set to NULL if performing a presence check.
|
||||
*
|
||||
* @retval kThreadError_None
|
||||
* @retval OT_ERROR_NONE
|
||||
* The given setting was found and fetched successfully.
|
||||
* @retval kThreadError_NotFound
|
||||
* @retval OT_ERROR_NOT_FOUND
|
||||
* The given setting was not found in the setting store.
|
||||
* @retval kThreadError_NotImplemented
|
||||
* @retval OT_ERROR_NOT_IMPLEMENTED
|
||||
* This function is not implemented on this platform.
|
||||
*/
|
||||
ThreadError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue,
|
||||
uint16_t *aValueLength);
|
||||
otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue,
|
||||
uint16_t *aValueLength);
|
||||
|
||||
/// Sets or replaces the value of a setting
|
||||
/** This function sets or replaces the value of a setting
|
||||
@@ -196,12 +196,12 @@ ThreadError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex,
|
||||
* The length of the data pointed to by aValue.
|
||||
* May be zero.
|
||||
*
|
||||
* @retval kThreadError_None
|
||||
* @retval OT_ERROR_NONE
|
||||
* The given setting was changed or staged.
|
||||
* @retval kThreadError_NotImplemented
|
||||
* @retval OT_ERROR_NOT_IMPLEMENTED
|
||||
* This function is not implemented on this platform.
|
||||
*/
|
||||
ThreadError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
|
||||
otError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
|
||||
|
||||
/// Adds a value to a setting
|
||||
/** This function adds the value to a setting
|
||||
@@ -229,12 +229,12 @@ ThreadError otPlatSettingsSet(otInstance *aInstance, uint16_t aKey, const uint8_
|
||||
* The length of the data pointed to by aValue.
|
||||
* May be zero.
|
||||
*
|
||||
* @retval kThreadError_None
|
||||
* @retval OT_ERROR_NONE
|
||||
* The given setting was added or staged to be added.
|
||||
* @retval kThreadError_NotImplemented
|
||||
* @retval OT_ERROR_NOT_IMPLEMENTED
|
||||
* This function is not implemented on this platform.
|
||||
*/
|
||||
ThreadError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
|
||||
otError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_t *aValue, uint16_t aValueLength);
|
||||
|
||||
/// Removes a setting from the setting store
|
||||
/** This function deletes a specific value from the
|
||||
@@ -252,14 +252,14 @@ ThreadError otPlatSettingsAdd(otInstance *aInstance, uint16_t aKey, const uint8_
|
||||
* The index of the value to be removed. If set to
|
||||
* -1, all values for this aKey will be removed.
|
||||
*
|
||||
* @retval kThreadError_None
|
||||
* @retval OT_ERROR_NONE
|
||||
* The given key and index was found and removed successfully.
|
||||
* @retval kThreadError_NotFound
|
||||
* @retval OT_ERROR_NOT_FOUND
|
||||
* The given key or index was not found in the setting store.
|
||||
* @retval kThreadError_NotImplemented
|
||||
* @retval OT_ERROR_NOT_IMPLEMENTED
|
||||
* This function is not implemented on this platform.
|
||||
*/
|
||||
ThreadError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex);
|
||||
otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex);
|
||||
|
||||
/// Removes all settings from the setting store
|
||||
/** This function deletes all settings from the settings
|
||||
|
||||
@@ -87,12 +87,12 @@ typedef void (*otPlatSpiSlaveTransactionCompleteCallback)(void *aContext, uint8_
|
||||
* @param[in] aCallback Pointer to transaction complete callback.
|
||||
* @param[in] aContext Context pointer to be passed to transaction complete callback.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enabled the SPI Slave interface.
|
||||
* @retval kThreadError_Already SPI Slave interface is already enabled.
|
||||
* @retval kThreadError_Failed Failed to enable the SPI Slave interface.
|
||||
* @retval OT_ERROR_NONE Successfully enabled the SPI Slave interface.
|
||||
* @retval OT_ERROR_ALREADY SPI Slave interface is already enabled.
|
||||
* @retval OT_ERROR_FAILED Failed to enable the SPI Slave interface.
|
||||
*
|
||||
*/
|
||||
ThreadError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aCallback, void *aContext);
|
||||
otError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aCallback, void *aContext);
|
||||
|
||||
/**
|
||||
* Shutdown and disable the SPI slave interface.
|
||||
@@ -122,7 +122,7 @@ void otPlatSpiSlaveDisable(void);
|
||||
* 30 bytes, the value 30 is passed to the transaction complete callback.
|
||||
*
|
||||
* Any call to this function while a transaction is in progress will cause all of the arguments to be ignored and the
|
||||
* return value to be `kThreadError_Busy`.
|
||||
* return value to be `OT_ERROR_BUSY`.
|
||||
*
|
||||
* @param[in] aOutputBuf Data to be written to MISO pin
|
||||
* @param[in] aOutputBufLen Size of the output buffer, in bytes
|
||||
@@ -130,13 +130,13 @@ void otPlatSpiSlaveDisable(void);
|
||||
* @param[in] aInputBufLen Size of the input buffer, in bytes
|
||||
* @param[in] aRequestTransactionFlag Set to true if host interrupt should be set
|
||||
*
|
||||
* @retval kThreadError_None Transaction was successfully prepared.
|
||||
* @retval kThreadError_Busy A transaction is currently in progress.
|
||||
* @retval kThreadError_InvalidState otPlatSpiSlaveEnable() hasn't been called.
|
||||
* @retval OT_ERROR_NONE Transaction was successfully prepared.
|
||||
* @retval OT_ERROR_BUSY A transaction is currently in progress.
|
||||
* @retval OT_ERROR_INVALID_STATE otPlatSpiSlaveEnable() hasn't been called.
|
||||
*
|
||||
*/
|
||||
ThreadError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf, uint16_t aOutputBufLen, uint8_t *aInputBuf,
|
||||
uint16_t aInputBufLen, bool aRequestTransactionFlag);
|
||||
otError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf, uint16_t aOutputBufLen, uint8_t *aInputBuf,
|
||||
uint16_t aInputBufLen, bool aRequestTransactionFlag);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -56,20 +56,20 @@ extern "C" {
|
||||
/**
|
||||
* Enable the UART.
|
||||
*
|
||||
* @retval kThreadError_None Successfully enabled the UART.
|
||||
* @retval kThreadError_Failed Failed to enabled the UART.
|
||||
* @retval OT_ERROR_NONE Successfully enabled the UART.
|
||||
* @retval OT_ERROR_FAILED Failed to enabled the UART.
|
||||
*
|
||||
*/
|
||||
ThreadError otPlatUartEnable(void);
|
||||
otError otPlatUartEnable(void);
|
||||
|
||||
/**
|
||||
* Disable the UART.
|
||||
*
|
||||
* @retval kThreadError_None Successfully disabled the UART.
|
||||
* @retval kThreadError_Failed Failed to disable the UART.
|
||||
* @retval OT_ERROR_NONE Successfully disabled the UART.
|
||||
* @retval OT_ERROR_FAILED Failed to disable the UART.
|
||||
*
|
||||
*/
|
||||
ThreadError otPlatUartDisable(void);
|
||||
otError otPlatUartDisable(void);
|
||||
|
||||
/**
|
||||
* Send bytes over the UART.
|
||||
@@ -77,11 +77,11 @@ ThreadError otPlatUartDisable(void);
|
||||
* @param[in] aBuf A pointer to the data buffer.
|
||||
* @param[in] aBufLength Number of bytes to transmit.
|
||||
*
|
||||
* @retval kThreadError_None Successfully started transmission.
|
||||
* @retval kThreadError_Failed Failed to start the transmission.
|
||||
* @retval OT_ERROR_NONE Successfully started transmission.
|
||||
* @retval OT_ERROR_FAILED Failed to start the transmission.
|
||||
*
|
||||
*/
|
||||
ThreadError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength);
|
||||
otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength);
|
||||
|
||||
/**
|
||||
* The UART driver calls this method to notify OpenThread that the requested bytes have been sent.
|
||||
|
||||
+53
-53
@@ -58,11 +58,11 @@ extern "C" {
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aEnabled TRUE if Thread is enabled, FALSE otherwise.
|
||||
*
|
||||
* @retval kThreadError_None Successfully started Thread protocol operation.
|
||||
* @retval kThreadError_InvalidState The network interface was not not up.
|
||||
* @retval OT_ERROR_NONE Successfully started Thread protocol operation.
|
||||
* @retval OT_ERROR_INVALID_STATE The network interface was not not up.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetEnabled(otInstance *aInstance, bool aEnabled);
|
||||
OTAPI otError OTCALL otThreadSetEnabled(otInstance *aInstance, bool aEnabled);
|
||||
|
||||
/**
|
||||
* This function queries if the Thread stack is configured to automatically start on reinitialization.
|
||||
@@ -83,7 +83,7 @@ OTAPI bool OTCALL otThreadGetAutoStart(otInstance *aInstance);
|
||||
* @param[in] aStartAutomatically TRUE to automatically start; FALSE to not automatically start.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetAutoStart(otInstance *aInstance, bool aStartAutomatically);
|
||||
OTAPI otError OTCALL otThreadSetAutoStart(otInstance *aInstance, bool aStartAutomatically);
|
||||
|
||||
/**
|
||||
* This function indicates whether a node is the only router on the network.
|
||||
@@ -108,13 +108,13 @@ OTAPI bool OTCALL otThreadIsSingleton(otInstance *aInstance);
|
||||
* scan completes.
|
||||
* @param[in] aCallbackContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadError_None Accepted the Thread Discovery request.
|
||||
* @retval kThreadError_Busy Already performing an Thread Discovery.
|
||||
* @retval OT_ERROR_NONE Accepted the Thread Discovery request.
|
||||
* @retval OT_ERROR_BUSY Already performing an Thread Discovery.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadDiscover(otInstance *aInstance, uint32_t aScanChannels, uint16_t aPanid, bool aJoiner,
|
||||
bool aEnableEui64Filtering, otHandleActiveScanResult aCallback,
|
||||
void *aCallbackContext);
|
||||
OTAPI otError OTCALL otThreadDiscover(otInstance *aInstance, uint32_t aScanChannels, uint16_t aPanid, bool aJoiner,
|
||||
bool aEnableEui64Filtering, otHandleActiveScanResult aCallback,
|
||||
void *aCallbackContext);
|
||||
|
||||
/**
|
||||
* This function determines if an MLE Thread Discovery is currently in progress.
|
||||
@@ -167,12 +167,12 @@ OTAPI const uint8_t *OTCALL otThreadGetExtendedPanId(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aExtendedPanId A pointer to the IEEE 802.15.4 Extended PAN ID.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the Extended PAN ID.
|
||||
* @retval kThreadError_InvalidState Thread protocols are enabled.
|
||||
* @retval OT_ERROR_NONE Successfully set the Extended PAN ID.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread protocols are enabled.
|
||||
*
|
||||
* @sa otThreadGetExtendedPanId
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetExtendedPanId(otInstance *aInstance, const uint8_t *aExtendedPanId);
|
||||
OTAPI otError OTCALL otThreadSetExtendedPanId(otInstance *aInstance, const uint8_t *aExtendedPanId);
|
||||
|
||||
/**
|
||||
* This function returns a pointer to the Leader's RLOC.
|
||||
@@ -180,12 +180,12 @@ OTAPI ThreadError OTCALL otThreadSetExtendedPanId(otInstance *aInstance, const u
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[out] aLeaderRloc A pointer to where the Leader's RLOC will be written.
|
||||
*
|
||||
* @retval kThreadError_None The Leader's RLOC was successfully written to @p aLeaderRloc.
|
||||
* @retval kThreadError_InvalidArgs @p aLeaderRloc was NULL.
|
||||
* @retval kThreadError_Detached Not currently attached to a Thread Partition.
|
||||
* @retval OT_ERROR_NONE The Leader's RLOC was successfully written to @p aLeaderRloc.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aLeaderRloc was NULL.
|
||||
* @retval OT_ERROR_DETACHED Not currently attached to a Thread Partition.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetLeaderRloc(otInstance *aInstance, otIp6Address *aLeaderRloc);
|
||||
OTAPI otError OTCALL otThreadGetLeaderRloc(otInstance *aInstance, otIp6Address *aLeaderRloc);
|
||||
|
||||
/**
|
||||
* Get the MLE Link Mode configuration.
|
||||
@@ -204,11 +204,11 @@ OTAPI otLinkModeConfig OTCALL otThreadGetLinkMode(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aConfig A pointer to the Link Mode configuration.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully set the MLE Link Mode configuration.
|
||||
* @retval OT_ERROR_NONE Successfully set the MLE Link Mode configuration.
|
||||
*
|
||||
* @sa otThreadGetLinkMode
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetLinkMode(otInstance *aInstance, otLinkModeConfig aConfig);
|
||||
OTAPI otError OTCALL otThreadSetLinkMode(otInstance *aInstance, otLinkModeConfig aConfig);
|
||||
|
||||
/**
|
||||
* Get the thrMasterKey.
|
||||
@@ -231,13 +231,13 @@ OTAPI const otMasterKey *OTCALL otThreadGetMasterKey(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aKey A pointer to a buffer containing the thrMasterKey.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully set the thrMasterKey.
|
||||
* @retval kThreadErrorInvalidArgs If aKeyLength is larger than 16.
|
||||
* @retval kThreadError_InvalidState Thread protocols are enabled.
|
||||
* @retval OT_ERROR_NONE Successfully set the thrMasterKey.
|
||||
* @retval OT_ERROR_INVALID_ARGS If aKeyLength is larger than 16.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread protocols are enabled.
|
||||
*
|
||||
* @sa otThreadGetMasterKey
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetMasterKey(otInstance *aInstance, const otMasterKey *aKey);
|
||||
OTAPI otError OTCALL otThreadSetMasterKey(otInstance *aInstance, const otMasterKey *aKey);
|
||||
|
||||
/**
|
||||
* This function returns a pointer to the Mesh Local EID.
|
||||
@@ -269,11 +269,11 @@ OTAPI const uint8_t *OTCALL otThreadGetMeshLocalPrefix(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aMeshLocalPrefix A pointer to the Mesh Local Prefix.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the Mesh Local Prefix.
|
||||
* @retval kThreadError_InvalidState Thread protocols are enabled.
|
||||
* @retval OT_ERROR_NONE Successfully set the Mesh Local Prefix.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread protocols are enabled.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetMeshLocalPrefix(otInstance *aInstance, const uint8_t *aMeshLocalPrefix);
|
||||
OTAPI otError OTCALL otThreadSetMeshLocalPrefix(otInstance *aInstance, const uint8_t *aMeshLocalPrefix);
|
||||
|
||||
/**
|
||||
* Get the Thread Network Name.
|
||||
@@ -296,12 +296,12 @@ OTAPI const char *OTCALL otThreadGetNetworkName(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aNetworkName A pointer to the Thread Network Name.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully set the Thread Network Name.
|
||||
* @retval kThreadError_InvalidState Thread protocols are enabled.
|
||||
* @retval OT_ERROR_NONE Successfully set the Thread Network Name.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread protocols are enabled.
|
||||
*
|
||||
* @sa otThreadGetNetworkName
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetNetworkName(otInstance *aInstance, const char *aNetworkName);
|
||||
OTAPI otError OTCALL otThreadSetNetworkName(otInstance *aInstance, const char *aNetworkName);
|
||||
|
||||
/**
|
||||
* Get the thrKeySequenceCounter.
|
||||
@@ -350,10 +350,10 @@ OTAPI void OTCALL otThreadSetKeySwitchGuardTime(otInstance *aInstance, uint32_t
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully detached from the Thread network.
|
||||
* @retval kThreadErrorInvalidState Thread is disabled.
|
||||
* @retval OT_ERROR_NONE Successfully detached from the Thread network.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread is disabled.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadBecomeDetached(otInstance *aInstance);
|
||||
OTAPI otError OTCALL otThreadBecomeDetached(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Attempt to reattach as a child.
|
||||
@@ -361,10 +361,10 @@ OTAPI ThreadError OTCALL otThreadBecomeDetached(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aFilter Identifies whether to join any, same, or better partition.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully begin attempt to become a child.
|
||||
* @retval kThreadErrorInvalidState Thread is disabled.
|
||||
* @retval OT_ERROR_NONE Successfully begin attempt to become a child.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread is disabled.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadBecomeChild(otInstance *aInstance, otMleAttachFilter aFilter);
|
||||
OTAPI otError OTCALL otThreadBecomeChild(otInstance *aInstance, otMleAttachFilter aFilter);
|
||||
|
||||
/**
|
||||
* This function gets the next neighbor information. It is used to go through the entries of
|
||||
@@ -375,13 +375,13 @@ OTAPI ThreadError OTCALL otThreadBecomeChild(otInstance *aInstance, otMleAttachF
|
||||
it should be set to OT_NEIGHBOR_INFO_ITERATOR_INIT.
|
||||
* @param[out] aInfo A pointer to where the neighbor information will be placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully found the next neighbor entry in table.
|
||||
* @retval kThreadError_NotFound No subsequent neighbor entry exists in the table.
|
||||
* @retval kThreadError_InvalidArgs @p aIterator or @p aInfo was NULL.
|
||||
* @retval OT_ERROR_NONE Successfully found the next neighbor entry in table.
|
||||
* @retval OT_ERROR_NOT_FOUND No subsequent neighbor entry exists in the table.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aIterator or @p aInfo was NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetNextNeighborInfo(otInstance *aInstance, otNeighborInfoIterator *aIterator,
|
||||
otNeighborInfo *aInfo);
|
||||
OTAPI otError OTCALL otThreadGetNextNeighborInfo(otInstance *aInstance, otNeighborInfoIterator *aIterator,
|
||||
otNeighborInfo *aInfo);
|
||||
|
||||
/**
|
||||
* Get the device role.
|
||||
@@ -402,12 +402,12 @@ OTAPI otDeviceRole OTCALL otThreadGetDeviceRole(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[out] aLeaderData A pointer to where the leader data is placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully retrieved the leader data.
|
||||
* @retval kThreadError_Detached Not currently attached.
|
||||
* @retval kThreadError_InvalidArgs @p aLeaderData is NULL.
|
||||
* @retval OT_ERROR_NONE Successfully retrieved the leader data.
|
||||
* @retval OT_ERROR_DETACHED Not currently attached.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aLeaderData is NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetLeaderData(otInstance *aInstance, otLeaderData *aLeaderData);
|
||||
OTAPI otError OTCALL otThreadGetLeaderData(otInstance *aInstance, otLeaderData *aLeaderData);
|
||||
|
||||
/**
|
||||
* Get the Leader's Router ID.
|
||||
@@ -452,7 +452,7 @@ OTAPI uint16_t OTCALL otThreadGetRloc16(otInstance *aInstance);
|
||||
* @param[out] aParentInfo A pointer to where the parent router information is placed.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetParentInfo(otInstance *aInstance, otRouterInfo *aParentInfo);
|
||||
OTAPI otError OTCALL otThreadGetParentInfo(otInstance *aInstance, otRouterInfo *aParentInfo);
|
||||
|
||||
/**
|
||||
* The function retrieves the average RSSI for the Thread Parent.
|
||||
@@ -461,7 +461,7 @@ OTAPI ThreadError OTCALL otThreadGetParentInfo(otInstance *aInstance, otRouterIn
|
||||
* @param[out] aParentRssi A pointer to where the parent rssi should be placed.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetParentAverageRssi(otInstance *aInstance, int8_t *aParentRssi);
|
||||
OTAPI otError OTCALL otThreadGetParentAverageRssi(otInstance *aInstance, int8_t *aParentRssi);
|
||||
|
||||
/**
|
||||
* The function retrieves the RSSI of the last packet from the Thread Parent.
|
||||
@@ -469,11 +469,11 @@ OTAPI ThreadError OTCALL otThreadGetParentAverageRssi(otInstance *aInstance, int
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[out] aLastRssi A pointer to where the last rssi should be placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully retrieved the RSSI data.
|
||||
* @retval kThreadError_Failed Unable to get RSSI data.
|
||||
* @retval kThreadError_InvalidArgs @p aLastRssi is NULL.
|
||||
* @retval OT_ERROR_NONE Successfully retrieved the RSSI data.
|
||||
* @retval OT_ERROR_FAILED Unable to get RSSI data.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aLastRssi is NULL.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetParentLastRssi(otInstance *aInstance, int8_t *aLastRssi);
|
||||
OTAPI otError OTCALL otThreadGetParentLastRssi(otInstance *aInstance, int8_t *aLastRssi);
|
||||
|
||||
/**
|
||||
* This function pointer is called when Network Diagnostic Get response is received.
|
||||
@@ -508,8 +508,8 @@ void otThreadSetReceiveDiagnosticGetCallback(otInstance *aInstance, otReceiveDia
|
||||
* @param[in] aCount Number of types in aTlvTypes
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSendDiagnosticGet(otInstance *aInstance, const otIp6Address *aDestination,
|
||||
const uint8_t aTlvTypes[], uint8_t aCount);
|
||||
OTAPI otError OTCALL otThreadSendDiagnosticGet(otInstance *aInstance, const otIp6Address *aDestination,
|
||||
const uint8_t aTlvTypes[], uint8_t aCount);
|
||||
|
||||
/**
|
||||
* Send a Network Diagnostic Reset request.
|
||||
@@ -520,8 +520,8 @@ OTAPI ThreadError OTCALL otThreadSendDiagnosticGet(otInstance *aInstance, const
|
||||
* @param[in] aCount Number of types in aTlvTypes
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSendDiagnosticReset(otInstance *aInstance, const otIp6Address *aDestination,
|
||||
const uint8_t aTlvTypes[], uint8_t aCount);
|
||||
OTAPI otError OTCALL otThreadSendDiagnosticReset(otInstance *aInstance, const otIp6Address *aDestination,
|
||||
const uint8_t aTlvTypes[], uint8_t aCount);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -70,13 +70,13 @@ OTAPI uint8_t OTCALL otThreadGetMaxAllowedChildren(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aMaxChildren The maximum allowed children.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the max.
|
||||
* @retval kThreadError_InvalidArgs If @p aMaxChildren is not in the range [1, OPENTHREAD_CONFIG_MAX_CHILDREN].
|
||||
* @retval kThreadError_InvalidState If Thread isn't stopped.
|
||||
* @retval OT_ERROR_NONE Successfully set the max.
|
||||
* @retval OT_ERROR_INVALID_ARGS If @p aMaxChildren is not in the range [1, OPENTHREAD_CONFIG_MAX_CHILDREN].
|
||||
* @retval OT_ERROR_INVALID_STATE If Thread isn't stopped.
|
||||
*
|
||||
* @sa otThreadGetMaxAllowedChildren, otThreadStop
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetMaxAllowedChildren(otInstance *aInstance, uint8_t aMaxChildren);
|
||||
OTAPI otError OTCALL otThreadSetMaxAllowedChildren(otInstance *aInstance, uint8_t aMaxChildren);
|
||||
|
||||
/**
|
||||
* This function indicates whether or not the Router Role is enabled.
|
||||
@@ -109,11 +109,11 @@ OTAPI void OTCALL otThreadSetRouterRoleEnabled(otInstance *aInstance, bool aEnab
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aRouterId The preferred Router Id.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the preferred Router Id.
|
||||
* @retval kThreadError_InvalidState Could not set (role is not detached or disabled)
|
||||
* @retval OT_ERROR_NONE Successfully set the preferred Router Id.
|
||||
* @retval OT_ERROR_INVALID_STATE Could not set (role is not detached or disabled)
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetPreferredRouterId(otInstance *aInstance, uint8_t aRouterId);
|
||||
OTAPI otError OTCALL otThreadSetPreferredRouterId(otInstance *aInstance, uint8_t aRouterId);
|
||||
|
||||
/**
|
||||
* Get the Thread Leader Weight used when operating in the Leader role.
|
||||
@@ -172,17 +172,17 @@ OTAPI uint16_t OTCALL otThreadGetJoinerUdpPort(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aJoinerUdpPort The Joiner UDP Port number.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the Joiner UDP Port.
|
||||
* @retval OT_ERROR_NONE Successfully set the Joiner UDP Port.
|
||||
*
|
||||
* @sa otThreadGetJoinerUdpPort
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetJoinerUdpPort(otInstance *aInstance, uint16_t aJoinerUdpPort);
|
||||
OTAPI otError OTCALL otThreadSetJoinerUdpPort(otInstance *aInstance, uint16_t aJoinerUdpPort);
|
||||
|
||||
/**
|
||||
* Set Steering data out of band
|
||||
*
|
||||
* Configuration option `OPENTHREAD_CONFIG_ENABLE_STEERING_DATA_SET_OOB` should be set to enable setting of steering
|
||||
* data out of band. Otherwise calling this function does nothing and it returns `kThreadError_DisabledFeature`
|
||||
* data out of band. Otherwise calling this function does nothing and it returns `OT_ERROR_DISABLED_FEATURE`
|
||||
* error.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
@@ -191,11 +191,11 @@ OTAPI ThreadError OTCALL otThreadSetJoinerUdpPort(otInstance *aInstance, uint16_
|
||||
* All 0xFFs to set steering data/bloom filter to accept/allow all.
|
||||
* A specific EUI64 which is then added to current steering data/bloom filter.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set/updated the steering data.
|
||||
* @retval kThreadError_DisabledFeature Feature is disabled, not capable of setting steering data out of band.
|
||||
* @retval OT_ERROR_NONE Successfully set/updated the steering data.
|
||||
* @retval OT_ERROR_DISABLED_FEATURE Feature is disabled, not capable of setting steering data out of band.
|
||||
*
|
||||
*/
|
||||
ThreadError otThreadSetSteeringData(otInstance *aInstance, otExtAddress *aExtAddress);
|
||||
otError otThreadSetSteeringData(otInstance *aInstance, otExtAddress *aExtAddress);
|
||||
|
||||
/**
|
||||
* Get the CONTEXT_ID_REUSE_DELAY parameter used in the Leader role.
|
||||
@@ -266,29 +266,29 @@ OTAPI void OTCALL otThreadSetRouterUpgradeThreshold(otInstance *aInstance, uint8
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aRouterId The Router ID to release. Valid range is [0, 62].
|
||||
*
|
||||
* @retval kThreadError_None Successfully released the Router ID specified by aRouterId.
|
||||
* @retval OT_ERROR_NONE Successfully released the Router ID specified by aRouterId.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadReleaseRouterId(otInstance *aInstance, uint8_t aRouterId);
|
||||
OTAPI otError OTCALL otThreadReleaseRouterId(otInstance *aInstance, uint8_t aRouterId);
|
||||
|
||||
/**
|
||||
* Attempt to become a router.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None Successfully begin attempt to become a router.
|
||||
* @retval kThreadError_InvalidState Thread is disabled.
|
||||
* @retval OT_ERROR_NONE Successfully begin attempt to become a router.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread is disabled.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadBecomeRouter(otInstance *aInstance);
|
||||
OTAPI otError OTCALL otThreadBecomeRouter(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Become a leader and start a new partition.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @retval kThreadError_None Successfully became a leader and started a new partition.
|
||||
* @retval kThreadError_InvalidState Thread is disabled.
|
||||
* @retval OT_ERROR_NONE Successfully became a leader and started a new partition.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread is disabled.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadBecomeLeader(otInstance *aInstance);
|
||||
OTAPI otError OTCALL otThreadBecomeLeader(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* Get the ROUTER_DOWNGRADE_THRESHOLD parameter used in the Router role.
|
||||
@@ -339,12 +339,12 @@ OTAPI void OTCALL otThreadSetRouterSelectionJitter(otInstance *aInstance, uint8_
|
||||
* @param[in] aChildId The Child ID or RLOC16 for the attached child.
|
||||
* @param[out] aChildInfo A pointer to where the child information is placed.
|
||||
*
|
||||
* @retval kThreadError_None @p aChildInfo was successfully updated with the info for the given ID.
|
||||
* @retval kThreadError_NotFound No valid child with this Child ID.
|
||||
* @retval kThreadError_InvalidArgs If @p aChildInfo is NULL.
|
||||
* @retval OT_ERROR_NONE @p aChildInfo was successfully updated with the info for the given ID.
|
||||
* @retval OT_ERROR_NOT_FOUND No valid child with this Child ID.
|
||||
* @retval OT_ERROR_INVALID_ARGS If @p aChildInfo is NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetChildInfoById(otInstance *aInstance, uint16_t aChildId, otChildInfo *aChildInfo);
|
||||
OTAPI otError OTCALL otThreadGetChildInfoById(otInstance *aInstance, uint16_t aChildId, otChildInfo *aChildInfo);
|
||||
|
||||
/**
|
||||
* The function retains diagnostic information for an attached Child by the internal table index.
|
||||
@@ -353,16 +353,16 @@ OTAPI ThreadError OTCALL otThreadGetChildInfoById(otInstance *aInstance, uint16_
|
||||
* @param[in] aChildIndex The table index.
|
||||
* @param[out] aChildInfo A pointer to where the child information is placed.
|
||||
*
|
||||
* @retval kThreadError_None @p aChildInfo was successfully updated with the info for the given index.
|
||||
* @retval kThreadError_NotFound No valid child at this index.
|
||||
* @retval kThreadError_InvalidArgs Either @p aChildInfo is NULL, or @p aChildIndex is out of range (higher
|
||||
* than max table index).
|
||||
* @retval OT_ERROR_NONE @p aChildInfo was successfully updated with the info for the given index.
|
||||
* @retval OT_ERROR_NOT_FOUND No valid child at this index.
|
||||
* @retval OT_ERROR_INVALID_ARGS Either @p aChildInfo is NULL, or @p aChildIndex is out of range (higher
|
||||
* than max table index).
|
||||
*
|
||||
* @sa otGetMaxAllowedChildren
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetChildInfoByIndex(otInstance *aInstance, uint8_t aChildIndex,
|
||||
otChildInfo *aChildInfo);
|
||||
OTAPI otError OTCALL otThreadGetChildInfoByIndex(otInstance *aInstance, uint8_t aChildIndex,
|
||||
otChildInfo *aChildInfo);
|
||||
|
||||
/**
|
||||
* Get the current Router ID Sequence.
|
||||
@@ -381,7 +381,7 @@ OTAPI uint8_t OTCALL otThreadGetRouterIdSequence(otInstance *aInstance);
|
||||
* @param[out] aRouterInfo A pointer to where the router information is placed.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetRouterInfo(otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo);
|
||||
OTAPI otError OTCALL otThreadGetRouterInfo(otInstance *aInstance, uint16_t aRouterId, otRouterInfo *aRouterInfo);
|
||||
|
||||
/**
|
||||
* This function gets an EID cache entry.
|
||||
@@ -390,11 +390,11 @@ OTAPI ThreadError OTCALL otThreadGetRouterInfo(otInstance *aInstance, uint16_t a
|
||||
* @param[in] aIndex An index into the EID cache table.
|
||||
* @param[out] aEntry A pointer to where the EID information is placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully retrieved the EID cache entry.
|
||||
* @retval kThreadError_InvalidArgs @p aIndex was out of bounds or @p aEntry was NULL.
|
||||
* @retval OT_ERROR_NONE Successfully retrieved the EID cache entry.
|
||||
* @retval OT_ERROR_INVALID_ARGS @p aIndex was out of bounds or @p aEntry was NULL.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetEidCacheEntry(otInstance *aInstance, uint8_t aIndex, otEidCacheEntry *aEntry);
|
||||
OTAPI otError OTCALL otThreadGetEidCacheEntry(otInstance *aInstance, uint8_t aIndex, otEidCacheEntry *aEntry);
|
||||
|
||||
/**
|
||||
* Get the thrPSKc.
|
||||
@@ -417,12 +417,12 @@ OTAPI const uint8_t *OTCALL otThreadGetPSKc(otInstance *aInstance);
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aPSKc A pointer to a buffer containing the thrPSKc.
|
||||
*
|
||||
* @retval kThreadError_None Successfully set the thrPSKc.
|
||||
* @retval kThreadError_InvalidState Thread protocols are enabled.
|
||||
* @retval OT_ERROR_NONE Successfully set the thrPSKc.
|
||||
* @retval OT_ERROR_INVALID_STATE Thread protocols are enabled.
|
||||
*
|
||||
* @sa otThreadGetPSKc
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadSetPSKc(otInstance *aInstance, const uint8_t *aPSKc);
|
||||
OTAPI otError OTCALL otThreadSetPSKc(otInstance *aInstance, const uint8_t *aPSKc);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
+95
-39
@@ -94,128 +94,184 @@ typedef struct otDeviceList
|
||||
/**
|
||||
* This enumeration represents error codes used throughout OpenThread.
|
||||
*/
|
||||
typedef enum ThreadError
|
||||
typedef enum otError
|
||||
{
|
||||
kThreadError_None = 0,
|
||||
kThreadError_Failed = 1,
|
||||
kThreadError_Drop = 2,
|
||||
kThreadError_NoBufs = 3,
|
||||
kThreadError_NoRoute = 4,
|
||||
kThreadError_Busy = 5,
|
||||
kThreadError_Parse = 6,
|
||||
kThreadError_InvalidArgs = 7,
|
||||
kThreadError_Security = 8,
|
||||
kThreadError_AddressQuery = 9,
|
||||
kThreadError_NoAddress = 10,
|
||||
kThreadError_NotReceiving = 11,
|
||||
kThreadError_Abort = 12,
|
||||
kThreadError_NotImplemented = 13,
|
||||
kThreadError_InvalidState = 14,
|
||||
kThreadError_NoTasklets = 15,
|
||||
/**
|
||||
* No error.
|
||||
*/
|
||||
OT_ERROR_NONE = 0,
|
||||
|
||||
/**
|
||||
* Operational failed.
|
||||
*/
|
||||
OT_ERROR_FAILED = 1,
|
||||
|
||||
/**
|
||||
* Message was dropped.
|
||||
*/
|
||||
OT_ERROR_DROP = 2,
|
||||
|
||||
/**
|
||||
* Insufficient buffers.
|
||||
*/
|
||||
OT_ERROR_NO_BUFS = 3,
|
||||
|
||||
/**
|
||||
* No route available.
|
||||
*/
|
||||
OT_ERROR_NO_ROUTE = 4,
|
||||
|
||||
/**
|
||||
* Service is busy and could not service the operation.
|
||||
*/
|
||||
OT_ERROR_BUSY = 5,
|
||||
|
||||
/**
|
||||
* Failed to parse message or arguments.
|
||||
*/
|
||||
OT_ERROR_PARSE = 6,
|
||||
|
||||
/**
|
||||
* Input arguments are invalid.
|
||||
*/
|
||||
OT_ERROR_INVALID_ARGS = 7,
|
||||
|
||||
/**
|
||||
* Security checks failed.
|
||||
*/
|
||||
OT_ERROR_SECURITY = 8,
|
||||
|
||||
/**
|
||||
* Address resolution requires an address query operation.
|
||||
*/
|
||||
OT_ERROR_ADDRESS_QUERY = 9,
|
||||
|
||||
/**
|
||||
* Address is not in the source match table.
|
||||
*/
|
||||
OT_ERROR_NO_ADDRESS = 10,
|
||||
|
||||
/**
|
||||
* Operation was aborted.
|
||||
*/
|
||||
OT_ERROR_ABORT = 11,
|
||||
|
||||
/**
|
||||
* Function or method is not implemented.
|
||||
*/
|
||||
OT_ERROR_NOT_IMPLEMENTED = 12,
|
||||
|
||||
/**
|
||||
* Cannot complete due to invalid state.
|
||||
*/
|
||||
OT_ERROR_INVALID_STATE = 13,
|
||||
|
||||
/**
|
||||
* No acknowledgment was received after macMaxFrameRetries (IEEE 802.15.4-2006).
|
||||
*/
|
||||
kThreadError_NoAck = 16,
|
||||
OT_ERROR_NO_ACK = 14,
|
||||
|
||||
/**
|
||||
* A transmission could not take place due to activity on the channel, i.e., the CSMA-CA mechanism has failed
|
||||
* (IEEE 802.15.4-2006).
|
||||
*/
|
||||
kThreadError_ChannelAccessFailure = 17,
|
||||
OT_ERROR_CHANNEL_ACCESS_FAILURE = 15,
|
||||
|
||||
/**
|
||||
* Not currently attached to a Thread Partition.
|
||||
*/
|
||||
kThreadError_Detached = 18,
|
||||
OT_ERROR_DETACHED = 16,
|
||||
|
||||
/**
|
||||
* FCS check failure while receiving.
|
||||
*/
|
||||
kThreadError_FcsErr = 19,
|
||||
OT_ERROR_FCS = 17,
|
||||
|
||||
/**
|
||||
* No frame received.
|
||||
*/
|
||||
kThreadError_NoFrameReceived = 20,
|
||||
OT_ERROR_NO_FRAME_RECEIVED = 18,
|
||||
|
||||
/**
|
||||
* Received a frame from an unknown neighbor.
|
||||
*/
|
||||
kThreadError_UnknownNeighbor = 21,
|
||||
OT_ERROR_UNKNOWN_NEIGHBOR = 19,
|
||||
|
||||
/**
|
||||
* Received a frame from an invalid source address.
|
||||
*/
|
||||
kThreadError_InvalidSourceAddress = 22,
|
||||
OT_ERROR_INVALID_SOURCE_ADDRESS = 20,
|
||||
|
||||
/**
|
||||
* Received a frame filtered by the whitelist.
|
||||
*/
|
||||
kThreadError_WhitelistFiltered = 23,
|
||||
OT_ERROR_WHITELIST_FILTERED = 21,
|
||||
|
||||
/**
|
||||
* Received a frame filtered by the destination address check.
|
||||
*/
|
||||
kThreadError_DestinationAddressFiltered = 24,
|
||||
OT_ERROR_DESTINATION_ADDRESS_FILTERED = 22,
|
||||
|
||||
/**
|
||||
* The requested item could not be found.
|
||||
*/
|
||||
kThreadError_NotFound = 25,
|
||||
OT_ERROR_NOT_FOUND = 23,
|
||||
|
||||
/**
|
||||
* The operation is already in progress.
|
||||
*/
|
||||
kThreadError_Already = 26,
|
||||
OT_ERROR_ALREADY = 24,
|
||||
|
||||
/**
|
||||
* Received a frame filtered by the blacklist.
|
||||
*/
|
||||
kThreadError_BlacklistFiltered = 27,
|
||||
OT_ERROR_BLACKLIST_FILTERED = 25,
|
||||
|
||||
/**
|
||||
* The creation of IPv6 address failed.
|
||||
*/
|
||||
kThreadError_Ipv6AddressCreationFailure = 28,
|
||||
OT_ERROR_IP6_ADDRESS_CREATION_FAILURE = 26,
|
||||
|
||||
/**
|
||||
* Operation prevented by mode flags
|
||||
*/
|
||||
kThreadError_NotCapable = 29,
|
||||
OT_ERROR_NOT_CAPABLE = 27,
|
||||
|
||||
/**
|
||||
* Coap response or acknowledgment or DNS response not received.
|
||||
*/
|
||||
kThreadError_ResponseTimeout = 30,
|
||||
OT_ERROR_RESPONSE_TIMEOUT = 28,
|
||||
|
||||
/**
|
||||
* Received a duplicated frame.
|
||||
*/
|
||||
kThreadError_Duplicated = 31,
|
||||
OT_ERROR_DUPLICATED = 29,
|
||||
|
||||
/**
|
||||
* Message is being dropped from reassembly list due to timeout.
|
||||
*/
|
||||
kThreadError_ReassemblyTimeout = 32,
|
||||
OT_ERROR_REASSEMBLY_TIMEOUT = 30,
|
||||
|
||||
/**
|
||||
* Message is not a TMF Message.
|
||||
*/
|
||||
kThreadError_NotTmf = 33,
|
||||
OT_ERROR_NOT_TMF = 31,
|
||||
|
||||
/**
|
||||
* Received a non-lowpan data frame.
|
||||
*/
|
||||
kThreadError_NonLowpanDataFrame = 34,
|
||||
OT_ERROR_NOT_LOWPAN_DATA_FRAME = 32,
|
||||
|
||||
/**
|
||||
* A feature/functionality disabled by build-time configuration options.
|
||||
*/
|
||||
kThreadError_DisabledFeature = 35,
|
||||
OT_ERROR_DISABLED_FEATURE = 33,
|
||||
|
||||
kThreadError_Error = 255,
|
||||
} ThreadError;
|
||||
/**
|
||||
* Generic error (should not use).
|
||||
*/
|
||||
OT_ERROR_GENERIC = 255,
|
||||
} otError;
|
||||
|
||||
#define OT_IP6_IID_SIZE 8 ///< Size of an IPv6 Interface Identifier (bytes)
|
||||
|
||||
|
||||
+10
-10
@@ -93,8 +93,8 @@ otMessage *otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled);
|
||||
* @param[in] aCallback A pointer to the application callback function.
|
||||
* @param[in] aContext A pointer to application-specific context.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully opened the socket.
|
||||
* @retval kThreadErrorInvalidArgs Given socket structure was already opened.
|
||||
* @retval OT_ERROR_NONE Successfully opened the socket.
|
||||
* @retval OT_ERROR_INVALID_ARGS Given socket structure was already opened.
|
||||
*
|
||||
* @sa otUdpNewMessage
|
||||
* @sa otUdpClose
|
||||
@@ -103,14 +103,14 @@ otMessage *otUdpNewMessage(otInstance *aInstance, bool aLinkSecurityEnabled);
|
||||
* @sa otUdpSend
|
||||
*
|
||||
*/
|
||||
ThreadError otUdpOpen(otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext);
|
||||
otError otUdpOpen(otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive aCallback, void *aContext);
|
||||
|
||||
/**
|
||||
* Close a UDP/IPv6 socket.
|
||||
*
|
||||
* @param[in] aSocket A pointer to a UDP socket structure.
|
||||
*
|
||||
* @retval kThreadErrorNone Successfully closed the socket.
|
||||
* @retval OT_ERROR_NONE Successfully closed the socket.
|
||||
*
|
||||
* @sa otUdpNewMessage
|
||||
* @sa otUdpOpen
|
||||
@@ -119,7 +119,7 @@ ThreadError otUdpOpen(otInstance *aInstance, otUdpSocket *aSocket, otUdpReceive
|
||||
* @sa otUdpSend
|
||||
*
|
||||
*/
|
||||
ThreadError otUdpClose(otUdpSocket *aSocket);
|
||||
otError otUdpClose(otUdpSocket *aSocket);
|
||||
|
||||
/**
|
||||
* Bind a UDP/IPv6 socket.
|
||||
@@ -127,7 +127,7 @@ ThreadError otUdpClose(otUdpSocket *aSocket);
|
||||
* @param[in] aSocket A pointer to a UDP socket structure.
|
||||
* @param[in] aSockName A pointer to an IPv6 socket address structure.
|
||||
*
|
||||
* @retval kThreadErrorNone Bind operation was successful.
|
||||
* @retval OT_ERROR_NONE Bind operation was successful.
|
||||
*
|
||||
* @sa otUdpNewMessage
|
||||
* @sa otUdpOpen
|
||||
@@ -136,7 +136,7 @@ ThreadError otUdpClose(otUdpSocket *aSocket);
|
||||
* @sa otUdpSend
|
||||
*
|
||||
*/
|
||||
ThreadError otUdpBind(otUdpSocket *aSocket, otSockAddr *aSockName);
|
||||
otError otUdpBind(otUdpSocket *aSocket, otSockAddr *aSockName);
|
||||
|
||||
/**
|
||||
* Connect a UDP/IPv6 socket.
|
||||
@@ -144,7 +144,7 @@ ThreadError otUdpBind(otUdpSocket *aSocket, otSockAddr *aSockName);
|
||||
* @param[in] aSocket A pointer to a UDP socket structure.
|
||||
* @param[in] aSockName A pointer to an IPv6 socket address structure.
|
||||
*
|
||||
* @retval kThreadErrorNone Connect operation was successful.
|
||||
* @retval OT_ERROR_NONE Connect operation was successful.
|
||||
*
|
||||
* @sa otUdpNewMessage
|
||||
* @sa otUdpOpen
|
||||
@@ -153,7 +153,7 @@ ThreadError otUdpBind(otUdpSocket *aSocket, otSockAddr *aSockName);
|
||||
* @sa otUdpSend
|
||||
*
|
||||
*/
|
||||
ThreadError otUdpConnect(otUdpSocket *aSocket, otSockAddr *aSockName);
|
||||
otError otUdpConnect(otUdpSocket *aSocket, otSockAddr *aSockName);
|
||||
|
||||
/**
|
||||
* Send a UDP/IPv6 message.
|
||||
@@ -170,7 +170,7 @@ ThreadError otUdpConnect(otUdpSocket *aSocket, otSockAddr *aSockName);
|
||||
* @sa otUdpSend
|
||||
*
|
||||
*/
|
||||
ThreadError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo);
|
||||
otError otUdpSend(otUdpSocket *aSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
+181
-181
File diff suppressed because it is too large
Load Diff
+21
-21
@@ -119,11 +119,11 @@ public:
|
||||
* @param[in] aString A pointer to the ASCII string.
|
||||
* @param[out] aLong A reference to where the parsed long is placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully parsed the ASCII string.
|
||||
* @retval kThreadError_Parse Could not parse the ASCII string.
|
||||
* @retval OT_ERROR_NONE Successfully parsed the ASCII string.
|
||||
* @retval OT_ERROR_PARSE Could not parse the ASCII string.
|
||||
*
|
||||
*/
|
||||
static ThreadError ParseLong(char *aString, long &aLong);
|
||||
static otError ParseLong(char *aString, long &aLong);
|
||||
|
||||
/**
|
||||
* This method parses an ASCII string as an unsigned long.
|
||||
@@ -131,11 +131,11 @@ public:
|
||||
* @param[in] aString A pointer to the ASCII string.
|
||||
* @param[out] aUnsignedLong A reference to where the parsed unsigned long is placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully parsed the ASCII string.
|
||||
* @retval kThreadError_Parse Could not parse the ASCII string.
|
||||
* @retval OT_ERROR_NONE Successfully parsed the ASCII string.
|
||||
* @retval OT_ERROR_PARSE Could not parse the ASCII string.
|
||||
*
|
||||
*/
|
||||
static ThreadError ParseUnsignedLong(char *aString, unsigned long &aUnsignedLong);
|
||||
static otError ParseUnsignedLong(char *aString, unsigned long &aUnsignedLong);
|
||||
|
||||
/**
|
||||
* This method converts a hex string to binary.
|
||||
@@ -156,7 +156,7 @@ private:
|
||||
kDefaultJoinerTimeout = 120, ///< Default timeout for Joiners, in seconds.
|
||||
};
|
||||
|
||||
void AppendResult(ThreadError error);
|
||||
void AppendResult(otError error);
|
||||
void OutputBytes(const uint8_t *aBytes, uint8_t aLength);
|
||||
|
||||
void ProcessHelp(int argc, char *argv[]);
|
||||
@@ -203,13 +203,13 @@ private:
|
||||
void ProcessHashMacAddress(int argc, char *argv[]);
|
||||
void ProcessIfconfig(int argc, char *argv[]);
|
||||
void ProcessIpAddr(int argc, char *argv[]);
|
||||
ThreadError ProcessIpAddrAdd(int argc, char *argv[]);
|
||||
ThreadError ProcessIpAddrDel(int argc, char *argv[]);
|
||||
otError ProcessIpAddrAdd(int argc, char *argv[]);
|
||||
otError ProcessIpAddrDel(int argc, char *argv[]);
|
||||
void ProcessIpMulticastAddr(int argc, char *argv[]);
|
||||
#ifndef OTDLL
|
||||
ThreadError ProcessIpMulticastAddrAdd(int argc, char *argv[]);
|
||||
ThreadError ProcessIpMulticastAddrDel(int argc, char *argv[]);
|
||||
ThreadError ProcessMulticastPromiscuous(int argc, char *argv[]);
|
||||
otError ProcessIpMulticastAddrAdd(int argc, char *argv[]);
|
||||
otError ProcessIpMulticastAddrDel(int argc, char *argv[]);
|
||||
otError ProcessMulticastPromiscuous(int argc, char *argv[]);
|
||||
#endif
|
||||
#if OPENTHREAD_ENABLE_JOINER
|
||||
void ProcessJoiner(int argc, char *argv[]);
|
||||
@@ -239,9 +239,9 @@ private:
|
||||
void ProcessPing(int argc, char *argv[]);
|
||||
void ProcessPollPeriod(int argc, char *argv[]);
|
||||
void ProcessPrefix(int argc, char *argv[]);
|
||||
ThreadError ProcessPrefixAdd(int argc, char *argv[]);
|
||||
ThreadError ProcessPrefixRemove(int argc, char *argv[]);
|
||||
ThreadError ProcessPrefixList(void);
|
||||
otError ProcessPrefixAdd(int argc, char *argv[]);
|
||||
otError ProcessPrefixRemove(int argc, char *argv[]);
|
||||
otError ProcessPrefixList(void);
|
||||
void ProcessPromiscuous(int argc, char *argv[]);
|
||||
#if OPENTHREAD_FTD
|
||||
void ProcessPSKc(int argc, char *argv[]);
|
||||
@@ -249,8 +249,8 @@ private:
|
||||
#endif
|
||||
void ProcessReset(int argc, char *argv[]);
|
||||
void ProcessRoute(int argc, char *argv[]);
|
||||
ThreadError ProcessRouteAdd(int argc, char *argv[]);
|
||||
ThreadError ProcessRouteRemove(int argc, char *argv[]);
|
||||
otError ProcessRouteAdd(int argc, char *argv[]);
|
||||
otError ProcessRouteRemove(int argc, char *argv[]);
|
||||
#if OPENTHREAD_FTD
|
||||
void ProcessRouter(int argc, char *argv[]);
|
||||
void ProcessRouterDowngradeThreshold(int argc, char *argv[]);
|
||||
@@ -289,11 +289,11 @@ private:
|
||||
static void OTCALL s_HandleDiagnosticGetResponse(otMessage *aMessage, const otMessageInfo *aMessageInfo,
|
||||
void *aContext);
|
||||
#endif
|
||||
static void OTCALL s_HandleJoinerCallback(ThreadError aError, void *aContext);
|
||||
static void OTCALL s_HandleJoinerCallback(otError aError, void *aContext);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DNS_CLIENT
|
||||
static void s_HandleDnsResponse(void *aContext, const char *aHostname, otIp6Address *aAddress,
|
||||
uint32_t aTtl, ThreadError aResult);
|
||||
uint32_t aTtl, otError aResult);
|
||||
#endif
|
||||
|
||||
#ifndef OTDLL
|
||||
@@ -315,10 +315,10 @@ private:
|
||||
#ifndef OTDLL
|
||||
void HandleDiagnosticGetResponse(Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
#endif
|
||||
void HandleJoinerCallback(ThreadError aError);
|
||||
void HandleJoinerCallback(otError aError);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DNS_CLIENT
|
||||
void HandleDnsResponse(const char *aHostname, Ip6::Address &aAddress, uint32_t aTtl, ThreadError aResult);
|
||||
void HandleDnsResponse(const char *aHostname, Ip6::Address &aAddress, uint32_t aTtl, otError aResult);
|
||||
#endif
|
||||
|
||||
static const struct Command sCommands[];
|
||||
|
||||
+21
-21
@@ -105,9 +105,9 @@ void Coap::OutputBytes(const uint8_t *aBytes, uint8_t aLength)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError Coap::Process(otInstance *aInstance, int argc, char *argv[], Server &aServer)
|
||||
otError Coap::Process(otInstance *aInstance, int argc, char *argv[], Server &aServer)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
sInstance = aInstance;
|
||||
sServer = &aServer;
|
||||
@@ -115,7 +115,7 @@ ThreadError Coap::Process(otInstance *aInstance, int argc, char *argv[], Server
|
||||
sResource.mContext = aInstance;
|
||||
sResource.mHandler = (otCoapRequestHandler) &Coap::s_HandleServerResponse;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_InvalidArgs);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
for (unsigned int i = 0; i < sizeof(sCommands) / sizeof(sCommands[0]); i++)
|
||||
{
|
||||
@@ -130,11 +130,11 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Coap::ProcessServer(int argc, char *argv[])
|
||||
otError Coap::ProcessServer(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_InvalidArgs);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
ConvertToLower(argv[0]);
|
||||
|
||||
@@ -164,7 +164,7 @@ ThreadError Coap::ProcessServer(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = kThreadError_InvalidArgs);
|
||||
ExitNow(error = OT_ERROR_INVALID_ARGS);
|
||||
}
|
||||
|
||||
exit:
|
||||
@@ -179,7 +179,7 @@ void OTCALL Coap::s_HandleServerResponse(void *aContext, otCoapHeader *aHeader,
|
||||
|
||||
void Coap::HandleServerResponse(otCoapHeader *aHeader, otMessage *aMessage, otMessageInfo *aMessageInfo)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otCoapHeader responseHeader;
|
||||
otMessage *responseMessage;
|
||||
otCoapCode responseCode = kCoapCodeEmpty;
|
||||
@@ -241,7 +241,7 @@ void Coap::HandleServerResponse(otCoapHeader *aHeader, otMessage *aMessage, otMe
|
||||
}
|
||||
|
||||
responseMessage = otCoapNewMessage(sInstance, &responseHeader);
|
||||
VerifyOrExit(responseMessage != NULL, error = kThreadError_NoBufs);
|
||||
VerifyOrExit(responseMessage != NULL, error = OT_ERROR_NO_BUFS);
|
||||
|
||||
if (otCoapHeaderGetCode(aHeader) == kCoapRequestGet)
|
||||
{
|
||||
@@ -253,7 +253,7 @@ void Coap::HandleServerResponse(otCoapHeader *aHeader, otMessage *aMessage, otMe
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None && responseMessage != NULL)
|
||||
if (error != OT_ERROR_NONE && responseMessage != NULL)
|
||||
{
|
||||
sServer->OutputFormat("Cannot send CoAP response message: Error %d\r\n", error);
|
||||
otMessageFree(responseMessage);
|
||||
@@ -267,9 +267,9 @@ exit:
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError Coap::ProcessClient(int argc, char *argv[])
|
||||
otError Coap::ProcessClient(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otMessage *message = NULL;
|
||||
otMessageInfo messageInfo;
|
||||
otCoapHeader header;
|
||||
@@ -281,7 +281,7 @@ ThreadError Coap::ProcessClient(int argc, char *argv[])
|
||||
otCoapCode coapCode = kCoapRequestGet;
|
||||
otIp6Address coapDestinationIp;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_InvalidArgs);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
// CoAP-Code
|
||||
ConvertToLower(argv[0]);
|
||||
@@ -304,7 +304,7 @@ ThreadError Coap::ProcessClient(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = kThreadError_Parse);
|
||||
ExitNow(error = OT_ERROR_PARSE);
|
||||
}
|
||||
|
||||
// Destination IPv6 address
|
||||
@@ -314,7 +314,7 @@ ThreadError Coap::ProcessClient(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = kThreadError_InvalidArgs);
|
||||
ExitNow(error = OT_ERROR_INVALID_ARGS);
|
||||
}
|
||||
|
||||
// CoAP-URI
|
||||
@@ -324,7 +324,7 @@ ThreadError Coap::ProcessClient(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = kThreadError_InvalidArgs);
|
||||
ExitNow(error = OT_ERROR_INVALID_ARGS);
|
||||
}
|
||||
|
||||
// CoAP-Type
|
||||
@@ -350,7 +350,7 @@ ThreadError Coap::ProcessClient(int argc, char *argv[])
|
||||
}
|
||||
|
||||
message = otCoapNewMessage(sInstance, &header);
|
||||
VerifyOrExit(message != NULL, error = kThreadError_NoBufs);
|
||||
VerifyOrExit(message != NULL, error = OT_ERROR_NO_BUFS);
|
||||
|
||||
// Embed content into message if given
|
||||
if (payloadLength > 0)
|
||||
@@ -377,7 +377,7 @@ ThreadError Coap::ProcessClient(int argc, char *argv[])
|
||||
|
||||
exit:
|
||||
|
||||
if ((error != kThreadError_None) && (message != NULL))
|
||||
if ((error != OT_ERROR_NONE) && (message != NULL))
|
||||
{
|
||||
otMessageFree(message);
|
||||
}
|
||||
@@ -386,15 +386,15 @@ exit:
|
||||
}
|
||||
|
||||
void OTCALL Coap::s_HandleClientResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
|
||||
otMessageInfo *aMessageInfo, ThreadError aResult)
|
||||
otMessageInfo *aMessageInfo, otError aResult)
|
||||
{
|
||||
static_cast<Coap *>(aContext)->HandleClientResponse(aHeader, aMessage, aMessageInfo, aResult);
|
||||
}
|
||||
|
||||
void Coap::HandleClientResponse(otCoapHeader *aHeader, otMessage *aMessage, otMessageInfo *aMessageInfo,
|
||||
ThreadError aResult)
|
||||
otError aResult)
|
||||
{
|
||||
if (aResult != kThreadError_None)
|
||||
if (aResult != OT_ERROR_NONE)
|
||||
{
|
||||
sServer->OutputFormat("Error receiving CoAP response message: %d", aResult);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Cli {
|
||||
struct CoapCommand
|
||||
{
|
||||
const char *mName; ///< A pointer to the command string.
|
||||
ThreadError(*mCommand)(int argc, char *argv[]); ///< A function pointer to process the command.
|
||||
otError(*mCommand)(int argc, char *argv[]); ///< A function pointer to process the command.
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
* @param[in] aServer A reference to the CLI server.
|
||||
*
|
||||
*/
|
||||
static ThreadError Process(otInstance *aInstance, int argc, char *argv[], Server &aServer);
|
||||
static otError Process(otInstance *aInstance, int argc, char *argv[], Server &aServer);
|
||||
|
||||
private:
|
||||
enum
|
||||
@@ -80,16 +80,16 @@ private:
|
||||
static void ConvertToLower(char *aString);
|
||||
static void OutputBytes(const uint8_t *aBytes, uint8_t aLength);
|
||||
|
||||
static ThreadError ProcessClient(int argc, char *argv[]);
|
||||
static ThreadError ProcessServer(int argc, char *argv[]);
|
||||
static otError ProcessClient(int argc, char *argv[]);
|
||||
static otError ProcessServer(int argc, char *argv[]);
|
||||
|
||||
static void OTCALL s_HandleServerResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
|
||||
otMessageInfo *aMessageInfo);
|
||||
static void HandleServerResponse(otCoapHeader *aHeader, otMessage *aMessage, otMessageInfo *aMessageInfo);
|
||||
static void OTCALL s_HandleClientResponse(void *aContext, otCoapHeader *aHeader, otMessage *aMessage,
|
||||
otMessageInfo *aMessageInfo, ThreadError aResult);
|
||||
otMessageInfo *aMessageInfo, otError aResult);
|
||||
static void HandleClientResponse(otCoapHeader *aHeader, otMessage *aMessage, otMessageInfo *aMessageInfo,
|
||||
ThreadError aResult);
|
||||
otError aResult);
|
||||
|
||||
static const CoapCommand sCommands[];
|
||||
static Server *sServer;
|
||||
|
||||
+87
-87
@@ -92,7 +92,7 @@ void Dataset::OutputBytes(const uint8_t *aBytes, uint8_t aLength)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError Dataset::Print(otOperationalDataset &aDataset)
|
||||
otError Dataset::Print(otOperationalDataset &aDataset)
|
||||
{
|
||||
if (aDataset.mIsPendingTimestampSet)
|
||||
{
|
||||
@@ -193,12 +193,12 @@ ThreadError Dataset::Print(otOperationalDataset &aDataset)
|
||||
sServer->OutputFormat("\r\n");
|
||||
}
|
||||
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError Dataset::Process(otInstance *aInstance, int argc, char *argv[], Server &aServer)
|
||||
otError Dataset::Process(otInstance *aInstance, int argc, char *argv[], Server &aServer)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
sServer = &aServer;
|
||||
|
||||
@@ -220,7 +220,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessHelp(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessHelp(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
for (unsigned int i = 0; i < sizeof(sCommands) / sizeof(sCommands[0]); i++)
|
||||
{
|
||||
@@ -230,10 +230,10 @@ ThreadError Dataset::ProcessHelp(otInstance *aInstance, int argc, char *argv[])
|
||||
(void)aInstance;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessActive(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessActive(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
otOperationalDataset dataset;
|
||||
otDatasetGetActive(aInstance, &dataset);
|
||||
@@ -243,7 +243,7 @@ ThreadError Dataset::ProcessActive(otInstance *aInstance, int argc, char *argv[]
|
||||
return Print(dataset);
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessPending(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessPending(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
otOperationalDataset dataset;
|
||||
otDatasetGetPending(aInstance, &dataset);
|
||||
@@ -254,12 +254,12 @@ ThreadError Dataset::ProcessPending(otInstance *aInstance, int argc, char *argv[
|
||||
}
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
ThreadError Dataset::ProcessActiveTimestamp(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessActiveTimestamp(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
long value;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[0], value));
|
||||
sDataset.mActiveTimestamp = static_cast<uint64_t>(value);
|
||||
sDataset.mIsActiveTimestampSet = true;
|
||||
@@ -270,12 +270,12 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessChannel(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessChannel(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
long value;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[0], value));
|
||||
sDataset.mChannel = static_cast<uint16_t>(value);
|
||||
sDataset.mIsChannelSet = true;
|
||||
@@ -286,12 +286,12 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessChannelMask(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessChannelMask(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
long value;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[0], value));
|
||||
sDataset.mChannelMaskPage0 = static_cast<uint32_t>(value);
|
||||
sDataset.mIsChannelMaskPage0Set = true;
|
||||
@@ -301,20 +301,20 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessClear(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessClear(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
memset(&sDataset, 0, sizeof(sDataset));
|
||||
(void)aInstance;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
return kThreadError_None;
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessCommit(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessCommit(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_InvalidArgs);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
if (strcmp(argv[0], "active") == 0)
|
||||
{
|
||||
@@ -326,7 +326,7 @@ ThreadError Dataset::ProcessCommit(otInstance *aInstance, int argc, char *argv[]
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = kThreadError_Parse);
|
||||
ExitNow(error = OT_ERROR_PARSE);
|
||||
}
|
||||
|
||||
(void)aInstance;
|
||||
@@ -335,12 +335,12 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessDelay(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessDelay(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
long value;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[0], value));
|
||||
sDataset.mDelay = static_cast<uint32_t>(value);
|
||||
sDataset.mIsDelaySet = true;
|
||||
@@ -351,13 +351,13 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessExtPanId(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessExtPanId(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint8_t extPanId[OT_EXT_PAN_ID_SIZE];
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(Interpreter::Hex2Bin(argv[0], extPanId, sizeof(extPanId)) >= 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
VerifyOrExit(Interpreter::Hex2Bin(argv[0], extPanId, sizeof(extPanId)) >= 0, error = OT_ERROR_PARSE);
|
||||
|
||||
memcpy(sDataset.mExtendedPanId.m8, extPanId, sizeof(sDataset.mExtendedPanId));
|
||||
sDataset.mIsExtendedPanIdSet = true;
|
||||
@@ -368,15 +368,15 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessMasterKey(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessMasterKey(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int keyLength;
|
||||
uint8_t key[OT_MASTER_KEY_SIZE];
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
VerifyOrExit((keyLength = Interpreter::Hex2Bin(argv[0], key, sizeof(key))) == OT_MASTER_KEY_SIZE,
|
||||
error = kThreadError_Parse);
|
||||
error = OT_ERROR_PARSE);
|
||||
|
||||
memcpy(sDataset.mMasterKey.m8, key, sizeof(sDataset.mMasterKey));
|
||||
sDataset.mIsMasterKeySet = true;
|
||||
@@ -387,12 +387,12 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessMeshLocalPrefix(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessMeshLocalPrefix(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otIp6Address prefix;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
SuccessOrExit(error = otIp6AddressFromString(argv[0], &prefix));
|
||||
|
||||
memcpy(sDataset.mMeshLocalPrefix.m8, prefix.mFields.m8, sizeof(sDataset.mMeshLocalPrefix.m8));
|
||||
@@ -404,13 +404,13 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessNetworkName(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessNetworkName(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
size_t length;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit((length = strlen(argv[0])) <= OT_NETWORK_NAME_MAX_SIZE, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
VerifyOrExit((length = strlen(argv[0])) <= OT_NETWORK_NAME_MAX_SIZE, error = OT_ERROR_PARSE);
|
||||
|
||||
memset(&sDataset.mNetworkName, 0, sizeof(sDataset.mNetworkName));
|
||||
memcpy(sDataset.mNetworkName.m8, argv[0], length);
|
||||
@@ -422,12 +422,12 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessPanId(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessPanId(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
long value;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[0], value));
|
||||
sDataset.mPanId = static_cast<otPanId>(value);
|
||||
sDataset.mIsPanIdSet = true;
|
||||
@@ -438,12 +438,12 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessPendingTimestamp(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessPendingTimestamp(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
long value;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[0], value));
|
||||
sDataset.mPendingTimestamp = static_cast<uint64_t>(value);
|
||||
sDataset.mIsPendingTimestampSet = true;
|
||||
@@ -454,16 +454,16 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessMgmtSetCommand(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessMgmtSetCommand(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otOperationalDataset dataset;
|
||||
uint8_t tlvs[128];
|
||||
long value;
|
||||
int length = 0;
|
||||
otIp6Address prefix;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
|
||||
memset(&dataset, 0, sizeof(dataset));
|
||||
|
||||
@@ -471,89 +471,89 @@ ThreadError Dataset::ProcessMgmtSetCommand(otInstance *aInstance, int argc, char
|
||||
{
|
||||
if (strcmp(argv[index], "activetimestamp") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsActiveTimestampSet = true;
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[++index], value));
|
||||
dataset.mActiveTimestamp = static_cast<uint64_t>(value);
|
||||
}
|
||||
else if (strcmp(argv[index], "pendingtimestamp") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsPendingTimestampSet = true;
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[++index], value));
|
||||
dataset.mPendingTimestamp = static_cast<uint64_t>(value);
|
||||
}
|
||||
else if (strcmp(argv[index], "masterkey") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsMasterKeySet = true;
|
||||
VerifyOrExit((length = Interpreter::Hex2Bin(argv[++index], dataset.mMasterKey.m8,
|
||||
sizeof(dataset.mMasterKey.m8))) == OT_MASTER_KEY_SIZE, error = kThreadError_Parse);
|
||||
sizeof(dataset.mMasterKey.m8))) == OT_MASTER_KEY_SIZE, error = OT_ERROR_PARSE);
|
||||
length = 0;
|
||||
}
|
||||
else if (strcmp(argv[index], "networkname") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsNetworkNameSet = true;
|
||||
VerifyOrExit((length = static_cast<int>(strlen(argv[++index]))) <= OT_NETWORK_NAME_MAX_SIZE,
|
||||
error = kThreadError_Parse);
|
||||
error = OT_ERROR_PARSE);
|
||||
memset(&dataset.mNetworkName, 0, sizeof(sDataset.mNetworkName));
|
||||
memcpy(dataset.mNetworkName.m8, argv[index], static_cast<size_t>(length));
|
||||
length = 0;
|
||||
}
|
||||
else if (strcmp(argv[index], "extpanid") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsExtendedPanIdSet = true;
|
||||
VerifyOrExit(Interpreter::Hex2Bin(argv[++index], dataset.mExtendedPanId.m8,
|
||||
sizeof(dataset.mExtendedPanId.m8)) >= 0, error = kThreadError_Parse);
|
||||
sizeof(dataset.mExtendedPanId.m8)) >= 0, error = OT_ERROR_PARSE);
|
||||
}
|
||||
else if (strcmp(argv[index], "localprefix") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsMeshLocalPrefixSet = true;
|
||||
SuccessOrExit(error = otIp6AddressFromString(argv[++index], &prefix));
|
||||
memcpy(dataset.mMeshLocalPrefix.m8, prefix.mFields.m8, sizeof(dataset.mMeshLocalPrefix.m8));
|
||||
}
|
||||
else if (strcmp(argv[index], "delaytimer") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsDelaySet = true;
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[++index], value));
|
||||
dataset.mDelay = static_cast<uint32_t>(value);
|
||||
}
|
||||
else if (strcmp(argv[index], "panid") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsPanIdSet = true;
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[++index], value));
|
||||
dataset.mPanId = static_cast<otPanId>(value);
|
||||
}
|
||||
else if (strcmp(argv[index], "channel") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsChannelSet = true;
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[++index], value));
|
||||
dataset.mChannel = static_cast<uint16_t>(value);
|
||||
}
|
||||
else if (strcmp(argv[index], "channelmask") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
dataset.mIsChannelMaskPage0Set = true;
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[++index], value));
|
||||
dataset.mChannelMaskPage0 = static_cast<uint32_t>(value);
|
||||
}
|
||||
else if (strcmp(argv[index], "binary") == 0)
|
||||
{
|
||||
VerifyOrExit((index + 1) < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit((index + 1) < argc, error = OT_ERROR_PARSE);
|
||||
length = static_cast<int>((strlen(argv[++index]) + 1) / 2);
|
||||
VerifyOrExit(static_cast<size_t>(length) <= sizeof(tlvs), error = kThreadError_NoBufs);
|
||||
VerifyOrExit(static_cast<size_t>(length) <= sizeof(tlvs), error = OT_ERROR_NO_BUFS);
|
||||
VerifyOrExit(Interpreter::Hex2Bin(argv[index], tlvs, static_cast<uint16_t>(length)) >= 0,
|
||||
error = kThreadError_Parse);
|
||||
error = OT_ERROR_PARSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = kThreadError_Parse);
|
||||
ExitNow(error = OT_ERROR_PARSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,7 +567,7 @@ ThreadError Dataset::ProcessMgmtSetCommand(otInstance *aInstance, int argc, char
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = kThreadError_Parse);
|
||||
ExitNow(error = OT_ERROR_PARSE);
|
||||
}
|
||||
|
||||
(void)aInstance;
|
||||
@@ -576,9 +576,9 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessMgmtGetCommand(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessMgmtGetCommand(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otOperationalDataset dataset;
|
||||
uint8_t tlvs[32];
|
||||
long value;
|
||||
@@ -586,13 +586,13 @@ ThreadError Dataset::ProcessMgmtGetCommand(otInstance *aInstance, int argc, char
|
||||
bool destAddrSpecified = false;
|
||||
otIp6Address address;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
|
||||
memset(&dataset, 0, sizeof(dataset));
|
||||
|
||||
for (uint8_t index = 1; index < argc; index++)
|
||||
{
|
||||
VerifyOrExit(static_cast<size_t>(length) < sizeof(tlvs), error = kThreadError_NoBufs);
|
||||
VerifyOrExit(static_cast<size_t>(length) < sizeof(tlvs), error = OT_ERROR_NO_BUFS);
|
||||
|
||||
if (strcmp(argv[index], "activetimestamp") == 0)
|
||||
{
|
||||
@@ -632,22 +632,22 @@ ThreadError Dataset::ProcessMgmtGetCommand(otInstance *aInstance, int argc, char
|
||||
}
|
||||
else if (strcmp(argv[index], "binary") == 0)
|
||||
{
|
||||
VerifyOrExit((index + 1) < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit((index + 1) < argc, error = OT_ERROR_PARSE);
|
||||
value = static_cast<long>(strlen(argv[++index]) + 1) / 2;
|
||||
VerifyOrExit(static_cast<size_t>(value) <= (sizeof(tlvs) - static_cast<size_t>(length)), error = kThreadError_NoBufs);
|
||||
VerifyOrExit(static_cast<size_t>(value) <= (sizeof(tlvs) - static_cast<size_t>(length)), error = OT_ERROR_NO_BUFS);
|
||||
VerifyOrExit(Interpreter::Hex2Bin(argv[index], tlvs + length, static_cast<uint16_t>(value)) >= 0,
|
||||
error = kThreadError_Parse);
|
||||
error = OT_ERROR_PARSE);
|
||||
length += value;
|
||||
}
|
||||
else if (strcmp(argv[index], "address") == 0)
|
||||
{
|
||||
VerifyOrExit(index < argc, error = kThreadError_Parse);
|
||||
VerifyOrExit(index < argc, error = OT_ERROR_PARSE);
|
||||
SuccessOrExit(error = otIp6AddressFromString(argv[++index], &address));
|
||||
destAddrSpecified = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = kThreadError_Parse);
|
||||
ExitNow(error = OT_ERROR_PARSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -663,7 +663,7 @@ ThreadError Dataset::ProcessMgmtGetCommand(otInstance *aInstance, int argc, char
|
||||
}
|
||||
else
|
||||
{
|
||||
ExitNow(error = kThreadError_Parse);
|
||||
ExitNow(error = OT_ERROR_PARSE);
|
||||
}
|
||||
|
||||
(void)aInstance;
|
||||
@@ -672,16 +672,16 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessPSKc(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessPSKc(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
uint16_t length;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
length = static_cast<uint16_t>((strlen(argv[0]) + 1) / 2);
|
||||
VerifyOrExit(length <= OT_PSKC_MAX_SIZE, error = kThreadError_NoBufs);
|
||||
VerifyOrExit(length <= OT_PSKC_MAX_SIZE, error = OT_ERROR_NO_BUFS);
|
||||
VerifyOrExit(Interpreter::Hex2Bin(argv[0], sDataset.mPSKc.m8 + OT_PSKC_MAX_SIZE - length, length) == length,
|
||||
error = kThreadError_Parse);
|
||||
error = OT_ERROR_PARSE);
|
||||
|
||||
sDataset.mIsPSKcSet = true;
|
||||
(void)aInstance;
|
||||
@@ -690,12 +690,12 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Dataset::ProcessSecurityPolicy(otInstance *aInstance, int argc, char *argv[])
|
||||
otError Dataset::ProcessSecurityPolicy(otInstance *aInstance, int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
long value;
|
||||
|
||||
VerifyOrExit(argc > 0, error = kThreadError_Parse);
|
||||
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
|
||||
|
||||
SuccessOrExit(error = Interpreter::ParseLong(argv[0], value));
|
||||
sDataset.mSecurityPolicy.mRotationTime = static_cast<uint16_t>(value);
|
||||
@@ -728,7 +728,7 @@ ThreadError Dataset::ProcessSecurityPolicy(otInstance *aInstance, int argc, char
|
||||
break;
|
||||
|
||||
default:
|
||||
ExitNow(error = kThreadError_Parse);
|
||||
ExitNow(error = OT_ERROR_PARSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+23
-24
@@ -47,9 +47,8 @@ namespace Cli {
|
||||
*/
|
||||
struct DatasetCommand
|
||||
{
|
||||
const char *mName; ///< A pointer to the command string.
|
||||
ThreadError(*mCommand)(otInstance *aInstance, int argc,
|
||||
char *argv[]); ///< A function pointer to process the command.
|
||||
const char *mName; ///< A pointer to the command string.
|
||||
otError(*mCommand)(otInstance *aInstance, int argc, char *argv[]); ///< A function pointer to process the command.
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -66,31 +65,31 @@ public:
|
||||
* @param[in] argv A pointer to an array of command line arguments.
|
||||
*
|
||||
*/
|
||||
static ThreadError Process(otInstance *aInstance, int argc, char *argv[], Server &aServer);
|
||||
static otError Process(otInstance *aInstance, int argc, char *argv[], Server &aServer);
|
||||
|
||||
private:
|
||||
static void OutputBytes(const uint8_t *aBytes, uint8_t aLength);
|
||||
static ThreadError Print(otOperationalDataset &aDataset);
|
||||
static otError Print(otOperationalDataset &aDataset);
|
||||
|
||||
static ThreadError ProcessHelp(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessActive(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessActiveTimestamp(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessChannel(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessChannelMask(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessClear(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessCommit(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessDelay(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessExtPanId(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessMasterKey(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessMeshLocalPrefix(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessNetworkName(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessPanId(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessPending(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessPendingTimestamp(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessMgmtSetCommand(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessMgmtGetCommand(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessPSKc(otInstance *aInstance, int argc, char *argv[]);
|
||||
static ThreadError ProcessSecurityPolicy(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessHelp(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessActive(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessActiveTimestamp(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessChannel(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessChannelMask(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessClear(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessCommit(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessDelay(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessExtPanId(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessMasterKey(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessMeshLocalPrefix(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessNetworkName(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessPanId(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessPending(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessPendingTimestamp(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessMgmtSetCommand(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessMgmtGetCommand(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessPSKc(otInstance *aInstance, int argc, char *argv[]);
|
||||
static otError ProcessSecurityPolicy(otInstance *aInstance, int argc, char *argv[]);
|
||||
|
||||
static const DatasetCommand sCommands[];
|
||||
static otOperationalDataset sDataset;
|
||||
|
||||
@@ -93,7 +93,7 @@ void Interpreter::ProcessInstanceList(int argc, char *argv[])
|
||||
|
||||
void Interpreter::ProcessInstance(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
long value;
|
||||
|
||||
if (argc == 0)
|
||||
@@ -113,7 +113,7 @@ void Interpreter::ProcessInstance(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
SuccessOrExit(error = ParseLong(argv[0], value));
|
||||
VerifyOrExit(value >= 0 && value < mInstancesLength, error = kThreadError_InvalidArgs);
|
||||
VerifyOrExit(value >= 0 && value < mInstancesLength, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
mInstanceIndex = (uint8_t)value;
|
||||
mInstance = mInstances[mInstanceIndex].aInstance;
|
||||
|
||||
@@ -138,9 +138,9 @@ void Uart::ReceiveTask(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
}
|
||||
}
|
||||
|
||||
ThreadError Uart::ProcessCommand(void)
|
||||
otError Uart::ProcessCommand(void)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
if (mRxBuffer[mRxLength - 1] == '\n')
|
||||
{
|
||||
|
||||
@@ -104,7 +104,7 @@ private:
|
||||
kMaxLineLength = 128,
|
||||
};
|
||||
|
||||
ThreadError ProcessCommand(void);
|
||||
otError ProcessCommand(void);
|
||||
void Send(void);
|
||||
|
||||
char mRxBuffer[kRxBufferSize];
|
||||
|
||||
+5
-5
@@ -57,9 +57,9 @@ Udp::Udp(otInstance *aInstance, Interpreter *aInterpreter):
|
||||
memset(&mPeer, 0, sizeof(mPeer));
|
||||
}
|
||||
|
||||
ThreadError Udp::Start(void)
|
||||
otError Udp::Start(void)
|
||||
{
|
||||
ThreadError error;
|
||||
otError error;
|
||||
|
||||
otSockAddr sockaddr;
|
||||
memset(&sockaddr, 0, sizeof(otSockAddr));
|
||||
@@ -105,17 +105,17 @@ exit:
|
||||
|
||||
int Udp::Output(const char *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
otError error = OT_ERROR_NONE;
|
||||
otMessage *message;
|
||||
|
||||
VerifyOrExit((message = otUdpNewMessage(mInstance, true)) != NULL, error = kThreadError_NoBufs);
|
||||
VerifyOrExit((message = otUdpNewMessage(mInstance, true)) != NULL, error = OT_ERROR_NO_BUFS);
|
||||
SuccessOrExit(error = otMessageSetLength(message, aBufLength));
|
||||
otMessageWrite(message, 0, aBuf, aBufLength);
|
||||
SuccessOrExit(error = otUdpSend(&mSocket, message, &mPeer));
|
||||
|
||||
exit:
|
||||
|
||||
if (error != kThreadError_None && message != NULL)
|
||||
if (error != OT_ERROR_NONE && message != NULL)
|
||||
{
|
||||
otMessageFree(message);
|
||||
aBufLength = 0;
|
||||
|
||||
+2
-2
@@ -61,10 +61,10 @@ public:
|
||||
/**
|
||||
* This method starts the CLI server.
|
||||
*
|
||||
* @retval kThreadError_None Successfully started the server.
|
||||
* @retval OT_ERROR_NONE Successfully started the server.
|
||||
*
|
||||
*/
|
||||
ThreadError Start(void);
|
||||
otError Start(void);
|
||||
|
||||
/**
|
||||
* This method delivers raw characters to the client.
|
||||
|
||||
@@ -39,18 +39,18 @@ using namespace ot;
|
||||
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_ENABLE_BORDER_AGENT_PROXY
|
||||
|
||||
ThreadError otBorderAgentProxyStart(otInstance *aInstance, otBorderAgentProxyStreamHandler aBorderAgentProxyCallback,
|
||||
void *aContext)
|
||||
otError otBorderAgentProxyStart(otInstance *aInstance, otBorderAgentProxyStreamHandler aBorderAgentProxyCallback,
|
||||
void *aContext)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetBorderAgentProxy().Start(aBorderAgentProxyCallback, aContext);
|
||||
}
|
||||
|
||||
ThreadError otBorderAgentProxyStop(otInstance *aInstance)
|
||||
otError otBorderAgentProxyStop(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetBorderAgentProxy().Stop();
|
||||
}
|
||||
|
||||
ThreadError otBorderAgentProxySend(otInstance *aInstance, otMessage *aMessage, uint16_t aLocator, uint16_t aPort)
|
||||
otError otBorderAgentProxySend(otInstance *aInstance, otMessage *aMessage, uint16_t aLocator, uint16_t aPort)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetBorderAgentProxy().Send(*static_cast<Message *>(aMessage), aLocator, aPort);
|
||||
}
|
||||
|
||||
+12
-12
@@ -56,32 +56,32 @@ void otCoapHeaderGenerateToken(otCoapHeader *aHeader, uint8_t aTokenLength)
|
||||
static_cast<Coap::Header *>(aHeader)->SetToken(aTokenLength);
|
||||
}
|
||||
|
||||
ThreadError otCoapHeaderAppendOption(otCoapHeader *aHeader, const otCoapOption *aOption)
|
||||
otError otCoapHeaderAppendOption(otCoapHeader *aHeader, const otCoapOption *aOption)
|
||||
{
|
||||
return static_cast<Coap::Header *>(aHeader)->AppendOption(*static_cast<const Coap::Header::Option *>(aOption));
|
||||
}
|
||||
|
||||
ThreadError otCoapHeaderAppendUintOption(otCoapHeader *aHeader, uint16_t aNumber, uint32_t aValue)
|
||||
otError otCoapHeaderAppendUintOption(otCoapHeader *aHeader, uint16_t aNumber, uint32_t aValue)
|
||||
{
|
||||
return static_cast<Coap::Header *>(aHeader)->AppendUintOption(aNumber, aValue);
|
||||
}
|
||||
|
||||
ThreadError otCoapHeaderAppendObserveOption(otCoapHeader *aHeader, uint32_t aObserve)
|
||||
otError otCoapHeaderAppendObserveOption(otCoapHeader *aHeader, uint32_t aObserve)
|
||||
{
|
||||
return static_cast<Coap::Header *>(aHeader)->AppendObserveOption(aObserve);
|
||||
}
|
||||
|
||||
ThreadError otCoapHeaderAppendUriPathOptions(otCoapHeader *aHeader, const char *aUriPath)
|
||||
otError otCoapHeaderAppendUriPathOptions(otCoapHeader *aHeader, const char *aUriPath)
|
||||
{
|
||||
return static_cast<Coap::Header *>(aHeader)->AppendUriPathOptions(aUriPath);
|
||||
}
|
||||
|
||||
ThreadError otCoapHeaderAppendMaxAgeOption(otCoapHeader *aHeader, uint32_t aMaxAge)
|
||||
otError otCoapHeaderAppendMaxAgeOption(otCoapHeader *aHeader, uint32_t aMaxAge)
|
||||
{
|
||||
return static_cast<Coap::Header *>(aHeader)->AppendMaxAgeOption(aMaxAge);
|
||||
}
|
||||
|
||||
ThreadError otCoapHeaderAppendUriQueryOption(otCoapHeader *aHeader, const char *aUriQuery)
|
||||
otError otCoapHeaderAppendUriQueryOption(otCoapHeader *aHeader, const char *aUriQuery)
|
||||
{
|
||||
return static_cast<Coap::Header *>(aHeader)->AppendUriQueryOption(aUriQuery);
|
||||
}
|
||||
@@ -140,8 +140,8 @@ exit:
|
||||
return message;
|
||||
}
|
||||
|
||||
ThreadError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo,
|
||||
otCoapResponseHandler aHandler, void *aContext)
|
||||
otError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo,
|
||||
otCoapResponseHandler aHandler, void *aContext)
|
||||
{
|
||||
return aInstance->mApplicationCoap.SendMessage(
|
||||
*static_cast<Message *>(aMessage),
|
||||
@@ -149,17 +149,17 @@ ThreadError otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const
|
||||
aHandler, aContext);
|
||||
}
|
||||
|
||||
ThreadError otCoapStart(otInstance *aInstance, uint16_t aPort)
|
||||
otError otCoapStart(otInstance *aInstance, uint16_t aPort)
|
||||
{
|
||||
return aInstance->mApplicationCoap.Start(aPort);
|
||||
}
|
||||
|
||||
ThreadError otCoapStop(otInstance *aInstance)
|
||||
otError otCoapStop(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mApplicationCoap.Stop();
|
||||
}
|
||||
|
||||
ThreadError otCoapAddResource(otInstance *aInstance, otCoapResource *aResource)
|
||||
otError otCoapAddResource(otInstance *aInstance, otCoapResource *aResource)
|
||||
{
|
||||
return aInstance->mApplicationCoap.AddResource(*static_cast<Coap::Resource *>(aResource));
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void otCoapSetDefaultHandler(otInstance *aInstance, otCoapRequestHandler aHandle
|
||||
aInstance->mApplicationCoap.SetDefaultHandler(aHandler, aContext);
|
||||
}
|
||||
|
||||
ThreadError otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
||||
otError otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
||||
{
|
||||
return aInstance->mApplicationCoap.SendMessage(
|
||||
*static_cast<Message *>(aMessage), *static_cast<const Ip6::MessageInfo *>(aMessageInfo));
|
||||
|
||||
@@ -39,64 +39,64 @@ using namespace ot;
|
||||
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_ENABLE_COMMISSIONER
|
||||
|
||||
ThreadError otCommissionerStart(otInstance *aInstance)
|
||||
otError otCommissionerStart(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().Start();
|
||||
}
|
||||
|
||||
ThreadError otCommissionerStop(otInstance *aInstance)
|
||||
otError otCommissionerStop(otInstance *aInstance)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().Stop();
|
||||
}
|
||||
|
||||
ThreadError otCommissionerAddJoiner(otInstance *aInstance, const otExtAddress *aExtAddress, const char *aPSKd,
|
||||
uint32_t aTimeout)
|
||||
otError otCommissionerAddJoiner(otInstance *aInstance, const otExtAddress *aExtAddress, const char *aPSKd,
|
||||
uint32_t aTimeout)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().AddJoiner(static_cast<const Mac::ExtAddress *>(aExtAddress), aPSKd,
|
||||
aTimeout);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerRemoveJoiner(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
otError otCommissionerRemoveJoiner(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().RemoveJoiner(static_cast<const Mac::ExtAddress *>(aExtAddress), 0);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerSetProvisioningUrl(otInstance *aInstance, const char *aProvisioningUrl)
|
||||
otError otCommissionerSetProvisioningUrl(otInstance *aInstance, const char *aProvisioningUrl)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().SetProvisioningUrl(aProvisioningUrl);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerAnnounceBegin(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod,
|
||||
const otIp6Address *aAddress)
|
||||
otError otCommissionerAnnounceBegin(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod,
|
||||
const otIp6Address *aAddress)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().mAnnounceBegin.SendRequest(aChannelMask, aCount, aPeriod,
|
||||
*static_cast<const Ip6::Address *>(aAddress));
|
||||
}
|
||||
|
||||
ThreadError otCommissionerEnergyScan(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod,
|
||||
uint16_t aScanDuration, const otIp6Address *aAddress,
|
||||
otCommissionerEnergyReportCallback aCallback, void *aContext)
|
||||
otError otCommissionerEnergyScan(otInstance *aInstance, uint32_t aChannelMask, uint8_t aCount, uint16_t aPeriod,
|
||||
uint16_t aScanDuration, const otIp6Address *aAddress,
|
||||
otCommissionerEnergyReportCallback aCallback, void *aContext)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().mEnergyScan.SendQuery(aChannelMask, aCount, aPeriod, aScanDuration,
|
||||
*static_cast<const Ip6::Address *>(aAddress),
|
||||
aCallback, aContext);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerPanIdQuery(otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask,
|
||||
const otIp6Address *aAddress,
|
||||
otCommissionerPanIdConflictCallback aCallback, void *aContext)
|
||||
otError otCommissionerPanIdQuery(otInstance *aInstance, uint16_t aPanId, uint32_t aChannelMask,
|
||||
const otIp6Address *aAddress,
|
||||
otCommissionerPanIdConflictCallback aCallback, void *aContext)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().mPanIdQuery.SendQuery(
|
||||
aPanId, aChannelMask, *static_cast<const Ip6::Address *>(aAddress), aCallback, aContext);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerSendMgmtGet(otInstance *aInstance, const uint8_t *aTlvs, uint8_t aLength)
|
||||
otError otCommissionerSendMgmtGet(otInstance *aInstance, const uint8_t *aTlvs, uint8_t aLength)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().SendMgmtCommissionerGetRequest(aTlvs, aLength);
|
||||
}
|
||||
|
||||
ThreadError otCommissionerSendMgmtSet(otInstance *aInstance, const otCommissioningDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength)
|
||||
otError otCommissionerSendMgmtSet(otInstance *aInstance, const otCommissioningDataset *aDataset,
|
||||
const uint8_t *aTlvs, uint8_t aLength)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().SendMgmtCommissionerSetRequest(*aDataset, aTlvs, aLength);
|
||||
}
|
||||
@@ -111,8 +111,8 @@ otCommissionerState otCommissionerGetState(otInstance *aInstance)
|
||||
return aInstance->mThreadNetif.GetCommissioner().GetState();
|
||||
}
|
||||
|
||||
ThreadError otCommissionerGeneratePSKc(otInstance *aInstance, const char *aPassPhrase, const char *aNetworkName,
|
||||
const uint8_t *aExtPanId, uint8_t *aPSKc)
|
||||
otError otCommissionerGeneratePSKc(otInstance *aInstance, const char *aPassPhrase, const char *aNetworkName,
|
||||
const uint8_t *aExtPanId, uint8_t *aPSKc)
|
||||
{
|
||||
return aInstance->mThreadNetif.GetCommissioner().GeneratePSKc(aPassPhrase, aNetworkName, aExtPanId, aPSKc);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user