From aed58bc595256e9062a5a12ad6786c3e43869249 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 1 Feb 2023 18:42:02 -0500 Subject: [PATCH] Make OperationalSessionSetup a bit smaller. 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); /*