mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[clang-format] use AllowShortFunctionsOnASingleLine: All (#8502)
This commit updates `AllowShortFunctionsOnASingleLine` to `All` from `InlineOnly`.
This commit is contained in:
committed by
GitHub
parent
48c0582e4e
commit
99a615bec2
+1
-1
@@ -11,7 +11,7 @@ AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: InlineOnly
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: true
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
|
||||
@@ -368,15 +368,9 @@ exit:
|
||||
return rval;
|
||||
}
|
||||
|
||||
void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
ReceiveTask(aBuf, aBufLength);
|
||||
}
|
||||
void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength) { ReceiveTask(aBuf, aBufLength); }
|
||||
|
||||
void otPlatUartSendDone(void)
|
||||
{
|
||||
SendDoneTask();
|
||||
}
|
||||
void otPlatUartSendDone(void) { SendDoneTask(); }
|
||||
|
||||
extern "C" void otAppCliInit(otInstance *aInstance)
|
||||
{
|
||||
|
||||
@@ -50,21 +50,12 @@
|
||||
extern void otAppCliInit(otInstance *aInstance);
|
||||
|
||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
{
|
||||
return calloc(aNum, aSize);
|
||||
}
|
||||
OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize) { return calloc(aNum, aSize); }
|
||||
|
||||
OT_TOOL_WEAK void otPlatFree(void *aPtr)
|
||||
{
|
||||
free(aPtr);
|
||||
}
|
||||
OT_TOOL_WEAK void otPlatFree(void *aPtr) { free(aPtr); }
|
||||
#endif
|
||||
|
||||
void otTaskletsSignalPending(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
void otTaskletsSignalPending(otInstance *aInstance) { OT_UNUSED_VARIABLE(aInstance); }
|
||||
|
||||
#if OPENTHREAD_POSIX && !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
|
||||
static otError ProcessExit(void *aContext, uint8_t aArgsLength, char *aArgs[])
|
||||
|
||||
@@ -46,21 +46,12 @@
|
||||
extern void otAppNcpInit(otInstance *aInstance);
|
||||
|
||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
{
|
||||
return calloc(aNum, aSize);
|
||||
}
|
||||
OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize) { return calloc(aNum, aSize); }
|
||||
|
||||
OT_TOOL_WEAK void otPlatFree(void *aPtr)
|
||||
{
|
||||
free(aPtr);
|
||||
}
|
||||
OT_TOOL_WEAK void otPlatFree(void *aPtr) { free(aPtr); }
|
||||
#endif
|
||||
|
||||
void otTaskletsSignalPending(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
void otTaskletsSignalPending(otInstance *aInstance) { OT_UNUSED_VARIABLE(aInstance); }
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
@@ -37,15 +37,9 @@
|
||||
#if !OPENTHREAD_CONFIG_NCP_SPI_ENABLE
|
||||
#include "utils/uart.h"
|
||||
|
||||
void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
otNcpHdlcReceive(aBuf, aBufLength);
|
||||
}
|
||||
void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength) { otNcpHdlcReceive(aBuf, aBufLength); }
|
||||
|
||||
void otPlatUartSendDone(void)
|
||||
{
|
||||
otNcpHdlcSendDone();
|
||||
}
|
||||
void otPlatUartSendDone(void) { otNcpHdlcSendDone(); }
|
||||
#endif
|
||||
|
||||
#if !OPENTHREAD_ENABLE_NCP_VENDOR_HOOK
|
||||
|
||||
@@ -162,10 +162,7 @@ uint64_t platformGetNow(void)
|
||||
}
|
||||
#endif // defined(CLOCK_MONOTONIC_RAW) || defined(CLOCK_MONOTONIC)
|
||||
|
||||
uint32_t otPlatAlarmMilliGetNow(void)
|
||||
{
|
||||
return (uint32_t)(platformGetNow() / US_PER_MS);
|
||||
}
|
||||
uint32_t otPlatAlarmMilliGetNow(void) { return (uint32_t)(platformGetNow() / US_PER_MS); }
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
@@ -182,10 +179,7 @@ void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
sIsMsRunning = false;
|
||||
}
|
||||
|
||||
uint32_t otPlatAlarmMicroGetNow(void)
|
||||
{
|
||||
return (uint32_t)platformGetNow();
|
||||
}
|
||||
uint32_t otPlatAlarmMicroGetNow(void) { return (uint32_t)platformGetNow(); }
|
||||
|
||||
void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
@@ -303,14 +297,8 @@ void platformAlarmProcess(otInstance *aInstance)
|
||||
#endif
|
||||
}
|
||||
|
||||
uint64_t otPlatTimeGet(void)
|
||||
{
|
||||
return platformGetNow();
|
||||
}
|
||||
uint64_t otPlatTimeGet(void) { return platformGetNow(); }
|
||||
|
||||
uint16_t otPlatTimeGetXtalAccuracy(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
uint16_t otPlatTimeGetXtalAccuracy(void) { return 0; }
|
||||
|
||||
#endif // OPENTHREAD_SIMULATION_VIRTUAL_TIME == 0
|
||||
|
||||
@@ -56,25 +56,13 @@ enum
|
||||
static otGpioMode sGpioMode = OT_GPIO_MODE_INPUT;
|
||||
static bool sGpioValue = false;
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
{
|
||||
sDiagMode = aMode;
|
||||
}
|
||||
void otPlatDiagModeSet(bool aMode) { sDiagMode = aMode; }
|
||||
|
||||
bool otPlatDiagModeGet()
|
||||
{
|
||||
return sDiagMode;
|
||||
}
|
||||
bool otPlatDiagModeGet() { return sDiagMode; }
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
void otPlatDiagChannelSet(uint8_t aChannel) { OT_UNUSED_VARIABLE(aChannel); }
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower) { OT_UNUSED_VARIABLE(aTxPower); }
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
@@ -83,10 +71,7 @@ void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otErro
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance) { OT_UNUSED_VARIABLE(aInstance); }
|
||||
|
||||
otError otPlatDiagGpioSet(uint32_t aGpio, bool aValue)
|
||||
{
|
||||
|
||||
@@ -185,10 +185,7 @@ static void NodeIdFilterDeny(uint16_t aNodeId)
|
||||
sDeniedNodeIdsBitVector[index / 8] |= 0x80 >> (index % 8);
|
||||
}
|
||||
|
||||
static void NodeIdFilterClear(void)
|
||||
{
|
||||
memset(sDeniedNodeIdsBitVector, 0, sizeof(sDeniedNodeIdsBitVector));
|
||||
}
|
||||
static void NodeIdFilterClear(void) { memset(sDeniedNodeIdsBitVector, 0, sizeof(sDeniedNodeIdsBitVector)); }
|
||||
|
||||
otError ProcessNodeIdFilter(void *aContext, uint8_t aArgsLength, char *aArgs[])
|
||||
{
|
||||
@@ -237,10 +234,7 @@ otError ProcessNodeIdFilter(void *aContext, uint8_t aArgsLength, char *aArgs[])
|
||||
}
|
||||
#endif // OPENTHREAD_SIMULATION_VIRTUAL_TIME == 0
|
||||
|
||||
static bool IsTimeAfterOrEqual(uint32_t aTimeA, uint32_t aTimeB)
|
||||
{
|
||||
return (aTimeA - aTimeB) < (1U << 31);
|
||||
}
|
||||
static bool IsTimeAfterOrEqual(uint32_t aTimeA, uint32_t aTimeB) { return (aTimeA - aTimeB) < (1U << 31); }
|
||||
|
||||
static void ReverseExtAddress(otExtAddress *aReversed, const otExtAddress *aOrigin)
|
||||
{
|
||||
@@ -794,10 +788,7 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
bool platformRadioIsTransmitPending(void)
|
||||
{
|
||||
return sState == OT_RADIO_STATE_TRANSMIT && !sTxWait;
|
||||
}
|
||||
bool platformRadioIsTransmitPending(void) { return sState == OT_RADIO_STATE_TRANSMIT && !sTxWait; }
|
||||
|
||||
#if OPENTHREAD_SIMULATION_VIRTUAL_TIME
|
||||
void platformRadioReceive(otInstance *aInstance, uint8_t *aBuf, uint16_t aBufLength)
|
||||
|
||||
@@ -52,9 +52,7 @@ otError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aComplete
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
void otPlatSpiSlaveDisable(void)
|
||||
{
|
||||
}
|
||||
void otPlatSpiSlaveDisable(void) {}
|
||||
|
||||
otError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf,
|
||||
uint16_t aOutputBufLen,
|
||||
@@ -73,9 +71,7 @@ otError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf,
|
||||
|
||||
// Uart
|
||||
|
||||
void otPlatUartSendDone(void)
|
||||
{
|
||||
}
|
||||
void otPlatUartSendDone(void) {}
|
||||
|
||||
void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
|
||||
@@ -176,10 +176,7 @@ void otSysInit(int aArgCount, char *aArgVector[])
|
||||
platformRandomInit();
|
||||
}
|
||||
|
||||
bool otSysPseudoResetWasRequested(void)
|
||||
{
|
||||
return gPlatformPseudoResetWasRequested;
|
||||
}
|
||||
bool otSysPseudoResetWasRequested(void) { return gPlatformPseudoResetWasRequested; }
|
||||
|
||||
void otSysDeinit(void)
|
||||
{
|
||||
|
||||
@@ -419,10 +419,7 @@ void platformTrelInit(uint32_t aSpeedUpFactor)
|
||||
OT_UNUSED_VARIABLE(aSpeedUpFactor);
|
||||
}
|
||||
|
||||
void platformTrelDeinit(void)
|
||||
{
|
||||
deinitFds();
|
||||
}
|
||||
void platformTrelDeinit(void) { deinitFds(); }
|
||||
|
||||
void platformTrelUpdateFdSet(fd_set *aReadFdSet, fd_set *aWriteFdSet, struct timeval *aTimeout, int *aMaxFd)
|
||||
{
|
||||
|
||||
@@ -54,15 +54,9 @@ static int s_out_fd;
|
||||
static struct termios original_stdin_termios;
|
||||
static struct termios original_stdout_termios;
|
||||
|
||||
static void restore_stdin_termios(void)
|
||||
{
|
||||
tcsetattr(s_in_fd, TCSAFLUSH, &original_stdin_termios);
|
||||
}
|
||||
static void restore_stdin_termios(void) { tcsetattr(s_in_fd, TCSAFLUSH, &original_stdin_termios); }
|
||||
|
||||
static void restore_stdout_termios(void)
|
||||
{
|
||||
tcsetattr(s_out_fd, TCSAFLUSH, &original_stdout_termios);
|
||||
}
|
||||
static void restore_stdout_termios(void) { tcsetattr(s_out_fd, TCSAFLUSH, &original_stdout_termios); }
|
||||
|
||||
void platformUartRestore(void)
|
||||
{
|
||||
|
||||
@@ -55,20 +55,11 @@ void platformAlarmInit(uint32_t aSpeedUpFactor)
|
||||
sNow = 0;
|
||||
}
|
||||
|
||||
uint64_t platformAlarmGetNow(void)
|
||||
{
|
||||
return sNow;
|
||||
}
|
||||
uint64_t platformAlarmGetNow(void) { return sNow; }
|
||||
|
||||
void platformAlarmAdvanceNow(uint64_t aDelta)
|
||||
{
|
||||
sNow += aDelta;
|
||||
}
|
||||
void platformAlarmAdvanceNow(uint64_t aDelta) { sNow += aDelta; }
|
||||
|
||||
uint32_t otPlatAlarmMilliGetNow(void)
|
||||
{
|
||||
return (uint32_t)(sNow / US_PER_MS);
|
||||
}
|
||||
uint32_t otPlatAlarmMilliGetNow(void) { return (uint32_t)(sNow / US_PER_MS); }
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
@@ -85,10 +76,7 @@ void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
sIsMsRunning = false;
|
||||
}
|
||||
|
||||
uint32_t otPlatAlarmMicroGetNow(void)
|
||||
{
|
||||
return (uint32_t)sNow;
|
||||
}
|
||||
uint32_t otPlatAlarmMicroGetNow(void) { return (uint32_t)sNow; }
|
||||
|
||||
void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
@@ -186,16 +174,10 @@ void platformAlarmProcess(otInstance *aInstance)
|
||||
#endif // OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
|
||||
}
|
||||
|
||||
uint64_t otPlatTimeGet(void)
|
||||
{
|
||||
return platformAlarmGetNow();
|
||||
}
|
||||
uint64_t otPlatTimeGet(void) { return platformAlarmGetNow(); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
uint16_t otPlatTimeGetXtalAccuracy(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
uint16_t otPlatTimeGetXtalAccuracy(void) { return 0; }
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_SIMULATION_VIRTUAL_TIME
|
||||
|
||||
@@ -136,19 +136,11 @@ static void platformSendSleepEvent(void)
|
||||
}
|
||||
|
||||
#if OPENTHREAD_SIMULATION_VIRTUAL_TIME_UART
|
||||
void platformUartRestore(void)
|
||||
{
|
||||
}
|
||||
void platformUartRestore(void) {}
|
||||
|
||||
otError otPlatUartEnable(void)
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
otError otPlatUartEnable(void) { return OT_ERROR_NONE; }
|
||||
|
||||
otError otPlatUartDisable(void)
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
otError otPlatUartDisable(void) { return OT_ERROR_NONE; }
|
||||
|
||||
otError otPlatUartSend(const uint8_t *aData, uint16_t aLength)
|
||||
{
|
||||
@@ -168,10 +160,7 @@ otError otPlatUartSend(const uint8_t *aData, uint16_t aLength)
|
||||
return error;
|
||||
}
|
||||
|
||||
otError otPlatUartFlush(void)
|
||||
{
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
otError otPlatUartFlush(void) { return OT_ERROR_NONE; }
|
||||
#endif // OPENTHREAD_SIMULATION_VIRTUAL_TIME_UART
|
||||
|
||||
static void socket_init(void)
|
||||
@@ -242,15 +231,9 @@ void otSysInit(int argc, char *argv[])
|
||||
signal(SIGHUP, &handleSignal);
|
||||
}
|
||||
|
||||
bool otSysPseudoResetWasRequested(void)
|
||||
{
|
||||
return gPlatformPseudoResetWasRequested;
|
||||
}
|
||||
bool otSysPseudoResetWasRequested(void) { return gPlatformPseudoResetWasRequested; }
|
||||
|
||||
void otSysDeinit(void)
|
||||
{
|
||||
close(sSockFd);
|
||||
}
|
||||
void otSysDeinit(void) { close(sSockFd); }
|
||||
|
||||
void otSysProcessDrivers(otInstance *aInstance)
|
||||
{
|
||||
|
||||
@@ -103,22 +103,13 @@ void otPlatDebugUart_putchar(int c)
|
||||
|
||||
/* provide WEAK stubs for platforms that do not implement all functions */
|
||||
OT_TOOL_WEAK
|
||||
void otPlatDebugUart_putchar_raw(int c)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(c);
|
||||
}
|
||||
void otPlatDebugUart_putchar_raw(int c) { OT_UNUSED_VARIABLE(c); }
|
||||
|
||||
OT_TOOL_WEAK
|
||||
int otPlatDebugUart_kbhit(void)
|
||||
{
|
||||
return 0; /* nothing */
|
||||
}
|
||||
int otPlatDebugUart_kbhit(void) { return 0; /* nothing */ }
|
||||
|
||||
OT_TOOL_WEAK
|
||||
int otPlatDebugUart_getc(void)
|
||||
{
|
||||
return -1; /* nothing */
|
||||
}
|
||||
int otPlatDebugUart_getc(void) { return -1; /* nothing */ }
|
||||
|
||||
OT_TOOL_WEAK
|
||||
otError otPlatDebugUart_logfile(const char *filename)
|
||||
|
||||
@@ -177,10 +177,7 @@ static inline bool IsLinkMetricsClear(otLinkMetrics aLinkMetrics)
|
||||
return !aLinkMetrics.mPduCount && !aLinkMetrics.mLqi && !aLinkMetrics.mLinkMargin && !aLinkMetrics.mRssi;
|
||||
}
|
||||
|
||||
void otLinkMetricsInit(int8_t aNoiseFloor)
|
||||
{
|
||||
sNoiseFloor = aNoiseFloor;
|
||||
}
|
||||
void otLinkMetricsInit(int8_t aNoiseFloor) { sNoiseFloor = aNoiseFloor; }
|
||||
|
||||
otError otLinkMetricsConfigureEnhAckProbing(otShortAddress aShortAddress,
|
||||
const otExtAddress *aExtAddress,
|
||||
|
||||
@@ -136,10 +136,7 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void utilsLogRttDeinit(void)
|
||||
{
|
||||
sLogInitialized = false;
|
||||
}
|
||||
void utilsLogRttDeinit(void) { sLogInitialized = false; }
|
||||
|
||||
void utilsLogRttOutput(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, va_list ap)
|
||||
{
|
||||
|
||||
@@ -206,10 +206,7 @@ uint8_t otMacFrameGetKeyId(otRadioFrame *aFrame)
|
||||
return keyId;
|
||||
}
|
||||
|
||||
void otMacFrameSetKeyId(otRadioFrame *aFrame, uint8_t aKeyId)
|
||||
{
|
||||
static_cast<Mac::Frame *>(aFrame)->SetKeyId(aKeyId);
|
||||
}
|
||||
void otMacFrameSetKeyId(otRadioFrame *aFrame, uint8_t aKeyId) { static_cast<Mac::Frame *>(aFrame)->SetKeyId(aKeyId); }
|
||||
|
||||
uint32_t otMacFrameGetFrameCounter(otRadioFrame *aFrame)
|
||||
{
|
||||
|
||||
@@ -43,9 +43,6 @@ using namespace ot;
|
||||
#if OPENTHREAD_CONFIG_OTNS_ENABLE
|
||||
|
||||
OT_TOOL_WEAK
|
||||
void otPlatOtnsStatus(const char *aStatus)
|
||||
{
|
||||
LogAlways("[OTNS] %s", aStatus);
|
||||
}
|
||||
void otPlatOtnsStatus(const char *aStatus) { LogAlways("[OTNS] %s", aStatus); }
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_OTNS_ENABLE
|
||||
|
||||
@@ -66,10 +66,7 @@ void otPlatSettingsInit(otInstance *aInstance, const uint16_t *aSensitiveKeys, u
|
||||
sSettingsBufLength = 0;
|
||||
}
|
||||
|
||||
void otPlatSettingsDeinit(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
void otPlatSettingsDeinit(otInstance *aInstance) { OT_UNUSED_VARIABLE(aInstance); }
|
||||
|
||||
otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint8_t *aValue, uint16_t *aValueLength)
|
||||
{
|
||||
@@ -229,9 +226,6 @@ otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex)
|
||||
return error;
|
||||
}
|
||||
|
||||
void otPlatSettingsWipe(otInstance *aInstance)
|
||||
{
|
||||
otPlatSettingsInit(aInstance, NULL, 0);
|
||||
}
|
||||
void otPlatSettingsWipe(otInstance *aInstance) { otPlatSettingsInit(aInstance, NULL, 0); }
|
||||
|
||||
#endif // OPENTHREAD_SETTINGS_RAM
|
||||
|
||||
@@ -46,10 +46,7 @@
|
||||
#if RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM || RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM
|
||||
static uint16_t sPanId = 0;
|
||||
|
||||
void utilsSoftSrcMatchSetPanId(uint16_t aPanId)
|
||||
{
|
||||
sPanId = aPanId;
|
||||
}
|
||||
void utilsSoftSrcMatchSetPanId(uint16_t aPanId) { sPanId = aPanId; }
|
||||
#endif // RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM || RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM
|
||||
|
||||
#if RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM
|
||||
|
||||
+14
-56
@@ -483,10 +483,7 @@ exit:
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_HISTORY_TRACKER_ENABLE
|
||||
template <> otError Interpreter::Process<Cmd("history")>(Arg aArgs[])
|
||||
{
|
||||
return mHistory.Process(aArgs);
|
||||
}
|
||||
template <> otError Interpreter::Process<Cmd("history")>(Arg aArgs[]) { return mHistory.Process(aArgs); }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE
|
||||
@@ -2352,17 +2349,11 @@ template <> otError Interpreter::Process<Cmd("childtimeout")>(Arg aArgs[])
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_API_ENABLE
|
||||
template <> otError Interpreter::Process<Cmd("coap")>(Arg aArgs[])
|
||||
{
|
||||
return mCoap.Process(aArgs);
|
||||
}
|
||||
template <> otError Interpreter::Process<Cmd("coap")>(Arg aArgs[]) { return mCoap.Process(aArgs); }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE
|
||||
template <> otError Interpreter::Process<Cmd("coaps")>(Arg aArgs[])
|
||||
{
|
||||
return mCoapSecure.Process(aArgs);
|
||||
}
|
||||
template <> otError Interpreter::Process<Cmd("coaps")>(Arg aArgs[]) { return mCoapSecure.Process(aArgs); }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE
|
||||
@@ -5079,10 +5070,7 @@ exit:
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
|
||||
|
||||
template <> otError Interpreter::Process<Cmd("netdata")>(Arg aArgs[])
|
||||
{
|
||||
return mNetworkData.Process(aArgs);
|
||||
}
|
||||
template <> otError Interpreter::Process<Cmd("netdata")>(Arg aArgs[]) { return mNetworkData.Process(aArgs); }
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
template <> otError Interpreter::Process<Cmd("networkidtimeout")>(Arg aArgs[])
|
||||
@@ -6358,10 +6346,7 @@ template <> otError Interpreter::Process<Cmd("thread")>(Arg aArgs[])
|
||||
return error;
|
||||
}
|
||||
|
||||
template <> otError Interpreter::Process<Cmd("dataset")>(Arg aArgs[])
|
||||
{
|
||||
return mDataset.Process(aArgs);
|
||||
}
|
||||
template <> otError Interpreter::Process<Cmd("dataset")>(Arg aArgs[]) { return mDataset.Process(aArgs); }
|
||||
|
||||
template <> otError Interpreter::Process<Cmd("txpower")>(Arg aArgs[])
|
||||
{
|
||||
@@ -6384,16 +6369,10 @@ exit:
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_TCP_ENABLE && OPENTHREAD_CONFIG_CLI_TCP_ENABLE
|
||||
template <> otError Interpreter::Process<Cmd("tcp")>(Arg aArgs[])
|
||||
{
|
||||
return mTcp.Process(aArgs);
|
||||
}
|
||||
template <> otError Interpreter::Process<Cmd("tcp")>(Arg aArgs[]) { return mTcp.Process(aArgs); }
|
||||
#endif
|
||||
|
||||
template <> otError Interpreter::Process<Cmd("udp")>(Arg aArgs[])
|
||||
{
|
||||
return mUdp.Process(aArgs);
|
||||
}
|
||||
template <> otError Interpreter::Process<Cmd("udp")>(Arg aArgs[]) { return mUdp.Process(aArgs); }
|
||||
|
||||
template <> otError Interpreter::Process<Cmd("unsecureport")>(Arg aArgs[])
|
||||
{
|
||||
@@ -6465,17 +6444,11 @@ template <> otError Interpreter::Process<Cmd("uptime")>(Arg aArgs[])
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE && OPENTHREAD_FTD
|
||||
template <> otError Interpreter::Process<Cmd("commissioner")>(Arg aArgs[])
|
||||
{
|
||||
return mCommissioner.Process(aArgs);
|
||||
}
|
||||
template <> otError Interpreter::Process<Cmd("commissioner")>(Arg aArgs[]) { return mCommissioner.Process(aArgs); }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_JOINER_ENABLE
|
||||
template <> otError Interpreter::Process<Cmd("joiner")>(Arg aArgs[])
|
||||
{
|
||||
return mJoiner.Process(aArgs);
|
||||
}
|
||||
template <> otError Interpreter::Process<Cmd("joiner")>(Arg aArgs[]) { return mJoiner.Process(aArgs); }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
@@ -7449,10 +7422,7 @@ extern "C" void otCliInit(otInstance *aInstance, otCliOutputCallback aCallback,
|
||||
Interpreter::Initialize(aInstance, aCallback, aContext);
|
||||
}
|
||||
|
||||
extern "C" void otCliInputLine(char *aBuf)
|
||||
{
|
||||
Interpreter::GetInterpreter().ProcessLine(aBuf);
|
||||
}
|
||||
extern "C" void otCliInputLine(char *aBuf) { Interpreter::GetInterpreter().ProcessLine(aBuf); }
|
||||
|
||||
extern "C" void otCliSetUserCommands(const otCliCommand *aUserCommands, uint8_t aLength, void *aContext)
|
||||
{
|
||||
@@ -7472,10 +7442,7 @@ extern "C" void otCliOutputFormat(const char *aFmt, ...)
|
||||
va_end(aAp);
|
||||
}
|
||||
|
||||
extern "C" void otCliAppendResult(otError aError)
|
||||
{
|
||||
Interpreter::GetInterpreter().OutputResult(aError);
|
||||
}
|
||||
extern "C" void otCliAppendResult(otError aError) { Interpreter::GetInterpreter().OutputResult(aError); }
|
||||
|
||||
extern "C" void otCliPlatLogv(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, va_list aArgs)
|
||||
{
|
||||
@@ -7499,18 +7466,9 @@ exit:
|
||||
} // namespace ot
|
||||
|
||||
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
|
||||
OT_TOOL_WEAK void otNcpRegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aHandlers);
|
||||
}
|
||||
OT_TOOL_WEAK void otNcpRegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers) { OT_UNUSED_VARIABLE(aHandlers); }
|
||||
|
||||
OT_TOOL_WEAK void otNcpHandleDidReceiveNewLegacyUlaPrefix(const uint8_t *aUlaPrefix)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aUlaPrefix);
|
||||
}
|
||||
OT_TOOL_WEAK void otNcpHandleDidReceiveNewLegacyUlaPrefix(const uint8_t *aUlaPrefix) { OT_UNUSED_VARIABLE(aUlaPrefix); }
|
||||
|
||||
OT_TOOL_WEAK void otNcpHandleLegacyNodeDidJoin(const otExtAddress *aExtAddr)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aExtAddr);
|
||||
}
|
||||
OT_TOOL_WEAK void otNcpHandleLegacyNodeDidJoin(const otExtAddress *aExtAddr) { OT_UNUSED_VARIABLE(aExtAddr); }
|
||||
#endif
|
||||
|
||||
+7
-28
@@ -153,10 +153,7 @@ public:
|
||||
* @returns Whether the interpreter is initialized.
|
||||
*
|
||||
*/
|
||||
static bool IsInitialized(void)
|
||||
{
|
||||
return sInterpreter != nullptr;
|
||||
}
|
||||
static bool IsInitialized(void) { return sInterpreter != nullptr; }
|
||||
|
||||
/**
|
||||
* This method interprets a CLI command.
|
||||
@@ -582,35 +579,17 @@ private:
|
||||
|
||||
// Specializations of `FormatStringFor<ValueType>()`
|
||||
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<uint8_t>(void)
|
||||
{
|
||||
return "%u";
|
||||
}
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<uint8_t>(void) { return "%u"; }
|
||||
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<uint16_t>(void)
|
||||
{
|
||||
return "%u";
|
||||
}
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<uint16_t>(void) { return "%u"; }
|
||||
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<uint32_t>(void)
|
||||
{
|
||||
return "%lu";
|
||||
}
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<uint32_t>(void) { return "%lu"; }
|
||||
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<int8_t>(void)
|
||||
{
|
||||
return "%d";
|
||||
}
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<int8_t>(void) { return "%d"; }
|
||||
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<int16_t>(void)
|
||||
{
|
||||
return "%d";
|
||||
}
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<int16_t>(void) { return "%d"; }
|
||||
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<int32_t>(void)
|
||||
{
|
||||
return "%ld";
|
||||
}
|
||||
template <> inline constexpr const char *Interpreter::FormatStringFor<int32_t>(void) { return "%ld"; }
|
||||
|
||||
// Specialization of ProcessGet<> for `uint32_t` and `int32_t`
|
||||
|
||||
|
||||
+4
-16
@@ -328,25 +328,13 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
template <> otError Coap::Process<Cmd("get")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRequest(aArgs, OT_COAP_CODE_GET);
|
||||
}
|
||||
template <> otError Coap::Process<Cmd("get")>(Arg aArgs[]) { return ProcessRequest(aArgs, OT_COAP_CODE_GET); }
|
||||
|
||||
template <> otError Coap::Process<Cmd("post")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRequest(aArgs, OT_COAP_CODE_POST);
|
||||
}
|
||||
template <> otError Coap::Process<Cmd("post")>(Arg aArgs[]) { return ProcessRequest(aArgs, OT_COAP_CODE_POST); }
|
||||
|
||||
template <> otError Coap::Process<Cmd("put")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRequest(aArgs, OT_COAP_CODE_PUT);
|
||||
}
|
||||
template <> otError Coap::Process<Cmd("put")>(Arg aArgs[]) { return ProcessRequest(aArgs, OT_COAP_CODE_PUT); }
|
||||
|
||||
template <> otError Coap::Process<Cmd("delete")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRequest(aArgs, OT_COAP_CODE_DELETE);
|
||||
}
|
||||
template <> otError Coap::Process<Cmd("delete")>(Arg aArgs[]) { return ProcessRequest(aArgs, OT_COAP_CODE_DELETE); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE
|
||||
template <> otError Coap::Process<Cmd("observe")>(Arg aArgs[])
|
||||
|
||||
@@ -200,20 +200,11 @@ template <> otError CoapSecure::Process<Cmd("stop")>(Arg aArgs[])
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
template <> otError CoapSecure::Process<Cmd("get")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRequest(aArgs, OT_COAP_CODE_GET);
|
||||
}
|
||||
template <> otError CoapSecure::Process<Cmd("get")>(Arg aArgs[]) { return ProcessRequest(aArgs, OT_COAP_CODE_GET); }
|
||||
|
||||
template <> otError CoapSecure::Process<Cmd("post")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRequest(aArgs, OT_COAP_CODE_POST);
|
||||
}
|
||||
template <> otError CoapSecure::Process<Cmd("post")>(Arg aArgs[]) { return ProcessRequest(aArgs, OT_COAP_CODE_POST); }
|
||||
|
||||
template <> otError CoapSecure::Process<Cmd("put")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRequest(aArgs, OT_COAP_CODE_PUT);
|
||||
}
|
||||
template <> otError CoapSecure::Process<Cmd("put")>(Arg aArgs[]) { return ProcessRequest(aArgs, OT_COAP_CODE_PUT); }
|
||||
|
||||
template <> otError CoapSecure::Process<Cmd("delete")>(Arg aArgs[])
|
||||
{
|
||||
|
||||
+3
-12
@@ -299,20 +299,11 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
template <> otError History::Process<Cmd("rx")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRxTxHistory(kRx, aArgs);
|
||||
}
|
||||
template <> otError History::Process<Cmd("rx")>(Arg aArgs[]) { return ProcessRxTxHistory(kRx, aArgs); }
|
||||
|
||||
template <> otError History::Process<Cmd("rxtx")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRxTxHistory(kRxTx, aArgs);
|
||||
}
|
||||
template <> otError History::Process<Cmd("rxtx")>(Arg aArgs[]) { return ProcessRxTxHistory(kRxTx, aArgs); }
|
||||
|
||||
template <> otError History::Process<Cmd("tx")>(Arg aArgs[])
|
||||
{
|
||||
return ProcessRxTxHistory(kTx, aArgs);
|
||||
}
|
||||
template <> otError History::Process<Cmd("tx")>(Arg aArgs[]) { return ProcessRxTxHistory(kTx, aArgs); }
|
||||
|
||||
const char *History::MessagePriorityToString(uint8_t aPriority)
|
||||
{
|
||||
|
||||
@@ -261,10 +261,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
void Joiner::HandleCallback(otError aError, void *aContext)
|
||||
{
|
||||
static_cast<Joiner *>(aContext)->HandleCallback(aError);
|
||||
}
|
||||
void Joiner::HandleCallback(otError aError, void *aContext) { static_cast<Joiner *>(aContext)->HandleCallback(aError); }
|
||||
|
||||
void Joiner::HandleCallback(otError aError)
|
||||
{
|
||||
|
||||
+4
-16
@@ -104,15 +104,9 @@ void Output::OutputLine(uint8_t aIndentSize, const char *aFormat, ...)
|
||||
OutputNewLine();
|
||||
}
|
||||
|
||||
void Output::OutputNewLine(void)
|
||||
{
|
||||
OutputFormat("\r\n");
|
||||
}
|
||||
void Output::OutputNewLine(void) { OutputFormat("\r\n"); }
|
||||
|
||||
void Output::OutputSpaces(uint8_t aCount)
|
||||
{
|
||||
OutputFormat("%*s", aCount, "");
|
||||
}
|
||||
void Output::OutputSpaces(uint8_t aCount) { OutputFormat("%*s", aCount, ""); }
|
||||
|
||||
void Output::OutputBytes(const uint8_t *aBytes, uint16_t aLength)
|
||||
{
|
||||
@@ -162,10 +156,7 @@ void Output::OutputUint64Line(uint64_t aUint64)
|
||||
OutputNewLine();
|
||||
}
|
||||
|
||||
void Output::OutputEnabledDisabledStatus(bool aEnabled)
|
||||
{
|
||||
OutputLine(aEnabled ? "Enabled" : "Disabled");
|
||||
}
|
||||
void Output::OutputEnabledDisabledStatus(bool aEnabled) { OutputLine(aEnabled ? "Enabled" : "Disabled"); }
|
||||
|
||||
#if OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
|
||||
@@ -272,10 +263,7 @@ void Output::OutputDnsTxtData(const uint8_t *aTxtData, uint16_t aTxtDataLength)
|
||||
}
|
||||
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
|
||||
void Output::OutputFormatV(const char *aFormat, va_list aArguments)
|
||||
{
|
||||
mImplementer.OutputV(aFormat, aArguments);
|
||||
}
|
||||
void Output::OutputFormatV(const char *aFormat, va_list aArguments) { mImplementer.OutputV(aFormat, aArguments); }
|
||||
|
||||
void OutputImplementer::OutputV(const char *aFormat, va_list aArguments)
|
||||
{
|
||||
|
||||
+3
-10
@@ -90,14 +90,9 @@ public:
|
||||
OutputImplementer(otCliOutputCallback aCallback, void *aCallbackContext);
|
||||
|
||||
#if OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_ENABLE
|
||||
void SetEmittingCommandOutput(bool aEmittingOutput)
|
||||
{
|
||||
mEmittingCommandOutput = aEmittingOutput;
|
||||
}
|
||||
void SetEmittingCommandOutput(bool aEmittingOutput) { mEmittingCommandOutput = aEmittingOutput; }
|
||||
#else
|
||||
void SetEmittingCommandOutput(bool)
|
||||
{
|
||||
}
|
||||
void SetEmittingCommandOutput(bool) {}
|
||||
#endif
|
||||
|
||||
private:
|
||||
@@ -512,9 +507,7 @@ protected:
|
||||
#if OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_ENABLE
|
||||
void LogInput(const Arg *aArgs);
|
||||
#else
|
||||
void LogInput(const Arg *)
|
||||
{
|
||||
}
|
||||
void LogInput(const Arg *) {}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
@@ -129,10 +129,7 @@ otError otCoapMessageAppendUriQueryOption(otMessage *aMessage, const char *aUriQ
|
||||
return AsCoapMessage(aMessage).AppendUriQueryOption(aUriQuery);
|
||||
}
|
||||
|
||||
otError otCoapMessageSetPayloadMarker(otMessage *aMessage)
|
||||
{
|
||||
return AsCoapMessage(aMessage).SetPayloadMarker();
|
||||
}
|
||||
otError otCoapMessageSetPayloadMarker(otMessage *aMessage) { return AsCoapMessage(aMessage).SetPayloadMarker(); }
|
||||
|
||||
otCoapType otCoapMessageGetType(const otMessage *aMessage)
|
||||
{
|
||||
@@ -144,30 +141,15 @@ otCoapCode otCoapMessageGetCode(const otMessage *aMessage)
|
||||
return static_cast<otCoapCode>(AsCoapMessage(aMessage).GetCode());
|
||||
}
|
||||
|
||||
void otCoapMessageSetCode(otMessage *aMessage, otCoapCode aCode)
|
||||
{
|
||||
AsCoapMessage(aMessage).SetCode(MapEnum(aCode));
|
||||
}
|
||||
void otCoapMessageSetCode(otMessage *aMessage, otCoapCode aCode) { AsCoapMessage(aMessage).SetCode(MapEnum(aCode)); }
|
||||
|
||||
const char *otCoapMessageCodeToString(const otMessage *aMessage)
|
||||
{
|
||||
return AsCoapMessage(aMessage).CodeToString();
|
||||
}
|
||||
const char *otCoapMessageCodeToString(const otMessage *aMessage) { return AsCoapMessage(aMessage).CodeToString(); }
|
||||
|
||||
uint16_t otCoapMessageGetMessageId(const otMessage *aMessage)
|
||||
{
|
||||
return AsCoapMessage(aMessage).GetMessageId();
|
||||
}
|
||||
uint16_t otCoapMessageGetMessageId(const otMessage *aMessage) { return AsCoapMessage(aMessage).GetMessageId(); }
|
||||
|
||||
uint8_t otCoapMessageGetTokenLength(const otMessage *aMessage)
|
||||
{
|
||||
return AsCoapMessage(aMessage).GetTokenLength();
|
||||
}
|
||||
uint8_t otCoapMessageGetTokenLength(const otMessage *aMessage) { return AsCoapMessage(aMessage).GetTokenLength(); }
|
||||
|
||||
const uint8_t *otCoapMessageGetToken(const otMessage *aMessage)
|
||||
{
|
||||
return AsCoapMessage(aMessage).GetToken();
|
||||
}
|
||||
const uint8_t *otCoapMessageGetToken(const otMessage *aMessage) { return AsCoapMessage(aMessage).GetToken(); }
|
||||
|
||||
otError otCoapOptionIteratorInit(otCoapOptionIterator *aIterator, const otMessage *aMessage)
|
||||
{
|
||||
@@ -271,10 +253,7 @@ otError otCoapStart(otInstance *aInstance, uint16_t aPort)
|
||||
return AsCoreType(aInstance).GetApplicationCoap().Start(aPort);
|
||||
}
|
||||
|
||||
otError otCoapStop(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).GetApplicationCoap().Stop();
|
||||
}
|
||||
otError otCoapStop(otInstance *aInstance) { return AsCoreType(aInstance).GetApplicationCoap().Stop(); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE
|
||||
void otCoapAddBlockWiseResource(otInstance *aInstance, otCoapBlockwiseResource *aResource)
|
||||
|
||||
@@ -110,10 +110,7 @@ otError otCoapSecureConnect(otInstance *aInstance,
|
||||
return AsCoreType(aInstance).GetApplicationCoapSecure().Connect(AsCoreType(aSockAddr), aHandler, aContext);
|
||||
}
|
||||
|
||||
void otCoapSecureDisconnect(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).GetApplicationCoapSecure().Disconnect();
|
||||
}
|
||||
void otCoapSecureDisconnect(otInstance *aInstance) { AsCoreType(aInstance).GetApplicationCoapSecure().Disconnect(); }
|
||||
|
||||
bool otCoapSecureIsConnected(otInstance *aInstance)
|
||||
{
|
||||
@@ -125,10 +122,7 @@ bool otCoapSecureIsConnectionActive(otInstance *aInstance)
|
||||
return AsCoreType(aInstance).GetApplicationCoapSecure().IsConnectionActive();
|
||||
}
|
||||
|
||||
void otCoapSecureStop(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).GetApplicationCoapSecure().Stop();
|
||||
}
|
||||
void otCoapSecureStop(otInstance *aInstance) { AsCoreType(aInstance).GetApplicationCoapSecure().Stop(); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE
|
||||
otError otCoapSecureSendRequestBlockWise(otInstance *aInstance,
|
||||
|
||||
@@ -60,10 +60,7 @@ otError otCommissionerSetId(otInstance *aInstance, const char *aId)
|
||||
return AsCoreType(aInstance).Get<MeshCoP::Commissioner>().SetId(aId);
|
||||
}
|
||||
|
||||
otError otCommissionerStop(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<MeshCoP::Commissioner>().Stop();
|
||||
}
|
||||
otError otCommissionerStop(otInstance *aInstance) { return AsCoreType(aInstance).Get<MeshCoP::Commissioner>().Stop(); }
|
||||
|
||||
otError otCommissionerAddJoiner(otInstance *aInstance, const otExtAddress *aEui64, const char *aPskd, uint32_t aTimeout)
|
||||
{
|
||||
|
||||
@@ -54,9 +54,6 @@ otError otDiagProcessCmd(otInstance *aInstance, uint8_t aArgsLength, char *aArgs
|
||||
return AsCoreType(aInstance).Get<FactoryDiags::Diags>().ProcessCmd(aArgsLength, aArgs, aOutput, aOutputMaxLen);
|
||||
}
|
||||
|
||||
bool otDiagIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<FactoryDiags::Diags>().IsEnabled();
|
||||
}
|
||||
bool otDiagIsEnabled(otInstance *aInstance) { return AsCoreType(aInstance).Get<FactoryDiags::Diags>().IsEnabled(); }
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -51,15 +51,9 @@ otError otDnsGetNextTxtEntry(otDnsTxtEntryIterator *aIterator, otDnsTxtEntry *aE
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
|
||||
void otDnsSetNameCompressionEnabled(bool aEnabled)
|
||||
{
|
||||
Instance::SetDnsNameCompressionEnabled(aEnabled);
|
||||
}
|
||||
void otDnsSetNameCompressionEnabled(bool aEnabled) { Instance::SetDnsNameCompressionEnabled(aEnabled); }
|
||||
|
||||
bool otDnsIsNameCompressionEnabled(void)
|
||||
{
|
||||
return Instance::IsDnsNameCompressionEnabled();
|
||||
}
|
||||
bool otDnsIsNameCompressionEnabled(void) { return Instance::IsDnsNameCompressionEnabled(); }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
|
||||
|
||||
@@ -37,7 +37,4 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
const char *otThreadErrorToString(otError aError)
|
||||
{
|
||||
return ErrorToString(aError);
|
||||
}
|
||||
const char *otThreadErrorToString(otError aError) { return ErrorToString(aError); }
|
||||
|
||||
@@ -60,13 +60,7 @@ void otHeapFree(void *aPointer)
|
||||
}
|
||||
|
||||
#else // OPENTHREAD_RADIO
|
||||
void *otHeapCAlloc(size_t aCount, size_t aSize)
|
||||
{
|
||||
return ot::Heap::CAlloc(aCount, aSize);
|
||||
}
|
||||
void *otHeapCAlloc(size_t aCount, size_t aSize) { return ot::Heap::CAlloc(aCount, aSize); }
|
||||
|
||||
void otHeapFree(void *aPointer)
|
||||
{
|
||||
ot::Heap::Free(aPointer);
|
||||
}
|
||||
void otHeapFree(void *aPointer) { ot::Heap::Free(aPointer); }
|
||||
#endif // OPENTHREAD_RADIO
|
||||
|
||||
@@ -43,10 +43,7 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
void otHistoryTrackerInitIterator(otHistoryTrackerIterator *aIterator)
|
||||
{
|
||||
AsCoreType(aIterator).Init();
|
||||
}
|
||||
void otHistoryTrackerInitIterator(otHistoryTrackerIterator *aIterator) { AsCoreType(aIterator).Init(); }
|
||||
|
||||
const otHistoryTrackerNetworkInfo *otHistoryTrackerIterateNetInfoHistory(otInstance *aInstance,
|
||||
otHistoryTrackerIterator *aIterator,
|
||||
|
||||
@@ -67,10 +67,7 @@ otInstance *otInstanceInit(void *aInstanceBuffer, size_t *aInstanceBufferSize)
|
||||
return instance;
|
||||
}
|
||||
#else
|
||||
otInstance *otInstanceInitSingle(void)
|
||||
{
|
||||
return &Instance::InitSingle();
|
||||
}
|
||||
otInstance *otInstanceInitSingle(void) { return &Instance::InitSingle(); }
|
||||
#endif // #if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
|
||||
bool otInstanceIsInitialized(otInstance *aInstance)
|
||||
@@ -83,21 +80,12 @@ bool otInstanceIsInitialized(otInstance *aInstance)
|
||||
#endif // OPENTHREAD_MTD || OPENTHREAD_FTD
|
||||
}
|
||||
|
||||
void otInstanceFinalize(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Finalize();
|
||||
}
|
||||
void otInstanceFinalize(otInstance *aInstance) { AsCoreType(aInstance).Finalize(); }
|
||||
|
||||
void otInstanceReset(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Reset();
|
||||
}
|
||||
void otInstanceReset(otInstance *aInstance) { AsCoreType(aInstance).Reset(); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_UPTIME_ENABLE
|
||||
uint64_t otInstanceGetUptime(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Uptime>().GetUptime();
|
||||
}
|
||||
uint64_t otInstanceGetUptime(otInstance *aInstance) { return AsCoreType(aInstance).Get<Uptime>().GetUptime(); }
|
||||
|
||||
void otInstanceGetUptimeAsString(otInstance *aInstance, char *aBuffer, uint16_t aSize)
|
||||
{
|
||||
@@ -118,22 +106,13 @@ void otRemoveStateChangeCallback(otInstance *aInstance, otStateChangedCallback a
|
||||
AsCoreType(aInstance).Get<Notifier>().RemoveCallback(aCallback, aContext);
|
||||
}
|
||||
|
||||
void otInstanceFactoryReset(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).FactoryReset();
|
||||
}
|
||||
void otInstanceFactoryReset(otInstance *aInstance) { AsCoreType(aInstance).FactoryReset(); }
|
||||
|
||||
otError otInstanceErasePersistentInfo(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).ErasePersistentInfo();
|
||||
}
|
||||
otError otInstanceErasePersistentInfo(otInstance *aInstance) { return AsCoreType(aInstance).ErasePersistentInfo(); }
|
||||
#endif // OPENTHREAD_MTD || OPENTHREAD_FTD
|
||||
|
||||
#if OPENTHREAD_RADIO
|
||||
void otInstanceResetRadioStack(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).ResetRadioStack();
|
||||
}
|
||||
void otInstanceResetRadioStack(otInstance *aInstance) { AsCoreType(aInstance).ResetRadioStack(); }
|
||||
#endif
|
||||
|
||||
const char *otGetVersionString(void)
|
||||
|
||||
@@ -68,10 +68,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
bool otIp6IsEnabled(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<ThreadNetif>().IsUp();
|
||||
}
|
||||
bool otIp6IsEnabled(otInstance *aInstance) { return AsCoreType(aInstance).Get<ThreadNetif>().IsUp(); }
|
||||
|
||||
const otNetifAddress *otIp6GetUnicastAddresses(otInstance *aInstance)
|
||||
{
|
||||
@@ -222,10 +219,7 @@ void otIp6GetPrefix(const otIp6Address *aAddress, uint8_t aLength, otIp6Prefix *
|
||||
AsCoreType(aAddress).GetPrefix(aLength, AsCoreType(aPrefix));
|
||||
}
|
||||
|
||||
bool otIp6IsAddressUnspecified(const otIp6Address *aAddress)
|
||||
{
|
||||
return AsCoreType(aAddress).IsUnspecified();
|
||||
}
|
||||
bool otIp6IsAddressUnspecified(const otIp6Address *aAddress) { return AsCoreType(aAddress).IsUnspecified(); }
|
||||
|
||||
otError otIp6SelectSourceAddress(otInstance *aInstance, otMessageInfo *aMessageInfo)
|
||||
{
|
||||
@@ -255,10 +249,7 @@ otError otIp6RegisterMulticastListeners(otInstance *
|
||||
|
||||
#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
|
||||
|
||||
bool otIp6IsSlaacEnabled(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Utils::Slaac>().IsEnabled();
|
||||
}
|
||||
bool otIp6IsSlaacEnabled(otInstance *aInstance) { return AsCoreType(aInstance).Get<Utils::Slaac>().IsEnabled(); }
|
||||
|
||||
void otIp6SetSlaacEnabled(otInstance *aInstance, bool aEnabled)
|
||||
{
|
||||
@@ -290,10 +281,7 @@ otError otIp6SetMeshLocalIid(otInstance *aInstance, const otIp6InterfaceIdentifi
|
||||
|
||||
#endif
|
||||
|
||||
const char *otIp6ProtoToString(uint8_t aIpProto)
|
||||
{
|
||||
return Ip6::Ip6::IpProtoToString(aIpProto);
|
||||
}
|
||||
const char *otIp6ProtoToString(uint8_t aIpProto) { return Ip6::Ip6::IpProtoToString(aIpProto); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE
|
||||
const otBorderRoutingCounters *otIp6GetBorderRoutingCounters(otInstance *aInstance)
|
||||
|
||||
@@ -79,10 +79,7 @@ otError otJamDetectionStart(otInstance *aInstance, otJamDetectionCallback aCallb
|
||||
return AsCoreType(aInstance).Get<Utils::JamDetector>().Start(aCallback, aContext);
|
||||
}
|
||||
|
||||
otError otJamDetectionStop(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Utils::JamDetector>().Stop();
|
||||
}
|
||||
otError otJamDetectionStop(otInstance *aInstance) { return AsCoreType(aInstance).Get<Utils::JamDetector>().Stop(); }
|
||||
|
||||
bool otJamDetectionIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
|
||||
@@ -57,10 +57,7 @@ otError otJoinerStart(otInstance *aInstance,
|
||||
aVendorSwVersion, aVendorData, aCallback, aContext);
|
||||
}
|
||||
|
||||
void otJoinerStop(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Get<MeshCoP::Joiner>().Stop();
|
||||
}
|
||||
void otJoinerStop(otInstance *aInstance) { AsCoreType(aInstance).Get<MeshCoP::Joiner>().Stop(); }
|
||||
|
||||
otJoinerState otJoinerGetState(otInstance *aInstance)
|
||||
{
|
||||
|
||||
@@ -127,10 +127,7 @@ void otLinkGetFactoryAssignedIeeeEui64(otInstance *aInstance, otExtAddress *aEui
|
||||
AsCoreType(aInstance).Get<Radio>().GetIeeeEui64(AsCoreType(aEui64));
|
||||
}
|
||||
|
||||
otPanId otLinkGetPanId(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::Mac>().GetPanId();
|
||||
}
|
||||
otPanId otLinkGetPanId(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::Mac>().GetPanId(); }
|
||||
|
||||
otError otLinkSetPanId(otInstance *aInstance, otPanId aPanId)
|
||||
{
|
||||
@@ -246,10 +243,7 @@ void otLinkFilterClearDefaultRssIn(otInstance *aInstance)
|
||||
AsCoreType(aInstance).Get<Mac::Filter>().ClearDefaultRssIn();
|
||||
}
|
||||
|
||||
void otLinkFilterClearAllRssIn(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Get<Mac::Filter>().ClearAllRssIn();
|
||||
}
|
||||
void otLinkFilterClearAllRssIn(otInstance *aInstance) { AsCoreType(aInstance).Get<Mac::Filter>().ClearAllRssIn(); }
|
||||
|
||||
otError otLinkFilterGetNextRssIn(otInstance *aInstance, otMacFilterIterator *aIterator, otMacFilterEntry *aEntry)
|
||||
{
|
||||
@@ -319,10 +313,7 @@ void otLinkSetPcapCallback(otInstance *aInstance, otLinkPcapCallback aPcapCallba
|
||||
AsCoreType(aInstance).Get<Mac::Mac>().SetPcapCallback(aPcapCallback, aCallbackContext);
|
||||
}
|
||||
|
||||
bool otLinkIsPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::Mac>().IsPromiscuous();
|
||||
}
|
||||
bool otLinkIsPromiscuous(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::Mac>().IsPromiscuous(); }
|
||||
|
||||
otError otLinkSetPromiscuous(otInstance *aInstance, bool aPromiscuous)
|
||||
{
|
||||
@@ -352,20 +343,14 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
bool otLinkIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::Mac>().IsEnabled();
|
||||
}
|
||||
bool otLinkIsEnabled(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::Mac>().IsEnabled(); }
|
||||
|
||||
const otMacCounters *otLinkGetCounters(otInstance *aInstance)
|
||||
{
|
||||
return &AsCoreType(aInstance).Get<Mac::Mac>().GetCounters();
|
||||
}
|
||||
|
||||
void otLinkResetCounters(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Get<Mac::Mac>().ResetCounters();
|
||||
}
|
||||
void otLinkResetCounters(otInstance *aInstance) { AsCoreType(aInstance).Get<Mac::Mac>().ResetCounters(); }
|
||||
|
||||
otError otLinkActiveScan(otInstance *aInstance,
|
||||
uint32_t aScanChannels,
|
||||
@@ -406,10 +391,7 @@ uint16_t otLinkGetCcaFailureRate(otInstance *aInstance)
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
uint8_t otLinkCslGetChannel(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::Mac>().GetCslChannel();
|
||||
}
|
||||
uint8_t otLinkCslGetChannel(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::Mac>().GetCslChannel(); }
|
||||
|
||||
otError otLinkCslSetChannel(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
@@ -423,10 +405,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
uint16_t otLinkCslGetPeriod(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::Mac>().GetCslPeriod();
|
||||
}
|
||||
uint16_t otLinkCslGetPeriod(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::Mac>().GetCslPeriod(); }
|
||||
|
||||
otError otLinkCslSetPeriod(otInstance *aInstance, uint16_t aPeriod)
|
||||
{
|
||||
|
||||
@@ -54,20 +54,14 @@ otError otLinkRawSetReceiveDone(otInstance *aInstance, otLinkRawReceiveDone aCal
|
||||
return AsCoreType(aInstance).Get<Mac::LinkRaw>().SetReceiveDone(aCallback);
|
||||
}
|
||||
|
||||
bool otLinkRawIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::LinkRaw>().IsEnabled();
|
||||
}
|
||||
bool otLinkRawIsEnabled(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::LinkRaw>().IsEnabled(); }
|
||||
|
||||
otError otLinkRawSetShortAddress(otInstance *aInstance, uint16_t aShortAddress)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::LinkRaw>().SetShortAddress(aShortAddress);
|
||||
}
|
||||
|
||||
bool otLinkRawGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Radio>().GetPromiscuous();
|
||||
}
|
||||
bool otLinkRawGetPromiscuous(otInstance *aInstance) { return AsCoreType(aInstance).Get<Radio>().GetPromiscuous(); }
|
||||
|
||||
otError otLinkRawSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
@@ -94,10 +88,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
otError otLinkRawReceive(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::LinkRaw>().Receive();
|
||||
}
|
||||
otError otLinkRawReceive(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::LinkRaw>().Receive(); }
|
||||
|
||||
otRadioFrame *otLinkRawGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
@@ -109,15 +100,9 @@ otError otLinkRawTransmit(otInstance *aInstance, otLinkRawTransmitDone aCallback
|
||||
return AsCoreType(aInstance).Get<Mac::LinkRaw>().Transmit(aCallback);
|
||||
}
|
||||
|
||||
int8_t otLinkRawGetRssi(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Radio>().GetRssi();
|
||||
}
|
||||
int8_t otLinkRawGetRssi(otInstance *aInstance) { return AsCoreType(aInstance).Get<Radio>().GetRssi(); }
|
||||
|
||||
otRadioCaps otLinkRawGetCaps(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::LinkRaw>().GetCaps();
|
||||
}
|
||||
otRadioCaps otLinkRawGetCaps(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::LinkRaw>().GetCaps(); }
|
||||
|
||||
otError otLinkRawEnergyScan(otInstance *aInstance,
|
||||
uint8_t aScanChannel,
|
||||
@@ -255,20 +240,14 @@ otDeviceRole otThreadGetDeviceRole(otInstance *aInstance)
|
||||
return OT_DEVICE_ROLE_DISABLED;
|
||||
}
|
||||
|
||||
uint8_t otLinkGetChannel(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::LinkRaw>().GetChannel();
|
||||
}
|
||||
uint8_t otLinkGetChannel(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::LinkRaw>().GetChannel(); }
|
||||
|
||||
otError otLinkSetChannel(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::LinkRaw>().SetChannel(aChannel);
|
||||
}
|
||||
|
||||
otPanId otLinkGetPanId(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mac::LinkRaw>().GetPanId();
|
||||
}
|
||||
otPanId otLinkGetPanId(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mac::LinkRaw>().GetPanId(); }
|
||||
|
||||
otError otLinkSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
{
|
||||
|
||||
@@ -41,10 +41,7 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
otLogLevel otLoggingGetLevel(void)
|
||||
{
|
||||
return static_cast<otLogLevel>(Instance::GetLogLevel());
|
||||
}
|
||||
otLogLevel otLoggingGetLevel(void) { return static_cast<otLogLevel>(Instance::GetLogLevel()); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE
|
||||
otError otLoggingSetLevel(otLogLevel aLogLevel)
|
||||
|
||||
@@ -40,35 +40,17 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
void otMessageFree(otMessage *aMessage)
|
||||
{
|
||||
AsCoreType(aMessage).Free();
|
||||
}
|
||||
void otMessageFree(otMessage *aMessage) { AsCoreType(aMessage).Free(); }
|
||||
|
||||
uint16_t otMessageGetLength(const otMessage *aMessage)
|
||||
{
|
||||
return AsCoreType(aMessage).GetLength();
|
||||
}
|
||||
uint16_t otMessageGetLength(const otMessage *aMessage) { return AsCoreType(aMessage).GetLength(); }
|
||||
|
||||
otError otMessageSetLength(otMessage *aMessage, uint16_t aLength)
|
||||
{
|
||||
return AsCoreType(aMessage).SetLength(aLength);
|
||||
}
|
||||
otError otMessageSetLength(otMessage *aMessage, uint16_t aLength) { return AsCoreType(aMessage).SetLength(aLength); }
|
||||
|
||||
uint16_t otMessageGetOffset(const otMessage *aMessage)
|
||||
{
|
||||
return AsCoreType(aMessage).GetOffset();
|
||||
}
|
||||
uint16_t otMessageGetOffset(const otMessage *aMessage) { return AsCoreType(aMessage).GetOffset(); }
|
||||
|
||||
void otMessageSetOffset(otMessage *aMessage, uint16_t aOffset)
|
||||
{
|
||||
AsCoreType(aMessage).SetOffset(aOffset);
|
||||
}
|
||||
void otMessageSetOffset(otMessage *aMessage, uint16_t aOffset) { AsCoreType(aMessage).SetOffset(aOffset); }
|
||||
|
||||
bool otMessageIsLinkSecurityEnabled(const otMessage *aMessage)
|
||||
{
|
||||
return AsCoreType(aMessage).IsLinkSecurityEnabled();
|
||||
}
|
||||
bool otMessageIsLinkSecurityEnabled(const otMessage *aMessage) { return AsCoreType(aMessage).IsLinkSecurityEnabled(); }
|
||||
|
||||
void otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled)
|
||||
{
|
||||
@@ -82,10 +64,7 @@ void otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
int8_t otMessageGetRss(const otMessage *aMessage)
|
||||
{
|
||||
return AsCoreType(aMessage).GetAverageRss();
|
||||
}
|
||||
int8_t otMessageGetRss(const otMessage *aMessage) { return AsCoreType(aMessage).GetAverageRss(); }
|
||||
|
||||
otError otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength)
|
||||
{
|
||||
@@ -132,10 +111,7 @@ void otMessageQueueDequeue(otMessageQueue *aQueue, otMessage *aMessage)
|
||||
AsCoreType(aQueue).Dequeue(AsCoreType(aMessage));
|
||||
}
|
||||
|
||||
otMessage *otMessageQueueGetHead(otMessageQueue *aQueue)
|
||||
{
|
||||
return AsCoreType(aQueue).GetHead();
|
||||
}
|
||||
otMessage *otMessageQueueGetHead(otMessageQueue *aQueue) { return AsCoreType(aQueue).GetHead(); }
|
||||
|
||||
otMessage *otMessageQueueGetNext(otMessageQueue *aQueue, const otMessage *aMessage)
|
||||
{
|
||||
|
||||
@@ -47,9 +47,6 @@ otError otPingSenderPing(otInstance *aInstance, const otPingSenderConfig *aConfi
|
||||
return AsCoreType(aInstance).Get<Utils::PingSender>().Ping(AsCoreType(aConfig));
|
||||
}
|
||||
|
||||
void otPingSenderStop(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Get<Utils::PingSender>().Stop();
|
||||
}
|
||||
void otPingSenderStop(otInstance *aInstance) { AsCoreType(aInstance).Get<Utils::PingSender>().Stop(); }
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_PING_SENDER_ENABLE
|
||||
|
||||
@@ -37,20 +37,11 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
uint32_t otRandomNonCryptoGetUint32(void)
|
||||
{
|
||||
return Random::NonCrypto::GetUint32();
|
||||
}
|
||||
uint32_t otRandomNonCryptoGetUint32(void) { return Random::NonCrypto::GetUint32(); }
|
||||
|
||||
uint8_t otRandomNonCryptoGetUint8(void)
|
||||
{
|
||||
return Random::NonCrypto::GetUint8();
|
||||
}
|
||||
uint8_t otRandomNonCryptoGetUint8(void) { return Random::NonCrypto::GetUint8(); }
|
||||
|
||||
uint16_t otRandomNonCryptoGetUint16(void)
|
||||
{
|
||||
return Random::NonCrypto::GetUint16();
|
||||
}
|
||||
uint16_t otRandomNonCryptoGetUint16(void) { return Random::NonCrypto::GetUint16(); }
|
||||
|
||||
uint8_t otRandomNonCryptoGetUint8InRange(uint8_t aMin, uint8_t aMax)
|
||||
{
|
||||
@@ -67,10 +58,7 @@ uint32_t otRandomNonCryptoGetUint32InRange(uint32_t aMin, uint32_t aMax)
|
||||
return Random::NonCrypto::GetUint32InRange(aMin, aMax);
|
||||
}
|
||||
|
||||
void otRandomNonCryptoFillBuffer(uint8_t *aBuffer, uint16_t aSize)
|
||||
{
|
||||
Random::NonCrypto::FillBuffer(aBuffer, aSize);
|
||||
}
|
||||
void otRandomNonCryptoFillBuffer(uint8_t *aBuffer, uint16_t aSize) { Random::NonCrypto::FillBuffer(aBuffer, aSize); }
|
||||
|
||||
uint32_t otRandomNonCryptoAddJitter(uint32_t aValue, uint16_t aJitter)
|
||||
{
|
||||
|
||||
@@ -47,15 +47,9 @@ otError otSrpClientStart(otInstance *aInstance, const otSockAddr *aServerSockAdd
|
||||
return AsCoreType(aInstance).Get<Srp::Client>().Start(AsCoreType(aServerSockAddr));
|
||||
}
|
||||
|
||||
void otSrpClientStop(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Srp::Client>().Stop();
|
||||
}
|
||||
void otSrpClientStop(otInstance *aInstance) { return AsCoreType(aInstance).Get<Srp::Client>().Stop(); }
|
||||
|
||||
bool otSrpClientIsRunning(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Srp::Client>().IsRunning();
|
||||
}
|
||||
bool otSrpClientIsRunning(otInstance *aInstance) { return AsCoreType(aInstance).Get<Srp::Client>().IsRunning(); }
|
||||
|
||||
const otSockAddr *otSrpClientGetServerAddress(otInstance *aInstance)
|
||||
{
|
||||
@@ -84,10 +78,7 @@ bool otSrpClientIsAutoStartModeEnabled(otInstance *aInstance)
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_API_ENABLE
|
||||
|
||||
uint32_t otSrpClientGetTtl(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Srp::Client>().GetTtl();
|
||||
}
|
||||
uint32_t otSrpClientGetTtl(otInstance *aInstance) { return AsCoreType(aInstance).Get<Srp::Client>().GetTtl(); }
|
||||
|
||||
void otSrpClientSetTtl(otInstance *aInstance, uint32_t aTtl)
|
||||
{
|
||||
|
||||
@@ -42,10 +42,7 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
const char *otSrpServerGetDomain(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Srp::Server>().GetDomain();
|
||||
}
|
||||
const char *otSrpServerGetDomain(otInstance *aInstance) { return AsCoreType(aInstance).Get<Srp::Server>().GetDomain(); }
|
||||
|
||||
otError otSrpServerSetDomain(otInstance *aInstance, const char *aDomain)
|
||||
{
|
||||
@@ -57,10 +54,7 @@ otSrpServerState otSrpServerGetState(otInstance *aInstance)
|
||||
return MapEnum(AsCoreType(aInstance).Get<Srp::Server>().GetState());
|
||||
}
|
||||
|
||||
uint16_t otSrpServerGetPort(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Srp::Server>().GetPort();
|
||||
}
|
||||
uint16_t otSrpServerGetPort(otInstance *aInstance) { return AsCoreType(aInstance).Get<Srp::Server>().GetPort(); }
|
||||
|
||||
otSrpServerAddressMode otSrpServerGetAddressMode(otInstance *aInstance)
|
||||
{
|
||||
@@ -141,15 +135,9 @@ const otSrpServerResponseCounters *otSrpServerGetResponseCounters(otInstance *aI
|
||||
return AsCoreType(aInstance).Get<Srp::Server>().GetResponseCounters();
|
||||
}
|
||||
|
||||
bool otSrpServerHostIsDeleted(const otSrpServerHost *aHost)
|
||||
{
|
||||
return AsCoreType(aHost).IsDeleted();
|
||||
}
|
||||
bool otSrpServerHostIsDeleted(const otSrpServerHost *aHost) { return AsCoreType(aHost).IsDeleted(); }
|
||||
|
||||
const char *otSrpServerHostGetFullName(const otSrpServerHost *aHost)
|
||||
{
|
||||
return AsCoreType(aHost).GetFullName();
|
||||
}
|
||||
const char *otSrpServerHostGetFullName(const otSrpServerHost *aHost) { return AsCoreType(aHost).GetFullName(); }
|
||||
|
||||
const otIp6Address *otSrpServerHostGetAddresses(const otSrpServerHost *aHost, uint8_t *aAddressesNum)
|
||||
{
|
||||
@@ -161,10 +149,7 @@ void otSrpServerHostGetLeaseInfo(const otSrpServerHost *aHost, otSrpServerLeaseI
|
||||
AsCoreType(aHost).GetLeaseInfo(*aLeaseInfo);
|
||||
}
|
||||
|
||||
uint32_t otSrpServerHostGetKeyLease(const otSrpServerHost *aHost)
|
||||
{
|
||||
return AsCoreType(aHost).GetKeyLease();
|
||||
}
|
||||
uint32_t otSrpServerHostGetKeyLease(const otSrpServerHost *aHost) { return AsCoreType(aHost).GetKeyLease(); }
|
||||
|
||||
const otSrpServerService *otSrpServerHostGetNextService(const otSrpServerHost *aHost,
|
||||
const otSrpServerService *aService)
|
||||
@@ -181,15 +166,9 @@ const otSrpServerService *otSrpServerHostFindNextService(const otSrpServerHost
|
||||
return AsCoreType(aHost).FindNextService(AsCoreTypePtr(aPrevService), aFlags, aServiceName, aInstanceName);
|
||||
}
|
||||
|
||||
bool otSrpServerServiceIsDeleted(const otSrpServerService *aService)
|
||||
{
|
||||
return AsCoreType(aService).IsDeleted();
|
||||
}
|
||||
bool otSrpServerServiceIsDeleted(const otSrpServerService *aService) { return AsCoreType(aService).IsDeleted(); }
|
||||
|
||||
bool otSrpServerServiceIsSubType(const otSrpServerService *aService)
|
||||
{
|
||||
return AsCoreType(aService).IsSubType();
|
||||
}
|
||||
bool otSrpServerServiceIsSubType(const otSrpServerService *aService) { return AsCoreType(aService).IsSubType(); }
|
||||
|
||||
const char *otSrpServerServiceGetFullName(const otSrpServerService *aService)
|
||||
{
|
||||
@@ -211,25 +190,16 @@ otError otSrpServerServiceGetServiceSubTypeLabel(const otSrpServerService *aServ
|
||||
return AsCoreType(aService).GetServiceSubTypeLabel(aLabel, aMaxSize);
|
||||
}
|
||||
|
||||
uint16_t otSrpServerServiceGetPort(const otSrpServerService *aService)
|
||||
{
|
||||
return AsCoreType(aService).GetPort();
|
||||
}
|
||||
uint16_t otSrpServerServiceGetPort(const otSrpServerService *aService) { return AsCoreType(aService).GetPort(); }
|
||||
|
||||
uint16_t otSrpServerServiceGetWeight(const otSrpServerService *aService)
|
||||
{
|
||||
return AsCoreType(aService).GetWeight();
|
||||
}
|
||||
uint16_t otSrpServerServiceGetWeight(const otSrpServerService *aService) { return AsCoreType(aService).GetWeight(); }
|
||||
|
||||
uint16_t otSrpServerServiceGetPriority(const otSrpServerService *aService)
|
||||
{
|
||||
return AsCoreType(aService).GetPriority();
|
||||
}
|
||||
|
||||
uint32_t otSrpServerServiceGetTtl(const otSrpServerService *aService)
|
||||
{
|
||||
return AsCoreType(aService).GetTtl();
|
||||
}
|
||||
uint32_t otSrpServerServiceGetTtl(const otSrpServerService *aService) { return AsCoreType(aService).GetTtl(); }
|
||||
|
||||
const uint8_t *otSrpServerServiceGetTxtData(const otSrpServerService *aService, uint16_t *aDataLength)
|
||||
{
|
||||
|
||||
@@ -60,6 +60,4 @@ exit:
|
||||
return retval;
|
||||
}
|
||||
|
||||
OT_TOOL_WEAK void otTaskletsSignalPending(otInstance *)
|
||||
{
|
||||
}
|
||||
OT_TOOL_WEAK void otTaskletsSignalPending(otInstance *) {}
|
||||
|
||||
+10
-40
@@ -49,15 +49,9 @@ otError otTcpEndpointInitialize(otInstance *aInstance,
|
||||
return AsCoreType(aEndpoint).Initialize(AsCoreType(aInstance), *aArgs);
|
||||
}
|
||||
|
||||
otInstance *otTcpEndpointGetInstance(otTcpEndpoint *aEndpoint)
|
||||
{
|
||||
return &AsCoreType(aEndpoint).GetInstance();
|
||||
}
|
||||
otInstance *otTcpEndpointGetInstance(otTcpEndpoint *aEndpoint) { return &AsCoreType(aEndpoint).GetInstance(); }
|
||||
|
||||
void *otTcpEndpointGetContext(otTcpEndpoint *aEndpoint)
|
||||
{
|
||||
return AsCoreType(aEndpoint).GetContext();
|
||||
}
|
||||
void *otTcpEndpointGetContext(otTcpEndpoint *aEndpoint) { return AsCoreType(aEndpoint).GetContext(); }
|
||||
|
||||
const otSockAddr *otTcpGetLocalAddress(const otTcpEndpoint *aEndpoint)
|
||||
{
|
||||
@@ -94,30 +88,18 @@ otError otTcpReceiveByReference(otTcpEndpoint *aEndpoint, const otLinkedBuffer *
|
||||
return AsCoreType(aEndpoint).ReceiveByReference(*aBuffer);
|
||||
}
|
||||
|
||||
otError otTcpReceiveContiguify(otTcpEndpoint *aEndpoint)
|
||||
{
|
||||
return AsCoreType(aEndpoint).ReceiveContiguify();
|
||||
}
|
||||
otError otTcpReceiveContiguify(otTcpEndpoint *aEndpoint) { return AsCoreType(aEndpoint).ReceiveContiguify(); }
|
||||
|
||||
otError otTcpCommitReceive(otTcpEndpoint *aEndpoint, size_t aNumBytes, uint32_t aFlags)
|
||||
{
|
||||
return AsCoreType(aEndpoint).CommitReceive(aNumBytes, aFlags);
|
||||
}
|
||||
|
||||
otError otTcpSendEndOfStream(otTcpEndpoint *aEndpoint)
|
||||
{
|
||||
return AsCoreType(aEndpoint).SendEndOfStream();
|
||||
}
|
||||
otError otTcpSendEndOfStream(otTcpEndpoint *aEndpoint) { return AsCoreType(aEndpoint).SendEndOfStream(); }
|
||||
|
||||
otError otTcpAbort(otTcpEndpoint *aEndpoint)
|
||||
{
|
||||
return AsCoreType(aEndpoint).Abort();
|
||||
}
|
||||
otError otTcpAbort(otTcpEndpoint *aEndpoint) { return AsCoreType(aEndpoint).Abort(); }
|
||||
|
||||
otError otTcpEndpointDeinitialize(otTcpEndpoint *aEndpoint)
|
||||
{
|
||||
return AsCoreType(aEndpoint).Deinitialize();
|
||||
}
|
||||
otError otTcpEndpointDeinitialize(otTcpEndpoint *aEndpoint) { return AsCoreType(aEndpoint).Deinitialize(); }
|
||||
|
||||
otError otTcpListenerInitialize(otInstance *aInstance,
|
||||
otTcpListener *aListener,
|
||||
@@ -126,29 +108,17 @@ otError otTcpListenerInitialize(otInstance *aInstance,
|
||||
return AsCoreType(aListener).Initialize(AsCoreType(aInstance), *aArgs);
|
||||
}
|
||||
|
||||
otInstance *otTcpListenerGetInstance(otTcpListener *aListener)
|
||||
{
|
||||
return &AsCoreType(aListener).GetInstance();
|
||||
}
|
||||
otInstance *otTcpListenerGetInstance(otTcpListener *aListener) { return &AsCoreType(aListener).GetInstance(); }
|
||||
|
||||
void *otTcpListenerGetContext(otTcpListener *aListener)
|
||||
{
|
||||
return AsCoreType(aListener).GetContext();
|
||||
}
|
||||
void *otTcpListenerGetContext(otTcpListener *aListener) { return AsCoreType(aListener).GetContext(); }
|
||||
|
||||
otError otTcpListen(otTcpListener *aListener, const otSockAddr *aSockName)
|
||||
{
|
||||
return AsCoreType(aListener).Listen(AsCoreType(aSockName));
|
||||
}
|
||||
|
||||
otError otTcpStopListening(otTcpListener *aListener)
|
||||
{
|
||||
return AsCoreType(aListener).StopListening();
|
||||
}
|
||||
otError otTcpStopListening(otTcpListener *aListener) { return AsCoreType(aListener).StopListening(); }
|
||||
|
||||
otError otTcpListenerDeinitialize(otTcpListener *aListener)
|
||||
{
|
||||
return AsCoreType(aListener).Deinitialize();
|
||||
}
|
||||
otError otTcpListenerDeinitialize(otTcpListener *aListener) { return AsCoreType(aListener).Deinitialize(); }
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_TCP_ENABLE
|
||||
|
||||
@@ -292,10 +292,7 @@ otError otThreadBecomeDetached(otInstance *aInstance)
|
||||
return AsCoreType(aInstance).Get<Mle::MleRouter>().BecomeDetached();
|
||||
}
|
||||
|
||||
otError otThreadBecomeChild(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mle::MleRouter>().BecomeChild();
|
||||
}
|
||||
otError otThreadBecomeChild(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mle::MleRouter>().BecomeChild(); }
|
||||
|
||||
otError otThreadGetNextNeighborInfo(otInstance *aInstance, otNeighborInfoIterator *aIterator, otNeighborInfo *aInfo)
|
||||
{
|
||||
@@ -309,10 +306,7 @@ otDeviceRole otThreadGetDeviceRole(otInstance *aInstance)
|
||||
return MapEnum(AsCoreType(aInstance).Get<Mle::MleRouter>().GetRole());
|
||||
}
|
||||
|
||||
const char *otThreadDeviceRoleToString(otDeviceRole aRole)
|
||||
{
|
||||
return Mle::RoleToString(MapEnum(aRole));
|
||||
}
|
||||
const char *otThreadDeviceRoleToString(otDeviceRole aRole) { return Mle::RoleToString(MapEnum(aRole)); }
|
||||
|
||||
otError otThreadGetLeaderData(otInstance *aInstance, otLeaderData *aLeaderData)
|
||||
{
|
||||
@@ -342,10 +336,7 @@ uint32_t otThreadGetPartitionId(otInstance *aInstance)
|
||||
return AsCoreType(aInstance).Get<Mle::MleRouter>().GetLeaderData().GetPartitionId();
|
||||
}
|
||||
|
||||
uint16_t otThreadGetRloc16(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mle::MleRouter>().GetRloc16();
|
||||
}
|
||||
uint16_t otThreadGetRloc16(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mle::MleRouter>().GetRloc16(); }
|
||||
|
||||
otError otThreadGetParentInfo(otInstance *aInstance, otRouterInfo *aParentInfo)
|
||||
{
|
||||
@@ -401,15 +392,9 @@ otError otThreadSetEnabled(otInstance *aInstance, bool aEnabled)
|
||||
return error;
|
||||
}
|
||||
|
||||
uint16_t otThreadGetVersion(void)
|
||||
{
|
||||
return kThreadVersion;
|
||||
}
|
||||
uint16_t otThreadGetVersion(void) { return kThreadVersion; }
|
||||
|
||||
bool otThreadIsSingleton(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Mle::MleRouter>().IsSingleton();
|
||||
}
|
||||
bool otThreadIsSingleton(otInstance *aInstance) { return AsCoreType(aInstance).Get<Mle::MleRouter>().IsSingleton(); }
|
||||
|
||||
otError otThreadDiscover(otInstance *aInstance,
|
||||
uint32_t aScanChannels,
|
||||
@@ -442,20 +427,14 @@ const otIpCounters *otThreadGetIp6Counters(otInstance *aInstance)
|
||||
return &AsCoreType(aInstance).Get<MeshForwarder>().GetCounters();
|
||||
}
|
||||
|
||||
void otThreadResetIp6Counters(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Get<MeshForwarder>().ResetCounters();
|
||||
}
|
||||
void otThreadResetIp6Counters(otInstance *aInstance) { AsCoreType(aInstance).Get<MeshForwarder>().ResetCounters(); }
|
||||
|
||||
const otMleCounters *otThreadGetMleCounters(otInstance *aInstance)
|
||||
{
|
||||
return &AsCoreType(aInstance).Get<Mle::MleRouter>().GetCounters();
|
||||
}
|
||||
|
||||
void otThreadResetMleCounters(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Get<Mle::MleRouter>().ResetCounters();
|
||||
}
|
||||
void otThreadResetMleCounters(otInstance *aInstance) { AsCoreType(aInstance).Get<Mle::MleRouter>().ResetCounters(); }
|
||||
|
||||
void otThreadRegisterParentResponseCallback(otInstance *aInstance,
|
||||
otThreadParentResponseCallback aCallback,
|
||||
|
||||
@@ -277,10 +277,7 @@ void otThreadGetPskc(otInstance *aInstance, otPskc *aPskc)
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
|
||||
otPskcRef otThreadGetPskcRef(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<KeyManager>().GetPskcRef();
|
||||
}
|
||||
otPskcRef otThreadGetPskcRef(otInstance *aInstance) { return AsCoreType(aInstance).Get<KeyManager>().GetPskcRef(); }
|
||||
#endif
|
||||
|
||||
otError otThreadSetPskc(otInstance *aInstance, const otPskc *aPskc)
|
||||
|
||||
@@ -43,20 +43,11 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
void otTrelEnable(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Get<Trel::Interface>().Enable();
|
||||
}
|
||||
void otTrelEnable(otInstance *aInstance) { AsCoreType(aInstance).Get<Trel::Interface>().Enable(); }
|
||||
|
||||
void otTrelDisable(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Get<Trel::Interface>().Disable();
|
||||
}
|
||||
void otTrelDisable(otInstance *aInstance) { AsCoreType(aInstance).Get<Trel::Interface>().Disable(); }
|
||||
|
||||
bool otTrelIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Trel::Interface>().IsEnabled();
|
||||
}
|
||||
bool otTrelIsEnabled(otInstance *aInstance) { return AsCoreType(aInstance).Get<Trel::Interface>().IsEnabled(); }
|
||||
|
||||
void otTrelInitPeerIterator(otInstance *aInstance, otTrelPeerIterator *aIterator)
|
||||
{
|
||||
|
||||
@@ -76,10 +76,7 @@ otError otUdpSend(otInstance *aInstance, otUdpSocket *aSocket, otMessage *aMessa
|
||||
AsCoreType(aMessageInfo));
|
||||
}
|
||||
|
||||
otUdpSocket *otUdpGetSockets(otInstance *aInstance)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<Ip6::Udp>().GetUdpSockets();
|
||||
}
|
||||
otUdpSocket *otUdpGetSockets(otInstance *aInstance) { return AsCoreType(aInstance).Get<Ip6::Udp>().GetUdpSockets(); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE
|
||||
void otUdpForwardSetForwarder(otInstance *aInstance, otUdpForwarder aForwarder, void *aContext)
|
||||
|
||||
@@ -182,12 +182,8 @@ private:
|
||||
static const char *StateToString(State aState);
|
||||
static const char *DomainPrefixStateToString(DomainPrefixState aState);
|
||||
#else
|
||||
void LogBackboneRouterPrimary(State, const BackboneRouterConfig &) const
|
||||
{
|
||||
}
|
||||
void LogDomainPrefix(DomainPrefixState, const Ip6::Prefix &) const
|
||||
{
|
||||
}
|
||||
void LogBackboneRouterPrimary(State, const BackboneRouterConfig &) const {}
|
||||
void LogDomainPrefix(DomainPrefixState, const Ip6::Prefix &) const {}
|
||||
#endif
|
||||
|
||||
BackboneRouterConfig mConfig; ///< Primary Backbone Router information.
|
||||
|
||||
@@ -265,12 +265,8 @@ private:
|
||||
void LogBackboneRouterService(const char *aAction, Error aError);
|
||||
void LogDomainPrefix(const char *aAction, Error aError);
|
||||
#else
|
||||
void LogBackboneRouterService(const char *, Error)
|
||||
{
|
||||
}
|
||||
void LogDomainPrefix(const char *, Error)
|
||||
{
|
||||
}
|
||||
void LogBackboneRouterService(const char *, Error) {}
|
||||
void LogDomainPrefix(const char *, Error) {}
|
||||
#endif
|
||||
|
||||
BackboneRouterState mState;
|
||||
|
||||
@@ -492,10 +492,7 @@ void Manager::ConfigNextMulticastListenerRegistrationResponse(ThreadStatusTlv::M
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_DUA_NDPROXYING_ENABLE
|
||||
NdProxyTable &Manager::GetNdProxyTable(void)
|
||||
{
|
||||
return mNdProxyTable;
|
||||
}
|
||||
NdProxyTable &Manager::GetNdProxyTable(void) { return mNdProxyTable; }
|
||||
|
||||
bool Manager::ShouldForwardDuaToBackbone(const Ip6::Address &aAddress)
|
||||
{
|
||||
|
||||
@@ -119,10 +119,7 @@ public:
|
||||
* @returns The Multicast Listeners Table.
|
||||
*
|
||||
*/
|
||||
MulticastListenersTable &GetMulticastListenersTable(void)
|
||||
{
|
||||
return mMulticastListenersTable;
|
||||
}
|
||||
MulticastListenersTable &GetMulticastListenersTable(void) { return mMulticastListenersTable; }
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -143,10 +140,7 @@ public:
|
||||
* @returns A reference to the Backbone TMF agent.
|
||||
*
|
||||
*/
|
||||
BackboneTmfAgent &GetBackboneTmfAgent(void)
|
||||
{
|
||||
return mBackboneTmfAgent;
|
||||
}
|
||||
BackboneTmfAgent &GetBackboneTmfAgent(void) { return mBackboneTmfAgent; }
|
||||
|
||||
/**
|
||||
* This method sends BB.qry on the Backbone link.
|
||||
|
||||
@@ -123,10 +123,7 @@ void NdProxyTable::Iterator::Advance(void)
|
||||
} while (mItem < GetArrayEnd(table.mProxies) && !MatchesFilter(*mItem, mFilter));
|
||||
}
|
||||
|
||||
void NdProxyTable::Erase(NdProxy &aNdProxy)
|
||||
{
|
||||
aNdProxy.mValid = false;
|
||||
}
|
||||
void NdProxyTable::Erase(NdProxy &aNdProxy) { aNdProxy.mValid = false; }
|
||||
|
||||
void NdProxyTable::HandleDomainPrefixUpdate(Leader::DomainPrefixState aState)
|
||||
{
|
||||
|
||||
@@ -1633,10 +1633,7 @@ exit:
|
||||
return shouldPublish;
|
||||
}
|
||||
|
||||
void RoutingManager::DiscoveredPrefixTable::HandleEntryTimer(void)
|
||||
{
|
||||
RemoveExpiredEntries();
|
||||
}
|
||||
void RoutingManager::DiscoveredPrefixTable::HandleEntryTimer(void) { RemoveExpiredEntries(); }
|
||||
|
||||
void RoutingManager::DiscoveredPrefixTable::RemoveExpiredEntries(void)
|
||||
{
|
||||
@@ -1682,10 +1679,7 @@ void RoutingManager::DiscoveredPrefixTable::RemoveExpiredEntries(void)
|
||||
}
|
||||
}
|
||||
|
||||
void RoutingManager::DiscoveredPrefixTable::SignalTableChanged(void)
|
||||
{
|
||||
mSignalTask.Post();
|
||||
}
|
||||
void RoutingManager::DiscoveredPrefixTable::SignalTableChanged(void) { mSignalTask.Post(); }
|
||||
|
||||
void RoutingManager::DiscoveredPrefixTable::ProcessNeighborAdvertMessage(
|
||||
const Ip6::Nd::NeighborAdvertMessage &aNaMessage,
|
||||
@@ -2890,10 +2884,7 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void RoutingManager::RsSender::Stop(void)
|
||||
{
|
||||
mTimer.Stop();
|
||||
}
|
||||
void RoutingManager::RsSender::Stop(void) { mTimer.Stop(); }
|
||||
|
||||
Error RoutingManager::RsSender::SendRs(void)
|
||||
{
|
||||
|
||||
@@ -230,10 +230,7 @@ public:
|
||||
* @retval kStateActive The Border router is publishing a NAT64 prefix.
|
||||
*
|
||||
*/
|
||||
Nat64::State GetNat64PrefixManagerState(void) const
|
||||
{
|
||||
return mNat64PrefixManager.GetState();
|
||||
}
|
||||
Nat64::State GetNat64PrefixManagerState(void) const { return mNat64PrefixManager.GetState(); }
|
||||
|
||||
/**
|
||||
* Enable or disable NAT64 orefix publishing.
|
||||
@@ -275,10 +272,7 @@ public:
|
||||
* @param[in] aPrefix The discovered NAT64 prefix on `InfraIf`.
|
||||
*
|
||||
*/
|
||||
void HandleDiscoverNat64PrefixDone(const Ip6::Prefix &aPrefix)
|
||||
{
|
||||
mNat64PrefixManager.HandleDiscoverDone(aPrefix);
|
||||
}
|
||||
void HandleDiscoverNat64PrefixDone(const Ip6::Prefix &aPrefix) { mNat64PrefixManager.HandleDiscoverDone(aPrefix); }
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
|
||||
|
||||
@@ -297,10 +291,7 @@ public:
|
||||
* This method handles infrastructure interface state changes.
|
||||
*
|
||||
*/
|
||||
void HandleInfraIfStateChanged(void)
|
||||
{
|
||||
EvaluateState();
|
||||
}
|
||||
void HandleInfraIfStateChanged(void) { EvaluateState(); }
|
||||
|
||||
/**
|
||||
* This method checks whether the on-mesh prefix configuration is a valid OMR prefix.
|
||||
@@ -372,10 +363,7 @@ public:
|
||||
* @retval FALSE The RoutingManager is not running.
|
||||
*
|
||||
*/
|
||||
bool IsRunning(void) const
|
||||
{
|
||||
return mIsRunning;
|
||||
}
|
||||
bool IsRunning(void) const { return mIsRunning; }
|
||||
|
||||
private:
|
||||
static constexpr uint8_t kMaxOnMeshPrefixes = OPENTHREAD_CONFIG_BORDER_ROUTING_MAX_ON_MESH_PREFIXES;
|
||||
@@ -433,14 +421,8 @@ private:
|
||||
};
|
||||
|
||||
void HandleDiscoveredPrefixTableChanged(void); // Declare early so we can use in `mSignalTask`
|
||||
void HandleDiscoveredPrefixTableEntryTimer(void)
|
||||
{
|
||||
mDiscoveredPrefixTable.HandleEntryTimer();
|
||||
}
|
||||
void HandleDiscoveredPrefixTableRouterTimer(void)
|
||||
{
|
||||
mDiscoveredPrefixTable.HandleRouterTimer();
|
||||
}
|
||||
void HandleDiscoveredPrefixTableEntryTimer(void) { mDiscoveredPrefixTable.HandleEntryTimer(); }
|
||||
void HandleDiscoveredPrefixTableRouterTimer(void) { mDiscoveredPrefixTable.HandleRouterTimer(); }
|
||||
|
||||
class DiscoveredPrefixTable : public InstanceLocator
|
||||
{
|
||||
@@ -674,10 +656,7 @@ private:
|
||||
bool mIsAddedInNetData;
|
||||
};
|
||||
|
||||
void HandleOnLinkPrefixManagerTimer(void)
|
||||
{
|
||||
mOnLinkPrefixManager.HandleTimer();
|
||||
}
|
||||
void HandleOnLinkPrefixManagerTimer(void) { mOnLinkPrefixManager.HandleTimer(); }
|
||||
|
||||
class OnLinkPrefixManager : public InstanceLocator
|
||||
{
|
||||
@@ -748,10 +727,7 @@ private:
|
||||
};
|
||||
|
||||
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
|
||||
void HandleNat64PrefixManagerTimer(void)
|
||||
{
|
||||
mNat64PrefixManager.HandleTimer();
|
||||
}
|
||||
void HandleNat64PrefixManagerTimer(void) { mNat64PrefixManager.HandleTimer(); }
|
||||
|
||||
class Nat64PrefixManager : public InstanceLocator
|
||||
{
|
||||
@@ -820,10 +796,7 @@ private:
|
||||
TimeMilli mLastTxTime;
|
||||
};
|
||||
|
||||
void HandleRsSenderTimer(void)
|
||||
{
|
||||
mRsSender.HandleTimer();
|
||||
}
|
||||
void HandleRsSenderTimer(void) { mRsSender.HandleTimer(); }
|
||||
|
||||
class RsSender : public InstanceLocator
|
||||
{
|
||||
@@ -859,18 +832,12 @@ private:
|
||||
TimeMilli mStartTime;
|
||||
};
|
||||
|
||||
void EvaluateState(void);
|
||||
void Start(void);
|
||||
void Stop(void);
|
||||
void HandleNotifierEvents(Events aEvents);
|
||||
bool IsInitialized(void) const
|
||||
{
|
||||
return mInfraIf.IsInitialized();
|
||||
}
|
||||
bool IsEnabled(void) const
|
||||
{
|
||||
return mIsEnabled;
|
||||
}
|
||||
void EvaluateState(void);
|
||||
void Start(void);
|
||||
void Stop(void);
|
||||
void HandleNotifierEvents(Events aEvents);
|
||||
bool IsInitialized(void) const { return mInfraIf.IsInitialized(); }
|
||||
bool IsEnabled(void) const { return mIsEnabled; }
|
||||
Error LoadOrGenerateRandomBrUlaPrefix(void);
|
||||
|
||||
void EvaluateRoutingPolicy(void);
|
||||
|
||||
+8
-32
@@ -73,10 +73,7 @@ void CoapBase::ClearRequestsAndResponses(void)
|
||||
mResponsesQueue.DequeueAllResponses();
|
||||
}
|
||||
|
||||
void CoapBase::ClearRequests(const Ip6::Address &aAddress)
|
||||
{
|
||||
ClearRequests(&aAddress);
|
||||
}
|
||||
void CoapBase::ClearRequests(const Ip6::Address &aAddress) { ClearRequests(&aAddress); }
|
||||
|
||||
void CoapBase::ClearRequests(const Ip6::Address *aAddress)
|
||||
{
|
||||
@@ -94,10 +91,7 @@ void CoapBase::ClearRequests(const Ip6::Address *aAddress)
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE
|
||||
void CoapBase::AddBlockWiseResource(ResourceBlockWise &aResource)
|
||||
{
|
||||
IgnoreError(mBlockWiseResources.Add(aResource));
|
||||
}
|
||||
void CoapBase::AddBlockWiseResource(ResourceBlockWise &aResource) { IgnoreError(mBlockWiseResources.Add(aResource)); }
|
||||
|
||||
void CoapBase::RemoveBlockWiseResource(ResourceBlockWise &aResource)
|
||||
{
|
||||
@@ -106,10 +100,7 @@ void CoapBase::RemoveBlockWiseResource(ResourceBlockWise &aResource)
|
||||
}
|
||||
#endif
|
||||
|
||||
void CoapBase::AddResource(Resource &aResource)
|
||||
{
|
||||
IgnoreError(mResources.Add(aResource));
|
||||
}
|
||||
void CoapBase::AddResource(Resource &aResource) { IgnoreError(mResources.Add(aResource)); }
|
||||
|
||||
void CoapBase::RemoveResource(Resource &aResource)
|
||||
{
|
||||
@@ -145,10 +136,7 @@ Message *CoapBase::NewPriorityConfirmablePostMessage(Uri aUri)
|
||||
return InitMessage(NewPriorityMessage(), kTypeConfirmable, aUri);
|
||||
}
|
||||
|
||||
Message *CoapBase::NewConfirmablePostMessage(Uri aUri)
|
||||
{
|
||||
return InitMessage(NewMessage(), kTypeConfirmable, aUri);
|
||||
}
|
||||
Message *CoapBase::NewConfirmablePostMessage(Uri aUri) { return InitMessage(NewMessage(), kTypeConfirmable, aUri); }
|
||||
|
||||
Message *CoapBase::NewPriorityNonConfirmablePostMessage(Uri aUri)
|
||||
{
|
||||
@@ -165,10 +153,7 @@ Message *CoapBase::NewPriorityResponseMessage(const Message &aRequest)
|
||||
return InitResponse(NewPriorityMessage(), aRequest);
|
||||
}
|
||||
|
||||
Message *CoapBase::NewResponseMessage(const Message &aRequest)
|
||||
{
|
||||
return InitResponse(NewMessage(), aRequest);
|
||||
}
|
||||
Message *CoapBase::NewResponseMessage(const Message &aRequest) { return InitResponse(NewMessage(), aRequest); }
|
||||
|
||||
Message *CoapBase::InitMessage(Message *aMessage, Type aType, Uri aUri)
|
||||
{
|
||||
@@ -1589,15 +1574,9 @@ void ResponsesQueue::UpdateQueue(void)
|
||||
}
|
||||
}
|
||||
|
||||
void ResponsesQueue::DequeueResponse(Message &aMessage)
|
||||
{
|
||||
mQueue.DequeueAndFree(aMessage);
|
||||
}
|
||||
void ResponsesQueue::DequeueResponse(Message &aMessage) { mQueue.DequeueAndFree(aMessage); }
|
||||
|
||||
void ResponsesQueue::DequeueAllResponses(void)
|
||||
{
|
||||
mQueue.DequeueAndFreeAll();
|
||||
}
|
||||
void ResponsesQueue::DequeueAllResponses(void) { mQueue.DequeueAndFreeAll(); }
|
||||
|
||||
void ResponsesQueue::HandleTimer(Timer &aTimer)
|
||||
{
|
||||
@@ -1686,10 +1665,7 @@ uint32_t TxParameters::CalculateExchangeLifetime(void) const
|
||||
return CalculateSpan(mMaxRetransmit) + 2 * kDefaultMaxLatency + mAckTimeout;
|
||||
}
|
||||
|
||||
uint32_t TxParameters::CalculateMaxTransmitWait(void) const
|
||||
{
|
||||
return CalculateSpan(mMaxRetransmit + 1);
|
||||
}
|
||||
uint32_t TxParameters::CalculateMaxTransmitWait(void) const { return CalculateSpan(mMaxRetransmit + 1); }
|
||||
|
||||
uint32_t TxParameters::CalculateSpan(uint8_t aMaxRetx) const
|
||||
{
|
||||
|
||||
+3
-12
@@ -737,10 +737,7 @@ public:
|
||||
* @returns A reference to the request message list.
|
||||
*
|
||||
*/
|
||||
const MessageQueue &GetRequestMessages(void) const
|
||||
{
|
||||
return mPendingRequests;
|
||||
}
|
||||
const MessageQueue &GetRequestMessages(void) const { return mPendingRequests; }
|
||||
|
||||
/**
|
||||
* This method returns a reference to the cached response list.
|
||||
@@ -748,10 +745,7 @@ public:
|
||||
* @returns A reference to the cached response list.
|
||||
*
|
||||
*/
|
||||
const MessageQueue &GetCachedResponses(void) const
|
||||
{
|
||||
return mResponsesQueue.GetResponses();
|
||||
}
|
||||
const MessageQueue &GetCachedResponses(void) const { return mResponsesQueue.GetResponses(); }
|
||||
|
||||
protected:
|
||||
/**
|
||||
@@ -812,10 +806,7 @@ protected:
|
||||
* @param[in] aResourceHandler The resource handler function pointer.
|
||||
*
|
||||
*/
|
||||
void SetResourceHandler(ResourceHandler aHandler)
|
||||
{
|
||||
mResourceHandler = aHandler;
|
||||
}
|
||||
void SetResourceHandler(ResourceHandler aHandler) { mResourceHandler = aHandler; }
|
||||
|
||||
private:
|
||||
struct Metadata
|
||||
|
||||
@@ -84,15 +84,9 @@ Error Message::InitAsPost(const Ip6::Address &aDestination, Uri aUri)
|
||||
return Init(aDestination.IsMulticast() ? kTypeNonConfirmable : kTypeConfirmable, kCodePost, aUri);
|
||||
}
|
||||
|
||||
bool Message::IsConfirmablePostRequest(void) const
|
||||
{
|
||||
return IsConfirmable() && IsPostRequest();
|
||||
}
|
||||
bool Message::IsConfirmablePostRequest(void) const { return IsConfirmable() && IsPostRequest(); }
|
||||
|
||||
bool Message::IsNonConfirmablePostRequest(void) const
|
||||
{
|
||||
return IsNonConfirmable() && IsPostRequest();
|
||||
}
|
||||
bool Message::IsNonConfirmablePostRequest(void) const { return IsNonConfirmable() && IsPostRequest(); }
|
||||
|
||||
void Message::Finish(void)
|
||||
{
|
||||
@@ -456,15 +450,9 @@ const char *Message::CodeToString(void) const
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_COAP_API_ENABLE
|
||||
|
||||
Message::Iterator MessageQueue::begin(void)
|
||||
{
|
||||
return Message::Iterator(GetHead());
|
||||
}
|
||||
Message::Iterator MessageQueue::begin(void) { return Message::Iterator(GetHead()); }
|
||||
|
||||
Message::ConstIterator MessageQueue::begin(void) const
|
||||
{
|
||||
return Message::ConstIterator(GetHead());
|
||||
}
|
||||
Message::ConstIterator MessageQueue::begin(void) const { return Message::ConstIterator(GetHead()); }
|
||||
|
||||
Error Option::Iterator::Init(const Message &aMessage)
|
||||
{
|
||||
|
||||
+34
-136
@@ -315,10 +315,7 @@ public:
|
||||
* @returns The Message ID value.
|
||||
*
|
||||
*/
|
||||
uint16_t GetMessageId(void) const
|
||||
{
|
||||
return HostSwap16(GetHelpData().mHeader.mMessageId);
|
||||
}
|
||||
uint16_t GetMessageId(void) const { return HostSwap16(GetHelpData().mHeader.mMessageId); }
|
||||
|
||||
/**
|
||||
* This method sets the Message ID value.
|
||||
@@ -326,10 +323,7 @@ public:
|
||||
* @param[in] aMessageId The Message ID value.
|
||||
*
|
||||
*/
|
||||
void SetMessageId(uint16_t aMessageId)
|
||||
{
|
||||
GetHelpData().mHeader.mMessageId = HostSwap16(aMessageId);
|
||||
}
|
||||
void SetMessageId(uint16_t aMessageId) { GetHelpData().mHeader.mMessageId = HostSwap16(aMessageId); }
|
||||
|
||||
/**
|
||||
* This method returns the Token length.
|
||||
@@ -348,10 +342,7 @@ public:
|
||||
* @returns A pointer to the Token value.
|
||||
*
|
||||
*/
|
||||
const uint8_t *GetToken(void) const
|
||||
{
|
||||
return GetHelpData().mHeader.mToken;
|
||||
}
|
||||
const uint8_t *GetToken(void) const { return GetHelpData().mHeader.mToken; }
|
||||
|
||||
/**
|
||||
* This method sets the Token value and length.
|
||||
@@ -447,10 +438,7 @@ public:
|
||||
* @retval kErrorInvalidArgs The option type is not equal or greater than the last option type.
|
||||
* @retval kErrorNoBufs The option length exceeds the buffer size.
|
||||
*/
|
||||
Error AppendObserveOption(uint32_t aObserve)
|
||||
{
|
||||
return AppendUintOption(kOptionObserve, aObserve & kObserveMask);
|
||||
}
|
||||
Error AppendObserveOption(uint32_t aObserve) { return AppendUintOption(kOptionObserve, aObserve & kObserveMask); }
|
||||
|
||||
/**
|
||||
* This method appends a Uri-Path option.
|
||||
@@ -501,10 +489,7 @@ public:
|
||||
* @retval kErrorNoBufs The option length exceeds the buffer size.
|
||||
*
|
||||
*/
|
||||
Error AppendProxyUriOption(const char *aProxyUri)
|
||||
{
|
||||
return AppendStringOption(kOptionProxyUri, aProxyUri);
|
||||
}
|
||||
Error AppendProxyUriOption(const char *aProxyUri) { return AppendStringOption(kOptionProxyUri, aProxyUri); }
|
||||
|
||||
/**
|
||||
* This method appends a Content-Format option.
|
||||
@@ -530,10 +515,7 @@ public:
|
||||
* @retval kErrorInvalidArgs The option type is not equal or greater than the last option type.
|
||||
* @retval kErrorNoBufs The option length exceeds the buffer size.
|
||||
*/
|
||||
Error AppendMaxAgeOption(uint32_t aMaxAge)
|
||||
{
|
||||
return AppendUintOption(kOptionMaxAge, aMaxAge);
|
||||
}
|
||||
Error AppendMaxAgeOption(uint32_t aMaxAge) { return AppendUintOption(kOptionMaxAge, aMaxAge); }
|
||||
|
||||
/**
|
||||
* This method appends a single Uri-Query option.
|
||||
@@ -544,10 +526,7 @@ public:
|
||||
* @retval kErrorInvalidArgs The option type is not equal or greater than the last option type.
|
||||
* @retval kErrorNoBufs The option length exceeds the buffer size.
|
||||
*/
|
||||
Error AppendUriQueryOption(const char *aUriQuery)
|
||||
{
|
||||
return AppendStringOption(kOptionUriQuery, aUriQuery);
|
||||
}
|
||||
Error AppendUriQueryOption(const char *aUriQuery) { return AppendStringOption(kOptionUriQuery, aUriQuery); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE
|
||||
/**
|
||||
@@ -568,10 +547,7 @@ public:
|
||||
* @returns The length of the message header.
|
||||
*
|
||||
*/
|
||||
uint16_t GetHeaderLength(void) const
|
||||
{
|
||||
return GetHelpData().mHeaderLength;
|
||||
}
|
||||
uint16_t GetHeaderLength(void) const { return GetHelpData().mHeaderLength; }
|
||||
|
||||
/**
|
||||
* This method returns the block number of a CoAP block-wise transfer message.
|
||||
@@ -579,10 +555,7 @@ public:
|
||||
* @returns The block number.
|
||||
*
|
||||
*/
|
||||
uint32_t GetBlockWiseBlockNumber(void) const
|
||||
{
|
||||
return GetHelpData().mBlockWiseData.mBlockNumber;
|
||||
}
|
||||
uint32_t GetBlockWiseBlockNumber(void) const { return GetHelpData().mBlockWiseData.mBlockNumber; }
|
||||
|
||||
/**
|
||||
* This method checks if the More Blocks flag is set.
|
||||
@@ -591,10 +564,7 @@ public:
|
||||
* @retval FALSE More Blocks flag is not set.
|
||||
*
|
||||
*/
|
||||
bool IsMoreBlocksFlagSet(void) const
|
||||
{
|
||||
return GetHelpData().mBlockWiseData.mMoreBlocks;
|
||||
}
|
||||
bool IsMoreBlocksFlagSet(void) const { return GetHelpData().mBlockWiseData.mMoreBlocks; }
|
||||
|
||||
/**
|
||||
* This method returns the block size of a CoAP block-wise transfer message.
|
||||
@@ -602,10 +572,7 @@ public:
|
||||
* @returns The block size.
|
||||
*
|
||||
*/
|
||||
otCoapBlockSzx GetBlockWiseBlockSize(void) const
|
||||
{
|
||||
return GetHelpData().mBlockWiseData.mBlockSize;
|
||||
}
|
||||
otCoapBlockSzx GetBlockWiseBlockSize(void) const { return GetHelpData().mBlockWiseData.mBlockSize; }
|
||||
#endif // OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE
|
||||
|
||||
/**
|
||||
@@ -634,10 +601,7 @@ public:
|
||||
* @returns The offset of the first CoAP option.
|
||||
*
|
||||
*/
|
||||
uint16_t GetOptionStart(void) const
|
||||
{
|
||||
return kMinHeaderLength + GetTokenLength();
|
||||
}
|
||||
uint16_t GetOptionStart(void) const { return kMinHeaderLength + GetTokenLength(); }
|
||||
|
||||
/**
|
||||
* This method parses CoAP header and moves offset end of CoAP header.
|
||||
@@ -667,10 +631,7 @@ public:
|
||||
* @param[in] aBlockNumber Block number value to set.
|
||||
*
|
||||
*/
|
||||
void SetBlockWiseBlockNumber(uint32_t aBlockNumber)
|
||||
{
|
||||
GetHelpData().mBlockWiseData.mBlockNumber = aBlockNumber;
|
||||
}
|
||||
void SetBlockWiseBlockNumber(uint32_t aBlockNumber) { GetHelpData().mBlockWiseData.mBlockNumber = aBlockNumber; }
|
||||
|
||||
/**
|
||||
* This method sets the More Blocks falg in the message HelpData.
|
||||
@@ -678,10 +639,7 @@ public:
|
||||
* @param[in] aMoreBlocks TRUE or FALSE.
|
||||
*
|
||||
*/
|
||||
void SetMoreBlocksFlag(bool aMoreBlocks)
|
||||
{
|
||||
GetHelpData().mBlockWiseData.mMoreBlocks = aMoreBlocks;
|
||||
}
|
||||
void SetMoreBlocksFlag(bool aMoreBlocks) { GetHelpData().mBlockWiseData.mMoreBlocks = aMoreBlocks; }
|
||||
|
||||
/**
|
||||
* This method sets the block size value in the message HelpData.
|
||||
@@ -689,10 +647,7 @@ public:
|
||||
* @param[in] aBlockSize Block size value to set.
|
||||
*
|
||||
*/
|
||||
void SetBlockWiseBlockSize(otCoapBlockSzx aBlockSize)
|
||||
{
|
||||
GetHelpData().mBlockWiseData.mBlockSize = aBlockSize;
|
||||
}
|
||||
void SetBlockWiseBlockSize(otCoapBlockSzx aBlockSize) { GetHelpData().mBlockWiseData.mBlockSize = aBlockSize; }
|
||||
#endif // OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE
|
||||
|
||||
/**
|
||||
@@ -702,10 +657,7 @@ public:
|
||||
* @retval FALSE Message is not an empty message header.
|
||||
*
|
||||
*/
|
||||
bool IsEmpty(void) const
|
||||
{
|
||||
return (GetCode() == kCodeEmpty);
|
||||
}
|
||||
bool IsEmpty(void) const { return (GetCode() == kCodeEmpty); }
|
||||
|
||||
/**
|
||||
* This method checks if a header is a request header.
|
||||
@@ -714,10 +666,7 @@ public:
|
||||
* @retval FALSE Message is not a request header.
|
||||
*
|
||||
*/
|
||||
bool IsRequest(void) const
|
||||
{
|
||||
return (GetCode() >= kCodeGet) && (GetCode() <= kCodeDelete);
|
||||
}
|
||||
bool IsRequest(void) const { return (GetCode() >= kCodeGet) && (GetCode() <= kCodeDelete); }
|
||||
|
||||
/**
|
||||
* This method indicates whether or not the CoAP code in header is "Get" request.
|
||||
@@ -726,10 +675,7 @@ public:
|
||||
* @retval FALSE Message is not a Get request.
|
||||
*
|
||||
*/
|
||||
bool IsGetRequest(void) const
|
||||
{
|
||||
return GetCode() == kCodeGet;
|
||||
}
|
||||
bool IsGetRequest(void) const { return GetCode() == kCodeGet; }
|
||||
|
||||
/**
|
||||
* This method indicates whether or not the CoAP code in header is "Post" request.
|
||||
@@ -738,10 +684,7 @@ public:
|
||||
* @retval FALSE Message is not a Post request.
|
||||
*
|
||||
*/
|
||||
bool IsPostRequest(void) const
|
||||
{
|
||||
return GetCode() == kCodePost;
|
||||
}
|
||||
bool IsPostRequest(void) const { return GetCode() == kCodePost; }
|
||||
|
||||
/**
|
||||
* This method indicates whether or not the CoAP code in header is "Put" request.
|
||||
@@ -750,10 +693,7 @@ public:
|
||||
* @retval FALSE Message is not a Put request.
|
||||
*
|
||||
*/
|
||||
bool IsPutRequest(void) const
|
||||
{
|
||||
return GetCode() == kCodePut;
|
||||
}
|
||||
bool IsPutRequest(void) const { return GetCode() == kCodePut; }
|
||||
|
||||
/**
|
||||
* This method indicates whether or not the CoAP code in header is "Delete" request.
|
||||
@@ -762,10 +702,7 @@ public:
|
||||
* @retval FALSE Message is not a Delete request.
|
||||
*
|
||||
*/
|
||||
bool IsDeleteRequest(void) const
|
||||
{
|
||||
return GetCode() == kCodeDelete;
|
||||
}
|
||||
bool IsDeleteRequest(void) const { return GetCode() == kCodeDelete; }
|
||||
|
||||
/**
|
||||
* This method checks if a header is a response header.
|
||||
@@ -774,10 +711,7 @@ public:
|
||||
* @retval FALSE Message is not a response header.
|
||||
*
|
||||
*/
|
||||
bool IsResponse(void) const
|
||||
{
|
||||
return GetCode() >= OT_COAP_CODE_RESPONSE_MIN;
|
||||
}
|
||||
bool IsResponse(void) const { return GetCode() >= OT_COAP_CODE_RESPONSE_MIN; }
|
||||
|
||||
/**
|
||||
* This method checks if a header is a CON message header.
|
||||
@@ -786,10 +720,7 @@ public:
|
||||
* @retval FALSE Message is not is a CON message header.
|
||||
*
|
||||
*/
|
||||
bool IsConfirmable(void) const
|
||||
{
|
||||
return (GetType() == kTypeConfirmable);
|
||||
}
|
||||
bool IsConfirmable(void) const { return (GetType() == kTypeConfirmable); }
|
||||
|
||||
/**
|
||||
* This method checks if a header is a NON message header.
|
||||
@@ -798,10 +729,7 @@ public:
|
||||
* @retval FALSE Message is not is a NON message header.
|
||||
*
|
||||
*/
|
||||
bool IsNonConfirmable(void) const
|
||||
{
|
||||
return (GetType() == kTypeNonConfirmable);
|
||||
}
|
||||
bool IsNonConfirmable(void) const { return (GetType() == kTypeNonConfirmable); }
|
||||
|
||||
/**
|
||||
* This method checks if a header is a ACK message header.
|
||||
@@ -810,10 +738,7 @@ public:
|
||||
* @retval FALSE Message is not is a ACK message header.
|
||||
*
|
||||
*/
|
||||
bool IsAck(void) const
|
||||
{
|
||||
return (GetType() == kTypeAck);
|
||||
}
|
||||
bool IsAck(void) const { return (GetType() == kTypeAck); }
|
||||
|
||||
/**
|
||||
* This method checks if a header is a RST message header.
|
||||
@@ -822,10 +747,7 @@ public:
|
||||
* @retval FALSE Message is not is a RST message header.
|
||||
*
|
||||
*/
|
||||
bool IsReset(void) const
|
||||
{
|
||||
return (GetType() == kTypeReset);
|
||||
}
|
||||
bool IsReset(void) const { return (GetType() == kTypeReset); }
|
||||
|
||||
/**
|
||||
* This method indicates whether or not the header is a confirmable Put request (i.e, `kTypeConfirmable` with
|
||||
@@ -871,19 +793,13 @@ public:
|
||||
* @returns A pointer to the message or `nullptr` if insufficient message buffers are available.
|
||||
*
|
||||
*/
|
||||
Message *Clone(void) const
|
||||
{
|
||||
return Clone(GetLength());
|
||||
}
|
||||
Message *Clone(void) const { return Clone(GetLength()); }
|
||||
|
||||
/**
|
||||
* This method returns the minimal reserved bytes required for CoAP message.
|
||||
*
|
||||
*/
|
||||
static uint16_t GetHelpDataReserved(void)
|
||||
{
|
||||
return sizeof(HelpData) + kHelpDataAlignment;
|
||||
}
|
||||
static uint16_t GetHelpDataReserved(void) { return sizeof(HelpData) + kHelpDataAlignment; }
|
||||
|
||||
/**
|
||||
* This method returns a pointer to the next message after this as a `Coap::Message`.
|
||||
@@ -894,10 +810,7 @@ public:
|
||||
* @returns A pointer to the next message in the queue or `nullptr` if at the end of the queue.
|
||||
*
|
||||
*/
|
||||
Message *GetNextCoapMessage(void)
|
||||
{
|
||||
return static_cast<Message *>(GetNext());
|
||||
}
|
||||
Message *GetNextCoapMessage(void) { return static_cast<Message *>(GetNext()); }
|
||||
|
||||
/**
|
||||
* This method returns a pointer to the next message after this as a `Coap::Message`.
|
||||
@@ -908,10 +821,7 @@ public:
|
||||
* @returns A pointer to the next message in the queue or `nullptr` if at the end of the queue.
|
||||
*
|
||||
*/
|
||||
const Message *GetNextCoapMessage(void) const
|
||||
{
|
||||
return static_cast<const Message *>(GetNext());
|
||||
}
|
||||
const Message *GetNextCoapMessage(void) const { return static_cast<const Message *>(GetNext()); }
|
||||
|
||||
private:
|
||||
/*
|
||||
@@ -1047,15 +957,9 @@ private:
|
||||
return *static_cast<const HelpData *>(OT_ALIGN(GetFirstData(), kHelpDataAlignment));
|
||||
}
|
||||
|
||||
HelpData &GetHelpData(void)
|
||||
{
|
||||
return AsNonConst(AsConst(this)->GetHelpData());
|
||||
}
|
||||
HelpData &GetHelpData(void) { return AsNonConst(AsConst(this)->GetHelpData()); }
|
||||
|
||||
uint8_t *GetToken(void)
|
||||
{
|
||||
return GetHelpData().mHeader.mToken;
|
||||
}
|
||||
uint8_t *GetToken(void) { return GetHelpData().mHeader.mToken; }
|
||||
|
||||
void SetTokenLength(uint8_t aTokenLength)
|
||||
{
|
||||
@@ -1337,10 +1241,7 @@ DefineMapEnum(otCoapCode, Coap::Code);
|
||||
* @returns A reference to `Coap::Message` matching @p aMessage.
|
||||
*
|
||||
*/
|
||||
inline Coap::Message &AsCoapMessage(otMessage *aMessage)
|
||||
{
|
||||
return *static_cast<Coap::Message *>(aMessage);
|
||||
}
|
||||
inline Coap::Message &AsCoapMessage(otMessage *aMessage) { return *static_cast<Coap::Message *>(aMessage); }
|
||||
|
||||
/**
|
||||
* This method casts an `otMessage` pointer to a `Coap::Message` reference.
|
||||
@@ -1350,10 +1251,7 @@ inline Coap::Message &AsCoapMessage(otMessage *aMessage)
|
||||
* @returns A reference to `Coap::Message` matching @p aMessage.
|
||||
*
|
||||
*/
|
||||
inline Coap::Message *AsCoapMessagePtr(otMessage *aMessage)
|
||||
{
|
||||
return static_cast<Coap::Message *>(aMessage);
|
||||
}
|
||||
inline Coap::Message *AsCoapMessagePtr(otMessage *aMessage) { return static_cast<Coap::Message *>(aMessage); }
|
||||
|
||||
/**
|
||||
* This method casts an `otMessage` pointer to a `Coap::Message` pointer.
|
||||
|
||||
@@ -278,10 +278,7 @@ public:
|
||||
* @param[in] aVerifyPeerCertificate true, if the peer certificate should be verified
|
||||
*
|
||||
*/
|
||||
void SetSslAuthMode(bool aVerifyPeerCertificate)
|
||||
{
|
||||
mDtls.SetSslAuthMode(aVerifyPeerCertificate);
|
||||
}
|
||||
void SetSslAuthMode(bool aVerifyPeerCertificate) { mDtls.SetSslAuthMode(aVerifyPeerCertificate); }
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE
|
||||
|
||||
@@ -395,10 +392,7 @@ public:
|
||||
* @return DTLS session's message info.
|
||||
*
|
||||
*/
|
||||
const Ip6::MessageInfo &GetMessageInfo(void) const
|
||||
{
|
||||
return mDtls.GetMessageInfo();
|
||||
}
|
||||
const Ip6::MessageInfo &GetMessageInfo(void) const { return mDtls.GetMessageInfo(); }
|
||||
|
||||
private:
|
||||
static Error Send(CoapBase &aCoapBase, ot::Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
|
||||
|
||||
@@ -170,9 +170,6 @@
|
||||
* @param[in] aError The error to be ignored.
|
||||
*
|
||||
*/
|
||||
static inline void IgnoreError(otError aError)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
static inline void IgnoreError(otError aError) { OT_UNUSED_VARIABLE(aError); }
|
||||
|
||||
#endif // CODE_UTILS_HPP_
|
||||
|
||||
@@ -48,10 +48,7 @@ namespace ot {
|
||||
* @returns A const reference to @p aObject reference.
|
||||
*
|
||||
*/
|
||||
template <typename Type> const Type &AsConst(Type &aObject)
|
||||
{
|
||||
return const_cast<const Type &>(aObject);
|
||||
}
|
||||
template <typename Type> const Type &AsConst(Type &aObject) { return const_cast<const Type &>(aObject); }
|
||||
|
||||
/**
|
||||
* This template method casts a given non-const pointer to a const pointer.
|
||||
@@ -63,10 +60,7 @@ template <typename Type> const Type &AsConst(Type &aObject)
|
||||
* @returns A const pointer to @p aPointer pointer.
|
||||
*
|
||||
*/
|
||||
template <typename Type> const Type *AsConst(Type *aPointer)
|
||||
{
|
||||
return const_cast<const Type *>(aPointer);
|
||||
}
|
||||
template <typename Type> const Type *AsConst(Type *aPointer) { return const_cast<const Type *>(aPointer); }
|
||||
|
||||
/**
|
||||
* This template method casts a given const reference to a non-const reference.
|
||||
@@ -78,10 +72,7 @@ template <typename Type> const Type *AsConst(Type *aPointer)
|
||||
* @returns A non-const reference to @p aObject reference.
|
||||
*
|
||||
*/
|
||||
template <typename Type> Type &AsNonConst(const Type &aObject)
|
||||
{
|
||||
return const_cast<Type &>(aObject);
|
||||
}
|
||||
template <typename Type> Type &AsNonConst(const Type &aObject) { return const_cast<Type &>(aObject); }
|
||||
|
||||
/**
|
||||
* This template method casts a given const pointer to a non-const pointer.
|
||||
@@ -93,10 +84,7 @@ template <typename Type> Type &AsNonConst(const Type &aObject)
|
||||
* @returns A non-const pointer to @p aPointer pointer.
|
||||
*
|
||||
*/
|
||||
template <typename Type> Type *AsNonConst(const Type *aPointer)
|
||||
{
|
||||
return const_cast<Type *>(aPointer);
|
||||
}
|
||||
template <typename Type> Type *AsNonConst(const Type *aPointer) { return const_cast<Type *>(aPointer); }
|
||||
|
||||
} // namespace ot
|
||||
|
||||
|
||||
@@ -51,10 +51,7 @@
|
||||
namespace ot {
|
||||
namespace Encoding {
|
||||
|
||||
inline uint16_t Swap16(uint16_t v)
|
||||
{
|
||||
return (((v & 0x00ffU) << 8) & 0xff00) | (((v & 0xff00U) >> 8) & 0x00ff);
|
||||
}
|
||||
inline uint16_t Swap16(uint16_t v) { return (((v & 0x00ffU) << 8) & 0xff00) | (((v & 0xff00U) >> 8) & 0x00ff); }
|
||||
|
||||
inline uint32_t Swap32(uint32_t v)
|
||||
{
|
||||
@@ -91,33 +88,15 @@ namespace BigEndian {
|
||||
|
||||
#if BYTE_ORDER_BIG_ENDIAN
|
||||
|
||||
inline uint16_t HostSwap16(uint16_t v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
inline uint32_t HostSwap32(uint32_t v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
inline uint64_t HostSwap64(uint64_t v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
inline uint16_t HostSwap16(uint16_t v) { return v; }
|
||||
inline uint32_t HostSwap32(uint32_t v) { return v; }
|
||||
inline uint64_t HostSwap64(uint64_t v) { return v; }
|
||||
|
||||
#else /* BYTE_ORDER_LITTLE_ENDIAN */
|
||||
|
||||
inline uint16_t HostSwap16(uint16_t v)
|
||||
{
|
||||
return Swap16(v);
|
||||
}
|
||||
inline uint32_t HostSwap32(uint32_t v)
|
||||
{
|
||||
return Swap32(v);
|
||||
}
|
||||
inline uint64_t HostSwap64(uint64_t v)
|
||||
{
|
||||
return Swap64(v);
|
||||
}
|
||||
inline uint16_t HostSwap16(uint16_t v) { return Swap16(v); }
|
||||
inline uint32_t HostSwap32(uint32_t v) { return Swap32(v); }
|
||||
inline uint64_t HostSwap64(uint64_t v) { return Swap64(v); }
|
||||
|
||||
#endif // LITTLE_ENDIAN
|
||||
|
||||
@@ -133,22 +112,10 @@ inline uint64_t HostSwap64(uint64_t v)
|
||||
*/
|
||||
template <typename UintType> UintType HostSwap(UintType aValue);
|
||||
|
||||
template <> inline uint8_t HostSwap(uint8_t aValue)
|
||||
{
|
||||
return aValue;
|
||||
}
|
||||
template <> inline uint16_t HostSwap(uint16_t aValue)
|
||||
{
|
||||
return HostSwap16(aValue);
|
||||
}
|
||||
template <> inline uint32_t HostSwap(uint32_t aValue)
|
||||
{
|
||||
return HostSwap32(aValue);
|
||||
}
|
||||
template <> inline uint64_t HostSwap(uint64_t aValue)
|
||||
{
|
||||
return HostSwap64(aValue);
|
||||
}
|
||||
template <> inline uint8_t HostSwap(uint8_t aValue) { return aValue; }
|
||||
template <> inline uint16_t HostSwap(uint16_t aValue) { return HostSwap16(aValue); }
|
||||
template <> inline uint32_t HostSwap(uint32_t aValue) { return HostSwap32(aValue); }
|
||||
template <> inline uint64_t HostSwap(uint64_t aValue) { return HostSwap64(aValue); }
|
||||
|
||||
/**
|
||||
* This function reads a `uint16_t` value from a given buffer assuming big-endian encoding.
|
||||
@@ -158,10 +125,7 @@ template <> inline uint64_t HostSwap(uint64_t aValue)
|
||||
* @returns The `uint16_t` value read from buffer.
|
||||
*
|
||||
*/
|
||||
inline uint16_t ReadUint16(const uint8_t *aBuffer)
|
||||
{
|
||||
return static_cast<uint16_t>((aBuffer[0] << 8) | aBuffer[1]);
|
||||
}
|
||||
inline uint16_t ReadUint16(const uint8_t *aBuffer) { return static_cast<uint16_t>((aBuffer[0] << 8) | aBuffer[1]); }
|
||||
|
||||
/**
|
||||
* This function reads a `uint32_t` value from a given buffer assuming big-endian encoding.
|
||||
@@ -274,33 +238,15 @@ namespace LittleEndian {
|
||||
|
||||
#if BYTE_ORDER_BIG_ENDIAN
|
||||
|
||||
inline uint16_t HostSwap16(uint16_t v)
|
||||
{
|
||||
return Swap16(v);
|
||||
}
|
||||
inline uint32_t HostSwap32(uint32_t v)
|
||||
{
|
||||
return Swap32(v);
|
||||
}
|
||||
inline uint64_t HostSwap64(uint64_t v)
|
||||
{
|
||||
return Swap64(v);
|
||||
}
|
||||
inline uint16_t HostSwap16(uint16_t v) { return Swap16(v); }
|
||||
inline uint32_t HostSwap32(uint32_t v) { return Swap32(v); }
|
||||
inline uint64_t HostSwap64(uint64_t v) { return Swap64(v); }
|
||||
|
||||
#else /* BYTE_ORDER_LITTLE_ENDIAN */
|
||||
|
||||
inline uint16_t HostSwap16(uint16_t v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
inline uint32_t HostSwap32(uint32_t v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
inline uint64_t HostSwap64(uint64_t v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
inline uint16_t HostSwap16(uint16_t v) { return v; }
|
||||
inline uint32_t HostSwap32(uint32_t v) { return v; }
|
||||
inline uint64_t HostSwap64(uint64_t v) { return v; }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -316,22 +262,10 @@ inline uint64_t HostSwap64(uint64_t v)
|
||||
*/
|
||||
template <typename UintType> UintType HostSwap(UintType aValue);
|
||||
|
||||
template <> inline uint8_t HostSwap(uint8_t aValue)
|
||||
{
|
||||
return aValue;
|
||||
}
|
||||
template <> inline uint16_t HostSwap(uint16_t aValue)
|
||||
{
|
||||
return HostSwap16(aValue);
|
||||
}
|
||||
template <> inline uint32_t HostSwap(uint32_t aValue)
|
||||
{
|
||||
return HostSwap32(aValue);
|
||||
}
|
||||
template <> inline uint64_t HostSwap(uint64_t aValue)
|
||||
{
|
||||
return HostSwap64(aValue);
|
||||
}
|
||||
template <> inline uint8_t HostSwap(uint8_t aValue) { return aValue; }
|
||||
template <> inline uint16_t HostSwap(uint16_t aValue) { return HostSwap16(aValue); }
|
||||
template <> inline uint32_t HostSwap(uint32_t aValue) { return HostSwap32(aValue); }
|
||||
template <> inline uint64_t HostSwap(uint64_t aValue) { return HostSwap64(aValue); }
|
||||
|
||||
/**
|
||||
* This function reads a `uint16_t` value from a given buffer assuming little-endian encoding.
|
||||
@@ -341,10 +275,7 @@ template <> inline uint64_t HostSwap(uint64_t aValue)
|
||||
* @returns The `uint16_t` value read from buffer.
|
||||
*
|
||||
*/
|
||||
inline uint16_t ReadUint16(const uint8_t *aBuffer)
|
||||
{
|
||||
return static_cast<uint16_t>(aBuffer[0] | (aBuffer[1] << 8));
|
||||
}
|
||||
inline uint16_t ReadUint16(const uint8_t *aBuffer) { return static_cast<uint16_t>(aBuffer[0] | (aBuffer[1] << 8)); }
|
||||
|
||||
/**
|
||||
* This function reads a 24-bit integer value from a given buffer assuming little-endian encoding.
|
||||
|
||||
@@ -42,10 +42,7 @@ void FrameBuilder::Init(void *aBuffer, uint16_t aLength)
|
||||
mMaxLength = aLength;
|
||||
}
|
||||
|
||||
Error FrameBuilder::AppendUint8(uint8_t aUint8)
|
||||
{
|
||||
return Append<uint8_t>(aUint8);
|
||||
}
|
||||
Error FrameBuilder::AppendUint8(uint8_t aUint8) { return Append<uint8_t>(aUint8); }
|
||||
|
||||
Error FrameBuilder::AppendBigEndianUint16(uint16_t aUint16)
|
||||
{
|
||||
|
||||
@@ -38,10 +38,7 @@
|
||||
|
||||
namespace ot {
|
||||
|
||||
Error FrameData::ReadUint8(uint8_t &aUint8)
|
||||
{
|
||||
return ReadBytes(&aUint8, sizeof(uint8_t));
|
||||
}
|
||||
Error FrameData::ReadUint8(uint8_t &aUint8) { return ReadBytes(&aUint8, sizeof(uint8_t)); }
|
||||
|
||||
Error FrameData::ReadBigEndianUint16(uint16_t &aUint16)
|
||||
{
|
||||
@@ -99,9 +96,6 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
void FrameData::SkipOver(uint16_t aLength)
|
||||
{
|
||||
Init(GetBytes() + aLength, GetLength() - aLength);
|
||||
}
|
||||
void FrameData::SkipOver(uint16_t aLength) { Init(GetBytes() + aLength, GetLength() - aLength); }
|
||||
|
||||
} // namespace ot
|
||||
|
||||
@@ -40,27 +40,15 @@ namespace Heap {
|
||||
|
||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
|
||||
void *CAlloc(size_t aCount, size_t aSize)
|
||||
{
|
||||
return otPlatCAlloc(aCount, aSize);
|
||||
}
|
||||
void *CAlloc(size_t aCount, size_t aSize) { return otPlatCAlloc(aCount, aSize); }
|
||||
|
||||
void Free(void *aPointer)
|
||||
{
|
||||
otPlatFree(aPointer);
|
||||
}
|
||||
void Free(void *aPointer) { otPlatFree(aPointer); }
|
||||
|
||||
#else
|
||||
|
||||
void *CAlloc(size_t aCount, size_t aSize)
|
||||
{
|
||||
return Instance::GetHeap().CAlloc(aCount, aSize);
|
||||
}
|
||||
void *CAlloc(size_t aCount, size_t aSize) { return Instance::GetHeap().CAlloc(aCount, aSize); }
|
||||
|
||||
void Free(void *aPointer)
|
||||
{
|
||||
Instance::GetHeap().Free(aPointer);
|
||||
}
|
||||
void Free(void *aPointer) { Instance::GetHeap().Free(aPointer); }
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
|
||||
|
||||
@@ -299,10 +299,7 @@ exit:
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
|
||||
void Instance::Reset(void)
|
||||
{
|
||||
otPlatReset(this);
|
||||
}
|
||||
void Instance::Reset(void) { otPlatReset(this); }
|
||||
|
||||
#if OPENTHREAD_RADIO
|
||||
void Instance::ResetRadioStack(void)
|
||||
@@ -426,10 +423,7 @@ void Instance::SetLogLevel(LogLevel aLogLevel)
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" OT_TOOL_WEAK void otPlatLogHandleLevelChanged(otLogLevel aLogLevel)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
}
|
||||
extern "C" OT_TOOL_WEAK void otPlatLogHandleLevelChanged(otLogLevel aLogLevel) { OT_UNUSED_VARIABLE(aLogLevel); }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+104
-416
@@ -211,10 +211,7 @@ public:
|
||||
* @returns TRUE if the instance is valid/initialized, FALSE otherwise.
|
||||
*
|
||||
*/
|
||||
bool IsInitialized(void) const
|
||||
{
|
||||
return mIsInitialized;
|
||||
}
|
||||
bool IsInitialized(void) const { return mIsInitialized; }
|
||||
|
||||
/**
|
||||
* This method triggers a platform reset.
|
||||
@@ -303,10 +300,7 @@ public:
|
||||
* @returns A reference to the application COAP object.
|
||||
*
|
||||
*/
|
||||
Coap::Coap &GetApplicationCoap(void)
|
||||
{
|
||||
return mApplicationCoap;
|
||||
}
|
||||
Coap::Coap &GetApplicationCoap(void) { return mApplicationCoap; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE
|
||||
@@ -316,10 +310,7 @@ public:
|
||||
* @returns A reference to the application COAP Secure object.
|
||||
*
|
||||
*/
|
||||
Coap::CoapSecure &GetApplicationCoapSecure(void)
|
||||
{
|
||||
return mApplicationCoapSecure;
|
||||
}
|
||||
Coap::CoapSecure &GetApplicationCoapSecure(void) { return mApplicationCoapSecure; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
|
||||
@@ -334,10 +325,7 @@ public:
|
||||
* @param[in] aEnabled TRUE to enable the "DNS name compression" mode, FALSE to disable.
|
||||
*
|
||||
*/
|
||||
static void SetDnsNameCompressionEnabled(bool aEnabled)
|
||||
{
|
||||
sDnsNameCompressionEnabled = aEnabled;
|
||||
}
|
||||
static void SetDnsNameCompressionEnabled(bool aEnabled) { sDnsNameCompressionEnabled = aEnabled; }
|
||||
|
||||
/**
|
||||
* This method indicates whether the "DNS name compression" mode is enabled or not.
|
||||
@@ -345,10 +333,7 @@ public:
|
||||
* @returns TRUE if the "DNS name compressions" mode is enabled, FALSE otherwise.
|
||||
*
|
||||
*/
|
||||
static bool IsDnsNameCompressionEnabled(void)
|
||||
{
|
||||
return sDnsNameCompressionEnabled;
|
||||
}
|
||||
static bool IsDnsNameCompressionEnabled(void) { return sDnsNameCompressionEnabled; }
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -646,507 +631,255 @@ DefineCoreType(otBufferInfo, Instance::BufferInfo);
|
||||
|
||||
// Specializations of the `Get<Type>()` method.
|
||||
|
||||
template <> inline Instance &Instance::Get(void)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
template <> inline Instance &Instance::Get(void) { return *this; }
|
||||
|
||||
template <> inline Radio &Instance::Get(void)
|
||||
{
|
||||
return mRadio;
|
||||
}
|
||||
template <> inline Radio &Instance::Get(void) { return mRadio; }
|
||||
|
||||
template <> inline Radio::Callbacks &Instance::Get(void)
|
||||
{
|
||||
return mRadio.mCallbacks;
|
||||
}
|
||||
template <> inline Radio::Callbacks &Instance::Get(void) { return mRadio.mCallbacks; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_UPTIME_ENABLE
|
||||
template <> inline Uptime &Instance::Get(void)
|
||||
{
|
||||
return mUptime;
|
||||
}
|
||||
template <> inline Uptime &Instance::Get(void) { return mUptime; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_MTD || OPENTHREAD_FTD
|
||||
template <> inline Notifier &Instance::Get(void)
|
||||
{
|
||||
return mNotifier;
|
||||
}
|
||||
template <> inline Notifier &Instance::Get(void) { return mNotifier; }
|
||||
|
||||
template <> inline TimeTicker &Instance::Get(void)
|
||||
{
|
||||
return mTimeTicker;
|
||||
}
|
||||
template <> inline TimeTicker &Instance::Get(void) { return mTimeTicker; }
|
||||
|
||||
template <> inline Settings &Instance::Get(void)
|
||||
{
|
||||
return mSettings;
|
||||
}
|
||||
template <> inline Settings &Instance::Get(void) { return mSettings; }
|
||||
|
||||
template <> inline SettingsDriver &Instance::Get(void)
|
||||
{
|
||||
return mSettingsDriver;
|
||||
}
|
||||
template <> inline SettingsDriver &Instance::Get(void) { return mSettingsDriver; }
|
||||
|
||||
template <> inline MeshForwarder &Instance::Get(void)
|
||||
{
|
||||
return mMeshForwarder;
|
||||
}
|
||||
template <> inline MeshForwarder &Instance::Get(void) { return mMeshForwarder; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTI_RADIO
|
||||
template <> inline RadioSelector &Instance::Get(void)
|
||||
{
|
||||
return mRadioSelector;
|
||||
}
|
||||
template <> inline RadioSelector &Instance::Get(void) { return mRadioSelector; }
|
||||
#endif
|
||||
|
||||
template <> inline Mle::Mle &Instance::Get(void)
|
||||
{
|
||||
return mMleRouter;
|
||||
}
|
||||
template <> inline Mle::Mle &Instance::Get(void) { return mMleRouter; }
|
||||
|
||||
template <> inline Mle::MleRouter &Instance::Get(void)
|
||||
{
|
||||
return mMleRouter;
|
||||
}
|
||||
template <> inline Mle::MleRouter &Instance::Get(void) { return mMleRouter; }
|
||||
|
||||
template <> inline Mle::DiscoverScanner &Instance::Get(void)
|
||||
{
|
||||
return mDiscoverScanner;
|
||||
}
|
||||
template <> inline Mle::DiscoverScanner &Instance::Get(void) { return mDiscoverScanner; }
|
||||
|
||||
template <> inline NeighborTable &Instance::Get(void)
|
||||
{
|
||||
return mMleRouter.mNeighborTable;
|
||||
}
|
||||
template <> inline NeighborTable &Instance::Get(void) { return mMleRouter.mNeighborTable; }
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
template <> inline ChildTable &Instance::Get(void)
|
||||
{
|
||||
return mMleRouter.mChildTable;
|
||||
}
|
||||
template <> inline ChildTable &Instance::Get(void) { return mMleRouter.mChildTable; }
|
||||
|
||||
template <> inline RouterTable &Instance::Get(void)
|
||||
{
|
||||
return mMleRouter.mRouterTable;
|
||||
}
|
||||
template <> inline RouterTable &Instance::Get(void) { return mMleRouter.mRouterTable; }
|
||||
#endif
|
||||
|
||||
template <> inline Ip6::Netif &Instance::Get(void)
|
||||
{
|
||||
return mThreadNetif;
|
||||
}
|
||||
template <> inline Ip6::Netif &Instance::Get(void) { return mThreadNetif; }
|
||||
|
||||
template <> inline ThreadNetif &Instance::Get(void)
|
||||
{
|
||||
return mThreadNetif;
|
||||
}
|
||||
template <> inline ThreadNetif &Instance::Get(void) { return mThreadNetif; }
|
||||
|
||||
template <> inline Ip6::Ip6 &Instance::Get(void)
|
||||
{
|
||||
return mIp6;
|
||||
}
|
||||
template <> inline Ip6::Ip6 &Instance::Get(void) { return mIp6; }
|
||||
|
||||
template <> inline Mac::Mac &Instance::Get(void)
|
||||
{
|
||||
return mMac;
|
||||
}
|
||||
template <> inline Mac::Mac &Instance::Get(void) { return mMac; }
|
||||
|
||||
template <> inline Mac::SubMac &Instance::Get(void)
|
||||
{
|
||||
return mMac.mLinks.mSubMac;
|
||||
}
|
||||
template <> inline Mac::SubMac &Instance::Get(void) { return mMac.mLinks.mSubMac; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
|
||||
template <> inline Trel::Link &Instance::Get(void)
|
||||
{
|
||||
return mMac.mLinks.mTrel;
|
||||
}
|
||||
template <> inline Trel::Link &Instance::Get(void) { return mMac.mLinks.mTrel; }
|
||||
|
||||
template <> inline Trel::Interface &Instance::Get(void)
|
||||
{
|
||||
return mMac.mLinks.mTrel.mInterface;
|
||||
}
|
||||
template <> inline Trel::Interface &Instance::Get(void) { return mMac.mLinks.mTrel.mInterface; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
|
||||
template <> inline Mac::Filter &Instance::Get(void)
|
||||
{
|
||||
return mMac.mFilter;
|
||||
}
|
||||
template <> inline Mac::Filter &Instance::Get(void) { return mMac.mFilter; }
|
||||
#endif
|
||||
|
||||
template <> inline Lowpan::Lowpan &Instance::Get(void)
|
||||
{
|
||||
return mLowpan;
|
||||
}
|
||||
template <> inline Lowpan::Lowpan &Instance::Get(void) { return mLowpan; }
|
||||
|
||||
template <> inline KeyManager &Instance::Get(void)
|
||||
{
|
||||
return mKeyManager;
|
||||
}
|
||||
template <> inline KeyManager &Instance::Get(void) { return mKeyManager; }
|
||||
|
||||
template <> inline Ip6::Filter &Instance::Get(void)
|
||||
{
|
||||
return mIp6Filter;
|
||||
}
|
||||
template <> inline Ip6::Filter &Instance::Get(void) { return mIp6Filter; }
|
||||
|
||||
template <> inline AddressResolver &Instance::Get(void)
|
||||
{
|
||||
return mAddressResolver;
|
||||
}
|
||||
template <> inline AddressResolver &Instance::Get(void) { return mAddressResolver; }
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
|
||||
template <> inline IndirectSender &Instance::Get(void)
|
||||
{
|
||||
return mMeshForwarder.mIndirectSender;
|
||||
}
|
||||
template <> inline IndirectSender &Instance::Get(void) { return mMeshForwarder.mIndirectSender; }
|
||||
|
||||
template <> inline SourceMatchController &Instance::Get(void)
|
||||
{
|
||||
return mMeshForwarder.mIndirectSender.mSourceMatchController;
|
||||
}
|
||||
|
||||
template <> inline DataPollHandler &Instance::Get(void)
|
||||
{
|
||||
return mMeshForwarder.mIndirectSender.mDataPollHandler;
|
||||
}
|
||||
template <> inline DataPollHandler &Instance::Get(void) { return mMeshForwarder.mIndirectSender.mDataPollHandler; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
template <> inline CslTxScheduler &Instance::Get(void)
|
||||
{
|
||||
return mMeshForwarder.mIndirectSender.mCslTxScheduler;
|
||||
}
|
||||
template <> inline CslTxScheduler &Instance::Get(void) { return mMeshForwarder.mIndirectSender.mCslTxScheduler; }
|
||||
#endif
|
||||
|
||||
template <> inline MeshCoP::Leader &Instance::Get(void)
|
||||
{
|
||||
return mLeader;
|
||||
}
|
||||
template <> inline MeshCoP::Leader &Instance::Get(void) { return mLeader; }
|
||||
|
||||
template <> inline MeshCoP::JoinerRouter &Instance::Get(void)
|
||||
{
|
||||
return mJoinerRouter;
|
||||
}
|
||||
template <> inline MeshCoP::JoinerRouter &Instance::Get(void) { return mJoinerRouter; }
|
||||
#endif // OPENTHREAD_FTD
|
||||
|
||||
template <> inline AnnounceBeginServer &Instance::Get(void)
|
||||
{
|
||||
return mAnnounceBegin;
|
||||
}
|
||||
template <> inline AnnounceBeginServer &Instance::Get(void) { return mAnnounceBegin; }
|
||||
|
||||
template <> inline DataPollSender &Instance::Get(void)
|
||||
{
|
||||
return mMeshForwarder.mDataPollSender;
|
||||
}
|
||||
template <> inline DataPollSender &Instance::Get(void) { return mMeshForwarder.mDataPollSender; }
|
||||
|
||||
template <> inline EnergyScanServer &Instance::Get(void)
|
||||
{
|
||||
return mEnergyScan;
|
||||
}
|
||||
template <> inline EnergyScanServer &Instance::Get(void) { return mEnergyScan; }
|
||||
|
||||
template <> inline PanIdQueryServer &Instance::Get(void)
|
||||
{
|
||||
return mPanIdQuery;
|
||||
}
|
||||
template <> inline PanIdQueryServer &Instance::Get(void) { return mPanIdQuery; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_TMF_ANYCAST_LOCATOR_ENABLE
|
||||
template <> inline AnycastLocator &Instance::Get(void)
|
||||
{
|
||||
return mAnycastLocator;
|
||||
}
|
||||
template <> inline AnycastLocator &Instance::Get(void) { return mAnycastLocator; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE || OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
|
||||
template <> inline NetworkData::Local &Instance::Get(void)
|
||||
{
|
||||
return mNetworkDataLocal;
|
||||
}
|
||||
template <> inline NetworkData::Local &Instance::Get(void) { return mNetworkDataLocal; }
|
||||
#endif
|
||||
|
||||
template <> inline NetworkData::Leader &Instance::Get(void)
|
||||
{
|
||||
return mNetworkDataLeader;
|
||||
}
|
||||
template <> inline NetworkData::Leader &Instance::Get(void) { return mNetworkDataLeader; }
|
||||
|
||||
#if OPENTHREAD_FTD || OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE || OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE
|
||||
template <> inline NetworkData::Notifier &Instance::Get(void)
|
||||
{
|
||||
return mNetworkDataNotifier;
|
||||
}
|
||||
template <> inline NetworkData::Notifier &Instance::Get(void) { return mNetworkDataNotifier; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE
|
||||
template <> inline NetworkData::Publisher &Instance::Get(void)
|
||||
{
|
||||
return mNetworkDataPublisher;
|
||||
}
|
||||
template <> inline NetworkData::Publisher &Instance::Get(void) { return mNetworkDataPublisher; }
|
||||
#endif
|
||||
|
||||
template <> inline NetworkData::Service::Manager &Instance::Get(void)
|
||||
{
|
||||
return mNetworkDataServiceManager;
|
||||
}
|
||||
template <> inline NetworkData::Service::Manager &Instance::Get(void) { return mNetworkDataServiceManager; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_TCP_ENABLE
|
||||
template <> inline Ip6::Tcp &Instance::Get(void)
|
||||
{
|
||||
return mIp6.mTcp;
|
||||
}
|
||||
template <> inline Ip6::Tcp &Instance::Get(void) { return mIp6.mTcp; }
|
||||
#endif
|
||||
|
||||
template <> inline Ip6::Udp &Instance::Get(void)
|
||||
{
|
||||
return mIp6.mUdp;
|
||||
}
|
||||
template <> inline Ip6::Udp &Instance::Get(void) { return mIp6.mUdp; }
|
||||
|
||||
template <> inline Ip6::Icmp &Instance::Get(void)
|
||||
{
|
||||
return mIp6.mIcmp;
|
||||
}
|
||||
template <> inline Ip6::Icmp &Instance::Get(void) { return mIp6.mIcmp; }
|
||||
|
||||
template <> inline Ip6::Mpl &Instance::Get(void)
|
||||
{
|
||||
return mIp6.mMpl;
|
||||
}
|
||||
template <> inline Ip6::Mpl &Instance::Get(void) { return mIp6.mMpl; }
|
||||
|
||||
template <> inline Tmf::Agent &Instance::Get(void)
|
||||
{
|
||||
return mTmfAgent;
|
||||
}
|
||||
template <> inline Tmf::Agent &Instance::Get(void) { return mTmfAgent; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_DTLS_ENABLE
|
||||
template <> inline Tmf::SecureAgent &Instance::Get(void)
|
||||
{
|
||||
return mTmfSecureAgent;
|
||||
}
|
||||
template <> inline Tmf::SecureAgent &Instance::Get(void) { return mTmfSecureAgent; }
|
||||
#endif
|
||||
|
||||
template <> inline MeshCoP::ExtendedPanIdManager &Instance::Get(void)
|
||||
{
|
||||
return mExtendedPanIdManager;
|
||||
}
|
||||
template <> inline MeshCoP::ExtendedPanIdManager &Instance::Get(void) { return mExtendedPanIdManager; }
|
||||
|
||||
template <> inline MeshCoP::NetworkNameManager &Instance::Get(void)
|
||||
{
|
||||
return mNetworkNameManager;
|
||||
}
|
||||
template <> inline MeshCoP::NetworkNameManager &Instance::Get(void) { return mNetworkNameManager; }
|
||||
|
||||
template <> inline MeshCoP::ActiveDatasetManager &Instance::Get(void)
|
||||
{
|
||||
return mActiveDataset;
|
||||
}
|
||||
template <> inline MeshCoP::ActiveDatasetManager &Instance::Get(void) { return mActiveDataset; }
|
||||
|
||||
template <> inline MeshCoP::PendingDatasetManager &Instance::Get(void)
|
||||
{
|
||||
return mPendingDataset;
|
||||
}
|
||||
template <> inline MeshCoP::PendingDatasetManager &Instance::Get(void) { return mPendingDataset; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
template <> inline TimeSync &Instance::Get(void)
|
||||
{
|
||||
return mTimeSync;
|
||||
}
|
||||
template <> inline TimeSync &Instance::Get(void) { return mTimeSync; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE && OPENTHREAD_FTD
|
||||
template <> inline MeshCoP::Commissioner &Instance::Get(void)
|
||||
{
|
||||
return mCommissioner;
|
||||
}
|
||||
template <> inline MeshCoP::Commissioner &Instance::Get(void) { return mCommissioner; }
|
||||
|
||||
template <> inline AnnounceBeginClient &Instance::Get(void)
|
||||
{
|
||||
return mCommissioner.GetAnnounceBeginClient();
|
||||
}
|
||||
template <> inline AnnounceBeginClient &Instance::Get(void) { return mCommissioner.GetAnnounceBeginClient(); }
|
||||
|
||||
template <> inline EnergyScanClient &Instance::Get(void)
|
||||
{
|
||||
return mCommissioner.GetEnergyScanClient();
|
||||
}
|
||||
template <> inline EnergyScanClient &Instance::Get(void) { return mCommissioner.GetEnergyScanClient(); }
|
||||
|
||||
template <> inline PanIdQueryClient &Instance::Get(void)
|
||||
{
|
||||
return mCommissioner.GetPanIdQueryClient();
|
||||
}
|
||||
template <> inline PanIdQueryClient &Instance::Get(void) { return mCommissioner.GetPanIdQueryClient(); }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_JOINER_ENABLE
|
||||
template <> inline MeshCoP::Joiner &Instance::Get(void)
|
||||
{
|
||||
return mJoiner;
|
||||
}
|
||||
template <> inline MeshCoP::Joiner &Instance::Get(void) { return mJoiner; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
|
||||
template <> inline Dns::Client &Instance::Get(void)
|
||||
{
|
||||
return mDnsClient;
|
||||
}
|
||||
template <> inline Dns::Client &Instance::Get(void) { return mDnsClient; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE
|
||||
template <> inline Srp::Client &Instance::Get(void)
|
||||
{
|
||||
return mSrpClient;
|
||||
}
|
||||
template <> inline Srp::Client &Instance::Get(void) { return mSrpClient; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_ENABLE
|
||||
template <> inline Utils::SrpClientBuffers &Instance::Get(void)
|
||||
{
|
||||
return mSrpClientBuffers;
|
||||
}
|
||||
template <> inline Utils::SrpClientBuffers &Instance::Get(void) { return mSrpClientBuffers; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_DNSSD_SERVER_ENABLE
|
||||
template <> inline Dns::ServiceDiscovery::Server &Instance::Get(void)
|
||||
{
|
||||
return mDnssdServer;
|
||||
}
|
||||
template <> inline Dns::ServiceDiscovery::Server &Instance::Get(void) { return mDnssdServer; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_DNS_DSO_ENABLE
|
||||
template <> inline Dns::Dso &Instance::Get(void)
|
||||
{
|
||||
return mDnsDso;
|
||||
}
|
||||
template <> inline Dns::Dso &Instance::Get(void) { return mDnsDso; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_FTD || OPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE
|
||||
template <> inline NetworkDiagnostic::NetworkDiagnostic &Instance::Get(void)
|
||||
{
|
||||
return mNetworkDiagnostic;
|
||||
}
|
||||
template <> inline NetworkDiagnostic::NetworkDiagnostic &Instance::Get(void) { return mNetworkDiagnostic; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE
|
||||
template <> inline Dhcp6::Client &Instance::Get(void)
|
||||
{
|
||||
return mDhcp6Client;
|
||||
}
|
||||
template <> inline Dhcp6::Client &Instance::Get(void) { return mDhcp6Client; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE
|
||||
template <> inline Dhcp6::Server &Instance::Get(void)
|
||||
{
|
||||
return mDhcp6Server;
|
||||
}
|
||||
template <> inline Dhcp6::Server &Instance::Get(void) { return mDhcp6Server; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE
|
||||
template <> inline NeighborDiscovery::Agent &Instance::Get(void)
|
||||
{
|
||||
return mNeighborDiscoveryAgent;
|
||||
}
|
||||
template <> inline NeighborDiscovery::Agent &Instance::Get(void) { return mNeighborDiscoveryAgent; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
|
||||
template <> inline Utils::Slaac &Instance::Get(void)
|
||||
{
|
||||
return mSlaac;
|
||||
}
|
||||
template <> inline Utils::Slaac &Instance::Get(void) { return mSlaac; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
|
||||
template <> inline Utils::JamDetector &Instance::Get(void)
|
||||
{
|
||||
return mJamDetector;
|
||||
}
|
||||
template <> inline Utils::JamDetector &Instance::Get(void) { return mJamDetector; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE
|
||||
template <> inline Sntp::Client &Instance::Get(void)
|
||||
{
|
||||
return mSntpClient;
|
||||
}
|
||||
template <> inline Sntp::Client &Instance::Get(void) { return mSntpClient; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE
|
||||
#if OPENTHREAD_FTD
|
||||
template <> inline Utils::ChildSupervisor &Instance::Get(void)
|
||||
{
|
||||
return mChildSupervisor;
|
||||
}
|
||||
template <> inline Utils::ChildSupervisor &Instance::Get(void) { return mChildSupervisor; }
|
||||
#endif
|
||||
template <> inline Utils::SupervisionListener &Instance::Get(void)
|
||||
{
|
||||
return mSupervisionListener;
|
||||
}
|
||||
template <> inline Utils::SupervisionListener &Instance::Get(void) { return mSupervisionListener; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_PING_SENDER_ENABLE
|
||||
template <> inline Utils::PingSender &Instance::Get(void)
|
||||
{
|
||||
return mPingSender;
|
||||
}
|
||||
template <> inline Utils::PingSender &Instance::Get(void) { return mPingSender; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE
|
||||
template <> inline Utils::ChannelMonitor &Instance::Get(void)
|
||||
{
|
||||
return mChannelMonitor;
|
||||
}
|
||||
template <> inline Utils::ChannelMonitor &Instance::Get(void) { return mChannelMonitor; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE && OPENTHREAD_FTD
|
||||
template <> inline Utils::ChannelManager &Instance::Get(void)
|
||||
{
|
||||
return mChannelManager;
|
||||
}
|
||||
template <> inline Utils::ChannelManager &Instance::Get(void) { return mChannelManager; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_HISTORY_TRACKER_ENABLE
|
||||
template <> inline Utils::HistoryTracker &Instance::Get(void)
|
||||
{
|
||||
return mHistoryTracker;
|
||||
}
|
||||
template <> inline Utils::HistoryTracker &Instance::Get(void) { return mHistoryTracker; }
|
||||
#endif
|
||||
|
||||
#if (OPENTHREAD_CONFIG_DATASET_UPDATER_ENABLE || OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE) && OPENTHREAD_FTD
|
||||
template <> inline MeshCoP::DatasetUpdater &Instance::Get(void)
|
||||
{
|
||||
return mDatasetUpdater;
|
||||
}
|
||||
template <> inline MeshCoP::DatasetUpdater &Instance::Get(void) { return mDatasetUpdater; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE
|
||||
template <> inline MeshCoP::BorderAgent &Instance::Get(void)
|
||||
{
|
||||
return mBorderAgent;
|
||||
}
|
||||
template <> inline MeshCoP::BorderAgent &Instance::Get(void) { return mBorderAgent; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_ANNOUNCE_SENDER_ENABLE
|
||||
template <> inline AnnounceSender &Instance::Get(void)
|
||||
{
|
||||
return mAnnounceSender;
|
||||
}
|
||||
template <> inline AnnounceSender &Instance::Get(void) { return mAnnounceSender; }
|
||||
#endif
|
||||
|
||||
template <> inline MessagePool &Instance::Get(void)
|
||||
{
|
||||
return mMessagePool;
|
||||
}
|
||||
template <> inline MessagePool &Instance::Get(void) { return mMessagePool; }
|
||||
|
||||
#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
|
||||
|
||||
template <> inline BackboneRouter::Leader &Instance::Get(void)
|
||||
{
|
||||
return mBackboneRouterLeader;
|
||||
}
|
||||
template <> inline BackboneRouter::Leader &Instance::Get(void) { return mBackboneRouterLeader; }
|
||||
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||
template <> inline BackboneRouter::Local &Instance::Get(void)
|
||||
{
|
||||
return mBackboneRouterLocal;
|
||||
}
|
||||
template <> inline BackboneRouter::Manager &Instance::Get(void)
|
||||
{
|
||||
return mBackboneRouterManager;
|
||||
}
|
||||
template <> inline BackboneRouter::Local &Instance::Get(void) { return mBackboneRouterLocal; }
|
||||
template <> inline BackboneRouter::Manager &Instance::Get(void) { return mBackboneRouterManager; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_MULTICAST_ROUTING_ENABLE
|
||||
template <> inline BackboneRouter::MulticastListenersTable &Instance::Get(void)
|
||||
@@ -1169,107 +902,62 @@ template <> inline BackboneRouter::BackboneTmfAgent &Instance::Get(void)
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLR_ENABLE || (OPENTHREAD_FTD && OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE)
|
||||
template <> inline MlrManager &Instance::Get(void)
|
||||
{
|
||||
return mMlrManager;
|
||||
}
|
||||
template <> inline MlrManager &Instance::Get(void) { return mMlrManager; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_DUA_ENABLE || (OPENTHREAD_FTD && OPENTHREAD_CONFIG_TMF_PROXY_DUA_ENABLE)
|
||||
template <> inline DuaManager &Instance::Get(void)
|
||||
{
|
||||
return mDuaManager;
|
||||
}
|
||||
template <> inline DuaManager &Instance::Get(void) { return mDuaManager; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
template <> inline LinkMetrics::LinkMetrics &Instance::Get(void)
|
||||
{
|
||||
return mLinkMetrics;
|
||||
}
|
||||
template <> inline LinkMetrics::LinkMetrics &Instance::Get(void) { return mLinkMetrics; }
|
||||
#endif
|
||||
|
||||
#endif // (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
|
||||
|
||||
#if OPENTHREAD_CONFIG_OTNS_ENABLE
|
||||
template <> inline Utils::Otns &Instance::Get(void)
|
||||
{
|
||||
return mOtns;
|
||||
}
|
||||
template <> inline Utils::Otns &Instance::Get(void) { return mOtns; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
|
||||
template <> inline BorderRouter::RoutingManager &Instance::Get(void)
|
||||
{
|
||||
return mRoutingManager;
|
||||
}
|
||||
template <> inline BorderRouter::RoutingManager &Instance::Get(void) { return mRoutingManager; }
|
||||
|
||||
template <> inline BorderRouter::InfraIf &Instance::Get(void)
|
||||
{
|
||||
return mRoutingManager.mInfraIf;
|
||||
}
|
||||
template <> inline BorderRouter::InfraIf &Instance::Get(void) { return mRoutingManager.mInfraIf; }
|
||||
#endif // OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE
|
||||
template <> inline Nat64::Translator &Instance::Get(void)
|
||||
{
|
||||
return mNat64Translator;
|
||||
}
|
||||
template <> inline Nat64::Translator &Instance::Get(void) { return mNat64Translator; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_SRP_SERVER_ENABLE
|
||||
template <> inline Srp::Server &Instance::Get(void)
|
||||
{
|
||||
return mSrpServer;
|
||||
}
|
||||
template <> inline Srp::Server &Instance::Get(void) { return mSrpServer; }
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_MTD || OPENTHREAD_FTD
|
||||
|
||||
#if OPENTHREAD_RADIO || OPENTHREAD_CONFIG_LINK_RAW_ENABLE
|
||||
template <> inline Mac::LinkRaw &Instance::Get(void)
|
||||
{
|
||||
return mLinkRaw;
|
||||
}
|
||||
template <> inline Mac::LinkRaw &Instance::Get(void) { return mLinkRaw; }
|
||||
|
||||
#if OPENTHREAD_RADIO
|
||||
template <> inline Mac::SubMac &Instance::Get(void)
|
||||
{
|
||||
return mLinkRaw.mSubMac;
|
||||
}
|
||||
template <> inline Mac::SubMac &Instance::Get(void) { return mLinkRaw.mSubMac; }
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_RADIO || OPENTHREAD_CONFIG_LINK_RAW_ENABLE
|
||||
|
||||
template <> inline Tasklet::Scheduler &Instance::Get(void)
|
||||
{
|
||||
return mTaskletScheduler;
|
||||
}
|
||||
template <> inline Tasklet::Scheduler &Instance::Get(void) { return mTaskletScheduler; }
|
||||
|
||||
template <> inline TimerMilli::Scheduler &Instance::Get(void)
|
||||
{
|
||||
return mTimerMilliScheduler;
|
||||
}
|
||||
template <> inline TimerMilli::Scheduler &Instance::Get(void) { return mTimerMilliScheduler; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE
|
||||
template <> inline TimerMicro::Scheduler &Instance::Get(void)
|
||||
{
|
||||
return mTimerMicroScheduler;
|
||||
}
|
||||
template <> inline TimerMicro::Scheduler &Instance::Get(void) { return mTimerMicroScheduler; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_VENDOR_EXTENSION
|
||||
template <> inline Extension::ExtensionBase &Instance::Get(void)
|
||||
{
|
||||
return mExtension;
|
||||
}
|
||||
template <> inline Extension::ExtensionBase &Instance::Get(void) { return mExtension; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
template <> inline FactoryDiags::Diags &Instance::Get(void)
|
||||
{
|
||||
return mDiags;
|
||||
}
|
||||
template <> inline FactoryDiags::Diags &Instance::Get(void) { return mDiags; }
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -113,15 +113,9 @@ public:
|
||||
*
|
||||
*/
|
||||
#if OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE
|
||||
Instance &GetInstance(void) const
|
||||
{
|
||||
return *mInstance;
|
||||
}
|
||||
Instance &GetInstance(void) const { return *mInstance; }
|
||||
#else
|
||||
Instance &GetInstance(void) const
|
||||
{
|
||||
return *reinterpret_cast<Instance *>(&gInstanceRaw);
|
||||
}
|
||||
Instance &GetInstance(void) const { return *reinterpret_cast<Instance *>(&gInstanceRaw); }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
+11
-44
@@ -154,10 +154,7 @@ void MessagePool::FreeBuffers(Buffer *aBuffer)
|
||||
}
|
||||
}
|
||||
|
||||
Error MessagePool::ReclaimBuffers(Message::Priority aPriority)
|
||||
{
|
||||
return Get<MeshForwarder>().EvictMessage(aPriority);
|
||||
}
|
||||
Error MessagePool::ReclaimBuffers(Message::Priority aPriority) { return Get<MeshForwarder>().EvictMessage(aPriority); }
|
||||
|
||||
uint16_t MessagePool::GetFreeBufferCount(void) const
|
||||
{
|
||||
@@ -255,10 +252,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
void Message::Free(void)
|
||||
{
|
||||
GetMessagePool()->Free(this);
|
||||
}
|
||||
void Message::Free(void) { GetMessagePool()->Free(this); }
|
||||
|
||||
Message *Message::GetNext(void) const
|
||||
{
|
||||
@@ -703,25 +697,13 @@ exit:
|
||||
return messageCopy;
|
||||
}
|
||||
|
||||
bool Message::GetChildMask(uint16_t aChildIndex) const
|
||||
{
|
||||
return GetMetadata().mChildMask.Get(aChildIndex);
|
||||
}
|
||||
bool Message::GetChildMask(uint16_t aChildIndex) const { return GetMetadata().mChildMask.Get(aChildIndex); }
|
||||
|
||||
void Message::ClearChildMask(uint16_t aChildIndex)
|
||||
{
|
||||
GetMetadata().mChildMask.Set(aChildIndex, false);
|
||||
}
|
||||
void Message::ClearChildMask(uint16_t aChildIndex) { GetMetadata().mChildMask.Set(aChildIndex, false); }
|
||||
|
||||
void Message::SetChildMask(uint16_t aChildIndex)
|
||||
{
|
||||
GetMetadata().mChildMask.Set(aChildIndex, true);
|
||||
}
|
||||
void Message::SetChildMask(uint16_t aChildIndex) { GetMetadata().mChildMask.Set(aChildIndex, true); }
|
||||
|
||||
bool Message::IsChildPending(void) const
|
||||
{
|
||||
return GetMetadata().mChildMask.HasAny();
|
||||
}
|
||||
bool Message::IsChildPending(void) const { return GetMetadata().mChildMask.HasAny(); }
|
||||
|
||||
void Message::SetLinkInfo(const ThreadLinkInfo &aLinkInfo)
|
||||
{
|
||||
@@ -835,15 +817,9 @@ void MessageQueue::DequeueAndFreeAll(void)
|
||||
}
|
||||
}
|
||||
|
||||
Message::Iterator MessageQueue::begin(void)
|
||||
{
|
||||
return Message::Iterator(GetHead());
|
||||
}
|
||||
Message::Iterator MessageQueue::begin(void) { return Message::Iterator(GetHead()); }
|
||||
|
||||
Message::ConstIterator MessageQueue::begin(void) const
|
||||
{
|
||||
return Message::ConstIterator(GetHead());
|
||||
}
|
||||
Message::ConstIterator MessageQueue::begin(void) const { return Message::ConstIterator(GetHead()); }
|
||||
|
||||
void MessageQueue::GetInfo(Info &aInfo) const
|
||||
{
|
||||
@@ -909,10 +885,7 @@ const Message *PriorityQueue::GetHeadForPriority(Message::Priority aPriority) co
|
||||
return head;
|
||||
}
|
||||
|
||||
const Message *PriorityQueue::GetTail(void) const
|
||||
{
|
||||
return FindFirstNonNullTail(Message::kPriorityLow);
|
||||
}
|
||||
const Message *PriorityQueue::GetTail(void) const { return FindFirstNonNullTail(Message::kPriorityLow); }
|
||||
|
||||
void PriorityQueue::Enqueue(Message &aMessage)
|
||||
{
|
||||
@@ -993,15 +966,9 @@ void PriorityQueue::DequeueAndFreeAll(void)
|
||||
}
|
||||
}
|
||||
|
||||
Message::Iterator PriorityQueue::begin(void)
|
||||
{
|
||||
return Message::Iterator(GetHead());
|
||||
}
|
||||
Message::Iterator PriorityQueue::begin(void) { return Message::Iterator(GetHead()); }
|
||||
|
||||
Message::ConstIterator PriorityQueue::begin(void) const
|
||||
{
|
||||
return Message::ConstIterator(GetHead());
|
||||
}
|
||||
Message::ConstIterator PriorityQueue::begin(void) const { return Message::ConstIterator(GetHead()); }
|
||||
|
||||
void PriorityQueue::GetInfo(Info &aInfo) const
|
||||
{
|
||||
|
||||
+28
-112
@@ -232,32 +232,14 @@ protected:
|
||||
static constexpr uint16_t kBufferDataSize = kBufferSize - sizeof(otMessageBuffer);
|
||||
static constexpr uint16_t kHeadBufferDataSize = kBufferDataSize - sizeof(Metadata);
|
||||
|
||||
Metadata &GetMetadata(void)
|
||||
{
|
||||
return mBuffer.mHead.mMetadata;
|
||||
}
|
||||
const Metadata &GetMetadata(void) const
|
||||
{
|
||||
return mBuffer.mHead.mMetadata;
|
||||
}
|
||||
Metadata &GetMetadata(void) { return mBuffer.mHead.mMetadata; }
|
||||
const Metadata &GetMetadata(void) const { return mBuffer.mHead.mMetadata; }
|
||||
|
||||
uint8_t *GetFirstData(void)
|
||||
{
|
||||
return mBuffer.mHead.mData;
|
||||
}
|
||||
const uint8_t *GetFirstData(void) const
|
||||
{
|
||||
return mBuffer.mHead.mData;
|
||||
}
|
||||
uint8_t *GetFirstData(void) { return mBuffer.mHead.mData; }
|
||||
const uint8_t *GetFirstData(void) const { return mBuffer.mHead.mData; }
|
||||
|
||||
uint8_t *GetData(void)
|
||||
{
|
||||
return mBuffer.mData;
|
||||
}
|
||||
const uint8_t *GetData(void) const
|
||||
{
|
||||
return mBuffer.mData;
|
||||
}
|
||||
uint8_t *GetData(void) { return mBuffer.mData; }
|
||||
const uint8_t *GetData(void) const { return mBuffer.mData; }
|
||||
|
||||
private:
|
||||
union
|
||||
@@ -1167,10 +1149,7 @@ public:
|
||||
* @param[in] aLqi A new LQI value (has no unit) to be added to average.
|
||||
*
|
||||
*/
|
||||
void AddLqi(uint8_t aLqi)
|
||||
{
|
||||
GetMetadata().mLqiAverager.Add(aLqi);
|
||||
}
|
||||
void AddLqi(uint8_t aLqi) { GetMetadata().mLqiAverager.Add(aLqi); }
|
||||
|
||||
/**
|
||||
* This method returns the average LQI (Link Quality Indicator) associated with the message.
|
||||
@@ -1178,10 +1157,7 @@ public:
|
||||
* @returns The current average LQI value (in dBm) or OT_RADIO_LQI_NONE if no average is available.
|
||||
*
|
||||
*/
|
||||
uint8_t GetAverageLqi(void) const
|
||||
{
|
||||
return GetMetadata().mLqiAverager.GetAverage();
|
||||
}
|
||||
uint8_t GetAverageLqi(void) const { return GetMetadata().mLqiAverager.GetAverage(); }
|
||||
|
||||
/**
|
||||
* This method returns the count of frames counted so far.
|
||||
@@ -1189,10 +1165,7 @@ public:
|
||||
* @returns The count of frames that have been counted.
|
||||
*
|
||||
*/
|
||||
uint8_t GetPsduCount(void) const
|
||||
{
|
||||
return GetMetadata().mLqiAverager.GetCount();
|
||||
}
|
||||
uint8_t GetPsduCount(void) const { return GetMetadata().mLqiAverager.GetCount(); }
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1243,10 +1216,7 @@ public:
|
||||
* @param[in] aEnabled TRUE if the message is also used for time sync purpose, FALSE otherwise.
|
||||
*
|
||||
*/
|
||||
void SetTimeSync(bool aEnabled)
|
||||
{
|
||||
GetMetadata().mTimeSync = aEnabled;
|
||||
}
|
||||
void SetTimeSync(bool aEnabled) { GetMetadata().mTimeSync = aEnabled; }
|
||||
|
||||
/**
|
||||
* This method sets the offset to network time.
|
||||
@@ -1254,10 +1224,7 @@ public:
|
||||
* @param[in] aNetworkTimeOffset The offset to network time.
|
||||
*
|
||||
*/
|
||||
void SetNetworkTimeOffset(int64_t aNetworkTimeOffset)
|
||||
{
|
||||
GetMetadata().mNetworkTimeOffset = aNetworkTimeOffset;
|
||||
}
|
||||
void SetNetworkTimeOffset(int64_t aNetworkTimeOffset) { GetMetadata().mNetworkTimeOffset = aNetworkTimeOffset; }
|
||||
|
||||
/**
|
||||
* This method gets the offset to network time.
|
||||
@@ -1265,10 +1232,7 @@ public:
|
||||
* @returns The offset to network time.
|
||||
*
|
||||
*/
|
||||
int64_t GetNetworkTimeOffset(void) const
|
||||
{
|
||||
return GetMetadata().mNetworkTimeOffset;
|
||||
}
|
||||
int64_t GetNetworkTimeOffset(void) const { return GetMetadata().mNetworkTimeOffset; }
|
||||
|
||||
/**
|
||||
* This method sets the time sync sequence.
|
||||
@@ -1276,10 +1240,7 @@ public:
|
||||
* @param[in] aTimeSyncSeq The time sync sequence.
|
||||
*
|
||||
*/
|
||||
void SetTimeSyncSeq(uint8_t aTimeSyncSeq)
|
||||
{
|
||||
GetMetadata().mTimeSyncSeq = aTimeSyncSeq;
|
||||
}
|
||||
void SetTimeSyncSeq(uint8_t aTimeSyncSeq) { GetMetadata().mTimeSyncSeq = aTimeSyncSeq; }
|
||||
|
||||
/**
|
||||
* This method gets the time sync sequence.
|
||||
@@ -1287,10 +1248,7 @@ public:
|
||||
* @returns The time sync sequence.
|
||||
*
|
||||
*/
|
||||
uint8_t GetTimeSyncSeq(void) const
|
||||
{
|
||||
return GetMetadata().mTimeSyncSeq;
|
||||
}
|
||||
uint8_t GetTimeSyncSeq(void) const { return GetMetadata().mTimeSyncSeq; }
|
||||
#endif // OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTI_RADIO
|
||||
@@ -1301,10 +1259,7 @@ public:
|
||||
* @retval FALSE If the radio type is not set.
|
||||
*
|
||||
*/
|
||||
bool IsRadioTypeSet(void) const
|
||||
{
|
||||
return GetMetadata().mIsRadioTypeSet;
|
||||
}
|
||||
bool IsRadioTypeSet(void) const { return GetMetadata().mIsRadioTypeSet; }
|
||||
|
||||
/**
|
||||
* This method gets the radio link type the message was received on, or should be sent on.
|
||||
@@ -1314,10 +1269,7 @@ public:
|
||||
* @returns The radio link type of the message.
|
||||
*
|
||||
*/
|
||||
Mac::RadioType GetRadioType(void) const
|
||||
{
|
||||
return static_cast<Mac::RadioType>(GetMetadata().mRadioType);
|
||||
}
|
||||
Mac::RadioType GetRadioType(void) const { return static_cast<Mac::RadioType>(GetMetadata().mRadioType); }
|
||||
|
||||
/**
|
||||
* This method sets the radio link type the message was received on, or should be sent on.
|
||||
@@ -1337,10 +1289,7 @@ public:
|
||||
* After calling this method, `IsRadioTypeSet()` returns false until radio type is set (`SetRadioType()`).
|
||||
*
|
||||
*/
|
||||
void ClearRadioType(void)
|
||||
{
|
||||
GetMetadata().mIsRadioTypeSet = false;
|
||||
}
|
||||
void ClearRadioType(void) { GetMetadata().mIsRadioTypeSet = false; }
|
||||
|
||||
#endif // #if OPENTHREAD_CONFIG_MULTI_RADIO
|
||||
|
||||
@@ -1384,14 +1333,8 @@ protected:
|
||||
Message *mNext;
|
||||
};
|
||||
|
||||
uint16_t GetReserved(void) const
|
||||
{
|
||||
return GetMetadata().mReserved;
|
||||
}
|
||||
void SetReserved(uint16_t aReservedHeader)
|
||||
{
|
||||
GetMetadata().mReserved = aReservedHeader;
|
||||
}
|
||||
uint16_t GetReserved(void) const { return GetMetadata().mReserved; }
|
||||
void SetReserved(uint16_t aReservedHeader) { GetMetadata().mReserved = aReservedHeader; }
|
||||
|
||||
private:
|
||||
class Chunk : public Data<kWithUint16Length>
|
||||
@@ -1423,43 +1366,19 @@ private:
|
||||
AsConst(this)->GetNextChunk(aLength, static_cast<Chunk &>(aChunk));
|
||||
}
|
||||
|
||||
MessagePool *GetMessagePool(void) const
|
||||
{
|
||||
return GetMetadata().mMessagePool;
|
||||
}
|
||||
void SetMessagePool(MessagePool *aMessagePool)
|
||||
{
|
||||
GetMetadata().mMessagePool = aMessagePool;
|
||||
}
|
||||
MessagePool *GetMessagePool(void) const { return GetMetadata().mMessagePool; }
|
||||
void SetMessagePool(MessagePool *aMessagePool) { GetMetadata().mMessagePool = aMessagePool; }
|
||||
|
||||
bool IsInAQueue(void) const
|
||||
{
|
||||
return (GetMetadata().mQueue != nullptr);
|
||||
}
|
||||
bool IsInAQueue(void) const { return (GetMetadata().mQueue != nullptr); }
|
||||
void SetMessageQueue(MessageQueue *aMessageQueue);
|
||||
void SetPriorityQueue(PriorityQueue *aPriorityQueue);
|
||||
|
||||
Message *&Next(void)
|
||||
{
|
||||
return GetMetadata().mNext;
|
||||
}
|
||||
Message *const &Next(void) const
|
||||
{
|
||||
return GetMetadata().mNext;
|
||||
}
|
||||
Message *&Prev(void)
|
||||
{
|
||||
return GetMetadata().mPrev;
|
||||
}
|
||||
Message *&Next(void) { return GetMetadata().mNext; }
|
||||
Message *const &Next(void) const { return GetMetadata().mNext; }
|
||||
Message *&Prev(void) { return GetMetadata().mPrev; }
|
||||
|
||||
static Message *NextOf(Message *aMessage)
|
||||
{
|
||||
return (aMessage != nullptr) ? aMessage->Next() : nullptr;
|
||||
}
|
||||
static const Message *NextOf(const Message *aMessage)
|
||||
{
|
||||
return (aMessage != nullptr) ? aMessage->Next() : nullptr;
|
||||
}
|
||||
static Message *NextOf(Message *aMessage) { return (aMessage != nullptr) ? aMessage->Next() : nullptr; }
|
||||
static const Message *NextOf(const Message *aMessage) { return (aMessage != nullptr) ? aMessage->Next() : nullptr; }
|
||||
|
||||
Error ResizeMessage(uint16_t aLength);
|
||||
};
|
||||
@@ -1791,10 +1710,7 @@ private:
|
||||
#endif
|
||||
};
|
||||
|
||||
inline Instance &Message::GetInstance(void) const
|
||||
{
|
||||
return GetMessagePool()->GetInstance();
|
||||
}
|
||||
inline Instance &Message::GetInstance(void) const { return GetMessagePool()->GetInstance(); }
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -40,9 +40,6 @@
|
||||
|
||||
#include <openthread/platform/toolchain.h>
|
||||
|
||||
inline void *operator new(size_t, void *p) throw()
|
||||
{
|
||||
return p;
|
||||
}
|
||||
inline void *operator new(size_t, void *p) throw() { return p; }
|
||||
|
||||
#endif // NEW_HPP_
|
||||
|
||||
@@ -300,14 +300,9 @@ const char *Notifier::EventToString(Event aEvent) const
|
||||
|
||||
#else // #if OT_SHOULD_LOG_AT( OT_LOG_LEVEL_INFO)
|
||||
|
||||
void Notifier::LogEvents(Events) const
|
||||
{
|
||||
}
|
||||
void Notifier::LogEvents(Events) const {}
|
||||
|
||||
const char *Notifier::EventToString(Event) const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
const char *Notifier::EventToString(Event) const { return ""; }
|
||||
|
||||
#endif // #if OT_SHOULD_LOG_AT( OT_LOG_LEVEL_INFO)
|
||||
|
||||
|
||||
@@ -52,10 +52,7 @@ namespace ot {
|
||||
* @returns The minimum of @p aFirst and @p aSecond.
|
||||
*
|
||||
*/
|
||||
template <typename Type> Type Min(Type aFirst, Type aSecond)
|
||||
{
|
||||
return (aFirst < aSecond) ? aFirst : aSecond;
|
||||
}
|
||||
template <typename Type> Type Min(Type aFirst, Type aSecond) { return (aFirst < aSecond) ? aFirst : aSecond; }
|
||||
|
||||
/**
|
||||
* This template function returns the maximum of two given values.
|
||||
@@ -70,10 +67,7 @@ template <typename Type> Type Min(Type aFirst, Type aSecond)
|
||||
* @returns The maximum of @p aFirst and @p aSecond.
|
||||
*
|
||||
*/
|
||||
template <typename Type> Type Max(Type aFirst, Type aSecond)
|
||||
{
|
||||
return (aFirst < aSecond) ? aSecond : aFirst;
|
||||
}
|
||||
template <typename Type> Type Max(Type aFirst, Type aSecond) { return (aFirst < aSecond) ? aSecond : aFirst; }
|
||||
|
||||
/**
|
||||
* This template function returns clamped version of a given value to a given closed range [min, max].
|
||||
@@ -195,10 +189,7 @@ template <typename IntType> inline IntType DivideAndRoundToClosest(IntType aDivi
|
||||
* @returns The @p aUint32 value as `unsigned long`.
|
||||
*
|
||||
*/
|
||||
inline unsigned long ToUlong(uint32_t aUint32)
|
||||
{
|
||||
return static_cast<unsigned long>(aUint32);
|
||||
}
|
||||
inline unsigned long ToUlong(uint32_t aUint32) { return static_cast<unsigned long>(aUint32); }
|
||||
|
||||
/**
|
||||
* This function counts the number of `1` bits in the binary representation of a given unsigned int bit-mask value.
|
||||
|
||||
@@ -84,10 +84,7 @@ public:
|
||||
* @retval kErrorNone Successfully filled buffer with random values.
|
||||
*
|
||||
*/
|
||||
static Error CryptoFillBuffer(uint8_t *aBuffer, uint16_t aSize)
|
||||
{
|
||||
return otPlatCryptoRandomGet(aBuffer, aSize);
|
||||
}
|
||||
static Error CryptoFillBuffer(uint8_t *aBuffer, uint16_t aSize) { return otPlatCryptoRandomGet(aBuffer, aSize); }
|
||||
#endif
|
||||
|
||||
private:
|
||||
@@ -113,10 +110,7 @@ namespace NonCrypto {
|
||||
* @returns A random `uint32_t` value.
|
||||
*
|
||||
*/
|
||||
inline uint32_t GetUint32(void)
|
||||
{
|
||||
return Manager::NonCryptoGetUint32();
|
||||
}
|
||||
inline uint32_t GetUint32(void) { return Manager::NonCryptoGetUint32(); }
|
||||
|
||||
/**
|
||||
* This function generates and returns a random byte.
|
||||
@@ -124,10 +118,7 @@ inline uint32_t GetUint32(void)
|
||||
* @returns A random `uint8_t` value.
|
||||
*
|
||||
*/
|
||||
inline uint8_t GetUint8(void)
|
||||
{
|
||||
return static_cast<uint8_t>(GetUint32() & 0xff);
|
||||
}
|
||||
inline uint8_t GetUint8(void) { return static_cast<uint8_t>(GetUint32() & 0xff); }
|
||||
|
||||
/**
|
||||
* This function generates and returns a random `uint16_t` value.
|
||||
@@ -135,10 +126,7 @@ inline uint8_t GetUint8(void)
|
||||
* @returns A random `uint16_t` value.
|
||||
*
|
||||
*/
|
||||
inline uint16_t GetUint16(void)
|
||||
{
|
||||
return static_cast<uint16_t>(GetUint32() & 0xffff);
|
||||
}
|
||||
inline uint16_t GetUint16(void) { return static_cast<uint16_t>(GetUint32() & 0xffff); }
|
||||
|
||||
/**
|
||||
* This function generates and returns a random `uint8_t` value within a given range `[aMin, aMax)`.
|
||||
@@ -212,10 +200,7 @@ namespace Crypto {
|
||||
* @retval kErrorNone Successfully filled buffer with random values.
|
||||
*
|
||||
*/
|
||||
inline Error FillBuffer(uint8_t *aBuffer, uint16_t aSize)
|
||||
{
|
||||
return Manager::CryptoFillBuffer(aBuffer, aSize);
|
||||
}
|
||||
inline Error FillBuffer(uint8_t *aBuffer, uint16_t aSize) { return Manager::CryptoFillBuffer(aBuffer, aSize); }
|
||||
|
||||
} // namespace Crypto
|
||||
|
||||
|
||||
@@ -193,15 +193,9 @@ const uint16_t Settings::kSensitiveKeys[] = {
|
||||
SettingsBase::kKeySrpEcdsaKey,
|
||||
};
|
||||
|
||||
void Settings::Init(void)
|
||||
{
|
||||
Get<SettingsDriver>().Init(kSensitiveKeys, GetArrayLength(kSensitiveKeys));
|
||||
}
|
||||
void Settings::Init(void) { Get<SettingsDriver>().Init(kSensitiveKeys, GetArrayLength(kSensitiveKeys)); }
|
||||
|
||||
void Settings::Deinit(void)
|
||||
{
|
||||
Get<SettingsDriver>().Deinit();
|
||||
}
|
||||
void Settings::Deinit(void) { Get<SettingsDriver>().Deinit(); }
|
||||
|
||||
void Settings::Wipe(void)
|
||||
{
|
||||
@@ -364,10 +358,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
Error Settings::DeleteAllBrOnLinkPrefixes(void)
|
||||
{
|
||||
return Get<SettingsDriver>().Delete(kKeyBrOnLinkPrefixes);
|
||||
}
|
||||
Error Settings::DeleteAllBrOnLinkPrefixes(void) { return Get<SettingsDriver>().Delete(kKeyBrOnLinkPrefixes); }
|
||||
|
||||
Error Settings::ReadBrOnLinkPrefix(int aIndex, BrOnLinkPrefix &aBrOnLinkPrefix)
|
||||
{
|
||||
|
||||
@@ -1015,10 +1015,7 @@ public:
|
||||
* @returns A ChildInfoIteratorBuilder instance.
|
||||
*
|
||||
*/
|
||||
ChildInfoIteratorBuilder IterateChildInfo(void)
|
||||
{
|
||||
return ChildInfoIteratorBuilder(GetInstance());
|
||||
}
|
||||
ChildInfoIteratorBuilder IterateChildInfo(void) { return ChildInfoIteratorBuilder(GetInstance()); }
|
||||
|
||||
/**
|
||||
* This class defines an iterator to access all Child Info entries in the settings.
|
||||
|
||||
@@ -187,10 +187,7 @@ public:
|
||||
* @retval kErrorNotFound The key was not found.
|
||||
*
|
||||
*/
|
||||
Error Get(uint16_t aKey, void *aValue, uint16_t *aValueLength) const
|
||||
{
|
||||
return Get(aKey, 0, aValue, aValueLength);
|
||||
}
|
||||
Error Get(uint16_t aKey, void *aValue, uint16_t *aValueLength) const { return Get(aKey, 0, aValue, aValueLength); }
|
||||
|
||||
/**
|
||||
* This method sets or replaces the value identified by @p aKey.
|
||||
@@ -234,10 +231,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
otInstance *GetInstancePtr(void) const
|
||||
{
|
||||
return reinterpret_cast<otInstance *>(&InstanceLocator::GetInstance());
|
||||
}
|
||||
otInstance *GetInstancePtr(void) const { return reinterpret_cast<otInstance *>(&InstanceLocator::GetInstance()); }
|
||||
|
||||
#if OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE
|
||||
Flash mFlash;
|
||||
|
||||
@@ -255,10 +255,7 @@ StringWriter &StringWriter::AppendHexBytes(const uint8_t *aBytes, uint16_t aLeng
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool IsValidUtf8String(const char *aString)
|
||||
{
|
||||
return IsValidUtf8String(aString, strlen(aString));
|
||||
}
|
||||
bool IsValidUtf8String(const char *aString) { return IsValidUtf8String(aString, strlen(aString)); }
|
||||
|
||||
bool IsValidUtf8String(const char *aString, size_t aLength)
|
||||
{
|
||||
|
||||
@@ -77,10 +77,7 @@ bool Timer::DoesFireBefore(const Timer &aSecondTimer, Time aNow) const
|
||||
return retval;
|
||||
}
|
||||
|
||||
void TimerMilli::Start(uint32_t aDelay)
|
||||
{
|
||||
StartAt(GetNow(), aDelay);
|
||||
}
|
||||
void TimerMilli::Start(uint32_t aDelay) { StartAt(GetNow(), aDelay); }
|
||||
|
||||
void TimerMilli::StartAt(TimeMilli aStartTime, uint32_t aDelay)
|
||||
{
|
||||
@@ -102,15 +99,9 @@ void TimerMilli::FireAtIfEarlier(TimeMilli aFireTime)
|
||||
}
|
||||
}
|
||||
|
||||
void TimerMilli::Stop(void)
|
||||
{
|
||||
Get<Scheduler>().Remove(*this);
|
||||
}
|
||||
void TimerMilli::Stop(void) { Get<Scheduler>().Remove(*this); }
|
||||
|
||||
void TimerMilli::RemoveAll(Instance &aInstance)
|
||||
{
|
||||
aInstance.Get<Scheduler>().RemoveAll();
|
||||
}
|
||||
void TimerMilli::RemoveAll(Instance &aInstance) { aInstance.Get<Scheduler>().RemoveAll(); }
|
||||
|
||||
void Timer::Scheduler::Add(Timer &aTimer, const AlarmApi &aAlarmApi)
|
||||
{
|
||||
@@ -228,10 +219,7 @@ const Timer::Scheduler::AlarmApi TimerMicro::Scheduler::sAlarmMicroApi = {
|
||||
&otPlatAlarmMicroGetNow,
|
||||
};
|
||||
|
||||
void TimerMicro::Start(uint32_t aDelay)
|
||||
{
|
||||
StartAt(GetNow(), aDelay);
|
||||
}
|
||||
void TimerMicro::Start(uint32_t aDelay) { StartAt(GetNow(), aDelay); }
|
||||
|
||||
void TimerMicro::StartAt(TimeMicro aStartTime, uint32_t aDelay)
|
||||
{
|
||||
@@ -245,15 +233,9 @@ void TimerMicro::FireAt(TimeMicro aFireTime)
|
||||
Get<Scheduler>().Add(*this);
|
||||
}
|
||||
|
||||
void TimerMicro::Stop(void)
|
||||
{
|
||||
Get<Scheduler>().Remove(*this);
|
||||
}
|
||||
void TimerMicro::Stop(void) { Get<Scheduler>().Remove(*this); }
|
||||
|
||||
void TimerMicro::RemoveAll(Instance &aInstance)
|
||||
{
|
||||
aInstance.Get<Scheduler>().RemoveAll();
|
||||
}
|
||||
void TimerMicro::RemoveAll(Instance &aInstance) { aInstance.Get<Scheduler>().RemoveAll(); }
|
||||
|
||||
extern "C" void otPlatAlarmMicroFired(otInstance *aInstance)
|
||||
{
|
||||
|
||||
@@ -54,10 +54,7 @@ const uint8_t *Tlv::GetValue(void) const
|
||||
return reinterpret_cast<const uint8_t *>(this) + (IsExtended() ? sizeof(ExtendedTlv) : sizeof(Tlv));
|
||||
}
|
||||
|
||||
Error Tlv::AppendTo(Message &aMessage) const
|
||||
{
|
||||
return aMessage.AppendBytes(this, static_cast<uint16_t>(GetSize()));
|
||||
}
|
||||
Error Tlv::AppendTo(Message &aMessage) const { return aMessage.AppendBytes(this, static_cast<uint16_t>(GetSize())); }
|
||||
|
||||
Error Tlv::FindTlv(const Message &aMessage, uint8_t aType, uint16_t aMaxSize, Tlv &aTlv)
|
||||
{
|
||||
|
||||
@@ -562,10 +562,7 @@ private:
|
||||
* @returns A `TlvType` pointer to `aTlv`.
|
||||
*
|
||||
*/
|
||||
template <class TlvType> TlvType *As(Tlv *aTlv)
|
||||
{
|
||||
return static_cast<TlvType *>(aTlv);
|
||||
}
|
||||
template <class TlvType> TlvType *As(Tlv *aTlv) { return static_cast<TlvType *>(aTlv); }
|
||||
|
||||
/**
|
||||
* This template method casts a `Tlv` pointer to a given subclass `TlvType` pointer.
|
||||
@@ -577,10 +574,7 @@ template <class TlvType> TlvType *As(Tlv *aTlv)
|
||||
* @returns A `TlvType` pointer to `aTlv`.
|
||||
*
|
||||
*/
|
||||
template <class TlvType> const TlvType *As(const Tlv *aTlv)
|
||||
{
|
||||
return static_cast<const TlvType *>(aTlv);
|
||||
}
|
||||
template <class TlvType> const TlvType *As(const Tlv *aTlv) { return static_cast<const TlvType *>(aTlv); }
|
||||
|
||||
/**
|
||||
* This template method casts a `Tlv` reference to a given subclass `TlvType` reference.
|
||||
@@ -592,10 +586,7 @@ template <class TlvType> const TlvType *As(const Tlv *aTlv)
|
||||
* @returns A `TlvType` reference to `aTlv`.
|
||||
*
|
||||
*/
|
||||
template <class TlvType> TlvType &As(Tlv &aTlv)
|
||||
{
|
||||
return static_cast<TlvType &>(aTlv);
|
||||
}
|
||||
template <class TlvType> TlvType &As(Tlv &aTlv) { return static_cast<TlvType &>(aTlv); }
|
||||
|
||||
/**
|
||||
* This template method casts a `Tlv` reference to a given subclass `TlvType` reference.
|
||||
@@ -607,10 +598,7 @@ template <class TlvType> TlvType &As(Tlv &aTlv)
|
||||
* @returns A `TlvType` reference to `aTlv`.
|
||||
*
|
||||
*/
|
||||
template <class TlvType> const TlvType &As(const Tlv &aTlv)
|
||||
{
|
||||
return static_cast<const TlvType &>(aTlv);
|
||||
}
|
||||
template <class TlvType> const TlvType &As(const Tlv &aTlv) { return static_cast<const TlvType &>(aTlv); }
|
||||
|
||||
/**
|
||||
* This class defines constants for a TLV.
|
||||
|
||||
@@ -115,10 +115,7 @@ void TrickleTimer::StartNewInterval(void)
|
||||
TimerMilli::Start(mTimeInInterval);
|
||||
}
|
||||
|
||||
void TrickleTimer::HandleTimer(Timer &aTimer)
|
||||
{
|
||||
static_cast<TrickleTimer *>(&aTimer)->HandleTimer();
|
||||
}
|
||||
void TrickleTimer::HandleTimer(Timer &aTimer) { static_cast<TrickleTimer *>(&aTimer)->HandleTimer(); }
|
||||
|
||||
void TrickleTimer::HandleTimer(void)
|
||||
{
|
||||
|
||||
@@ -174,10 +174,7 @@ public:
|
||||
* @returns The tag length in bytes.
|
||||
*
|
||||
*/
|
||||
uint8_t GetTagLength(void) const
|
||||
{
|
||||
return mTagLength;
|
||||
}
|
||||
uint8_t GetTagLength(void) const { return mTagLength; }
|
||||
|
||||
/**
|
||||
* This method generates the tag.
|
||||
|
||||
@@ -45,20 +45,14 @@ AesEcb::AesEcb(void)
|
||||
SuccessOrAssert(otPlatCryptoAesInit(&mContext));
|
||||
}
|
||||
|
||||
void AesEcb::SetKey(const Key &aKey)
|
||||
{
|
||||
SuccessOrAssert(otPlatCryptoAesSetKey(&mContext, &aKey));
|
||||
}
|
||||
void AesEcb::SetKey(const Key &aKey) { SuccessOrAssert(otPlatCryptoAesSetKey(&mContext, &aKey)); }
|
||||
|
||||
void AesEcb::Encrypt(const uint8_t aInput[kBlockSize], uint8_t aOutput[kBlockSize])
|
||||
{
|
||||
SuccessOrAssert(otPlatCryptoAesEncrypt(&mContext, aInput, aOutput));
|
||||
}
|
||||
|
||||
AesEcb::~AesEcb(void)
|
||||
{
|
||||
SuccessOrAssert(otPlatCryptoAesFree(&mContext));
|
||||
}
|
||||
AesEcb::~AesEcb(void) { SuccessOrAssert(otPlatCryptoAesFree(&mContext)); }
|
||||
|
||||
} // namespace Crypto
|
||||
} // namespace ot
|
||||
|
||||
@@ -50,10 +50,7 @@ HkdfSha256::HkdfSha256(void)
|
||||
SuccessOrAssert(otPlatCryptoHkdfInit(&mContext));
|
||||
}
|
||||
|
||||
HkdfSha256::~HkdfSha256(void)
|
||||
{
|
||||
SuccessOrAssert(otPlatCryptoHkdfDeinit(&mContext));
|
||||
}
|
||||
HkdfSha256::~HkdfSha256(void) { SuccessOrAssert(otPlatCryptoHkdfDeinit(&mContext)); }
|
||||
|
||||
void HkdfSha256::Extract(const uint8_t *aSalt, uint16_t aSaltLength, const Key &aInputKey)
|
||||
{
|
||||
|
||||
@@ -47,15 +47,9 @@ HmacSha256::HmacSha256(void)
|
||||
SuccessOrAssert(otPlatCryptoHmacSha256Init(&mContext));
|
||||
}
|
||||
|
||||
HmacSha256::~HmacSha256(void)
|
||||
{
|
||||
SuccessOrAssert(otPlatCryptoHmacSha256Deinit(&mContext));
|
||||
}
|
||||
HmacSha256::~HmacSha256(void) { SuccessOrAssert(otPlatCryptoHmacSha256Deinit(&mContext)); }
|
||||
|
||||
void HmacSha256::Start(const Key &aKey)
|
||||
{
|
||||
SuccessOrAssert(otPlatCryptoHmacSha256Start(&mContext, &aKey));
|
||||
}
|
||||
void HmacSha256::Start(const Key &aKey) { SuccessOrAssert(otPlatCryptoHmacSha256Start(&mContext, &aKey)); }
|
||||
|
||||
void HmacSha256::Update(const void *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
|
||||
@@ -47,15 +47,9 @@ Sha256::Sha256(void)
|
||||
SuccessOrAssert(otPlatCryptoSha256Init(&mContext));
|
||||
}
|
||||
|
||||
Sha256::~Sha256(void)
|
||||
{
|
||||
SuccessOrAssert(otPlatCryptoSha256Deinit(&mContext));
|
||||
}
|
||||
Sha256::~Sha256(void) { SuccessOrAssert(otPlatCryptoSha256Deinit(&mContext)); }
|
||||
|
||||
void Sha256::Start(void)
|
||||
{
|
||||
SuccessOrAssert(otPlatCryptoSha256Start(&mContext));
|
||||
}
|
||||
void Sha256::Start(void) { SuccessOrAssert(otPlatCryptoSha256Start(&mContext)); }
|
||||
|
||||
void Sha256::Update(const void *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
@@ -75,10 +69,7 @@ void Sha256::Update(const Message &aMessage, uint16_t aOffset, uint16_t aLength)
|
||||
}
|
||||
}
|
||||
|
||||
void Sha256::Finish(Hash &aHash)
|
||||
{
|
||||
SuccessOrAssert(otPlatCryptoSha256Finish(&mContext, aHash.m8, Hash::kSize));
|
||||
}
|
||||
void Sha256::Finish(Hash &aHash) { SuccessOrAssert(otPlatCryptoSha256Finish(&mContext, aHash.m8, Hash::kSize)); }
|
||||
|
||||
} // namespace Crypto
|
||||
} // namespace ot
|
||||
|
||||
@@ -112,10 +112,7 @@ constexpr KeyRef kPendingDatasetPskcRef = OPENTHREAD_CONFIG_PSA_ITS_NVM_OF
|
||||
* @retval FALSE If @p aKeyRef is not valid.
|
||||
*
|
||||
*/
|
||||
inline bool IsKeyRefValid(KeyRef aKeyRef)
|
||||
{
|
||||
return (aKeyRef < kInvalidKeyRef);
|
||||
}
|
||||
inline bool IsKeyRefValid(KeyRef aKeyRef) { return (aKeyRef < kInvalidKeyRef); }
|
||||
|
||||
/**
|
||||
* Import a key into PSA ITS.
|
||||
@@ -187,10 +184,7 @@ inline void DestroyKey(KeyRef aKeyRef)
|
||||
* @retval false Key Ref passed is invalid and has no key associated in PSA.
|
||||
*
|
||||
*/
|
||||
inline bool HasKey(KeyRef aKeyRef)
|
||||
{
|
||||
return otPlatCryptoHasKey(aKeyRef);
|
||||
}
|
||||
inline bool HasKey(KeyRef aKeyRef) { return otPlatCryptoHasKey(aKeyRef); }
|
||||
|
||||
} // namespace Storage
|
||||
|
||||
@@ -250,10 +244,7 @@ public:
|
||||
* @retval FALSE The `Key` represents a literal key.
|
||||
*
|
||||
*/
|
||||
bool IsKeyRef(void) const
|
||||
{
|
||||
return (mKey == nullptr);
|
||||
}
|
||||
bool IsKeyRef(void) const { return (mKey == nullptr); }
|
||||
|
||||
/**
|
||||
* This method gets the `KeyRef`.
|
||||
@@ -263,10 +254,7 @@ public:
|
||||
* @returns The `KeyRef` associated with `Key`.
|
||||
*
|
||||
*/
|
||||
Storage::KeyRef GetKeyRef(void) const
|
||||
{
|
||||
return mKeyRef;
|
||||
}
|
||||
Storage::KeyRef GetKeyRef(void) const { return mKeyRef; }
|
||||
|
||||
/**
|
||||
* This method sets the `Key` as a `KeyRef`.
|
||||
|
||||
@@ -173,10 +173,7 @@ Error Diags::ProcessStop(uint8_t aArgsLength, char *aArgs[], char *aOutput, size
|
||||
return kErrorNone;
|
||||
}
|
||||
|
||||
extern "C" void otPlatDiagAlarmFired(otInstance *aInstance)
|
||||
{
|
||||
otPlatDiagAlarmCallback(aInstance);
|
||||
}
|
||||
extern "C" void otPlatDiagAlarmFired(otInstance *aInstance) { otPlatDiagAlarmCallback(aInstance); }
|
||||
|
||||
#else // OPENTHREAD_RADIO && !OPENTHREAD_RADIO_CLI
|
||||
// For OPENTHREAD_FTD, OPENTHREAD_MTD, OPENTHREAD_RADIO_CLI
|
||||
@@ -475,10 +472,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
extern "C" void otPlatDiagAlarmFired(otInstance *aInstance)
|
||||
{
|
||||
AsCoreType(aInstance).Get<Diags>().AlarmFired();
|
||||
}
|
||||
extern "C" void otPlatDiagAlarmFired(otInstance *aInstance) { AsCoreType(aInstance).Get<Diags>().AlarmFired(); }
|
||||
|
||||
void Diags::AlarmFired(void)
|
||||
{
|
||||
@@ -724,10 +718,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
bool Diags::IsEnabled(void)
|
||||
{
|
||||
return otPlatDiagModeGet();
|
||||
}
|
||||
bool Diags::IsEnabled(void) { return otPlatDiagModeGet(); }
|
||||
|
||||
} // namespace FactoryDiags
|
||||
} // namespace ot
|
||||
|
||||
@@ -94,82 +94,31 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
bool IsDataPollPending(void) const
|
||||
{
|
||||
return mDataPollPending;
|
||||
}
|
||||
void SetDataPollPending(bool aPending)
|
||||
{
|
||||
mDataPollPending = aPending;
|
||||
}
|
||||
bool IsDataPollPending(void) const { return mDataPollPending; }
|
||||
void SetDataPollPending(bool aPending) { mDataPollPending = aPending; }
|
||||
|
||||
uint32_t GetIndirectFrameCounter(void) const
|
||||
{
|
||||
return mIndirectFrameCounter;
|
||||
}
|
||||
void SetIndirectFrameCounter(uint32_t aFrameCounter)
|
||||
{
|
||||
mIndirectFrameCounter = aFrameCounter;
|
||||
}
|
||||
uint32_t GetIndirectFrameCounter(void) const { return mIndirectFrameCounter; }
|
||||
void SetIndirectFrameCounter(uint32_t aFrameCounter) { mIndirectFrameCounter = aFrameCounter; }
|
||||
|
||||
uint8_t GetIndirectKeyId(void) const
|
||||
{
|
||||
return mIndirectKeyId;
|
||||
}
|
||||
void SetIndirectKeyId(uint8_t aKeyId)
|
||||
{
|
||||
mIndirectKeyId = aKeyId;
|
||||
}
|
||||
uint8_t GetIndirectKeyId(void) const { return mIndirectKeyId; }
|
||||
void SetIndirectKeyId(uint8_t aKeyId) { mIndirectKeyId = aKeyId; }
|
||||
|
||||
uint8_t GetIndirectTxAttempts(void) const
|
||||
{
|
||||
return mIndirectTxAttempts;
|
||||
}
|
||||
void ResetIndirectTxAttempts(void)
|
||||
{
|
||||
mIndirectTxAttempts = 0;
|
||||
}
|
||||
void IncrementIndirectTxAttempts(void)
|
||||
{
|
||||
mIndirectTxAttempts++;
|
||||
}
|
||||
uint8_t GetIndirectTxAttempts(void) const { return mIndirectTxAttempts; }
|
||||
void ResetIndirectTxAttempts(void) { mIndirectTxAttempts = 0; }
|
||||
void IncrementIndirectTxAttempts(void) { mIndirectTxAttempts++; }
|
||||
|
||||
uint8_t GetIndirectDataSequenceNumber(void) const
|
||||
{
|
||||
return mIndirectDsn;
|
||||
}
|
||||
void SetIndirectDataSequenceNumber(uint8_t aDsn)
|
||||
{
|
||||
mIndirectDsn = aDsn;
|
||||
}
|
||||
uint8_t GetIndirectDataSequenceNumber(void) const { return mIndirectDsn; }
|
||||
void SetIndirectDataSequenceNumber(uint8_t aDsn) { mIndirectDsn = aDsn; }
|
||||
|
||||
bool IsFramePurgePending(void) const
|
||||
{
|
||||
return mFramePurgePending;
|
||||
}
|
||||
void SetFramePurgePending(bool aPurgePending)
|
||||
{
|
||||
mFramePurgePending = aPurgePending;
|
||||
}
|
||||
bool IsFramePurgePending(void) const { return mFramePurgePending; }
|
||||
void SetFramePurgePending(bool aPurgePending) { mFramePurgePending = aPurgePending; }
|
||||
|
||||
bool IsFrameReplacePending(void) const
|
||||
{
|
||||
return mFrameReplacePending;
|
||||
}
|
||||
void SetFrameReplacePending(bool aReplacePending)
|
||||
{
|
||||
mFrameReplacePending = aReplacePending;
|
||||
}
|
||||
bool IsFrameReplacePending(void) const { return mFrameReplacePending; }
|
||||
void SetFrameReplacePending(bool aReplacePending) { mFrameReplacePending = aReplacePending; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_MULTI_RADIO
|
||||
Mac::RadioType GetLastPollRadioType(void) const
|
||||
{
|
||||
return mLastPollRadioType;
|
||||
}
|
||||
void SetLastPollRadioType(Mac::RadioType aRadioType)
|
||||
{
|
||||
mLastPollRadioType = aRadioType;
|
||||
}
|
||||
Mac::RadioType GetLastPollRadioType(void) const { return mLastPollRadioType; }
|
||||
void SetLastPollRadioType(Mac::RadioType aRadioType) { mLastPollRadioType = aRadioType; }
|
||||
#endif
|
||||
|
||||
uint32_t mIndirectFrameCounter; // Frame counter for current indirect frame (used for retx).
|
||||
|
||||
@@ -276,10 +276,7 @@ private:
|
||||
void ScheduleNextPoll(PollPeriodSelector aPollPeriodSelector);
|
||||
uint32_t CalculatePollPeriod(void) const;
|
||||
const Neighbor &GetParent(void) const;
|
||||
void HandlePollTimer(void)
|
||||
{
|
||||
IgnoreError(SendDataPoll());
|
||||
}
|
||||
void HandlePollTimer(void) { IgnoreError(SendDataPoll()); }
|
||||
#if OPENTHREAD_CONFIG_MULTI_RADIO
|
||||
Error GetPollDestinationAddress(Mac::Address &aDest, Mac::RadioType &aRadioType) const;
|
||||
#else
|
||||
|
||||
@@ -303,9 +303,7 @@ public:
|
||||
uint8_t aRetryCount,
|
||||
bool aWillRetx);
|
||||
#else
|
||||
void RecordFrameTransmitStatus(const TxFrame &, const RxFrame *, Error, uint8_t, bool)
|
||||
{
|
||||
}
|
||||
void RecordFrameTransmitStatus(const TxFrame &, const RxFrame *, Error, uint8_t, bool) {}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user