Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --wifipaf commission in chip-tool and apps of Linux platform #33977

Merged
merged 33 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f7ef595
[NXP] Add --wifi-paf commission in chip-tool and apps of Linux platform
crlonxp Jun 14, 2024
d0310a8
Restyled by clang-format
restyled-commits Jun 18, 2024
4df2319
Restyled by gn
restyled-commits Jun 18, 2024
9c7e58c
* Add the missing compile macro
crlonxp Jun 18, 2024
a421e70
Restyled by clang-format
restyled-commits Jun 18, 2024
a816a61
Update src/controller/CHIPDeviceController.cpp
crlonxp Jun 20, 2024
9d052a0
Update src/include/platform/ConnectivityManager.h
crlonxp Jun 20, 2024
d15b8d5
Update examples/platform/linux/Options.cpp
crlonxp Jun 28, 2024
9bc1371
Change by following the review's comment:
crlonxp Jun 28, 2024
41e3343
Restyled by clang-format
restyled-commits Jun 28, 2024
5f21574
Change by following the review's comment:
crlonxp Jul 1, 2024
ad1b7d5
* Add the identifier to distinguish connections
crlonxp Jul 3, 2024
6a7a368
Restyled by clang-format
restyled-commits Jul 3, 2024
3bf4c67
Add RendezvousInformationFlag::kWiFiPAF to tests of TestQRCode
crlonxp Jul 3, 2024
2444a56
Restyled by clang-format
restyled-commits Jul 3, 2024
3160495
* Add code-wifi to do WiFiPAF by using code.
crlonxp Jul 4, 2024
0fae787
Restyled by clang-format
restyled-commits Jul 4, 2024
35afdf6
Update src/transport/raw/PeerAddress.h
crlonxp Jul 8, 2024
9f06e17
Update examples/chip-tool/commands/payload/SetupPayloadParseCommand.cpp
crlonxp Jul 8, 2024
509fc10
Update src/include/platform/CHIPDeviceConfig.h
crlonxp Jul 8, 2024
4023250
Change by following the review's comment:
crlonxp Jul 9, 2024
5003085
Remove the redundant LogErrorOnFailure()
crlonxp Jul 10, 2024
5a0c41f
Restyled by clang-format
restyled-commits Jul 10, 2024
02dfc41
Use the smart pointer to detect if the caller is still valid in the c…
crlonxp Jul 15, 2024
3f436c8
Fix the building error after rebase to TOT of master branch
crlonxp Jul 15, 2024
fef3192
Change the dbus interface usage by following the new api update in wp…
crlonxp Jul 17, 2024
f9f2aa3
Restyled by clang-format
restyled-commits Jul 17, 2024
30542c4
* Add freq_list option to support multiple channels
crlonxp Jul 19, 2024
19ccdba
Restyled by clang-format
restyled-commits Jul 19, 2024
e032c6e
* Change to have the consistent naming of the new added variables
crlonxp Jul 23, 2024
d63bd30
Restyled by clang-format
restyled-commits Jul 23, 2024
1bb23bf
Cancel the subscription in destructor to avoid the use-after-free issue
crlonxp Jul 25, 2024
96e5c60
Restyled by clang-format
restyled-commits Jul 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading