Skip to content

Commit

Permalink
Add --wifipaf commission in chip-tool and apps of Linux platform (pro…
Browse files Browse the repository at this point in the history
…ject-chip#33977)

* [NXP] Add --wifi-paf commission in chip-tool and apps of Linux platform
	* Need to enable the function by adding "chip_device_config_enable_wifipaf=true"
	* chip-tool: Add wifi-paf option for pairing.
		Example:
		$ chip-tool pairing wifi-paf 1 ap_ssid ap_pwd [setup-pin-code] [discriminator]
	* apps: Add --wifi-paf.
		Example:
		$ chip-all-clusters-app --wifi --wifi-paf
	Note: Need the usd functions of wpa_supplicant to run this option

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

* Restyled by gn

* * Add the missing compile macro

* Restyled by clang-format

* Update src/controller/CHIPDeviceController.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Update src/include/platform/ConnectivityManager.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/platform/linux/Options.cpp

Co-authored-by: Karsten Sperling <[email protected]>

* Change by following the review's comment:
* Change the name of option to [pair_mode]-[network]
* Remove redundant compile flags
* Move to start the Wi-Fi Manager in initialization stage
* Unconditional the defintion
* Add the cancel-publish / cancel-subscribe dbus interface
* Fix bugs:
	- Redundant callback function registration
	- Remove the incorrect StackLock

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

* Change by following the review's comment:
    - Unconditional functions in SetUpCodePairer
    - Change the description of the comment

Signed-off-by: Lo,Chin-Ran <[email protected]>

* * Add the identifier to distinguish connections
* Unconditional the SetupCode verification

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

* Add RendezvousInformationFlag::kWiFiPAF to tests of TestQRCode

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

* * Add code-wifi to do WiFiPAF by using code.
    example:
    - Linux DUT: sudo ./chip-all-clusters-app --wifi --wifipaf
    - Controller: sudo ./chip-tool pairing code-wifi 1 ap_ssid ap_pwd MT:-24J0SGJ10KA0648G00

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

* Update src/transport/raw/PeerAddress.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Update examples/chip-tool/commands/payload/SetupPayloadParseCommand.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Update src/include/platform/CHIPDeviceConfig.h

Co-authored-by: Boris Zbarsky <[email protected]>

* Change by following the review's comment:
* Add to end of the queue in OnDiscoveredDeviceOverWifiPAF()
* Factor out the long expression into local

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Remove the redundant LogErrorOnFailure()

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

* Use the smart pointer to detect if the caller is still valid in the callback function

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Fix the building error after rebase to TOT of master branch

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Change the dbus interface usage by following the new api update in wpa_supplicant

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

* * Add freq_list option to support multiple channels
* Add more tests in QRCode test

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

* * Change to have the consistent naming of the new added variables
* Fix the problem to add tests in TestQRCode.cpp
* Use a list to track the validation of the caller object.

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

* Cancel the subscription in destructor to avoid the use-after-free issue

Signed-off-by: Lo,Chin-Ran <[email protected]>

* Restyled by clang-format

---------

Signed-off-by: Lo,Chin-Ran <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Karsten Sperling <[email protected]>
  • Loading branch information
4 people authored and j-ororke committed Jul 31, 2024
1 parent 95ec923 commit 2796358
Show file tree
Hide file tree
Showing 34 changed files with 1,078 additions and 14 deletions.
13 changes: 13 additions & 0 deletions examples/chip-tool/commands/pairing/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ class PairSoftAP : public PairingCommand
{}
};

#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
class PairWiFiPAF : public PairingCommand
{
public:
PairWiFiPAF(CredentialIssuerCommands * credsIssuerConfig) :
PairingCommand("wifipaf-wifi", PairingMode::WiFiPAF, PairingNetworkType::WiFi, credsIssuerConfig)
{}
};
#endif

