Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits committed Oct 14, 2021
1 parent 18c8e3e commit 0770dc6
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 30 deletions.
15 changes: 6 additions & 9 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand Down
3 changes: 1 addition & 2 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 5 additions & 6 deletions src/controller/tests/TestDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/inet/IPAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>((aPrefix & 0xFF00000000000000ULL) >> 56),
Expand Down
5 changes: 3 additions & 2 deletions src/inet/TCPEndPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions src/transport/raw/TCP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

/**
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/transport/raw/UDP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0770dc6

Please sign in to comment.