mirror of
https://github.com/espressif/openthread.git
synced 2026-07-30 07:37:46 +00:00
otInstance Declarations (#473)
* Add otInstance type declaration and update ot APIs to take it as input.
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
|
||||
static Thread::Crypto::MbedTls mbedtls;
|
||||
|
||||
extern"C" void otSignalTaskletPending(void)
|
||||
extern"C" void otSignalTaskletPending(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
#include <platform/platform.h>
|
||||
#include <platform/radio.h>
|
||||
|
||||
extern "C" void otSignalTaskletPending(void)
|
||||
extern "C" void otSignalTaskletPending(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
extern "C" bool otAreTaskletsPending(void)
|
||||
extern "C" bool otAreTaskletsPending(otInstance *)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -51,17 +51,17 @@ extern "C" void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
(void)aBufLength;
|
||||
}
|
||||
|
||||
extern "C" void otPlatAlarmFired()
|
||||
extern "C" void otPlatAlarmFired(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
extern "C" void otPlatRadioTransmitDone(bool aRxPending, ThreadError aError)
|
||||
extern "C" void otPlatRadioTransmitDone(otInstance *, bool aRxPending, ThreadError aError)
|
||||
{
|
||||
(void)aRxPending;
|
||||
(void)aError;
|
||||
}
|
||||
|
||||
extern "C" void otPlatRadioReceiveDone(RadioPacket *aFrame, ThreadError aError)
|
||||
extern "C" void otPlatRadioReceiveDone(otInstance *, RadioPacket *aFrame, ThreadError aError)
|
||||
{
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
@@ -147,7 +147,7 @@ void TestDiag()
|
||||
PlatformInit(argc, argv);
|
||||
|
||||
// initialize diagnostics module
|
||||
diagInit();
|
||||
diagInit(NULL);
|
||||
|
||||
// test diagnostics commands
|
||||
VerifyOrQuit(!isDiagEnabled(), "diagnostics mode shoud be disabled as default\n");
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
static Thread::Crypto::MbedTls mbedtls;
|
||||
|
||||
extern"C" void otSignalTaskletPending(void)
|
||||
extern"C" void otSignalTaskletPending(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
namespace Thread {
|
||||
|
||||
extern"C" void otSignalTaskletPending(void)
|
||||
extern"C" void otSignalTaskletPending(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ using namespace Thread;
|
||||
|
||||
namespace Thread {
|
||||
|
||||
extern "C" void otSignalTaskletPending(void)
|
||||
extern "C" void otSignalTaskletPending(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
extern "C" bool otAreTaskletsPending(void)
|
||||
extern "C" bool otAreTaskletsPending(otInstance *)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -59,17 +59,17 @@ extern "C" void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength)
|
||||
(void)aBufLength;
|
||||
}
|
||||
|
||||
extern "C" void otPlatDiagAlarmFired()
|
||||
extern "C" void otPlatDiagAlarmFired(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
extern "C" void otPlatDiagRadioTransmitDone(bool aRxPending, ThreadError aError)
|
||||
extern "C" void otPlatDiagRadioTransmitDone(otInstance *, bool aRxPending, ThreadError aError)
|
||||
{
|
||||
(void)aRxPending;
|
||||
(void)aError;
|
||||
}
|
||||
|
||||
extern "C" void otPlatDiagRadioReceiveDone(RadioPacket *aFrame, ThreadError aError)
|
||||
extern "C" void otPlatDiagRadioReceiveDone(otInstance *, RadioPacket *aFrame, ThreadError aError)
|
||||
{
|
||||
(void)aFrame;
|
||||
(void)aError;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
namespace Thread {
|
||||
|
||||
extern"C" void otSignalTaskletPending(void)
|
||||
extern"C" void otSignalTaskletPending(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
#include <common/message.hpp>
|
||||
#include <string.h>
|
||||
|
||||
extern"C" void otSignalTaskletPending(void)
|
||||
extern"C" void otSignalTaskletPending(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
extern "C" void otPlatDiagAlarmFired(void)
|
||||
extern "C" void otPlatDiagAlarmFired(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -36,11 +36,11 @@ namespace Thread {
|
||||
|
||||
// This module implements unit-test for NcpFrameBuffer class.
|
||||
|
||||
extern"C" void otSignalTaskletPending(void)
|
||||
extern"C" void otSignalTaskletPending(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
extern "C" void otPlatDiagAlarmFired()
|
||||
extern "C" void otPlatDiagAlarmFired(otInstance *)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -51,13 +51,13 @@ static uint32_t sCallCount[kCallCountIndexMax];
|
||||
|
||||
extern "C" {
|
||||
|
||||
void otPlatAlarmStop(void)
|
||||
void otPlatAlarmStop(otInstance *)
|
||||
{
|
||||
sTimerOn = false;
|
||||
sCallCount[kCallCountIndexAlarmStop]++;
|
||||
}
|
||||
|
||||
void otPlatAlarmStartAt(uint32_t aT0, uint32_t aDt)
|
||||
void otPlatAlarmStartAt(otInstance *, uint32_t aT0, uint32_t aDt)
|
||||
{
|
||||
sTimerOn = true;
|
||||
sCallCount[kCallCountIndexAlarmStart]++;
|
||||
@@ -112,7 +112,7 @@ int TestOneTimer(void)
|
||||
|
||||
sNow += kTimerInterval;
|
||||
|
||||
otPlatAlarmFired();
|
||||
otPlatAlarmFired(NULL);
|
||||
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStart] == 1, "TestOneTimer: Start CallCount Failed.\n");
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStop] == 1, "TestOneTimer: Stop CallCount Failed.\n");
|
||||
@@ -136,7 +136,7 @@ int TestOneTimer(void)
|
||||
|
||||
sNow += kTimerInterval;
|
||||
|
||||
otPlatAlarmFired();
|
||||
otPlatAlarmFired(NULL);
|
||||
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStart] == 1, "TestOneTimer: Start CallCount Failed.\n");
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStop] == 1, "TestOneTimer: Stop CallCount Failed.\n");
|
||||
@@ -160,7 +160,7 @@ int TestOneTimer(void)
|
||||
|
||||
sNow += kTimerInterval + 5;
|
||||
|
||||
otPlatAlarmFired();
|
||||
otPlatAlarmFired(NULL);
|
||||
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStart] == 1, "TestOneTimer: Start CallCount Failed.\n");
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStop] == 1, "TestOneTimer: Stop CallCount Failed.\n");
|
||||
@@ -184,7 +184,7 @@ int TestOneTimer(void)
|
||||
|
||||
sNow += kTimerInterval - 2;
|
||||
|
||||
otPlatAlarmFired();
|
||||
otPlatAlarmFired(NULL);
|
||||
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStart] == 2, "TestOneTimer: Start CallCount Failed.\n");
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStop] == 0, "TestOneTimer: Stop CallCount Failed.\n");
|
||||
@@ -194,7 +194,7 @@ int TestOneTimer(void)
|
||||
|
||||
sNow += kTimerInterval;
|
||||
|
||||
otPlatAlarmFired();
|
||||
otPlatAlarmFired(NULL);
|
||||
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStart] == 2, "TestOneTimer: Start CallCount Failed.\n");
|
||||
VerifyOrQuit(sCallCount[kCallCountIndexAlarmStop] == 1, "TestOneTimer: Stop CallCount Failed.\n");
|
||||
@@ -376,7 +376,7 @@ int TestTenTimers(void)
|
||||
// timer is ready to be triggered by examining the aDt arg passed into otPlatAlarmStartAt(). If
|
||||
// that value is 0, then otPlatAlarmFired should be fired immediately. This loop calls otPlatAlarmFired()
|
||||
// the requisite number of times based on the aDt argument.
|
||||
otPlatAlarmFired();
|
||||
otPlatAlarmFired(NULL);
|
||||
}
|
||||
while (sPlatDt == 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user