mirror of
https://github.com/espressif/openthread.git
synced 2026-09-02 15:20:07 +00:00
[border-agent] remove unused GetUdpProxyPort() method (#11086)
This commit removes the unused `GetUdpProxyPort()` method and the related code tracking the proxy port in `BorderAgent`.
This commit is contained in:
@@ -48,7 +48,6 @@ RegisterLogModule("BorderAgent");
|
||||
BorderAgent::BorderAgent(Instance &aInstance)
|
||||
: InstanceLocator(aInstance)
|
||||
, mState(kStateStopped)
|
||||
, mUdpProxyPort(0)
|
||||
, mUdpReceiver(BorderAgent::HandleUdpReceive, this)
|
||||
, mTimer(aInstance)
|
||||
#if OPENTHREAD_CONFIG_BORDER_AGENT_ID_ENABLE
|
||||
@@ -135,8 +134,7 @@ Error BorderAgent::Start(uint16_t aUdpPort, const uint8_t *aPsk, uint8_t aPskLen
|
||||
|
||||
Get<Tmf::SecureAgent>().SetConnectCallback(HandleConnected, this);
|
||||
|
||||
mState = kStateStarted;
|
||||
mUdpProxyPort = 0;
|
||||
mState = kStateStarted;
|
||||
|
||||
LogInfo("Border Agent start listening on port %u", GetUdpPort());
|
||||
|
||||
@@ -161,8 +159,7 @@ void BorderAgent::Stop(void)
|
||||
mTimer.Stop();
|
||||
Get<Tmf::SecureAgent>().Close();
|
||||
|
||||
mState = kStateStopped;
|
||||
mUdpProxyPort = 0;
|
||||
mState = kStateStopped;
|
||||
LogInfo("Border Agent stopped");
|
||||
|
||||
exit:
|
||||
@@ -280,8 +277,7 @@ void BorderAgent::HandleConnected(Dtls::Session::ConnectEvent aEvent)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
mState = kStateStarted;
|
||||
mUdpProxyPort = 0;
|
||||
mState = kStateStarted;
|
||||
|
||||
if (aEvent == Dtls::Session::kDisconnectedError)
|
||||
{
|
||||
@@ -639,7 +635,6 @@ template <> void BorderAgent::HandleTmf<kUriProxyTx>(Coap::Message &aMessage, co
|
||||
SuccessOrExit(error = Tlv::Find<Ip6AddressTlv>(aMessage, messageInfo.GetPeerAddr()));
|
||||
|
||||
SuccessOrExit(error = Get<Ip6::Udp>().SendDatagram(*message, messageInfo));
|
||||
mUdpProxyPort = udpEncapHeader.GetSourcePort();
|
||||
|
||||
LogInfo("Proxy transmit sent to %s", messageInfo.GetPeerAddr().ToString().AsCString());
|
||||
|
||||
|
||||
@@ -247,14 +247,6 @@ public:
|
||||
*/
|
||||
const Counters &GetCounters(void) { return mCounters; }
|
||||
|
||||
/**
|
||||
* Returns the UDP Proxy port to which the commissioner is currently
|
||||
* bound.
|
||||
*
|
||||
* @returns The current UDP Proxy port or 0 if no Proxy Transmit has been received yet.
|
||||
*/
|
||||
uint16_t GetUdpProxyPort(void) const { return mUdpProxyPort; }
|
||||
|
||||
private:
|
||||
static_assert(kMaxEphemeralKeyLength <= Dtls::Transport::kPskMaxLength,
|
||||
"Max ephemeral key length is larger than max PSK len");
|
||||
@@ -323,7 +315,6 @@ private:
|
||||
#endif
|
||||
|
||||
State mState;
|
||||
uint16_t mUdpProxyPort;
|
||||
Ip6::Udp::Receiver mUdpReceiver;
|
||||
Ip6::Netif::UnicastAddress mCommissionerAloc;
|
||||
TimeoutTimer mTimer;
|
||||
|
||||
Reference in New Issue
Block a user