class PairAlreadyDiscovered : public PairingCommand
{
public:
Expand Down Expand Up @@ -243,6 +253,9 @@ void registerCommandsPairing(Commands & commands, CredentialIssuerCommands * cre
make_unique<PairBleWiFi>(credsIssuerConfig),
make_unique<PairBleThread>(credsIssuerConfig),
make_unique<PairSoftAP>(credsIssuerConfig),
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
make_unique<PairWiFiPAF>(credsIssuerConfig),
#endif
make_unique<PairAlreadyDiscovered>(credsIssuerConfig),
make_unique<PairAlreadyDiscoveredByIndex>(credsIssuerConfig),
make_unique<PairAlreadyDiscoveredByIndexWithWiFi>(credsIssuerConfig),
Expand Down
5 changes: 5 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ CHIP_ERROR PairingCommand::RunInternal(NodeId remoteId)
case PairingMode::SoftAP:
err = Pair(remoteId, PeerAddress::UDP(mRemoteAddr.address, mRemotePort, mRemoteAddr.interfaceId));
break;
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
case PairingMode::WiFiPAF:
err = Pair(remoteId, PeerAddress::WiFiPAF(remoteId));
break;
#endif
case PairingMode::AlreadyDiscovered:
err = Pair(remoteId, PeerAddress::UDP(mRemoteAddr.address, mRemotePort, mRemoteAddr.interfaceId));
break;
Expand Down
10 changes: 10 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ enum class PairingMode
CodePaseOnly,
Ble,
SoftAP,
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
WiFiPAF,
#endif
AlreadyDiscovered,
AlreadyDiscoveredByIndex,
AlreadyDiscoveredByIndexWithCode,
Expand Down Expand Up @@ -127,6 +130,13 @@ class PairingCommand : public CHIPCommand,
AddArgument("device-remote-port", 0, UINT16_MAX, &mRemotePort);
AddArgument("pase-only", 0, 1, &mPaseOnly);
break;
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
case PairingMode::WiFiPAF:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
AddArgument("discriminator", 0, 4096, &mDiscriminator.emplace());
break;
#endif
case PairingMode::AlreadyDiscovered:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ CHIP_ERROR SetupPayloadParseCommand::Print(chip::SetupPayload payload)
}
humanFlags.Add("On IP network");
}
if (payload.rendezvousInformation.Value().Has(RendezvousInformationFlag::kWiFiPAF))
{
if (!humanFlags.Empty())
{
humanFlags.Add(", ");
}
humanFlags.Add("Wi-Fi PAF");
}
}
else
{
Expand Down
19 changes: 18 additions & 1 deletion examples/platform/linux/AppMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,15 @@ int ChipLinuxAppInit(int argc, char * const argv[], OptionSet * customOptions,
#if CONFIG_NETWORK_LAYER_BLE
RendezvousInformationFlags rendezvousFlags = RendezvousInformationFlag::kBLE;
#else // CONFIG_NETWORK_LAYER_BLE
RendezvousInformationFlag rendezvousFlags = RendezvousInformationFlag::kOnNetwork;
RendezvousInformationFlags rendezvousFlags = RendezvousInformationFlag::kOnNetwork;
#endif // CONFIG_NETWORK_LAYER_BLE

#ifdef CONFIG_RENDEZVOUS_MODE
rendezvousFlags = static_cast<RendezvousInformationFlags>(CONFIG_RENDEZVOUS_MODE);
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
rendezvousFlags.Set(RendezvousInformationFlag::kWiFiPAF);
#endif

err = Platform::MemoryInit();
SuccessOrExit(err);
Expand Down Expand Up @@ -471,6 +474,20 @@ int ChipLinuxAppInit(int argc, char * const argv[], OptionSet * customOptions,
}
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA
#if CHIP_DEVICE_CONFIG_ENABLE_WPA && CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
ChipLogProgress(NotSpecified, "WiFi-PAF: initialzing");
if (LinuxDeviceOptions::GetInstance().mWiFi)
{
if (EnsureWiFiIsStarted())
{
ChipLogProgress(NotSpecified, "Wi-Fi Management started");
DeviceLayer::ConnectivityManager::WiFiPAFAdvertiseParam args;
args.enable = LinuxDeviceOptions::GetInstance().mWiFiPAF;
args.ExtCmds = LinuxDeviceOptions::GetInstance().mWiFiPAFExtCmds;
DeviceLayer::ConnectivityMgr().SetWiFiPAFAdvertisingEnabled(args);
}
}
#endif

#if CHIP_ENABLE_OPENTHREAD
if (LinuxDeviceOptions::GetInstance().mThread)
Expand Down
19 changes: 19 additions & 0 deletions examples/platform/linux/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ enum
#if CHIP_WITH_NLFAULTINJECTION
kDeviceOption_FaultInjection,
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
kDeviceOption_WiFi_PAF,
#endif
};

constexpr unsigned kAppUsageLength = 64;
Expand All @@ -117,6 +120,9 @@ OptionDef sDeviceOptionDefs[] = {
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
{ "wifi", kNoArgument, kDeviceOption_WiFi },
{ "wifi-supports-5g", kNoArgument, kDeviceOption_WiFiSupports5g },
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
{ "wifipaf", kArgumentRequired, kDeviceOption_WiFi_PAF },
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
#endif // CHIP_DEVICE_CONFIG_ENABLE_WPA
#if CHIP_ENABLE_OPENTHREAD
{ "thread", kNoArgument, kDeviceOption_Thread },
Expand Down Expand Up @@ -189,6 +195,12 @@ const char * sDeviceOptionHelp =
" --wifi-supports-5g\n"
" Indicate that local Wi-Fi hardware should report 5GHz support.\n"
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
"\n"
" --wifipaf freq_list=<freq_1>,<freq_2>... \n"
" Enable Wi-Fi PAF via wpa_supplicant.\n"
" Give an empty string if not setting freq_list: \"\"\n"
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFIPAFs
#if CHIP_ENABLE_OPENTHREAD
"\n"
" --thread\n"
Expand Down Expand Up @@ -588,6 +600,13 @@ bool HandleOption(const char * aProgram, OptionSet * aOptions, int aIdentifier,
}
break;
}
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
case kDeviceOption_WiFi_PAF: {
LinuxDeviceOptions::GetInstance().mWiFiPAF = true;
LinuxDeviceOptions::GetInstance().mWiFiPAFExtCmds = aValue;
break;
}
#endif
default:
PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", aProgram, aName);
Expand Down
4 changes: 4 additions & 0 deletions examples/platform/linux/Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ struct LinuxDeviceOptions
bool wifiSupports5g = false;
bool mWiFi = false;
bool mThread = false;
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
bool mWiFiPAF = false;
const char * mWiFiPAFExtCmds = nullptr;
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE || CHIP_DEVICE_ENABLE_PORT_PARAMS
uint16_t securedDevicePort = CHIP_PORT;
uint16_t unsecuredCommissionerPort = CHIP_UDC_PORT;
Expand Down
6 changes: 6 additions & 0 deletions src/app/server/CommissioningWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ void CommissioningWindowManager::OnPlatformEvent(const DeviceLayer::ChipDeviceEv
#if CONFIG_NETWORK_LAYER_BLE && CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
// If in NonConcurrentConnection, this will already have been completed
mServer->GetBleLayerObject()->CloseAllBleConnections();
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
DeviceLayer::ConnectivityManager::WiFiPAFAdvertiseParam args;
args.enable = false;
args.ExtCmds = nullptr;
DeviceLayer::ConnectivityMgr().SetWiFiPAFAdvertisingEnabled(args);
#endif
}
else if (event->Type == DeviceLayer::DeviceEventType::kFailSafeTimerExpired)
Expand Down
8 changes: 8 additions & 0 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
#include <system/TLVPacketBufferBackingStore.h>
#include <transport/SessionManager.h>

#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
#include <transport/raw/WiFiPAF.h>
#endif

#if defined(CHIP_SUPPORT_ENABLE_STORAGE_API_AUDIT) || defined(CHIP_SUPPORT_ENABLE_STORAGE_LOAD_TEST_AUDIT)
#include <lib/support/PersistentStorageAudit.h>
#endif // defined(CHIP_SUPPORT_ENABLE_STORAGE_API_AUDIT) || defined(CHIP_SUPPORT_ENABLE_STORAGE_LOAD_TEST_AUDIT)
Expand Down Expand Up @@ -214,6 +218,10 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams)
TcpListenParameters(DeviceLayer::TCPEndPointManager())
.SetAddressType(IPAddressType::kIPv6)
.SetListenPort(mOperationalServicePort)
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
,
Transport::WiFiPAFListenParameters(DeviceLayer::ConnectivityMgr().GetWiFiPAF())
#endif
);

