From 904e3eced58a9c7cb24549c7cc58d708f840d002 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 2 Feb 2023 01:53:05 -0500 Subject: [PATCH] Make OperationalSessionSetup a bit smaller. (#24805) We had two one-byte values, each of which was taking up 4-8 bytes (depending on target arch). Putting them next to each other packs better. --- src/app/OperationalSessionSetup.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/OperationalSessionSetup.h b/src/app/OperationalSessionSetup.h index 2eb86c25f6c1f4..825278ab771cab 100644 --- a/src/app/OperationalSessionSetup.h +++ b/src/app/OperationalSessionSetup.h @@ -225,7 +225,7 @@ class DLL_EXPORT OperationalSessionSetup : public SessionDelegate, void OnNodeAddressResolutionFailed(const PeerId & peerId, CHIP_ERROR reason) override; private: - enum class State + enum class State : uint8_t { Uninitialized, // Error state: OperationalSessionSetup is useless NeedsAddress, // No address known, lookup not started yet. @@ -247,10 +247,6 @@ class DLL_EXPORT OperationalSessionSetup : public SessionDelegate, Transport::PeerAddress mDeviceAddress = Transport::PeerAddress::UDP(Inet::IPAddress::Any); - void MoveToState(State aTargetState); - - State mState = State::Uninitialized; - SessionHolderWithDelegate mSecureSession; Callback::CallbackDeque mConnectionSuccess; @@ -261,8 +257,12 @@ class DLL_EXPORT OperationalSessionSetup : public SessionDelegate, /// This is used when a node address is required. chip::AddressResolve::NodeLookupHandle mAddressLookupHandle; + State mState = State::Uninitialized; + bool mPerformingAddressUpdate = false; + void MoveToState(State aTargetState); + CHIP_ERROR EstablishConnection(const ReliableMessageProtocolConfig & config); /*