mirror of
https://github.com/espressif/openthread.git
synced 2026-09-17 06:30:10 +00:00
[border-agent] return Counters as reference (#11070)
This commit is contained in:
@@ -112,7 +112,7 @@ void otBorderAgentSetEphemeralKeyCallback(otInstance *aIns
|
|||||||
|
|
||||||
const otBorderAgentCounters *otBorderAgentGetCounters(otInstance *aInstance)
|
const otBorderAgentCounters *otBorderAgentGetCounters(otInstance *aInstance)
|
||||||
{
|
{
|
||||||
return AsCoreType(aInstance).Get<MeshCoP::BorderAgent>().GetCounters();
|
return &AsCoreType(aInstance).Get<MeshCoP::BorderAgent>().GetCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
void otBorderAgentDisconnect(otInstance *aInstance) { AsCoreType(aInstance).Get<MeshCoP::BorderAgent>().Disconnect(); }
|
void otBorderAgentDisconnect(otInstance *aInstance) { AsCoreType(aInstance).Get<MeshCoP::BorderAgent>().Disconnect(); }
|
||||||
|
|||||||
@@ -83,7 +83,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
static constexpr uint32_t kMaxEphemeralKeyTimeout = OT_BORDER_AGENT_MAX_EPHEMERAL_KEY_TIMEOUT;
|
static constexpr uint32_t kMaxEphemeralKeyTimeout = OT_BORDER_AGENT_MAX_EPHEMERAL_KEY_TIMEOUT;
|
||||||
|
|
||||||
typedef otBorderAgentId Id; ///< Border Agent ID.
|
typedef otBorderAgentId Id; ///< Border Agent ID.
|
||||||
|
typedef otBorderAgentCounters Counters; ///< Border Agent Counters.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the Border Agent state.
|
* Defines the Border Agent state.
|
||||||
@@ -240,7 +241,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @returns The border agent counters.
|
* @returns The border agent counters.
|
||||||
*/
|
*/
|
||||||
const otBorderAgentCounters *GetCounters(void) { return &mCounters; }
|
const Counters &GetCounters(void) { return mCounters; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the UDP Proxy port to which the commissioner is currently
|
* Returns the UDP Proxy port to which the commissioner is currently
|
||||||
@@ -335,7 +336,7 @@ private:
|
|||||||
EphemeralKeyTask mEphemeralKeyTask;
|
EphemeralKeyTask mEphemeralKeyTask;
|
||||||
Callback<EphemeralKeyCallback> mEphemeralKeyCallback;
|
Callback<EphemeralKeyCallback> mEphemeralKeyCallback;
|
||||||
#endif
|
#endif
|
||||||
otBorderAgentCounters mCounters;
|
Counters mCounters;
|
||||||
};
|
};
|
||||||
|
|
||||||
DeclareTmfHandler(BorderAgent, kUriRelayRx);
|
DeclareTmfHandler(BorderAgent, kUriRelayRx);
|
||||||
|
|||||||
Reference in New Issue
Block a user