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 Jul 19, 2024
1 parent c8a828a commit 9656628
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 157 deletions.
2 changes: 1 addition & 1 deletion examples/platform/linux/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct LinuxDeviceOptions
bool mWiFi = false;
bool mThread = false;
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
bool mWiFiPAF = false;
bool mWiFiPAF = false;
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE || CHIP_DEVICE_ENABLE_PORT_PARAMS
uint16_t securedDevicePort = CHIP_PORT;
Expand Down
2 changes: 1 addition & 1 deletion src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams)
.SetListenPort(mOperationalServicePort)
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
,
,
Transport::WiFiPAFListenParameters(DeviceLayer::ConnectivityMgr().GetWiFiPAF())
#endif
);
Expand Down
4 changes: 2 additions & 2 deletions src/controller/AutoCommissioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,10 +592,10 @@ CHIP_ERROR AutoCommissioner::StartCommissioning(DeviceCommissioner * commissione
mCommissioneeDeviceProxy = proxy;
mNeedsNetworkSetup =
(mCommissioneeDeviceProxy->GetSecureSession().Value()->AsSecureSession()->GetPeerAddress().GetTransportType() ==
Transport::Type::kBle)
Transport::Type::kBle)
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
|| (mCommissioneeDeviceProxy->GetSecureSession().Value()->AsSecureSession()->GetPeerAddress().GetTransportType() ==
Transport::Type::kWiFiPAF)
Transport::Type::kWiFiPAF)
#endif
;
CHIP_ERROR err = CHIP_NO_ERROR;
Expand Down
15 changes: 6 additions & 9 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#include <transport/raw/WiFiPAF.h>
#endif


