mirror of
https://github.com/espressif/openthread.git
synced 2026-08-23 02:39:52 +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)
|
||||
{
|
||||
return AsCoreType(aInstance).Get<MeshCoP::BorderAgent>().GetCounters();
|
||||
return &AsCoreType(aInstance).Get<MeshCoP::BorderAgent>().GetCounters();
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
typedef otBorderAgentId Id; ///< Border Agent ID.
|
||||
typedef otBorderAgentId Id; ///< Border Agent ID.
|
||||
typedef otBorderAgentCounters Counters; ///< Border Agent Counters.
|
||||
|
||||
/**
|
||||
* Defines the Border Agent state.
|
||||
@@ -240,7 +241,7 @@ public:
|
||||
*
|
||||
* @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
|
||||
@@ -335,7 +336,7 @@ private:
|
||||
EphemeralKeyTask mEphemeralKeyTask;
|
||||
Callback<EphemeralKeyCallback> mEphemeralKeyCallback;
|
||||
#endif
|
||||
otBorderAgentCounters mCounters;
|
||||
Counters mCounters;
|
||||
};
|
||||
|
||||
DeclareTmfHandler(BorderAgent, kUriRelayRx);
|
||||
|
||||
Reference in New Issue
Block a user