Skip to content

Commit

Permalink
Updating Infineon P6 all clusters and all clusters minimal apps (#19245)
Browse files Browse the repository at this point in the history
  • Loading branch information
keithmwheeler authored Jun 9, 2022
1 parent ac7e2f7 commit 5d8599d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/all-clusters-app/p6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ AppTask AppTask::sAppTask;
namespace {
app::Clusters::NetworkCommissioning::Instance
sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::P6WiFiDriver::GetInstance()));

constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;

} // namespace

void NetWorkCommissioningInstInit()
Expand All @@ -88,6 +91,9 @@ static void InitServer(intptr_t context)
(void) initParams.InitializeStaticResourcesBeforeServerInit();
chip::Server::GetInstance().Init(initParams);

// We only have network commissioning on endpoint 0.
emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false);

// Initialize device attestation config
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
}
Expand Down
6 changes: 6 additions & 0 deletions examples/all-clusters-minimal-app/p6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ AppTask AppTask::sAppTask;
namespace {
app::Clusters::NetworkCommissioning::Instance
sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::P6WiFiDriver::GetInstance()));

constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE;

} // namespace

void NetWorkCommissioningInstInit()
Expand All @@ -88,6 +91,9 @@ static void InitServer(intptr_t context)
(void) initParams.InitializeStaticResourcesBeforeServerInit();
chip::Server::GetInstance().Init(initParams);

// We only have network commissioning on endpoint 0.
emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false);

// Initialize device attestation config
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
}
Expand Down
4 changes: 4 additions & 0 deletions src/platform/P6/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ void P6WiFiDriver::OnConnectWiFiNetwork()
if (mpConnectCallback)
{
CommitConfiguration();
chip::DeviceLayer::PlatformMgr().LockChipStack();
mpConnectCallback->OnResult(Status::kSuccess, CharSpan(), 0);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
mpConnectCallback = nullptr;
}
}
Expand All @@ -185,7 +187,9 @@ void P6WiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback
{
ChipLogError(NetworkProvisioning, "Failed to connect to WiFi network:%s", chip::ErrorStr(err));
mpConnectCallback = nullptr;
chip::DeviceLayer::PlatformMgr().LockChipStack();
callback->OnResult(networkingStatus, CharSpan(), 0);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
}
}

Expand Down

0 comments on commit 5d8599d

Please sign in to comment.