mirror of
https://github.com/espressif/openthread.git
synced 2026-07-26 13:59:05 +00:00
[dns/sntp-client] use Instance as a constructor parameter (#5253)
This commit is contained in:
@@ -72,10 +72,10 @@ QueryMetadata::QueryMetadata(otDnsResponseHandler aHandler, void *aContext)
|
||||
mDestinationAddress.Clear();
|
||||
}
|
||||
|
||||
Client::Client(Ip6::Netif &aNetif)
|
||||
: mSocket(aNetif.GetInstance())
|
||||
Client::Client(Instance &aInstance)
|
||||
: mSocket(aInstance)
|
||||
, mMessageId(0)
|
||||
, mRetransmissionTimer(aNetif.GetInstance(), Client::HandleRetransmissionTimer, this)
|
||||
, mRetransmissionTimer(aInstance, Client::HandleRetransmissionTimer, this)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -129,10 +129,10 @@ public:
|
||||
/**
|
||||
* This constructor initializes the object.
|
||||
*
|
||||
* @param[in] aNetif A reference to the network interface that DNS client should be assigned to.
|
||||
* @param[in] aInstance A reference to the OpenThread instance.
|
||||
*
|
||||
*/
|
||||
explicit Client(Ip6::Netif &aNetif);
|
||||
explicit Client(Instance &aInstance);
|
||||
|
||||
/**
|
||||
* This method starts the DNS client.
|
||||
|
||||
@@ -89,9 +89,9 @@ QueryMetadata::QueryMetadata(otSntpResponseHandler aHandler, void *aContext)
|
||||
mDestinationAddress.Clear();
|
||||
}
|
||||
|
||||
Client::Client(Ip6::Netif &aNetif)
|
||||
: mSocket(aNetif.GetInstance())
|
||||
, mRetransmissionTimer(aNetif.GetInstance(), Client::HandleRetransmissionTimer, this)
|
||||
Client::Client(Instance &aInstance)
|
||||
: mSocket(aInstance)
|
||||
, mRetransmissionTimer(aInstance, Client::HandleRetransmissionTimer, this)
|
||||
, mUnixEra(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -493,10 +493,10 @@ public:
|
||||
/**
|
||||
* This constructor initializes the object.
|
||||
*
|
||||
* @param[in] aNetif A reference to the network interface that SNTP client should be assigned to.
|
||||
* @param[in] aInstance A reference to the OpenThread instance.
|
||||
*
|
||||
*/
|
||||
explicit Client(Ip6::Netif &aNetif);
|
||||
explicit Client(Instance &aInstance);
|
||||
|
||||
/**
|
||||
* This method starts the SNTP client.
|
||||
|
||||
@@ -52,19 +52,19 @@ ThreadNetif::ThreadNetif(Instance &aInstance)
|
||||
, mCoap(aInstance)
|
||||
#if OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE
|
||||
, mDhcp6Client(aInstance)
|
||||
#endif // OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE
|
||||
, mDhcp6Server(aInstance)
|
||||
#endif // OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE
|
||||
, mSlaac(aInstance)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
|
||||
, mDnsClient(Get<ThreadNetif>())
|
||||
#endif // OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE
|
||||
, mDnsClient(aInstance)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE
|
||||
, mSntpClient(Get<ThreadNetif>())
|
||||
#endif // OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE
|
||||
, mSntpClient(aInstance)
|
||||
#endif
|
||||
, mActiveDataset(aInstance)
|
||||
, mPendingDataset(aInstance)
|
||||
, mKeyManager(aInstance)
|
||||
@@ -89,21 +89,21 @@ ThreadNetif::ThreadNetif(Instance &aInstance)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE && OPENTHREAD_FTD
|
||||
, mCommissioner(aInstance)
|
||||
#endif // OPENTHREAD_CONFIG_COMMISSIONER_ENABLE && OPENTHREAD_FTD
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_DTLS_ENABLE
|
||||
, mCoapSecure(aInstance)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_JOINER_ENABLE
|
||||
, mJoiner(aInstance)
|
||||
#endif // OPENTHREAD_CONFIG_JOINER_ENABLE
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
|
||||
, mJamDetector(aInstance)
|
||||
#endif // OPENTHREAD_CONFIG_JAM_DETECTION_ENABLE
|
||||
#endif
|
||||
#if OPENTHREAD_FTD
|
||||
, mJoinerRouter(aInstance)
|
||||
, mLeader(aInstance)
|
||||
, mAddressResolver(aInstance)
|
||||
#endif // OPENTHREAD_FTD
|
||||
#endif
|
||||
#if (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
|
||||
, mBackboneRouterLeader(aInstance)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user