mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 15:47:46 +00:00
[style] apply OT_UNUSED_VARIABLE (#3299)
This commit is contained in:
@@ -82,7 +82,8 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
*/
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sTime0 = aT0;
|
||||
sAlarmTime = aDt;
|
||||
sIsRunning = true;
|
||||
@@ -93,7 +94,8 @@ void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
*/
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sIsRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
// Add more platform specific diagnostics features here.
|
||||
if (argc > 1)
|
||||
@@ -69,24 +69,24 @@ bool otPlatDiagModeGet()
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
(void)aChannel;
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
(void)aTxPower;
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
(void)aFormat;
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
*/
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
SysCtrlSystemReset();
|
||||
}
|
||||
|
||||
@@ -52,9 +53,10 @@ void otPlatReset(otInstance *aInstance)
|
||||
*/
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
otPlatResetReason ret;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
switch (SysCtrlResetSourceGet())
|
||||
{
|
||||
case RSTSRC_PWR_ON:
|
||||
|
||||
@@ -1208,7 +1208,8 @@ void cc1352RadioInit(void)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc1352_stateSleep)
|
||||
{
|
||||
@@ -1257,7 +1258,7 @@ exit:
|
||||
*/
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sState != cc1352_stateDisabled);
|
||||
}
|
||||
|
||||
@@ -1267,7 +1268,8 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc1352_stateDisabled)
|
||||
{
|
||||
@@ -1293,7 +1295,8 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc1352_stateSleep)
|
||||
{
|
||||
@@ -1312,7 +1315,8 @@ exit:
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(aPower != NULL, error = OT_ERROR_INVALID_ARGS);
|
||||
*aPower = sCurrentOutputPower->dbm;
|
||||
@@ -1328,7 +1332,8 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
unsigned int i;
|
||||
output_config_t const *powerCfg = &(rgOutputPower[0]);
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
for (i = 1; i < OUTPUT_CONFIG_COUNT; i++)
|
||||
{
|
||||
@@ -1353,7 +1358,8 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc1352_stateSleep)
|
||||
{
|
||||
@@ -1406,7 +1412,8 @@ exit:
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc1352_stateSleep)
|
||||
{
|
||||
@@ -1432,7 +1439,7 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
*/
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
@@ -1465,7 +1472,7 @@ exit:
|
||||
*/
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sRfStats.maxRssi;
|
||||
}
|
||||
|
||||
@@ -1474,7 +1481,7 @@ int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
*/
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_ENERGY_SCAN | OT_RADIO_CAPS_TRANSMIT_RETRIES;
|
||||
}
|
||||
|
||||
@@ -1483,7 +1490,7 @@ otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
*/
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1503,8 +1510,9 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx = rfCoreFindShortSrcMatchIdx(aShortAddress);
|
||||
uint8_t idx = rfCoreFindShortSrcMatchIdx(aShortAddress);
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (idx == CC1352_SRC_MATCH_NONE)
|
||||
{
|
||||
@@ -1536,8 +1544,10 @@ exit:
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION((idx = rfCoreFindShortSrcMatchIdx(aShortAddress)) != CC1352_SRC_MATCH_NONE,
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -1564,8 +1574,9 @@ exit:
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress);
|
||||
uint8_t idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress);
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (idx == CC1352_SRC_MATCH_NONE)
|
||||
{
|
||||
@@ -1596,8 +1607,10 @@ exit:
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION((idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress)) != CC1352_SRC_MATCH_NONE,
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -1622,7 +1635,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1649,7 +1662,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1676,7 +1689,7 @@ exit:
|
||||
*/
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
/* we are promiscuous if we are not filtering */
|
||||
return sReceiveCmd.frameFiltOpt.frameFiltEn == 0;
|
||||
}
|
||||
@@ -1686,7 +1699,7 @@ bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
*/
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1709,7 +1722,8 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
uint8_t * eui64;
|
||||
unsigned int i;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/*
|
||||
* The IEEE MAC address can be stored two places. We check the Customer
|
||||
@@ -1757,7 +1771,7 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
*/
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanid)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/* XXX: if the pan id is the broadcast pan id (0xFFFF) the auto ack will
|
||||
* not work. This is due to the design of the CM0 and follows IEEE 802.15.4
|
||||
@@ -1788,7 +1802,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/* XXX: assuming little endian format */
|
||||
if (sState == cc1352_stateReceive)
|
||||
@@ -1817,7 +1831,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc1352_stateReceive)
|
||||
{
|
||||
@@ -1982,6 +1996,6 @@ void cc1352RadioProcess(otInstance *aInstance)
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return CC1352_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ const char *dummy_ccfg_ref = ((const char *)(&(__ccfg)));
|
||||
*/
|
||||
void otSysInit(int argc, char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
while (dummy_ccfg_ref == NULL)
|
||||
{
|
||||
|
||||
@@ -65,7 +65,8 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sAlarmT0 = t0;
|
||||
sAlarmDt = dt;
|
||||
sIsRunning = true;
|
||||
@@ -73,7 +74,7 @@ void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt)
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,10 +47,11 @@ static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
// Add more plarform specific diagnostics features here.
|
||||
snprintf(aOutput, aOutputMaxLen, "diag feature '%s' is not supported\r\n", argv[0]);
|
||||
(void)argc;
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
@@ -65,24 +66,24 @@ bool otPlatDiagModeGet()
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
(void)aChannel;
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
(void)aTxPower;
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
* Platform abstraction for the logging
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/platform/logging.h>
|
||||
@@ -40,8 +41,8 @@
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
(void)aFormat;
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
HWREG(SYS_CTRL_PWRDBG) = SYS_CTRL_PWRDBG_FORCE_WARM_RESET;
|
||||
}
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
// TODO: Write me!
|
||||
return OT_PLAT_RESET_REASON_POWER_ON;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,8 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
// See https://e2e.ti.com/support/wireless_connectivity/low_power_rf_tools/f/155/p/307344/1072252
|
||||
|
||||
volatile uint32_t *eui64 = &HWREG(IEEE_EUI64);
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
// Read first 32-bits
|
||||
uint32_t part = eui64[0];
|
||||
@@ -217,7 +218,7 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanid)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogInfoPlat("PANID=%X", aPanid);
|
||||
|
||||
@@ -227,7 +228,7 @@ void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanid)
|
||||
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogInfoPlat("ExtAddr=%X%X%X%X%X%X%X%X", aAddress->m8[7], aAddress->m8[6], aAddress->m8[5], aAddress->m8[4],
|
||||
aAddress->m8[3], aAddress->m8[2], aAddress->m8[1], aAddress->m8[0]);
|
||||
@@ -240,7 +241,7 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aA
|
||||
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogInfoPlat("ShortAddr=%X", aAddress);
|
||||
|
||||
@@ -281,7 +282,7 @@ void cc2538RadioInit(void)
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sState != OT_RADIO_STATE_DISABLED) ? true : false;
|
||||
}
|
||||
|
||||
@@ -310,7 +311,8 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == OT_RADIO_STATE_SLEEP || sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
@@ -326,7 +328,8 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState != OT_RADIO_STATE_DISABLED)
|
||||
{
|
||||
@@ -369,7 +372,8 @@ static void setupTransmit(otRadioFrame *aFrame)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
@@ -459,31 +463,31 @@ exit:
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_NONE;
|
||||
}
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (HWREG(RFCORE_XREG_FRMFILT0) & RFCORE_XREG_FRMFILT0_FRAME_FILTER_EN) == 0;
|
||||
}
|
||||
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogInfoPlat("PromiscuousMode=%d", aEnable ? 1 : 0);
|
||||
|
||||
@@ -782,7 +786,7 @@ int8_t findSrcMatchAvailEntry(bool aShort)
|
||||
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogInfoPlat("EnableSrcMatch=%d", aEnable ? 1 : 0);
|
||||
|
||||
@@ -804,7 +808,8 @@ otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t a
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = findSrcMatchAvailEntry(true);
|
||||
uint32_t *addr = (uint32_t *)RFCORE_FFSM_SRCADDRESS_TABLE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Add ShortAddr entry: %d", entry);
|
||||
|
||||
@@ -828,7 +833,8 @@ otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = findSrcMatchAvailEntry(false);
|
||||
uint32_t *addr = (uint32_t *)RFCORE_FFSM_SRCADDRESS_TABLE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Add ExtAddr entry: %d", entry);
|
||||
|
||||
@@ -851,7 +857,8 @@ otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = findSrcMatchShortEntry(aShortAddress);
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Clear ShortAddr entry: %d", entry);
|
||||
|
||||
@@ -867,7 +874,8 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = findSrcMatchExtEntry(aExtAddress);
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Clear ExtAddr entry: %d", entry);
|
||||
|
||||
@@ -883,7 +891,8 @@ void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
uint32_t *addrEn = (uint32_t *)RFCORE_XREG_SRCSHORTEN0;
|
||||
uint32_t *addrAutoPendEn = (uint32_t *)RFCORE_FFSM_SRCSHORTPENDEN0;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Clear ShortAddr entries", NULL);
|
||||
|
||||
@@ -898,7 +907,8 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
uint32_t *addrEn = (uint32_t *)RFCORE_XREG_SRCEXTEN0;
|
||||
uint32_t *addrAutoPendEn = (uint32_t *)RFCORE_FFSM_SRCEXTPENDEN0;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Clear ExtAddr entries", NULL);
|
||||
|
||||
@@ -911,16 +921,17 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aScanChannel);
|
||||
OT_UNUSED_VARIABLE(aScanDuration);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(aPower != NULL, error = OT_ERROR_INVALID_ARGS);
|
||||
*aPower = sTxPower;
|
||||
@@ -931,14 +942,13 @@ exit:
|
||||
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
setTxPower(aPower);
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return CC2538_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
@@ -38,15 +38,15 @@ otInstance *sInstance;
|
||||
|
||||
void otSysInit(int argc, char *argv[])
|
||||
{
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_DEBUG_UART
|
||||
cc2538DebugUartInit();
|
||||
#endif
|
||||
cc2538AlarmInit();
|
||||
cc2538RandomInit();
|
||||
cc2538RadioInit();
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
}
|
||||
|
||||
bool otSysPseudoResetWasRequested(void)
|
||||
|
||||
@@ -73,7 +73,8 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
*/
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sTime0 = aT0;
|
||||
sAlarmTime = aDt;
|
||||
sIsRunning = true;
|
||||
@@ -84,7 +85,7 @@ void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
*/
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,14 +45,13 @@ static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
// Add more platform specific diagnostics features here.
|
||||
if (argc > 1)
|
||||
{
|
||||
snprintf(aOutput, aOutputMaxLen, "diag feature '%s' is not supported\r\n", argv[0]);
|
||||
}
|
||||
|
||||
(void)argc;
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
@@ -67,24 +66,24 @@ bool otPlatDiagModeGet()
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
(void)aChannel;
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
(void)aTxPower;
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -47,28 +47,28 @@ uint32_t utilsFlashGetSize(void)
|
||||
|
||||
otError utilsFlashErasePage(uint32_t aAddress)
|
||||
{
|
||||
(void)aAddress;
|
||||
OT_UNUSED_VARIABLE(aAddress);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
(void)aTimeout;
|
||||
OT_UNUSED_VARIABLE(aTimeout);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashWrite(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
{
|
||||
(void)aAddress;
|
||||
(void)aData;
|
||||
(void)aSize;
|
||||
OT_UNUSED_VARIABLE(aAddress);
|
||||
OT_UNUSED_VARIABLE(aData);
|
||||
OT_UNUSED_VARIABLE(aSize);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t utilsFlashRead(uint32_t aAddress, uint8_t *aData, uint32_t aSize)
|
||||
{
|
||||
(void)aAddress;
|
||||
(void)aData;
|
||||
(void)aSize;
|
||||
OT_UNUSED_VARIABLE(aAddress);
|
||||
OT_UNUSED_VARIABLE(aData);
|
||||
OT_UNUSED_VARIABLE(aSize);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
(void)aFormat;
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
*/
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
SysCtrlSystemReset();
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ void otPlatReset(otInstance *aInstance)
|
||||
*/
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
switch (SysCtrlResetSourceGet())
|
||||
{
|
||||
|
||||
@@ -1153,7 +1153,8 @@ void cc2650RadioInit(void)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2650_stateSleep)
|
||||
{
|
||||
@@ -1182,7 +1183,7 @@ exit:
|
||||
*/
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sState != cc2650_stateDisabled);
|
||||
}
|
||||
|
||||
@@ -1192,7 +1193,8 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2650_stateDisabled)
|
||||
{
|
||||
@@ -1218,7 +1220,8 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2650_stateSleep)
|
||||
{
|
||||
@@ -1237,7 +1240,8 @@ exit:
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(aPower != NULL, error = OT_ERROR_INVALID_ARGS);
|
||||
*aPower = sCurrentOutputPower->dbm;
|
||||
@@ -1253,7 +1257,8 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
unsigned int i;
|
||||
output_config_t const *powerCfg = &(rgOutputPower[0]);
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
for (i = 1; i < OUTPUT_CONFIG_COUNT; i++)
|
||||
{
|
||||
@@ -1278,7 +1283,8 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2650_stateSleep)
|
||||
{
|
||||
@@ -1329,7 +1335,8 @@ exit:
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2650_stateSleep)
|
||||
{
|
||||
@@ -1355,7 +1362,7 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
*/
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
@@ -1388,7 +1395,7 @@ exit:
|
||||
*/
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sRfStats.maxRssi;
|
||||
}
|
||||
|
||||
@@ -1397,7 +1404,7 @@ int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
*/
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_ENERGY_SCAN | OT_RADIO_CAPS_TRANSMIT_RETRIES;
|
||||
}
|
||||
|
||||
@@ -1406,7 +1413,7 @@ otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
*/
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1426,8 +1433,9 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx = rfCoreFindShortSrcMatchIdx(aShortAddress);
|
||||
uint8_t idx = rfCoreFindShortSrcMatchIdx(aShortAddress);
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (idx == CC2650_SRC_MATCH_NONE)
|
||||
{
|
||||
@@ -1459,8 +1467,10 @@ exit:
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION((idx = rfCoreFindShortSrcMatchIdx(aShortAddress)) != CC2650_SRC_MATCH_NONE,
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -1487,8 +1497,9 @@ exit:
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress);
|
||||
uint8_t idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress);
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (idx == CC2650_SRC_MATCH_NONE)
|
||||
{
|
||||
@@ -1519,8 +1530,10 @@ exit:
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION((idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress)) != CC2650_SRC_MATCH_NONE,
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -1545,7 +1558,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1572,7 +1585,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1599,7 +1612,7 @@ exit:
|
||||
*/
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
/* we are promiscuous if we are not filtering */
|
||||
return sReceiveCmd.frameFiltOpt.frameFiltEn == 0;
|
||||
}
|
||||
@@ -1609,7 +1622,7 @@ bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
*/
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1632,7 +1645,8 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
uint8_t * eui64;
|
||||
unsigned int i;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/* The IEEE MAC address can be stored two places. We check the Customer
|
||||
* Configuration was not set before defaulting to the Factory
|
||||
@@ -1679,7 +1693,7 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
*/
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanid)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/* XXX: if the pan id is the broadcast pan id (0xFFFF) the auto ack will
|
||||
* not work. This is due to the design of the CM0 and follows IEEE 802.15.4
|
||||
@@ -1710,7 +1724,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/* XXX: assuming little endian format */
|
||||
if (sState == cc2650_stateReceive)
|
||||
@@ -1739,7 +1753,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2650_stateReceive)
|
||||
{
|
||||
@@ -1905,6 +1919,6 @@ void cc2650RadioProcess(otInstance *aInstance)
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return CC2650_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ void *dummy_ccfg_ref = ((void *)(&(__ccfg)));
|
||||
*/
|
||||
void otSysInit(int argc, char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
while (dummy_ccfg_ref == NULL)
|
||||
{
|
||||
|
||||
@@ -82,7 +82,8 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
*/
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sTime0 = aT0;
|
||||
sAlarmTime = aDt;
|
||||
sIsRunning = true;
|
||||
@@ -93,7 +94,7 @@ void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
*/
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
// Add more platform specific diagnostics features here.
|
||||
if (argc > 1)
|
||||
@@ -69,24 +69,24 @@ bool otPlatDiagModeGet()
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
(void)aChannel;
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
(void)aTxPower;
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
(void)aFormat;
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
*/
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
SysCtrlSystemReset();
|
||||
}
|
||||
|
||||
@@ -52,9 +52,10 @@ void otPlatReset(otInstance *aInstance)
|
||||
*/
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
otPlatResetReason ret;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
switch (SysCtrlResetSourceGet())
|
||||
{
|
||||
case RSTSRC_PWR_ON:
|
||||
|
||||
@@ -1207,7 +1207,8 @@ void cc2652RadioInit(void)
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2652_stateSleep)
|
||||
{
|
||||
@@ -1237,7 +1238,7 @@ exit:
|
||||
*/
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sState != cc2652_stateDisabled);
|
||||
}
|
||||
|
||||
@@ -1247,7 +1248,8 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2652_stateDisabled)
|
||||
{
|
||||
@@ -1273,7 +1275,8 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2652_stateSleep)
|
||||
{
|
||||
@@ -1292,7 +1295,8 @@ exit:
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(aPower != NULL, error = OT_ERROR_INVALID_ARGS);
|
||||
*aPower = sCurrentOutputPower->dbm;
|
||||
@@ -1308,7 +1312,8 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
unsigned int i;
|
||||
output_config_t const *powerCfg = &(rgOutputPower[0]);
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
for (i = 1; i < OUTPUT_CONFIG_COUNT; i++)
|
||||
{
|
||||
@@ -1333,7 +1338,8 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2652_stateSleep)
|
||||
{
|
||||
@@ -1386,7 +1392,8 @@ exit:
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_BUSY;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2652_stateSleep)
|
||||
{
|
||||
@@ -1412,7 +1419,7 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
*/
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
@@ -1445,7 +1452,7 @@ exit:
|
||||
*/
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sRfStats.maxRssi;
|
||||
}
|
||||
|
||||
@@ -1454,7 +1461,7 @@ int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
*/
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_ENERGY_SCAN | OT_RADIO_CAPS_TRANSMIT_RETRIES;
|
||||
}
|
||||
|
||||
@@ -1463,7 +1470,7 @@ otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
*/
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1483,8 +1490,9 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx = rfCoreFindShortSrcMatchIdx(aShortAddress);
|
||||
uint8_t idx = rfCoreFindShortSrcMatchIdx(aShortAddress);
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (idx == CC2652_SRC_MATCH_NONE)
|
||||
{
|
||||
@@ -1516,8 +1524,10 @@ exit:
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION((idx = rfCoreFindShortSrcMatchIdx(aShortAddress)) != CC2652_SRC_MATCH_NONE,
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -1544,8 +1554,9 @@ exit:
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress);
|
||||
uint8_t idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress);
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (idx == CC2652_SRC_MATCH_NONE)
|
||||
{
|
||||
@@ -1576,8 +1587,10 @@ exit:
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
uint8_t idx;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION((idx = rfCoreFindExtSrcMatchIdx((uint64_t *)aExtAddress)) != CC2652_SRC_MATCH_NONE,
|
||||
error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -1602,7 +1615,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1629,7 +1642,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1656,7 +1669,7 @@ exit:
|
||||
*/
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
/* we are promiscuous if we are not filtering */
|
||||
return sReceiveCmd.frameFiltOpt.frameFiltEn == 0;
|
||||
}
|
||||
@@ -1666,7 +1679,7 @@ bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
*/
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sReceiveCmd.status == ACTIVE || sReceiveCmd.status == IEEE_SUSPENDED)
|
||||
{
|
||||
@@ -1689,7 +1702,8 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
uint8_t * eui64;
|
||||
unsigned int i;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/*
|
||||
* The IEEE MAC address can be stored two places. We check the Customer
|
||||
@@ -1737,7 +1751,7 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
*/
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanid)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/* XXX: if the pan id is the broadcast pan id (0xFFFF) the auto ack will
|
||||
* not work. This is due to the design of the CM0 and follows IEEE 802.15.4
|
||||
@@ -1768,7 +1782,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/* XXX: assuming little endian format */
|
||||
if (sState == cc2652_stateReceive)
|
||||
@@ -1797,7 +1811,7 @@ exit:
|
||||
*/
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == cc2652_stateReceive)
|
||||
{
|
||||
@@ -1963,6 +1977,6 @@ void cc2652RadioProcess(otInstance *aInstance)
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return CC2652_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ const char *dummy_ccfg_ref = ((const char *)(&(__ccfg)));
|
||||
*/
|
||||
void otSysInit(int argc, char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
while (dummy_ccfg_ref == NULL)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,8 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sAlarm = t0 + dt;
|
||||
sIsRunning = true;
|
||||
|
||||
@@ -88,7 +89,7 @@ void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt)
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsRunning = false;
|
||||
hw_timer0_freeze();
|
||||
}
|
||||
|
||||
@@ -27,15 +27,18 @@
|
||||
*/
|
||||
|
||||
#include "aes_alt.h"
|
||||
#include "mbedtls/aes.h"
|
||||
|
||||
#ifdef MBEDTLS_AES_ALT
|
||||
|
||||
#include "hw_aes_hash.h"
|
||||
#include <common/code_utils.hpp>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <openthread/platform/toolchain.h>
|
||||
|
||||
#include "hw_aes_hash.h"
|
||||
#include <common/code_utils.hpp>
|
||||
#include "mbedtls/aes.h"
|
||||
|
||||
static void mbedtls_zeroize(void *v, size_t n)
|
||||
{
|
||||
volatile unsigned char *p = (unsigned char *)v;
|
||||
@@ -167,7 +170,8 @@ int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx, int mode, const unsigned cha
|
||||
|
||||
int mbedtls_aes_self_test(int verbose)
|
||||
{
|
||||
(void)verbose;
|
||||
OT_UNUSED_VARIABLE(verbose);
|
||||
|
||||
/* 128-bit Key 2b7e151628aed2a6abf7158809cf4f3c */
|
||||
const uint8_t key_128b[16] = {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
|
||||
0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c};
|
||||
|
||||
@@ -65,7 +65,7 @@ otError utilsFlashErasePage(uint32_t aAddress)
|
||||
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
(void)aTimeout;
|
||||
OT_UNUSED_VARIABLE(aTimeout);
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
(void)aFormat;
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -35,13 +35,13 @@
|
||||
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
hw_cpm_reboot_system();
|
||||
}
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_PLAT_RESET_REASON_POWER_ON;
|
||||
}
|
||||
|
||||
|
||||
@@ -145,8 +145,7 @@ void da15000RadioInit(void)
|
||||
|
||||
void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
memcpy(aIeeeEui64, sEui64, RADIO_EUI64_TABLE_SIZE);
|
||||
}
|
||||
|
||||
@@ -220,8 +219,7 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sRadioState != OT_RADIO_STATE_DISABLED);
|
||||
}
|
||||
|
||||
@@ -278,8 +276,8 @@ exit:
|
||||
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aEnable;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aEnable);
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
@@ -407,8 +405,7 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
@@ -433,22 +430,19 @@ exit:
|
||||
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sRssiReal;
|
||||
}
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_TRANSMIT_RETRIES | OT_RADIO_CAPS_CSMA_BACKOFF;
|
||||
}
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sRadioPromiscuous;
|
||||
}
|
||||
|
||||
@@ -462,9 +456,9 @@ void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aScanChannel);
|
||||
OT_UNUSED_VARIABLE(aScanDuration);
|
||||
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
@@ -472,7 +466,7 @@ otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint1
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(aPower != NULL, error = OT_ERROR_INVALID_ARGS);
|
||||
*aPower = sTxPower;
|
||||
@@ -543,7 +537,7 @@ exit:
|
||||
|
||||
void ftdf_send_frame_transparent_confirm(void *handle, ftdf_bitmap32_t status)
|
||||
{
|
||||
(void)handle;
|
||||
OT_UNUSED_VARIABLE(handle);
|
||||
|
||||
switch (status)
|
||||
{
|
||||
@@ -614,6 +608,6 @@ exit:
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return DA15000_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
@@ -127,15 +127,15 @@ static void ExampleProcess(otInstance *aInstance)
|
||||
|
||||
void otSysInit(int argc, char *argv[])
|
||||
{
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
// Initialize Random number generator
|
||||
da15000RandomInit();
|
||||
// Initialize Alarm
|
||||
da15000AlarmInit();
|
||||
// Initialize Radio
|
||||
da15000RadioInit();
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
}
|
||||
|
||||
bool otSysPseudoResetWasRequested(void)
|
||||
|
||||
@@ -93,7 +93,7 @@ uint32_t otPlatTimeGetXtalAccuracy(void)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sAlarmT0 = t0;
|
||||
sAlarmDt = dt;
|
||||
sIsRunning = true;
|
||||
@@ -101,7 +101,7 @@ void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt)
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,10 +53,11 @@ static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
|
||||
// Add more plarform specific diagnostics features here.
|
||||
snprintf(aOutput, aOutputMaxLen, "diag feature '%s' is not supported\r\n", argv[0]);
|
||||
(void)argc;
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
@@ -71,24 +72,24 @@ bool otPlatDiagModeGet()
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
(void)aChannel;
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
(void)aTxPower;
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // #if OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, The OpenThread Authors.
|
||||
* Copyright (c) 2016, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -27,8 +27,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread platform abstraction for logging.
|
||||
* @file logging.c
|
||||
* Platform abstraction for the logging
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
(void)aFormat;
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -49,15 +49,16 @@ void efr32MiscInit(void)
|
||||
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
otPlatResetReason reason;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sResetCause & RMU_RSTCAUSE_PORST)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_POWER_ON;
|
||||
|
||||
@@ -209,7 +209,8 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
uint64_t eui64;
|
||||
uint8_t *eui64Ptr = NULL;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
eui64 = SYSTEM_GetUnique();
|
||||
eui64Ptr = (uint8_t *)&eui64;
|
||||
@@ -224,7 +225,7 @@ void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
{
|
||||
RAIL_Status_t status;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogInfoPlat("PANID=%X", aPanId);
|
||||
|
||||
@@ -237,7 +238,7 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aA
|
||||
{
|
||||
RAIL_Status_t status;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogInfoPlat("ExtAddr=%X%X%X%X%X%X%X%X", aAddress->m8[7], aAddress->m8[6], aAddress->m8[5], aAddress->m8[4],
|
||||
aAddress->m8[3], aAddress->m8[2], aAddress->m8[1], aAddress->m8[0]);
|
||||
@@ -250,7 +251,7 @@ void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
{
|
||||
RAIL_Status_t status;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogInfoPlat("ShortAddr=%X", aAddress);
|
||||
|
||||
@@ -260,7 +261,7 @@ void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sState != OT_RADIO_STATE_DISABLED);
|
||||
}
|
||||
|
||||
@@ -289,7 +290,8 @@ exit:
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION((sState != OT_RADIO_STATE_TRANSMIT) && (sState != OT_RADIO_STATE_DISABLED),
|
||||
error = OT_ERROR_INVALID_STATE);
|
||||
@@ -307,7 +309,8 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
RAIL_Status_t status;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(sState != OT_RADIO_STATE_DISABLED, error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
@@ -328,7 +331,6 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
RAIL_CsmaConfig_t csmaConfig = RAIL_CSMA_CONFIG_802_15_4_2003_2p4_GHz_OQPSK_CSMA;
|
||||
RAIL_TxOptions_t txOptions = RAIL_TX_OPTIONS_NONE;
|
||||
RAIL_Status_t status;
|
||||
(void)aInstance;
|
||||
|
||||
otEXPECT_ACTION((sState != OT_RADIO_STATE_DISABLED) && (sState != OT_RADIO_STATE_TRANSMIT),
|
||||
error = OT_ERROR_INVALID_STATE);
|
||||
@@ -363,25 +365,25 @@ exit:
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (int8_t)(RAIL_GetAverageRssi(sRailHandle) >> 2);
|
||||
}
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_CSMA_BACKOFF;
|
||||
}
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sPromiscuous;
|
||||
}
|
||||
|
||||
@@ -389,7 +391,7 @@ void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
RAIL_Status_t status;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sPromiscuous = aEnable;
|
||||
status = RAIL_IEEE802154_SetPromiscuousMode(sRailHandle, aEnable);
|
||||
@@ -500,7 +502,7 @@ void removeFromSrcMatchExtIndirect(uint8_t entry)
|
||||
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
// set Frame Pending bit for all outgoing ACKs if aEnable is false
|
||||
sIsSrcMatchEnabled = aEnable;
|
||||
@@ -508,10 +510,11 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = -1;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
entry = findSrcMatchAvailEntry(true);
|
||||
otLogDebgPlat("Add ShortAddr entry: %d", entry);
|
||||
|
||||
@@ -527,7 +530,8 @@ otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = -1;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
entry = findSrcMatchAvailEntry(false);
|
||||
otLogDebgPlat("Add ExtAddr entry: %d", entry);
|
||||
@@ -544,7 +548,8 @@ otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = -1;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
entry = findSrcMatchShortEntry(aShortAddress);
|
||||
otLogDebgPlat("Clear ShortAddr entry: %d", entry);
|
||||
@@ -561,7 +566,8 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
int8_t entry = -1;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
entry = findSrcMatchExtEntry(aExtAddress);
|
||||
otLogDebgPlat("Clear ExtAddr entry: %d", entry);
|
||||
@@ -576,7 +582,7 @@ exit:
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Clear ShortAddr entries", NULL);
|
||||
|
||||
@@ -585,7 +591,7 @@ void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Clear ExtAddr entries", NULL);
|
||||
|
||||
@@ -764,9 +770,9 @@ static void RAILCb_Generic(RAIL_Handle_t aRailHandle, RAIL_Events_t aEvents)
|
||||
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aScanChannel);
|
||||
OT_UNUSED_VARIABLE(aScanDuration);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@@ -805,7 +811,8 @@ void efr32RadioProcess(otInstance *aInstance)
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(aPower != NULL, error = OT_ERROR_INVALID_ARGS);
|
||||
*aPower = (int8_t)(RAIL_GetTxPowerDbm(sRailHandle) / 10);
|
||||
@@ -817,7 +824,8 @@ exit:
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
RAIL_Status_t status;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
status = RAIL_SetTxPowerDbm(sRailHandle, ((RAIL_TxPower_t)aPower) * 10);
|
||||
assert(status == RAIL_STATUS_NO_ERROR);
|
||||
@@ -827,6 +835,6 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return EFR32_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ otInstance *sInstance;
|
||||
|
||||
void otSysInit(int argc, char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
CHIP_Init();
|
||||
|
||||
|
||||
@@ -53,14 +53,14 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
expires = t0 + dt;
|
||||
sIsRunning = true;
|
||||
}
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
(void)aFormat;
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
// Default
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
mrf24j40_hard_reset();
|
||||
}
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
// TODO: Write me!
|
||||
return OT_PLAT_RESET_REASON_POWER_ON;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,8 @@ void setChannel(uint8_t channel)
|
||||
|
||||
void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
/* should set it manually or preset it in memory */
|
||||
aIeeeEui64[0] = 0x00;
|
||||
aIeeeEui64[1] = 0x50;
|
||||
@@ -239,9 +240,10 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t panid)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint8_t pan[2];
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
pan[0] = (uint8_t)(panid & 0xFF);
|
||||
pan[1] = (uint8_t)(panid >> 8);
|
||||
mrf24j40_set_pan(pan);
|
||||
@@ -249,16 +251,17 @@ void otPlatRadioSetPanId(otInstance *aInstance, uint16_t panid)
|
||||
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *address)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
/* cast to remove const, FIXME: perhaps the bsp library should be updated? */
|
||||
mrf24j40_set_eui((uint8_t *)(address->m8));
|
||||
}
|
||||
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t address)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint8_t addr[2];
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
addr[0] = (uint8_t)(address & 0xFF);
|
||||
addr[1] = (uint8_t)(address >> 8);
|
||||
mrf24j40_set_short_addr(addr);
|
||||
@@ -327,7 +330,7 @@ void emskRadioInit(void)
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sState != OT_RADIO_STATE_DISABLED);
|
||||
}
|
||||
|
||||
@@ -354,7 +357,8 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == OT_RADIO_STATE_SLEEP || sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
@@ -369,7 +373,8 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState != OT_RADIO_STATE_DISABLED)
|
||||
{
|
||||
@@ -386,8 +391,9 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
|
||||
if (sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
@@ -400,32 +406,32 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_NONE;
|
||||
}
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (bool)(mrf24j40_read_short_ctrl_reg(MRF24J40_RXMCR) & MRF24J40_PROMI);
|
||||
}
|
||||
|
||||
// should be checked again with CC2538
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
mrf24j40_set_promiscuous(~aEnable);
|
||||
}
|
||||
|
||||
@@ -623,74 +629,74 @@ static void RadioIsr(void *ptr)
|
||||
and this is not supported in MRF24J40 */
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aEnable;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aEnable);
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aShortAddress;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aShortAddress);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aExtAddress;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aExtAddress);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aShortAddress;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aShortAddress);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aExtAddress;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aExtAddress);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aScanChannel);
|
||||
OT_UNUSED_VARIABLE(aScanDuration);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
// TODO: Create a proper implementation for this driver.
|
||||
(void)aInstance;
|
||||
(void)aPower;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aPower);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
// TODO: Create a proper implementation for this driver.
|
||||
(void)aInstance;
|
||||
(void)aPower;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aPower);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return EMSK_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
@@ -41,15 +41,15 @@
|
||||
|
||||
void otSysInit(int argc, char *argv[])
|
||||
{
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
emskAlarmInit();
|
||||
emskRadioInit();
|
||||
emskRandomInit();
|
||||
otPlatUartEnable();
|
||||
|
||||
DBG("OpenThread Init Finished\r\n");
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
}
|
||||
|
||||
bool otSysPseudoResetWasRequested(void)
|
||||
|
||||
@@ -56,7 +56,7 @@ static void qorvoAlarmFired(void *aInstance)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt)
|
||||
{
|
||||
(void)t0;
|
||||
OT_UNUSED_VARIABLE(t0);
|
||||
qorvoAlarmUnScheduleEventArg((qorvoAlarmCallback_t)qorvoAlarmFired, aInstance);
|
||||
qorvoAlarmScheduleEventArg(dt * 1000, qorvoAlarmFired, aInstance);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
|
||||
void qorvoAlarmUpdateTimeout(struct timeval *aTimeout)
|
||||
{
|
||||
(void)aTimeout;
|
||||
OT_UNUSED_VARIABLE(aTimeout);
|
||||
}
|
||||
|
||||
void qorvoAlarmProcess(void)
|
||||
|
||||
@@ -45,10 +45,11 @@ static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
|
||||
// Add more plarform specific diagnostics features here.
|
||||
snprintf(aOutput, aOutputMaxLen, "diag feature '%s' is not supported\r\n", argv[0]);
|
||||
(void)argc;
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
@@ -63,24 +64,24 @@ bool otPlatDiagModeGet()
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
(void)aChannel;
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
(void)aTxPower;
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -119,7 +119,7 @@ exit:
|
||||
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
(void)aTimeout;
|
||||
OT_UNUSED_VARIABLE(aTimeout);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,6 +97,8 @@ OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const
|
||||
int charsWritten;
|
||||
va_list args;
|
||||
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
|
||||
offset = 0;
|
||||
|
||||
va_start(args, aFormat);
|
||||
@@ -107,8 +109,6 @@ OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const
|
||||
|
||||
exit:
|
||||
syslog(PlatOtLogLevelToSysLogLevel(aLogLevel), "%s", logString);
|
||||
|
||||
(void)aLogRegion;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -46,6 +46,8 @@ void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
char *argv[gArgumentsCount + 1];
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
for (int i = 0; i < gArgumentsCount; ++i)
|
||||
{
|
||||
argv[i] = gArguments[i];
|
||||
@@ -59,12 +61,11 @@ void otPlatReset(otInstance *aInstance)
|
||||
execvp(argv[0], argv);
|
||||
perror("reset failed");
|
||||
exit(EXIT_FAILURE);
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_PLAT_RESET_REASON_POWER_ON;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,32 +82,32 @@ static int8_t sLastReceivedPower = 127;
|
||||
|
||||
void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
qorvoRadioGetIeeeEui64(aIeeeEui64);
|
||||
}
|
||||
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t panid)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
qorvoRadioSetPanId(panid);
|
||||
otCachedSettings.panid = panid;
|
||||
}
|
||||
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *address)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
qorvoRadioSetExtendedAddress(address->m8);
|
||||
}
|
||||
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t address)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
qorvoRadioSetShortAddress(address);
|
||||
}
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sState != OT_RADIO_STATE_DISABLED);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,8 @@ otError otPlatRadioEnable(otInstance *aInstance)
|
||||
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT(otPlatRadioIsEnabled(aInstance));
|
||||
|
||||
if (sState == OT_RADIO_STATE_RECEIVE)
|
||||
@@ -142,9 +143,10 @@ exit:
|
||||
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
qorvoRadioSetRxOnWhenIdle(false);
|
||||
@@ -157,7 +159,8 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
|
||||
pQorvoInstance = aInstance;
|
||||
|
||||
if ((sState != OT_RADIO_STATE_DISABLED) && (sScanstate == 0))
|
||||
@@ -223,81 +226,81 @@ void cbQorvoRadioReceiveDone(otRadioFrame *aPacket, otError aError)
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sLastReceivedPower;
|
||||
}
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_ENERGY_SCAN | OT_RADIO_CAPS_TRANSMIT_RETRIES;
|
||||
}
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return false;
|
||||
}
|
||||
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aEnable;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aEnable);
|
||||
}
|
||||
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
qorvoRadioEnableSrcMatch(aEnable);
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return qorvoRadioAddSrcMatchShortEntry(aShortAddress, otCachedSettings.panid);
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return qorvoRadioAddSrcMatchExtEntry(aExtAddress->m8, otCachedSettings.panid);
|
||||
}
|
||||
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return qorvoRadioClearSrcMatchShortEntry(aShortAddress, otCachedSettings.panid);
|
||||
}
|
||||
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return qorvoRadioClearSrcMatchExtEntry(aExtAddress->m8, otCachedSettings.panid);
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
/* clear both short and extended addresses here */
|
||||
qorvoRadioClearSrcMatchEntries();
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
/* not implemented */
|
||||
/* assumes clearing of short and extended entries is done simultaniously by the openthread stack */
|
||||
}
|
||||
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sScanstate = 1;
|
||||
return qorvoRadioEnergyScan(aScanChannel, aScanDuration);
|
||||
}
|
||||
@@ -311,21 +314,21 @@ void cbQorvoRadioEnergyScanDone(int8_t aEnergyScanMaxRssi)
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
// TODO: Create a proper implementation for this driver.
|
||||
(void)aInstance;
|
||||
(void)aPower;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aPower);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
// TODO: Create a proper implementation for this driver.
|
||||
(void)aInstance;
|
||||
(void)aPower;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aPower);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return GP712_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
@@ -72,12 +72,12 @@ static void restore_stdout_termios(void)
|
||||
|
||||
void platformDummy(void *dummyPointer)
|
||||
{
|
||||
(void)dummyPointer;
|
||||
OT_UNUSED_VARIABLE(dummyPointer);
|
||||
}
|
||||
|
||||
static void cbKeyPressed(uint8_t Param)
|
||||
{
|
||||
(void)Param;
|
||||
OT_UNUSED_VARIABLE(Param);
|
||||
qorvoAlarmScheduleEventArg(0, platformDummy, (void *)&s_in_fd);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ void PlatSocketRx(uint16_t length, const char *buffer, uint32_t socketId)
|
||||
|
||||
void PlatSocketClose(uint32_t socketId)
|
||||
{
|
||||
(void)socketId;
|
||||
OT_UNUSED_VARIABLE(socketId);
|
||||
}
|
||||
|
||||
otError otPlatUartEnable(void)
|
||||
@@ -187,7 +187,7 @@ exit:
|
||||
|
||||
void PlatSocketRxSignaled(uint8_t id)
|
||||
{
|
||||
(void)(id);
|
||||
OT_UNUSED_VARIABLE(id);
|
||||
//Dummy callback function to flush pipe
|
||||
uint8_t readChar;
|
||||
//Remove trigger byte from pipe
|
||||
|
||||
@@ -79,13 +79,13 @@ void kw41zAlarmProcess(otInstance *aInstance)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sAlarmTime = aT0 + aDt;
|
||||
}
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sAlarmTime = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,10 +51,11 @@ static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
|
||||
// Add more plarform specific diagnostics features here.
|
||||
snprintf(aOutput, aOutputMaxLen, "diag feature '%s' is not supported\r\n", argv[0]);
|
||||
(void)argc;
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
@@ -69,24 +70,24 @@ bool otPlatDiagModeGet()
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
(void)aChannel;
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
(void)aTxPower;
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, The OpenThread Authors.
|
||||
* Copyright (c) 2016, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -27,8 +27,8 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread platform abstraction for logging.
|
||||
* @file logging.c
|
||||
* Platform abstraction for the logging
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
(void)aFormat;
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
NVIC_SystemReset();
|
||||
|
||||
while (1)
|
||||
@@ -42,9 +43,10 @@ void otPlatReset(otInstance *aInstance)
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
otPlatResetReason reason;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (RCM->SRS0 & RCM_SRS0_POR_MASK)
|
||||
{
|
||||
reason = OT_PLAT_RESET_REASON_POWER_ON;
|
||||
@@ -81,8 +83,8 @@ otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
|
||||
void otPlatAssertFail(const char *aFilename, int aLineNumber)
|
||||
{
|
||||
(void)aFilename;
|
||||
(void)aLineNumber;
|
||||
OT_UNUSED_VARIABLE(aFilename);
|
||||
OT_UNUSED_VARIABLE(aLineNumber);
|
||||
}
|
||||
|
||||
void otPlatWakeHost(void)
|
||||
|
||||
@@ -126,16 +126,17 @@ static bool rf_process_rx_frame(void);
|
||||
|
||||
otRadioState otPlatRadioGetState(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sState;
|
||||
}
|
||||
|
||||
void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint32_t addrLo;
|
||||
uint32_t addrHi;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if ((RSIM->MAC_LSB == 0xffffffff) && (RSIM->MAC_MSB == 0xff))
|
||||
{
|
||||
addrLo = SIM->UIDL;
|
||||
@@ -153,7 +154,7 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sPanId = aPanId;
|
||||
ZLL->MACSHORTADDRS0 &= ~ZLL_MACSHORTADDRS0_MACPANID0_MASK;
|
||||
@@ -162,10 +163,11 @@ void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint32_t addrLo;
|
||||
uint32_t addrHi;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
memcpy(&addrLo, aExtAddress->m8, sizeof(addrLo));
|
||||
memcpy(&addrHi, aExtAddress->m8 + sizeof(addrLo), sizeof(addrHi));
|
||||
|
||||
@@ -175,7 +177,7 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aE
|
||||
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
ZLL->MACSHORTADDRS0 &= ~ZLL_MACSHORTADDRS0_MACSHORTADDRS0_MASK;
|
||||
ZLL->MACSHORTADDRS0 |= ZLL_MACSHORTADDRS0_MACSHORTADDRS0(aShortAddress);
|
||||
@@ -210,14 +212,15 @@ exit:
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sState != OT_RADIO_STATE_DISABLED;
|
||||
}
|
||||
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
otError status = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(((sState != OT_RADIO_STATE_TRANSMIT) && (sState != OT_RADIO_STATE_DISABLED)),
|
||||
status = OT_ERROR_INVALID_STATE);
|
||||
@@ -232,7 +235,8 @@ exit:
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError status = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(((sState != OT_RADIO_STATE_TRANSMIT) && (sState != OT_RADIO_STATE_DISABLED)),
|
||||
status = OT_ERROR_INVALID_STATE);
|
||||
@@ -265,7 +269,7 @@ exit:
|
||||
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (aEnable)
|
||||
{
|
||||
@@ -279,41 +283,46 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint16_t checksum = sPanId + aShortAddress;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return rf_add_addr_table_entry(checksum, false);
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint16_t checksum = rf_get_addr_checksum((uint8_t *)aExtAddress->m8, true, sPanId);
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return rf_add_addr_table_entry(checksum, true);
|
||||
}
|
||||
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint16_t checksum = sPanId + aShortAddress;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return rf_remove_addr_table_entry(checksum);
|
||||
}
|
||||
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint16_t checksum = rf_get_addr_checksum((uint8_t *)aExtAddress->m8, true, sPanId);
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return rf_remove_addr_table_entry(checksum);
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint32_t i;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
for (i = 0; i < RADIO_CONFIG_SRC_MATCH_ENTRY_NUM; i++)
|
||||
{
|
||||
/* Optimization: sExtSrcAddrBitmap[i / 8] & (1 << (i % 8)) */
|
||||
@@ -326,9 +335,10 @@ void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
uint32_t i;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
for (i = 0; i < RADIO_CONFIG_SRC_MATCH_ENTRY_NUM; i++)
|
||||
{
|
||||
/* Optimization: sExtSrcAddrBitmap[i / 8] & (1 << (i % 8))*/
|
||||
@@ -341,7 +351,7 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTxFrame;
|
||||
}
|
||||
|
||||
@@ -410,25 +420,25 @@ exit:
|
||||
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (ZLL->LQI_AND_RSSI & ZLL_LQI_AND_RSSI_RSSI_MASK) >> ZLL_LQI_AND_RSSI_RSSI_SHIFT;
|
||||
}
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_ENERGY_SCAN;
|
||||
}
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (ZLL->PHY_CTRL & ZLL_PHY_CTRL_PROMISCUOUS_MASK) == ZLL_PHY_CTRL_PROMISCUOUS_MASK;
|
||||
}
|
||||
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (aEnable)
|
||||
{
|
||||
@@ -448,7 +458,8 @@ otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint1
|
||||
{
|
||||
otError status = OT_ERROR_NONE;
|
||||
uint32_t timeout;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT_ACTION(((sState != OT_RADIO_STATE_TRANSMIT) && (sState != OT_RADIO_STATE_DISABLED)),
|
||||
status = OT_ERROR_INVALID_STATE);
|
||||
@@ -491,7 +502,7 @@ exit:
|
||||
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sAutoTxPwrLevel = aPower;
|
||||
|
||||
@@ -500,8 +511,7 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return -100;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,9 @@ void otSysInit(int argc, char *argv[])
|
||||
uint32_t temp, tempTrim;
|
||||
uint8_t revId;
|
||||
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
/* enable clock for PORTs */
|
||||
CLOCK_EnableClock(kCLOCK_PortA);
|
||||
CLOCK_EnableClock(kCLOCK_PortB);
|
||||
@@ -94,9 +97,6 @@ void otSysInit(int argc, char *argv[])
|
||||
kw41zRadioInit();
|
||||
|
||||
otPlatUartEnable();
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
}
|
||||
|
||||
bool otSysPseudoResetWasRequested(void)
|
||||
|
||||
@@ -530,14 +530,14 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
AlarmStartAt(aT0, aDt, kMsTimer);
|
||||
}
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
AlarmStop(kMsTimer);
|
||||
}
|
||||
@@ -549,14 +549,14 @@ uint32_t otPlatAlarmMicroGetNow(void)
|
||||
|
||||
void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
AlarmStartAt(aT0, aDt, kUsTimer);
|
||||
}
|
||||
|
||||
void otPlatAlarmMicroStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
AlarmStop(kUsTimer);
|
||||
}
|
||||
|
||||
@@ -113,7 +113,8 @@ static bool startCarrierTransmision(void)
|
||||
|
||||
static void processListen(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE);
|
||||
@@ -139,7 +140,7 @@ exit:
|
||||
|
||||
static void processID(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
@@ -336,7 +337,7 @@ exit:
|
||||
|
||||
static void processCcaThreshold(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
nrf_802154_cca_cfg_t ccaConfig;
|
||||
@@ -429,7 +430,7 @@ void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sListen && (aError == OT_ERROR_NONE))
|
||||
{
|
||||
|
||||
@@ -142,7 +142,7 @@ void nrf5LogDeinit()
|
||||
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogRegion;
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
|
||||
uint16_t length = 0;
|
||||
int charsWritten;
|
||||
|
||||
@@ -70,7 +70,7 @@ void nrf5MiscDeinit(void)
|
||||
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
#if OPENTHREAD_PLATFORM_USE_PSEUDO_RESET
|
||||
gPlatformPseudoResetWasRequested = true;
|
||||
sResetReason = POWER_RESETREAS_SREQ_Msk;
|
||||
@@ -81,7 +81,8 @@ void otPlatReset(otInstance *aInstance)
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otPlatResetReason reason;
|
||||
|
||||
if (sResetReason & POWER_RESETREAS_RESETPIN_Msk)
|
||||
|
||||
@@ -180,7 +180,7 @@ static inline void clearPendingEvents(void)
|
||||
#if !OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE
|
||||
void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
uint64_t factoryAddress = (uint64_t)NRF_FICR->DEVICEID[0] << 32;
|
||||
factoryAddress |= NRF_FICR->DEVICEID[1];
|
||||
@@ -191,7 +191,7 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
uint8_t address[SHORT_ADDRESS_SIZE];
|
||||
convertShortAddress(address, aPanId);
|
||||
@@ -201,14 +201,14 @@ void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
nrf_802154_extended_address_set(aExtAddress->m8);
|
||||
}
|
||||
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
uint8_t address[SHORT_ADDRESS_SIZE];
|
||||
convertShortAddress(address, aShortAddress);
|
||||
@@ -231,7 +231,7 @@ void nrf5RadioDeinit(void)
|
||||
|
||||
otRadioState otPlatRadioGetState(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sDisabled)
|
||||
{
|
||||
@@ -259,10 +259,10 @@ otRadioState otPlatRadioGetState(otInstance *aInstance)
|
||||
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
sInstance = aInstance;
|
||||
|
||||
otError error;
|
||||
|
||||
sInstance = aInstance;
|
||||
|
||||
if (sDisabled)
|
||||
{
|
||||
sDisabled = false;
|
||||
@@ -278,10 +278,10 @@ otError otPlatRadioEnable(otInstance *aInstance)
|
||||
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otError error;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (!sDisabled)
|
||||
{
|
||||
sDisabled = true;
|
||||
@@ -297,14 +297,14 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return !sDisabled;
|
||||
}
|
||||
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (nrf_802154_sleep())
|
||||
{
|
||||
@@ -321,10 +321,10 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
bool result;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
nrf_802154_channel_set(aChannel);
|
||||
nrf_802154_tx_power_set(sDefaultTxPower);
|
||||
result = nrf_802154_receive();
|
||||
@@ -365,52 +365,52 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return nrf_802154_rssi_last_get();
|
||||
}
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return (otRadioCaps)(OT_RADIO_CAPS_ENERGY_SCAN | OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_CSMA_BACKOFF);
|
||||
}
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return nrf_802154_promiscuous_get();
|
||||
}
|
||||
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
nrf_802154_promiscuous_set(aEnable);
|
||||
}
|
||||
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
nrf_802154_auto_pending_bit_set(aEnable);
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otError error;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
uint8_t shortAddress[SHORT_ADDRESS_SIZE];
|
||||
convertShortAddress(shortAddress, aShortAddress);
|
||||
|
||||
@@ -428,10 +428,10 @@ otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t a
|
||||
|
||||
otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otError error;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (nrf_802154_pending_bit_for_addr_set(aExtAddress->m8, true))
|
||||
{
|
||||
error = OT_ERROR_NONE;
|
||||
@@ -446,10 +446,10 @@ otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress
|
||||
|
||||
otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otError error;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
uint8_t shortAddress[SHORT_ADDRESS_SIZE];
|
||||
convertShortAddress(shortAddress, aShortAddress);
|
||||
|
||||
@@ -467,10 +467,10 @@ otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t
|
||||
|
||||
otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otError error;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (nrf_802154_pending_bit_for_addr_clear(aExtAddress->m8, true))
|
||||
{
|
||||
error = OT_ERROR_NONE;
|
||||
@@ -485,21 +485,21 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
nrf_802154_pending_bit_for_addr_reset(false);
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
nrf_802154_pending_bit_for_addr_reset(true);
|
||||
}
|
||||
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sEnergyDetectionTime = (uint32_t)aScanDuration * 1000UL;
|
||||
sEnergyDetectionChannel = aScanChannel;
|
||||
@@ -523,7 +523,8 @@ otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint1
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (aPower == NULL)
|
||||
{
|
||||
@@ -539,7 +540,7 @@ otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sDefaultTxPower = aPower;
|
||||
nrf_802154_tx_power_set(aPower);
|
||||
@@ -797,7 +798,7 @@ void nrf_802154_energy_detected(uint8_t result)
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return NRF52840_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,14 +55,14 @@ void __cxa_pure_virtual(void)
|
||||
|
||||
void otSysInit(int argc, char *argv[])
|
||||
{
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
OT_UNUSED_VARIABLE(argv);
|
||||
|
||||
if (gPlatformPseudoResetWasRequested)
|
||||
{
|
||||
otSysDeinit();
|
||||
}
|
||||
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
#if !SOFTDEVICE_PRESENT
|
||||
// Enable I-code cache
|
||||
NRF_NVMC->ICACHECNF = NVMC_ICACHECNF_CACHEEN_Enabled;
|
||||
|
||||
@@ -50,7 +50,7 @@ __STATIC_INLINE void dataReadyEventClear(void)
|
||||
{
|
||||
NRF_TEMP->EVENTS_DATARDY = 0;
|
||||
volatile uint32_t dummy = NRF_TEMP->EVENTS_DATARDY;
|
||||
(void)dummy;
|
||||
OT_UNUSED_VARIABLE(dummy);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -331,6 +331,6 @@ OT_TOOL_WEAK void otPlatUartSendDone(void)
|
||||
|
||||
OT_TOOL_WEAK void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
(void)aBuf;
|
||||
(void)aBufLength;
|
||||
OT_UNUSED_VARIABLE(aBuf);
|
||||
OT_UNUSED_VARIABLE(aBufLength);
|
||||
}
|
||||
|
||||
@@ -77,14 +77,14 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sMsAlarm = aT0 + aDt;
|
||||
sIsMsRunning = true;
|
||||
}
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsMsRunning = false;
|
||||
}
|
||||
|
||||
@@ -95,14 +95,14 @@ uint32_t otPlatAlarmMicroGetNow(void)
|
||||
|
||||
void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sUsAlarm = aT0 + aDt;
|
||||
sIsUsRunning = true;
|
||||
}
|
||||
|
||||
void otPlatAlarmMicroStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsUsRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,10 +47,11 @@ static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
|
||||
// Add more plarform specific diagnostics features here.
|
||||
snprintf(aOutput, aOutputMaxLen, "diag feature '%s' is not supported\r\n", argv[0]);
|
||||
(void)argc;
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
void otPlatDiagModeSet(bool aMode)
|
||||
@@ -65,24 +66,24 @@ bool otPlatDiagModeGet()
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
(void)aChannel;
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
(void)aTxPower;
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -127,7 +127,7 @@ exit:
|
||||
|
||||
otError utilsFlashStatusWait(uint32_t aTimeout)
|
||||
{
|
||||
(void)aTimeout;
|
||||
OT_UNUSED_VARIABLE(aTimeout);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,9 @@ OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const
|
||||
int charsWritten;
|
||||
va_list args;
|
||||
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
|
||||
offset = 0;
|
||||
|
||||
LOG_PRINTF("[%d] ", gNodeId);
|
||||
@@ -79,9 +82,6 @@ exit:
|
||||
#else
|
||||
printf("%s\r\n", logString);
|
||||
#endif
|
||||
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
}
|
||||
|
||||
#endif // #if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED)
|
||||
|
||||
@@ -47,6 +47,8 @@ static otPlatMcuPowerState gPlatMcuPowerState = OT_PLAT_MCU_POWER_STATE_ON;
|
||||
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
#if _WIN32
|
||||
// This function does nothing on the Windows platform.
|
||||
|
||||
@@ -63,13 +65,11 @@ void otPlatReset(otInstance *aInstance)
|
||||
assert(false);
|
||||
|
||||
#endif // else OPENTHREAD_PLATFORM_USE_PSEUDO_RESET
|
||||
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sPlatResetReason;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ otError otPlatSetMcuPowerState(otInstance *aInstance, otPlatMcuPowerState aState
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
switch (aState)
|
||||
{
|
||||
@@ -101,6 +101,6 @@ otError otPlatSetMcuPowerState(otInstance *aInstance, otPlatMcuPowerState aState
|
||||
|
||||
otPlatMcuPowerState otPlatGetMcuPowerState(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return gPlatMcuPowerState;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,8 @@ static uint16_t crc16_citt(uint16_t aFcs, uint8_t aByte)
|
||||
|
||||
void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
aIeeeEui64[0] = 0x18;
|
||||
aIeeeEui64[1] = 0xb4;
|
||||
aIeeeEui64[2] = 0x30;
|
||||
@@ -354,13 +355,13 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t panid)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sPanid = panid;
|
||||
}
|
||||
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
for (size_t i = 0; i < sizeof(sExtendedAddress); i++)
|
||||
{
|
||||
@@ -370,13 +371,13 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aE
|
||||
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t address)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sShortAddress = address;
|
||||
}
|
||||
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sPromiscuous = aEnable;
|
||||
}
|
||||
|
||||
@@ -449,7 +450,7 @@ void platformRadioDeinit(void)
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sState != OT_RADIO_STATE_DISABLED) ? true : false;
|
||||
}
|
||||
|
||||
@@ -476,7 +477,8 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == OT_RADIO_STATE_SLEEP || sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
@@ -490,7 +492,8 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState != OT_RADIO_STATE_DISABLED)
|
||||
{
|
||||
@@ -506,8 +509,9 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aRadio)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
(void)aRadio;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aRadio);
|
||||
|
||||
if (sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
@@ -520,7 +524,7 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aRadio)
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
@@ -530,7 +534,7 @@ int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
uint8_t channel = sReceiveFrame.mChannel;
|
||||
uint32_t probabilityThreshold;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT((OT_RADIO_CHANNEL_MIN <= channel) && channel <= (OT_RADIO_CHANNEL_MAX));
|
||||
|
||||
@@ -551,13 +555,13 @@ exit:
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_NONE;
|
||||
}
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sPromiscuous;
|
||||
}
|
||||
|
||||
@@ -828,7 +832,7 @@ exit:
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
sSrcMatchEnabled = aEnable;
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
@@ -845,7 +849,7 @@ otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t a
|
||||
sShortAddressMatchTable[sShortAddressMatchTableCount++] = aShortAddress;
|
||||
|
||||
exit:
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -865,7 +869,7 @@ otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress
|
||||
sExtAddressMatchTable[sExtAddressMatchTableCount++] = *aExtAddress;
|
||||
|
||||
exit:
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -885,7 +889,7 @@ otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t
|
||||
}
|
||||
|
||||
exit:
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -906,33 +910,33 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
}
|
||||
|
||||
exit:
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return error;
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
sShortAddressMatchTableCount = 0;
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
sExtAddressMatchTableCount = 0;
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aScanChannel);
|
||||
OT_UNUSED_VARIABLE(aScanDuration);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
*aPower = sTxPower;
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
@@ -940,7 +944,7 @@ otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sTxPower = aPower;
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
@@ -948,7 +952,7 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return POSIX_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ static uint32_t sUsAlarm = 0;
|
||||
|
||||
void platformAlarmInit(uint32_t aSpeedUpFactor)
|
||||
{
|
||||
(void)aSpeedUpFactor;
|
||||
OT_UNUSED_VARIABLE(aSpeedUpFactor);
|
||||
sNow = 0;
|
||||
}
|
||||
|
||||
@@ -71,14 +71,15 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sMsAlarm = aT0 + aDt;
|
||||
sIsMsRunning = true;
|
||||
}
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsMsRunning = false;
|
||||
}
|
||||
|
||||
@@ -89,14 +90,15 @@ uint32_t otPlatAlarmMicroGetNow(void)
|
||||
|
||||
void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sUsAlarm = aT0 + aDt;
|
||||
sIsUsRunning = true;
|
||||
}
|
||||
|
||||
void otPlatAlarmMicroStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sIsUsRunning = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ uint16_t sPortOffset;
|
||||
|
||||
static void handleSignal(int aSignal)
|
||||
{
|
||||
(void)aSignal;
|
||||
OT_UNUSED_VARIABLE(aSignal);
|
||||
gTerminate = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -328,7 +328,8 @@ static uint16_t crc16_citt(uint16_t aFcs, uint8_t aByte)
|
||||
|
||||
void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
aIeeeEui64[0] = 0x18;
|
||||
aIeeeEui64[1] = 0xb4;
|
||||
aIeeeEui64[2] = 0x30;
|
||||
@@ -341,13 +342,13 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t panid)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sPanid = panid;
|
||||
}
|
||||
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
for (size_t i = 0; i < sizeof(sExtendedAddress); i++)
|
||||
{
|
||||
@@ -357,13 +358,13 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aE
|
||||
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t address)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sShortAddress = address;
|
||||
}
|
||||
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
sPromiscuous = aEnable;
|
||||
}
|
||||
|
||||
@@ -376,7 +377,7 @@ void platformRadioInit(void)
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return (sState != OT_RADIO_STATE_DISABLED) ? true : false;
|
||||
}
|
||||
|
||||
@@ -403,7 +404,8 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState == OT_RADIO_STATE_SLEEP || sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
@@ -417,7 +419,8 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
if (sState != OT_RADIO_STATE_DISABLED)
|
||||
{
|
||||
@@ -433,8 +436,9 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aRadio)
|
||||
{
|
||||
otError error = OT_ERROR_INVALID_STATE;
|
||||
(void)aInstance;
|
||||
(void)aRadio;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aRadio);
|
||||
|
||||
if (sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
@@ -447,25 +451,25 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aRadio)
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_RADIO_CAPS_NONE;
|
||||
}
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return sPromiscuous;
|
||||
}
|
||||
|
||||
@@ -655,7 +659,7 @@ exit:
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
sSrcMatchEnabled = aEnable;
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
@@ -672,7 +676,7 @@ otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t a
|
||||
sShortAddressMatchTable[sShortAddressMatchTableCount++] = aShortAddress;
|
||||
|
||||
exit:
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -692,7 +696,7 @@ otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress
|
||||
sExtAddressMatchTable[sExtAddressMatchTableCount++] = *aExtAddress;
|
||||
|
||||
exit:
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -712,7 +716,7 @@ otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t
|
||||
}
|
||||
|
||||
exit:
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -733,47 +737,47 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
}
|
||||
|
||||
exit:
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return error;
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
sShortAddressMatchTableCount = 0;
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
sExtAddressMatchTableCount = 0;
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aScanChannel;
|
||||
(void)aScanDuration;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aScanChannel);
|
||||
OT_UNUSED_VARIABLE(aScanDuration);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aPower;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aPower);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aPower;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aPower);
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return POSIX_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@ otError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aComplete
|
||||
otPlatSpiSlaveTransactionProcessCallback aProcessCallback,
|
||||
void * aContext)
|
||||
{
|
||||
(void)aCompleteCallback;
|
||||
(void)aProcessCallback;
|
||||
(void)aContext;
|
||||
OT_UNUSED_VARIABLE(aCompleteCallback);
|
||||
OT_UNUSED_VARIABLE(aProcessCallback);
|
||||
OT_UNUSED_VARIABLE(aContext);
|
||||
|
||||
fprintf(stderr, "\nNo SPI support for posix platform.");
|
||||
exit(0);
|
||||
@@ -63,11 +63,11 @@ otError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf,
|
||||
uint16_t aInputBufLen,
|
||||
bool aRequestTransactionFlag)
|
||||
{
|
||||
(void)aOutputBuf;
|
||||
(void)aOutputBufLen;
|
||||
(void)aInputBuf;
|
||||
(void)aInputBufLen;
|
||||
(void)aRequestTransactionFlag;
|
||||
OT_UNUSED_VARIABLE(aOutputBuf);
|
||||
OT_UNUSED_VARIABLE(aOutputBufLen);
|
||||
OT_UNUSED_VARIABLE(aInputBuf);
|
||||
OT_UNUSED_VARIABLE(aInputBufLen);
|
||||
OT_UNUSED_VARIABLE(aRequestTransactionFlag);
|
||||
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
@@ -80,8 +80,8 @@ void otPlatUartSendDone(void)
|
||||
|
||||
void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
(void)aBuf;
|
||||
(void)aBufLength;
|
||||
OT_UNUSED_VARIABLE(aBuf);
|
||||
OT_UNUSED_VARIABLE(aBufLength);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_NCP_SPI
|
||||
|
||||
@@ -60,7 +60,7 @@ static volatile bool gTerminate = false;
|
||||
#ifndef _WIN32
|
||||
static void handleSignal(int aSignal)
|
||||
{
|
||||
(void)aSignal;
|
||||
OT_UNUSED_VARIABLE(aSignal);
|
||||
gTerminate = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@ static uint32_t sStartTime = 0;
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sDeltaTime = aDt;
|
||||
sStartTime = aT0;
|
||||
@@ -50,7 +50,7 @@ void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sDeltaTime = 0;
|
||||
}
|
||||
|
||||
@@ -47,8 +47,8 @@ static bool sDiagMode = false;
|
||||
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
(void)argc;
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(argc);
|
||||
|
||||
// Add more plarform specific diagnostics features here.
|
||||
snprintf(aOutput, aOutputMaxLen, "diag feature '%s' is not supported\r\n", argv[0]);
|
||||
@@ -66,24 +66,24 @@ bool otPlatDiagModeGet()
|
||||
|
||||
void otPlatDiagChannelSet(uint8_t aChannel)
|
||||
{
|
||||
(void)aChannel;
|
||||
OT_UNUSED_VARIABLE(aChannel);
|
||||
}
|
||||
|
||||
void otPlatDiagTxPowerSet(int8_t aTxPower)
|
||||
{
|
||||
(void)aTxPower;
|
||||
OT_UNUSED_VARIABLE(aTxPower);
|
||||
}
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
* Platform abstraction for the logging
|
||||
*
|
||||
*/
|
||||
|
||||
#include <openthread-core-config.h>
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/platform/logging.h>
|
||||
@@ -40,8 +41,8 @@
|
||||
(OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_NCP_SPINEL)
|
||||
OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
|
||||
{
|
||||
(void)aLogLevel;
|
||||
(void)aLogRegion;
|
||||
(void)aFormat;
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
OT_UNUSED_VARIABLE(aFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
system_reset();
|
||||
|
||||
|
||||
@@ -317,7 +317,7 @@ void samr21RadioInit(void)
|
||||
|
||||
void samr21RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
PHY_TaskHandler();
|
||||
|
||||
@@ -362,7 +362,7 @@ void samr21RadioRandomGetTrue(uint8_t *aOutput, uint16_t aOutputLength)
|
||||
******************************************************************************/
|
||||
otRadioState otPlatRadioGetState(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return sState;
|
||||
}
|
||||
@@ -374,7 +374,7 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Set Pan ID: 0x%04X", aPanId);
|
||||
|
||||
@@ -387,7 +387,7 @@ void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
radioTrxOff();
|
||||
|
||||
@@ -398,7 +398,7 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aA
|
||||
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
radioTrxOff();
|
||||
|
||||
@@ -409,7 +409,7 @@ void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return (sState != OT_RADIO_STATE_DISABLED);
|
||||
}
|
||||
@@ -444,7 +444,7 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
|
||||
otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Radio sleep");
|
||||
|
||||
@@ -463,7 +463,7 @@ exit:
|
||||
|
||||
otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Radio receive, channel: %d", aChannel);
|
||||
|
||||
@@ -484,12 +484,12 @@ exit:
|
||||
|
||||
otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
{
|
||||
(void)aInstance;
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Radio transmit");
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otEXPECT_ACTION(sState == OT_RADIO_STATE_RECEIVE, error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
uint8_t frame[OT_RADIO_FRAME_MAX_SIZE + 1];
|
||||
@@ -512,7 +512,7 @@ exit:
|
||||
|
||||
otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return &sTransmitFrame;
|
||||
}
|
||||
@@ -529,22 +529,22 @@ otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
|
||||
bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return sPromiscuous;
|
||||
}
|
||||
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sPromiscuous = aEnable;
|
||||
}
|
||||
|
||||
void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aEnable;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aEnable);
|
||||
}
|
||||
|
||||
otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t aShortAddress)
|
||||
@@ -569,17 +569,17 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
|
||||
void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sScanStartTime = otPlatAlarmMilliGetNow();
|
||||
sScanDuration = aScanDuration;
|
||||
@@ -604,7 +604,7 @@ exit:
|
||||
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otLogDebgPlat("Radio set default TX power: %d", aPower);
|
||||
|
||||
@@ -615,7 +615,7 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
|
||||
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return SAMR21_RECEIVE_SENSITIVITY;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ static uint32_t swapSettingsBlock(otInstance *aInstance)
|
||||
uint8_t pageNum = SETTINGS_CONFIG_PAGE_NUM;
|
||||
uint32_t settingsSize = pageNum > 1 ? SETTINGS_CONFIG_PAGE_SIZE * pageNum / 2 : SETTINGS_CONFIG_PAGE_SIZE;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otEXPECT(pageNum > 1);
|
||||
|
||||
@@ -261,7 +261,7 @@ void otPlatSettingsInit(otInstance *aInstance)
|
||||
uint32_t settingsSize = SETTINGS_CONFIG_PAGE_NUM > 1 ? SETTINGS_CONFIG_PAGE_SIZE * SETTINGS_CONFIG_PAGE_NUM / 2
|
||||
: SETTINGS_CONFIG_PAGE_SIZE;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sSettingsBaseAddress = SETTINGS_CONFIG_BASE_ADDRESS;
|
||||
|
||||
@@ -306,19 +306,19 @@ void otPlatSettingsInit(otInstance *aInstance)
|
||||
|
||||
otError otPlatSettingsBeginChange(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otError otPlatSettingsCommitChange(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
otError otPlatSettingsAbandonChange(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint
|
||||
uint16_t valueLength = 0;
|
||||
int index = 0;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
while (address < (sSettingsBaseAddress + sSettingsUsedSize))
|
||||
{
|
||||
@@ -401,7 +401,7 @@ otError otPlatSettingsDelete(otInstance *aInstance, uint16_t aKey, int aIndex)
|
||||
uint32_t address = sSettingsBaseAddress + OT_SETTINGS_FLAG_SIZE;
|
||||
int index = 0;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
while (address < (sSettingsBaseAddress + sSettingsUsedSize))
|
||||
{
|
||||
|
||||
@@ -550,9 +550,9 @@ otError otThreadRegisterParentResponseCallback(otInstance * aI
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
#else
|
||||
(void)aInstance;
|
||||
(void)aCallback;
|
||||
(void)aContext;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aCallback);
|
||||
OT_UNUSED_VARIABLE(aContext);
|
||||
|
||||
return OT_ERROR_DISABLED_FEATURE;
|
||||
#endif
|
||||
|
||||
@@ -584,8 +584,8 @@ exit:
|
||||
extern "C" void otPlatRadioFrameUpdated(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
{
|
||||
// Note: For now this functionality is not supported in Radio Only mode.
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -756,10 +756,10 @@ void Commissioner::HandleLeaderKeepAliveResponse(Coap::Header * aHeader
|
||||
const Ip6::MessageInfo *aMessageInfo,
|
||||
otError aResult)
|
||||
{
|
||||
(void)aMessageInfo;
|
||||
|
||||
StateTlv state;
|
||||
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
|
||||
VerifyOrExit(mState == OT_COMMISSIONER_STATE_ACTIVE, mState = OT_COMMISSIONER_STATE_DISABLED);
|
||||
VerifyOrExit(aResult == OT_ERROR_NONE && aHeader->GetCode() == OT_COAP_CODE_CHANGED,
|
||||
mState = OT_COMMISSIONER_STATE_DISABLED);
|
||||
|
||||
@@ -427,9 +427,10 @@ void Joiner::HandleJoinerFinalizeResponse(Coap::Header * aHeader,
|
||||
const Ip6::MessageInfo *aMessageInfo,
|
||||
otError aResult)
|
||||
{
|
||||
(void)aMessageInfo;
|
||||
StateTlv state;
|
||||
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
|
||||
VerifyOrExit(mState == OT_JOINER_STATE_CONNECTED && aResult == OT_ERROR_NONE &&
|
||||
aHeader->GetType() == OT_COAP_TYPE_ACKNOWLEDGMENT && aHeader->GetCode() == OT_COAP_CODE_CHANGED);
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ void __gcov_flush();
|
||||
|
||||
void otTaskletsSignalPending(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
||||
@@ -77,14 +77,16 @@ uint32_t otPlatAlarmMilliGetNow(void)
|
||||
|
||||
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sMsAlarm = aT0 + aDt;
|
||||
sIsMsRunning = true;
|
||||
}
|
||||
|
||||
void otPlatAlarmMilliStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sIsMsRunning = false;
|
||||
}
|
||||
|
||||
@@ -96,14 +98,16 @@ uint32_t otPlatAlarmMicroGetNow(void)
|
||||
|
||||
void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sUsAlarm = aT0 + aDt;
|
||||
sIsUsRunning = true;
|
||||
}
|
||||
|
||||
void otPlatAlarmMicroStop(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
sIsUsRunning = false;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_ENABLE_PLATFORM_USEC_TIMER
|
||||
|
||||
@@ -51,7 +51,7 @@ void platformLoggingInit(const char *aName)
|
||||
setlogmask(setlogmask(0) & LOG_UPTO(LOG_DEBUG));
|
||||
|
||||
#else
|
||||
(void)aName;
|
||||
OT_UNUSED_VARIABLE(aName);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -65,6 +65,8 @@ OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const
|
||||
int logLevel;
|
||||
unsigned int offset = 0;
|
||||
|
||||
OT_UNUSED_VARIABLE(aLogRegion);
|
||||
|
||||
charsWritten = snprintf(&logString[offset], sizeof(logString), "[%" PRIx64 "] ", gNodeId);
|
||||
otEXPECT_ACTION(charsWritten >= 0, logString[offset] = 0);
|
||||
offset += (unsigned int)charsWritten;
|
||||
@@ -103,8 +105,6 @@ exit:
|
||||
break;
|
||||
}
|
||||
syslog(logLevel, "%s", logString);
|
||||
|
||||
(void)aLogRegion;
|
||||
}
|
||||
|
||||
#endif // #if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED)
|
||||
|
||||
@@ -44,18 +44,19 @@ static otPlatMcuPowerState gPlatMcuPowerState = OT_PLAT_MCU_POWER_STATE_ON;
|
||||
|
||||
void otPlatReset(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
otSysDeinit();
|
||||
platformUartRestore();
|
||||
|
||||
longjmp(gResetJump, 1);
|
||||
assert(false);
|
||||
|
||||
(void)aInstance;
|
||||
}
|
||||
|
||||
otPlatResetReason otPlatGetResetReason(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return sPlatResetReason;
|
||||
}
|
||||
|
||||
@@ -68,7 +69,7 @@ otError otPlatSetMcuPowerState(otInstance *aInstance, otPlatMcuPowerState aState
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
switch (aState)
|
||||
{
|
||||
@@ -87,7 +88,8 @@ otError otPlatSetMcuPowerState(otInstance *aInstance, otPlatMcuPowerState aState
|
||||
|
||||
otPlatMcuPowerState otPlatGetMcuPowerState(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
|
||||
return gPlatMcuPowerState;
|
||||
}
|
||||
|
||||
|
||||
@@ -1659,13 +1659,13 @@ exit:
|
||||
|
||||
void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
(void)aInstance;
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aFrame);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
|
||||
void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
|
||||
@@ -49,9 +49,9 @@ otError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aComplete
|
||||
otPlatSpiSlaveTransactionProcessCallback aProcessCallback,
|
||||
void * aContext)
|
||||
{
|
||||
(void)aCompleteCallback;
|
||||
(void)aProcessCallback;
|
||||
(void)aContext;
|
||||
OT_UNUSED_VARIABLE(aCompleteCallback);
|
||||
OT_UNUSED_VARIABLE(aProcessCallback);
|
||||
OT_UNUSED_VARIABLE(aContext);
|
||||
|
||||
fprintf(stderr, "\nNo SPI support for posix platform.");
|
||||
exit(OT_EXIT_FAILURE);
|
||||
@@ -69,11 +69,11 @@ otError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf,
|
||||
uint16_t aInputBufLen,
|
||||
bool aRequestTransactionFlag)
|
||||
{
|
||||
(void)aOutputBuf;
|
||||
(void)aOutputBufLen;
|
||||
(void)aInputBuf;
|
||||
(void)aInputBufLen;
|
||||
(void)aRequestTransactionFlag;
|
||||
OT_UNUSED_VARIABLE(aOutputBuf);
|
||||
OT_UNUSED_VARIABLE(aOutputBufLen);
|
||||
OT_UNUSED_VARIABLE(aInputBuf);
|
||||
OT_UNUSED_VARIABLE(aInputBufLen);
|
||||
OT_UNUSED_VARIABLE(aRequestTransactionFlag);
|
||||
|
||||
return OT_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
@@ -86,8 +86,8 @@ void otPlatUartSendDone(void)
|
||||
|
||||
void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
{
|
||||
(void)aBuf;
|
||||
(void)aBufLength;
|
||||
OT_UNUSED_VARIABLE(aBuf);
|
||||
OT_UNUSED_VARIABLE(aBufLength);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_NCP_SPI
|
||||
|
||||
Reference in New Issue
Block a user