#include <errno.h>
#include <inttypes.h>
#include <memory>
Expand Down Expand Up @@ -818,7 +817,8 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
if (params.GetPeerAddress().GetTransportType() == Transport::Type::kWiFiPAF)
{
if (DeviceLayer::ConnectivityMgr().GetWiFiPAF()->GetWiFiPAFState() != Transport::WiFiPAFBase::State::kConnected) {
if (DeviceLayer::ConnectivityMgr().GetWiFiPAF()->GetWiFiPAFState() != Transport::WiFiPAFBase::State::kConnected)
{
ChipLogProgress(Controller, "WiFi-PAF: Subscribing the NAN-USD devices");
static constexpr useconds_t kWiFiStartCheckTimeUsec = WIFI_START_CHECK_TIME_USEC;
static constexpr uint8_t kWiFiStartCheckAttempts = WIFI_START_CHECK_ATTEMPTS;
Expand All @@ -834,15 +834,12 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re
usleep(kWiFiStartCheckTimeUsec);
}
}
if (!DeviceLayer::ConnectivityMgrImpl().IsWiFiManagementStarted()) {
if (!DeviceLayer::ConnectivityMgrImpl().IsWiFiManagementStarted())
{
ChipLogError(NotSpecified, "Wi-Fi Management taking too long to start - device configuration will be reset.");
}
mRendezvousParametersForDeviceDiscoveredOverWiFiPAF = params;
DeviceLayer::ConnectivityMgr().WiFiPAFConnect(
this,
OnWiFiPAFSubscribeComplete,
OnWiFiPAFSubscribeError
);
DeviceLayer::ConnectivityMgr().WiFiPAFConnect(this, OnWiFiPAFSubscribeComplete, OnWiFiPAFSubscribeError);
ExitNow(CHIP_NO_ERROR);
}
ChipLogProgress(Controller, "WiFi-PAF: Request to subscrib the NAN-USD device complete");
Expand Down Expand Up @@ -925,7 +922,7 @@ void DeviceCommissioner::OnWiFiPAFSubscribeComplete(void * appState)
if (nullptr != device && device->GetDeviceTransportType() == Transport::Type::kWiFiPAF)
{
auto remoteId = device->GetDeviceId();
auto params = self->mRendezvousParametersForDeviceDiscoveredOverWiFiPAF;
auto params = self->mRendezvousParametersForDeviceDiscoveredOverWiFiPAF;

self->mRendezvousParametersForDeviceDiscoveredOverWiFiPAF = RendezvousParameters();
self->ReleaseCommissioneeDevice(device);
Expand Down
3 changes: 1 addition & 2 deletions src/controller/CHIPDeviceControllerSystemState.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ inline constexpr size_t kMaxDeviceTransportBlePendingPackets = 1;
inline constexpr size_t kMaxDeviceTransportWiFiPAFPendingPackets = 1;
#endif


#if INET_CONFIG_ENABLE_TCP_ENDPOINT
inline constexpr size_t kMaxDeviceTransportTcpActiveConnectionCount = CHIP_CONFIG_MAX_ACTIVE_TCP_CONNECTIONS;

Expand Down Expand Up @@ -106,7 +105,7 @@ struct DeviceControllerSystemStateParams
Ble::BleLayer * bleLayer = nullptr;
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
Transport::WiFiPAFLayer *wifipaf_layer = nullptr;
Transport::WiFiPAFLayer * wifipaf_layer = nullptr;
#endif
Credentials::GroupDataProvider * groupDataProvider = nullptr;
Crypto::SessionKeystore * sessionKeystore = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions src/controller/SetUpCodePairer.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class DLL_EXPORT SetUpCodePairer : public DevicePairingDelegate
CHIP_ERROR StartDiscoverOverSoftAP(SetupPayload & payload);
CHIP_ERROR StopConnectOverSoftAP();
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
CHIP_ERROR StartDiscoverOverWiFiPAF(SetupPayload & payload);
CHIP_ERROR StopConnectOverWiFiPAF();
CHIP_ERROR StartDiscoverOverWiFiPAF(SetupPayload & payload);
CHIP_ERROR StopConnectOverWiFiPAF();
#endif

// Returns whether we have kicked off a new connection attempt.
Expand Down
1 change: 0 additions & 1 deletion src/include/platform/CHIPDeviceConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@
#define CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF 0
#endif


// -------------------- WiFi AP Configuration --------------------

/**
Expand Down
2 changes: 1 addition & 1 deletion src/include/platform/CHIPDeviceEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ struct ChipDeviceEvent final
BLE_CONNECTION_OBJECT ConId;
} CHIPoBLENotifyConfirm;
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
struct
struct
{
chip::System::PacketBuffer * Data;
} CHIPoWiFiPAFWriteReceived;
Expand Down
14 changes: 5 additions & 9 deletions src/include/platform/ConnectivityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,10 @@ class ConnectivityManager

typedef void (*OnConnectionCompleteFunct)(void * appState);
typedef void (*OnConnectionErrorFunct)(void * appState, CHIP_ERROR err);
CHIP_ERROR WiFiPAFConnect(void * appState,
OnConnectionCompleteFunct onSuccess,
OnConnectionErrorFunct onError);
CHIP_ERROR WiFiPAFConnect(void * appState, OnConnectionCompleteFunct onSuccess, OnConnectionErrorFunct onError);
CHIP_ERROR WiFiPAFSend(chip::System::PacketBufferHandle && msgBuf);
Transport::WiFiPAFBase * GetWiFiPAF();
void SetWiFiPAF(Transport::WiFiPAFBase * pmWiFiPAF);
Transport::WiFiPAFBase * GetWiFiPAF();
void SetWiFiPAF(Transport::WiFiPAFBase * pmWiFiPAF);
#endif

// WiFi AP methods
Expand Down Expand Up @@ -428,10 +426,8 @@ inline CHIP_ERROR ConnectivityManager::SetWiFiPAFAdvertisingEnabled(bool val)
return static_cast<ImplClass *>(this)->_SetWiFiPAFAdvertisingEnabled(val);
}

inline CHIP_ERROR ConnectivityManager::WiFiPAFConnect(
void * appState,
OnConnectionCompleteFunct onSuccess,
OnConnectionErrorFunct onError)
inline CHIP_ERROR ConnectivityManager::WiFiPAFConnect(void * appState, OnConnectionCompleteFunct onSuccess,
OnConnectionErrorFunct onError)
{
return static_cast<ImplClass *>(this)->_WiFiPAFConnect(appState, onSuccess, onError);
}
Expand Down
Loading

0 comments on commit 9656628

Please sign in to comment.