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 authored and crlonxp committed Aug 21, 2024
1 parent f1c2418 commit c515715
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams)
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
,
Transport::WiFiPAFListenParameters(static_cast<Transport::WiFiPAFBase*>(DeviceLayer::ConnectivityMgr().GetWiFiPAF()->mWiFiPAFTransport))
Transport::WiFiPAFListenParameters(static_cast<Transport::WiFiPAFBase *>(
DeviceLayer::ConnectivityMgr().GetWiFiPAF()->mWiFiPAFTransport))
#endif
);

Expand Down
5 changes: 3 additions & 2 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re
ExitNow(CHIP_ERROR_INTERNAL);
}
mRendezvousParametersForDeviceDiscoveredOverWiFiPAF = params;
DeviceLayer::ConnectivityMgr().WiFiPAFConnect(params.GetSetupDiscriminator().value(), reinterpret_cast<void*>(this),
DeviceLayer::ConnectivityMgr().WiFiPAFConnect(params.GetSetupDiscriminator().value(), reinterpret_cast<void *>(this),
OnWiFiPAFSubscribeComplete, OnWiFiPAFSubscribeError);
ExitNow(CHIP_NO_ERROR);
}
Expand Down Expand Up @@ -1823,7 +1823,8 @@ void DeviceCommissioner::CloseBleConnection()
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
void DeviceCommissioner::ConnectWiFiPAFTransportToSelf()
{
Transport::WiFiPAFBase & transport = std::get<Transport::WiFiPAF<1>>(mSystemState->TransportMgr()->GetTransport().GetTransports());
Transport::WiFiPAFBase & transport =
std::get<Transport::WiFiPAF<1>>(mSystemState->TransportMgr()->GetTransport().GetTransports());
if (!transport.IsWiFiPAFLayerTransportSetToSelf())
{
transport.SetWiFiPAFLayerTransportToSelf();
Expand Down
4 changes: 2 additions & 2 deletions src/platform/Linux/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1521,14 +1521,14 @@ CHIP_ERROR ConnectivityManagerImpl::_WiFiPAFCancelConnect()
snprintf(args, sizeof(args), "subscribe_id=%d", mpresubscribe_id);
wpa_fi_w1_wpa_supplicant1_interface_call_nancancel_subscribe_sync(mWpaSupplicant.iface, args, nullptr, &err.GetReceiver());
mOnPafSubscribeComplete = nullptr;
mOnPafSubscribeError = nullptr;
mOnPafSubscribeError = nullptr;
return CHIP_NO_ERROR;
}

CHIP_ERROR ConnectivityManagerImpl::_WiFiPAFCancelIncompleteConnect()
{
mOnPafSubscribeComplete = nullptr;
mOnPafSubscribeError = nullptr;
mOnPafSubscribeError = nullptr;
return CHIP_NO_ERROR;
}

Expand Down
11 changes: 7 additions & 4 deletions src/transport/raw/WiFiPAF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,17 @@ CHIP_ERROR WiFiPAFBase::SendMessage(const Transport::PeerAddress & address, Syst

bool WiFiPAFBase::CanSendToPeer(const Transport::PeerAddress & address)
{
if (mWiFiPAFLayer != nullptr) {
return (mWiFiPAFLayer->GetWiFiPAFState() != chip::WiFiPAF::State::kNotReady) && (address.GetTransportType() == Type::kWiFiPAF);
} else {
if (mWiFiPAFLayer != nullptr)
{
return (mWiFiPAFLayer->GetWiFiPAFState() != chip::WiFiPAF::State::kNotReady) &&
(address.GetTransportType() == Type::kWiFiPAF);
}
else
{
return false;
}
}


void WiFiPAFBase::OnWiFiPAFMessageReceived(System::PacketBufferHandle && buffer)
{
HandleMessageReceived(Transport::PeerAddress(Transport::Type::kWiFiPAF), std::move(buffer));
Expand Down
6 changes: 3 additions & 3 deletions src/transport/raw/WiFiPAF.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

#pragma once

#include "wifipaf/WiFiPAFLayer.h"
#include <lib/core/CHIPCore.h>
#include <lib/support/DLLUtil.h>
#include <system/SystemPacketBuffer.h>
#include <transport/raw/Base.h>
#include <utility>
#include "wifipaf/WiFiPAFLayer.h"

namespace chip {
namespace Transport {
Expand Down Expand Up @@ -66,8 +66,8 @@ class DLL_EXPORT WiFiPAFBase : public Base, public WiFiPAF::WiFiPAFLayerDelegate
*/
CHIP_ERROR SendAfterConnect(System::PacketBufferHandle && msg);

WiFiPAF::WiFiPAFLayer * mWiFiPAFLayer = nullptr; ///< Associated wifipaf layer
//WiFiPAF::WiFiPAFLayer::State mState = WiFiPAF::WiFiPAFLayer::State::kNotReady;
WiFiPAF::WiFiPAFLayer * mWiFiPAFLayer = nullptr; ///< Associated wifipaf layer
// WiFiPAF::WiFiPAFLayer::State mState = WiFiPAF::WiFiPAFLayer::State::kNotReady;

System::PacketBufferHandle * mPendingPackets;
size_t mPendingPacketsSize;
Expand Down

0 comments on commit c515715

Please sign in to comment.