mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 05:37:46 +00:00
[instance] define ot::Instance class (#2307)
This commit makes the following changes: It defines the public `otInstance` as an empty opaque structure which is used by all public C OpenThread APIs. It defines a new class `ot::Instance` (inheriting from `otInstance) which is then used in core source files. The functionality related to the instance is also moved/added into the newly added `Instance` class (as class/static or member methods).
This commit is contained in:
committed by
Jonathan Hui
parent
a394155372
commit
02c876ef62
@@ -33,8 +33,8 @@
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/openthread.h>
|
||||
|
||||
#include "openthread-instance.h"
|
||||
#include "common/debug.hpp"
|
||||
#include "common/instance.hpp"
|
||||
#include "common/message.hpp"
|
||||
#include "utils/wrap_string.h"
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#define kNumTestMessages 5
|
||||
|
||||
static otInstance *sInstance;
|
||||
static ot::Instance *sInstance;
|
||||
static ot::MessagePool *sMessagePool;
|
||||
|
||||
// This function verifies the content of the message queue to match the passed in messages
|
||||
@@ -87,7 +87,7 @@ void TestMessageQueue(void)
|
||||
sInstance = testInitInstance();
|
||||
VerifyOrQuit(sInstance != NULL, "Null instance");
|
||||
|
||||
sMessagePool = &sInstance->mMessagePool;
|
||||
sMessagePool = &sInstance->GetMessagePool();
|
||||
|
||||
for (int i = 0; i < kNumTestMessages; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user