Expand Down
7 changes: 7 additions & 0 deletions src/app/server/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
#if CONFIG_NETWORK_LAYER_BLE
#include <transport/raw/BLE.h>
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
#include <transport/raw/WiFiPAF.h>
#endif
#include <app/TimerDelegates.h>
#include <app/reporting/ReportSchedulerImpl.h>
#include <transport/raw/UDP.h>
Expand Down Expand Up @@ -104,6 +107,10 @@ using ServerTransportMgr = chip::TransportMgr<chip::Transport::UDP
#if INET_CONFIG_ENABLE_TCP_ENDPOINT
,
chip::Transport::TCP<kMaxTcpActiveConnectionCount, kMaxTcpPendingPackets>
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
,
chip::Transport::WiFiPAFBase
#endif
>;

Expand Down
11 changes: 8 additions & 3 deletions src/controller/AutoCommissioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,16 @@ CHIP_ERROR AutoCommissioner::StartCommissioning(DeviceCommissioner * commissione
mStopCommissioning = false;
mCommissioner = commissioner;
mCommissioneeDeviceProxy = proxy;
mNeedsNetworkSetup =
mCommissioneeDeviceProxy->GetSecureSession().Value()->AsSecureSession()->GetPeerAddress().GetTransportType() ==
Transport::Type::kBle;

auto transportType =
mCommissioneeDeviceProxy->GetSecureSession().Value()->AsSecureSession()->GetPeerAddress().GetTransportType();
mNeedsNetworkSetup = (transportType == Transport::Type::kBle);
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
mNeedsNetworkSetup = mNeedsNetworkSetup || (transportType == Transport::Type::kWiFiPAF);
#endif
CHIP_ERROR err = CHIP_NO_ERROR;
CommissioningStage nextStage = GetNextCommissioningStage(CommissioningStage::kSecurePairing, err);

mCommissioner->PerformCommissioningStep(mCommissioneeDeviceProxy, nextStage, mParams, this, GetEndpoint(nextStage),
GetCommandTimeout(mCommissioneeDeviceProxy, nextStage));
return CHIP_NO_ERROR;
Expand Down
71 changes: 71 additions & 0 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
#include <ble/Ble.h>
#include <transport/raw/BLE.h>
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
#include <transport/raw/WiFiPAF.h>
#endif

#include <errno.h>
#include <inttypes.h>
Expand Down Expand Up @@ -466,6 +469,13 @@ DeviceCommissioner::DeviceCommissioner() :
mDeviceNOCChainCallback(OnDeviceNOCChainGeneration, this), mSetUpCodePairer(this)
{}

DeviceCommissioner::~DeviceCommissioner()
{
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
DeviceLayer::ConnectivityMgr().WiFiPAFCancelConnect();
#endif
}

CHIP_ERROR DeviceCommissioner::Init(CommissionerInitParams params)
{
VerifyOrReturnError(params.operationalCredentialsDelegate != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
Expand Down Expand Up @@ -730,6 +740,12 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re
peerAddress = Transport::PeerAddress::UDP(params.GetPeerAddress().GetIPAddress(), params.GetPeerAddress().GetPort(),
params.GetPeerAddress().GetInterface());
}
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
else if (params.GetPeerAddress().GetTransportType() == Transport::Type::kWiFiPAF)
{
peerAddress = Transport::PeerAddress::WiFiPAF(remoteDeviceId);
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF

current = FindCommissioneeDevice(peerAddress);
if (current != nullptr)
Expand Down Expand Up @@ -804,6 +820,24 @@ CHIP_ERROR DeviceCommissioner::EstablishPASEConnection(NodeId remoteDeviceId, Re
ExitNow(err = CHIP_ERROR_INVALID_ARGUMENT);
}
}
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
if (params.GetPeerAddress().GetTransportType() == Transport::Type::kWiFiPAF)
{
if (DeviceLayer::ConnectivityMgr().GetWiFiPAF()->GetWiFiPAFState() != Transport::WiFiPAFBase::State::kConnected)
{
ChipLogProgress(Controller, "WiFi-PAF: Subscribing the NAN-USD devices");
if (!DeviceLayer::ConnectivityMgrImpl().IsWiFiManagementStarted())
{
ChipLogError(Controller, "Wi-Fi Management should have be started now.");
ExitNow(CHIP_ERROR_INTERNAL);
}
mRendezvousParametersForDeviceDiscoveredOverWiFiPAF = params;
DeviceLayer::ConnectivityMgr().WiFiPAFConnect(params.GetSetupDiscriminator().value(), (void *) this,
OnWiFiPAFSubscribeComplete, OnWiFiPAFSubscribeError);
ExitNow(CHIP_NO_ERROR);
}
}
#endif
session = mSystemState->SessionMgr()->CreateUnauthenticatedSession(params.GetPeerAddress(), params.GetMRPConfig());
VerifyOrExit(session.HasValue(), err = CHIP_ERROR_NO_MEMORY);
Expand Down Expand Up @@ -872,6 +906,43 @@ void DeviceCommissioner::OnDiscoveredDeviceOverBleError(void * appState, CHIP_ER
}
#endif // CONFIG_NETWORK_LAYER_BLE

#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
void DeviceCommissioner::OnWiFiPAFSubscribeComplete(void * appState)
{
auto self = (DeviceCommissioner *) appState;
auto device = self->mDeviceInPASEEstablishment;

if (nullptr != device && device->GetDeviceTransportType() == Transport::Type::kWiFiPAF)
{
ChipLogProgress(Controller, "WiFi-PAF: Subscription Completed, dev_id = %lu", device->GetDeviceId());
auto remoteId = device->GetDeviceId();
auto params = self->mRendezvousParametersForDeviceDiscoveredOverWiFiPAF;

self->mRendezvousParametersForDeviceDiscoveredOverWiFiPAF = RendezvousParameters();
self->ReleaseCommissioneeDevice(device);
LogErrorOnFailure(self->EstablishPASEConnection(remoteId, params));
}
}

void DeviceCommissioner::OnWiFiPAFSubscribeError(void * appState, CHIP_ERROR err)
{
auto self = (DeviceCommissioner *) appState;
auto device = self->mDeviceInPASEEstablishment;

if (nullptr != device && device->GetDeviceTransportType() == Transport::Type::kWiFiPAF)
{
ChipLogError(Controller, "WiFi-PAF: Subscription Error, id = %lu, err = %" CHIP_ERROR_FORMAT, device->GetDeviceId(),
err.Format());
self->ReleaseCommissioneeDevice(device);
self->mRendezvousParametersForDeviceDiscoveredOverWiFiPAF = RendezvousParameters();
if (self->mPairingDelegate != nullptr)
{
self->mPairingDelegate->OnPairingComplete(err);
}
}
}
#endif

CHIP_ERROR DeviceCommissioner::Commission(NodeId remoteDeviceId, CommissioningParameters & params)
{
if (mDefaultCommissioner == nullptr)
Expand Down
7 changes: 6 additions & 1 deletion src/controller/CHIPDeviceController.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController,
{
public:
DeviceCommissioner();
~DeviceCommissioner() override {}
~DeviceCommissioner() override;

#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY // make this commissioner discoverable
/**
Expand Down Expand Up @@ -847,6 +847,11 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController,
static void OnDiscoveredDeviceOverBleError(void * appState, CHIP_ERROR err);
RendezvousParameters mRendezvousParametersForDeviceDiscoveredOverBle;
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
static void OnWiFiPAFSubscribeComplete(void * appState);
static void OnWiFiPAFSubscribeError(void * appState, CHIP_ERROR err);
RendezvousParameters mRendezvousParametersForDeviceDiscoveredOverWiFiPAF;
#endif

static void OnBasicFailure(void * context, CHIP_ERROR err);
static void OnBasicSuccess(void * context, const chip::app::DataModel::NullObjectType &);
Expand Down
7 changes: 7 additions & 0 deletions src/controller/CHIPDeviceControllerFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ CHIP_ERROR DeviceControllerFactory::InitSystemState(FactoryInitParams params)
#else
stateParams.bleLayer = params.bleLayer;
#endif // CONFIG_DEVICE_LAYER
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
stateParams.wifipaf_layer = params.wifipaf_layer;
#endif
VerifyOrReturnError(stateParams.bleLayer != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
#endif

Expand All @@ -167,6 +170,10 @@ CHIP_ERROR DeviceControllerFactory::InitSystemState(FactoryInitParams params)
Transport::TcpListenParameters(stateParams.tcpEndPointManager)
.SetAddressType(IPAddressType::kIPv6)
.SetListenPort(params.listenPort)
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_WIFIPAF
,
Transport::WiFiPAFListenParameters()
#endif
));

Expand Down
Loading

0 comments on commit 2796358

Please sign in to comment.