Skip to content

Commit

Permalink
Pull request project-chip#1536: Feature/provision 2.0
Browse files Browse the repository at this point in the history
Merge in WMN_TOOLS/matter from feature/provision-2.0 to RC_2.3.0-1.3

Squashed commit of the following:

commit 15a5e146bc99d58cd81102bd97a393712b4d0a60
Author: Ricardo Casallas <77841255+rcasallas-silabs@users.noreply.github.com>
Date:   Wed Mar 13 14:14:38 2024 -0400

    Provision 2.0: Code review.

commit ebf550397e22b260f8e2970213e83da934783f08
Author: Ricardo Casallas <77841255+rcasallas-silabs@users.noreply.github.com>
Date:   Tue Feb 27 14:24:36 2024 -0500

    Provision 2.0: Bluetooth channel.
    Provision 2.0: Si917 support.
    Provision 2.0: Image generation automated.
    Provision 2.0: Generator images re-built.
    Provision 2.0: Bugfixes.

commit 92e0e84e7ac5c65ed2406bf99bcd78a9de6f53f7
Author: Louis-Philip Beliveau <Louis-Philip.Beliveau@silabs.com>
Date:   Thu Feb 1 20:57:10 2024 +0000

    Pull request project-chip#1532: Compiled apps

    Merge in WMN_TOOLS/matter from feature/compiled_apps to draft/provision-2.0

    Squashed commit of the following:

    commit bfe6d18c5a26230e1439cc556b4f18fe2d9c5b24
    Author: lpbeliveau-silabs <louis-philip.beliveau@silabs.com>
    Date:   Thu Feb 1 14:22:09 2024 -0500

        Added examples for all examples tested to for provisioning versions

... and 5 more commits
  • Loading branch information
rcasallas-silabs authored and jmartinez-silabs committed Mar 29, 2024
1 parent dc344a6 commit 6d6213b
Show file tree
Hide file tree
Showing 206 changed files with 63,405 additions and 25,064 deletions.
10 changes: 2 additions & 8 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#endif // QR_CODE_ENABLED
#endif // DISPLAY_ENABLED

#include <SilabsDeviceDataProvider.h>
#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1
#include <app/icd/server/ICDNotifier.h> // nogncheck
#endif
Expand Down Expand Up @@ -751,7 +750,7 @@ void BaseApplication::ScheduleFactoryReset()
// Press both buttons to request provisioning
if(GetPlatform().GetButtonState(APP_ACTION_BUTTON))
{
Provision::Manager::GetInstance().RequestProvision();
Provision::Manager::GetInstance().SetProvisionRequired(true);
}
PlatformMgr().HandleServerShuttingDown();
ConfigurationMgr().InitiateFactoryReset();
Expand All @@ -768,18 +767,13 @@ void BaseApplication::OnPlatformEvent(const ChipDeviceEvent * event, intptr_t)

void BaseApplication::OutputQrCode(bool refreshLCD)
{
CHIP_ERROR err = CHIP_NO_ERROR;
(void) refreshLCD; // could be unused

// Create buffer for the Qr code setup payload that can fit max size and null terminator.
char setupPayloadBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1];
chip::MutableCharSpan setupPayload(setupPayloadBuffer);

#if PROVISION_CHANNEL_ENABLED
err = Provision::Manager::GetInstance().GetStorage().GetSetupPayload(setupPayload);
#else
err = Silabs::SilabsDeviceDataProvider::GetDeviceDataProvider().GetSetupPayload(setupPayload);
#endif
CHIP_ERROR err = Provision::Manager::GetInstance().GetStorage().GetSetupPayload(setupPayload);
if (CHIP_NO_ERROR == err)
{
// Print setup info on LCD if available
Expand Down
28 changes: 8 additions & 20 deletions examples/platform/silabs/MatterConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys
#include "SilabsTestEventTriggerDelegate.h"
#include <app/InteractionModelEngine.h>
#include <app/TimerDelegates.h>
#if !PROVISION_CHANNEL_ENABLED
#include <SilabsDeviceDataProvider.h> // nogncheck
#endif
#include <provision/ProvisionManager.h>

#if CHIP_CONFIG_SYNCHRONOUS_REPORTS_ENABLED
#include <app/reporting/SynchronizedReportSchedulerImpl.h>
Expand Down Expand Up @@ -184,16 +182,8 @@ void SilabsMatterConfig::AppInit()
{
GetPlatform().Init();

if(Provision::Manager::GetInstance().ProvisionRequired())
{
Provision::Manager::GetInstance().Start();
}
else
{
xTaskCreate(application_start, "main_task", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, &main_Task);
SILABS_LOG("Starting scheduler");
}

xTaskCreate(application_start, "main_task", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, &main_Task);
SILABS_LOG("Starting scheduler");
GetPlatform().StartScheduler();

// Should never get here.
Expand Down Expand Up @@ -263,13 +253,11 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)

ReturnErrorOnFailure(PlatformMgr().InitChipStack());

#if PROVISION_CHANNEL_ENABLED
SetDeviceInstanceInfoProvider(&Silabs::Provision::Manager::GetInstance().GetStorage());
SetCommissionableDataProvider(&Silabs::Provision::Manager::GetInstance().GetStorage());
#else
SetDeviceInstanceInfoProvider(&Silabs::SilabsDeviceDataProvider::GetDeviceDataProvider());
SetCommissionableDataProvider(&Silabs::SilabsDeviceDataProvider::GetDeviceDataProvider());
#endif
// Provision Manager
Silabs::Provision::Manager & provision = Silabs::Provision::Manager::GetInstance();
ReturnErrorOnFailure(provision.Init());
SetDeviceInstanceInfoProvider(&provision.GetStorage());
SetCommissionableDataProvider(&provision.GetStorage());

chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(appName);

Expand Down
20 changes: 0 additions & 20 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,6 @@ source_set("siwx917-matter-shell") {
}
}

source_set("silabs-factory-data-provider") {
sources = [
"${silabs_common_plat_dir}/SilabsDeviceDataProvider.cpp",
"${silabs_common_plat_dir}/SilabsDeviceDataProvider.h",
]

public_deps = [
"${chip_root}/src/credentials",
"${chip_root}/src/platform:platform_base",
"${chip_root}/src/setup_payload",
]

public_configs = [ ":siwx917-common-config" ]
}

config("siwx917-common-config") {
defines = [ "OTA_PERIODIC_TIMEOUT=${ota_periodic_query_timeout_sec}" ]

Expand Down Expand Up @@ -251,11 +236,6 @@ source_set("siwx917-common") {
# Provisionned data and credentials
public_deps += [ "${silabs_common_plat_dir}/provision:provision-siwx917" ]

# Factory Data Provider
if (use_efr32_factory_data_provider && !use_provision_channel) {
public_deps += [ ":silabs-factory-data-provider" ]
}

if (silabs_test_event_trigger_enabled) {
sources +=
[ "${silabs_common_plat_dir}/SilabsTestEventTriggerDelegate.cpp" ]
Expand Down
Loading

0 comments on commit 6d6213b

Please sign in to comment.