mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 07:07:47 +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
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <openthread/config.h>
|
||||
|
||||
#include "openthread-instance.h"
|
||||
#include "common/instance.hpp"
|
||||
#include "thread/network_data_local.hpp"
|
||||
|
||||
#include "test_platform.h"
|
||||
@@ -39,7 +39,7 @@ namespace ot {
|
||||
class TestNetworkData: public NetworkData::NetworkData
|
||||
{
|
||||
public:
|
||||
TestNetworkData(otInstance *aInstance, const uint8_t *aTlvs, uint8_t aTlvsLength):
|
||||
TestNetworkData(ot::Instance *aInstance, const uint8_t *aTlvs, uint8_t aTlvsLength):
|
||||
NetworkData::NetworkData(*aInstance, false) {
|
||||
memcpy(mTlvs, aTlvs, aTlvsLength);
|
||||
mLength = aTlvsLength;
|
||||
@@ -72,7 +72,7 @@ bool CompareExternalRouteConfig(const otExternalRouteConfig &aConfig1, const otE
|
||||
|
||||
void TestNetworkDataIterator(void)
|
||||
{
|
||||
otInstance *instance;
|
||||
ot::Instance *instance;
|
||||
otNetworkDataIterator iter = OT_NETWORK_DATA_ITERATOR_INIT;
|
||||
otExternalRouteConfig config;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user