From 0770dc6d928e95258179d3f8833a1871af9333dc Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 14 Oct 2021 17:43:55 +0000 Subject: [PATCH] Restyled by clang-format --- src/app/server/Server.cpp | 15 ++++++--------- src/controller/CHIPDeviceController.cpp | 3 +-- src/controller/tests/TestDevice.cpp | 11 +++++------ src/inet/IPAddress.cpp | 2 +- src/inet/TCPEndPoint.cpp | 5 +++-- src/transport/raw/TCP.h | 10 +++++----- src/transport/raw/UDP.h | 10 +++++----- 7 files changed, 26 insertions(+), 30 deletions(-) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index c017f50cb19045..332b9caf9ad2a2 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -95,19 +95,16 @@ CHIP_ERROR Server::Init(AppDelegate * delegate, uint16_t secureServicePort, uint SuccessOrExit(err); // Init transport before operations with secure session mgr. - err = mTransports.Init(UdpListenParameters(&DeviceLayer::InetLayer) - .SetAddressType(IPAddressType::kIPv6) - .SetListenPort(mSecuredServicePort) + err = mTransports.Init( + UdpListenParameters(&DeviceLayer::InetLayer).SetAddressType(IPAddressType::kIPv6).SetListenPort(mSecuredServicePort) #if INET_CONFIG_ENABLE_IPV4 - , - UdpListenParameters(&DeviceLayer::InetLayer) - .SetAddressType(IPAddressType::kIPv4) - .SetListenPort(mSecuredServicePort) + , + UdpListenParameters(&DeviceLayer::InetLayer).SetAddressType(IPAddressType::kIPv4).SetListenPort(mSecuredServicePort) #endif #if CONFIG_NETWORK_LAYER_BLE - , - BleListenParameters(DeviceLayer::ConnectivityMgr().GetBleLayer()) + , + BleListenParameters(DeviceLayer::ConnectivityMgr().GetBleLayer()) #endif ); diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index a250a48a0d237e..b70d58561f4896 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1990,8 +1990,7 @@ void DeviceCommissioner::AdvanceCommissioningStage(CHIP_ERROR err) #if CHIP_DEVICE_CONFIG_ENABLE_DNSSD ChipLogProgress(Controller, "Finding node on operational network"); Dnssd::Resolver::Instance().ResolveNodeId( - PeerId().SetCompressedFabricId(GetCompressedFabricId()).SetNodeId(device->GetDeviceId()), - Inet::IPAddressType::kAny); + PeerId().SetCompressedFabricId(GetCompressedFabricId()).SetNodeId(device->GetDeviceId()), Inet::IPAddressType::kAny); #endif } break; diff --git a/src/controller/tests/TestDevice.cpp b/src/controller/tests/TestDevice.cpp index ed4c0a90db95bc..71c202d2c369cb 100644 --- a/src/controller/tests/TestDevice.cpp +++ b/src/controller/tests/TestDevice.cpp @@ -60,15 +60,14 @@ void TestDevice_EstablishSessionDirectly(nlTestSuite * inSuite, void * inContext systemLayer.Init(); inetLayer.Init(systemLayer, nullptr); - transportMgr.Init( - UdpListenParameters(&inetLayer).SetAddressType(Inet::IPAddressType::kIPv6).SetListenPort(CHIP_PORT) + transportMgr.Init(UdpListenParameters(&inetLayer).SetAddressType(Inet::IPAddressType::kIPv6).SetListenPort(CHIP_PORT) #if INET_CONFIG_ENABLE_IPV4 - , - UdpListenParameters(&inetLayer).SetAddressType(Inet::IPAddressType::kIPv4).SetListenPort(CHIP_PORT) + , + UdpListenParameters(&inetLayer).SetAddressType(Inet::IPAddressType::kIPv4).SetListenPort(CHIP_PORT) #endif #if CONFIG_NETWORK_LAYER_BLE - , - BleListenParameters(&blelayer) + , + BleListenParameters(&blelayer) #endif ); sessionManager.Init(&systemLayer, &transportMgr, &messageCounterManager); diff --git a/src/inet/IPAddress.cpp b/src/inet/IPAddress.cpp index 1e5283b20e911b..bd8eca1735e81d 100644 --- a/src/inet/IPAddress.cpp +++ b/src/inet/IPAddress.cpp @@ -433,7 +433,7 @@ IPAddress IPAddress::MakeIPv6TransientMulticast(IPv6MulticastFlags aFlags, uint8 IPAddress IPAddress::MakeIPv6PrefixMulticast(uint8_t aScope, uint8_t aPrefixLength, const uint64_t & aPrefix, uint32_t aGroupId) { const uint8_t lReserved = 0; - const IPv6MulticastFlag lFlags = IPv6MulticastFlag::kPrefix; + const IPv6MulticastFlag lFlags = IPv6MulticastFlag::kPrefix; const uint8_t lGroupId[NL_INET_IPV6_MCAST_GROUP_LEN_IN_BYTES] = { lReserved, aPrefixLength, static_cast((aPrefix & 0xFF00000000000000ULL) >> 56), diff --git a/src/inet/TCPEndPoint.cpp b/src/inet/TCPEndPoint.cpp index bd256e9708d889..dba5199d5a4dc9 100644 --- a/src/inet/TCPEndPoint.cpp +++ b/src/inet/TCPEndPoint.cpp @@ -1047,7 +1047,7 @@ err_t TCPEndPoint::LwIPHandleIncomingConnection(void * arg, struct tcp_pcb * tpc if (err == CHIP_NO_ERROR) { // Put the new end point into the Connected state. - conEP->mState = State::kConnected; + conEP->mState = State::kConnected; conEP->mTCP = tpcb; conEP->mLwIPEndPointType = LwIPEndPointType::TCP; conEP->Retain(); @@ -2576,7 +2576,8 @@ void TCPEndPoint::TCPConnectTimeoutHandler(chip::System::Layer * aSystemLayer, v bool TCPEndPoint::IsConnected(State state) { - return state == State::kConnected || state == State::kSendShutdown || state == State::kReceiveShutdown || state == State::kClosing; + return state == State::kConnected || state == State::kSendShutdown || state == State::kReceiveShutdown || + state == State::kClosing; } void TCPEndPoint::Init(InetLayer * inetLayer) diff --git a/src/transport/raw/TCP.h b/src/transport/raw/TCP.h index 6c78077222d7db..c09a7f62772d57 100644 --- a/src/transport/raw/TCP.h +++ b/src/transport/raw/TCP.h @@ -74,10 +74,10 @@ class TcpListenParameters } private: - Inet::InetLayer * mLayer = nullptr; ///< Associated inet layer + Inet::InetLayer * mLayer = nullptr; ///< Associated inet layer Inet::IPAddressType mAddressType = Inet::IPAddressType::kIPv6; ///< type of listening socket - uint16_t mListenPort = CHIP_PORT; ///< TCP listen port - Inet::InterfaceId mInterfaceId = INET_NULL_INTERFACEID; ///< Interface to listen on + uint16_t mListenPort = CHIP_PORT; ///< TCP listen port + Inet::InterfaceId mInterfaceId = INET_NULL_INTERFACEID; ///< Interface to listen on }; /** @@ -255,9 +255,9 @@ class DLL_EXPORT TCPBase : public Base // @see TCPEndpoint::OnAcceptErrorFunct static void OnAcceptError(Inet::TCPEndPoint * endPoint, CHIP_ERROR err); - Inet::TCPEndPoint * mListenSocket = nullptr; ///< TCP socket used by the transport + Inet::TCPEndPoint * mListenSocket = nullptr; ///< TCP socket used by the transport Inet::IPAddressType mEndpointType = Inet::IPAddressType::kUnknown; ///< Socket listening type - State mState = State::kNotReady; ///< State of the TCP transport + State mState = State::kNotReady; ///< State of the TCP transport // Number of active and 'pending connection' endpoints size_t mUsedEndPointCount = 0; diff --git a/src/transport/raw/UDP.h b/src/transport/raw/UDP.h index 5b55466d9ed4bf..710300cb8bdc8e 100644 --- a/src/transport/raw/UDP.h +++ b/src/transport/raw/UDP.h @@ -71,10 +71,10 @@ class UdpListenParameters } private: - Inet::InetLayer * mLayer = nullptr; ///< Associated inet layer + Inet::InetLayer * mLayer = nullptr; ///< Associated inet layer Inet::IPAddressType mAddressType = Inet::IPAddressType::kIPv6; ///< type of listening socket - uint16_t mListenPort = CHIP_PORT; ///< UDP listen port - Inet::InterfaceId mInterfaceId = INET_NULL_INTERFACEID; ///< Interface to listen on + uint16_t mListenPort = CHIP_PORT; ///< UDP listen port + Inet::InterfaceId mInterfaceId = INET_NULL_INTERFACEID; ///< Interface to listen on }; /** Implements a transport using UDP. */ @@ -125,9 +125,9 @@ class DLL_EXPORT UDP : public Base static void OnUdpReceive(Inet::IPEndPointBasis * endPoint, System::PacketBufferHandle && buffer, const Inet::IPPacketInfo * pktInfo); - Inet::UDPEndPoint * mUDPEndPoint = nullptr; ///< UDP socket used by the transport + Inet::UDPEndPoint * mUDPEndPoint = nullptr; ///< UDP socket used by the transport Inet::IPAddressType mUDPEndpointType = Inet::IPAddressType::kUnknown; ///< Socket listening type - State mState = State::kNotReady; ///< State of the UDP transport + State mState = State::kNotReady; ///< State of the UDP transport }; } // namespace Transport