Skip to content

Commit

Permalink
Merge branch 'master' into telink_image_update
Browse files Browse the repository at this point in the history
  • Loading branch information
s07641069 authored Jun 27, 2024
2 parents 474607b + d71a363 commit 14b9b0c
Show file tree
Hide file tree
Showing 176 changed files with 15,330 additions and 2,632 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples-linux-tv-casting-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Build Linux tv-casting-app
run: |
./scripts/run_in_build_env.sh \
"scripts/examples/gn_build_example.sh examples/tv-casting-app/linux/ out/tv-casting-app"
"scripts/examples/gn_build_example.sh examples/tv-casting-app/linux/ out/tv-casting-app chip_casting_simplified=true"
- name: Test casting from Linux tv-casting-app to Linux tv-app
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ jobs:
--no-print \
--log-level info \
src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \
src/app/zap-templates/zcl/data-model/chip/global-structs.xml \
src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml \
src/app/zap-templates/zcl/data-model/chip/access-control-definitions.xml \
src/app/zap-templates/zcl/data-model/chip/access-control-cluster.xml \
src/app/zap-templates/zcl/data-model/chip/account-login-cluster.xml \
Expand Down
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@
url = https://github.com/SiliconLabs/sdk_support.git
branch = main
platforms = silabs,silabs_docker
[submodule "third_party/silabs/gecko_sdk"]
path = third_party/silabs/gecko_sdk
url = https://github.com/SiliconLabs/gecko_sdk.git
branch = v4.4.2
[submodule "third_party/silabs/simplicity_sdk"]
path = third_party/silabs/simplicity_sdk
url = https://github.com/SiliconLabs/simplicity_sdk.git
branch = v2024.6.0
platforms = silabs
[submodule "third_party/silabs/wiseconnect-wifi-bt-sdk"]
path = third_party/silabs/wiseconnect-wifi-bt-sdk
Expand All @@ -244,7 +244,7 @@
[submodule "third_party/silabs/wifi_sdk"]
path = third_party/silabs/wifi_sdk
url = https://github.com/SiliconLabs/wiseconnect.git
branch = v3.1.3-matter-hotfix.4
branch = v3.3.0
platforms = silabs
[submodule "editline"]
path = third_party/editline/repo
Expand Down
1 change: 1 addition & 0 deletions docs/zap_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Generally regenerate using one of:
| 257 | 0x101 | DoorLock |
| 258 | 0x102 | WindowCovering |
| 259 | 0x103 | BarrierControl |
| 336 | 0x150 | ServiceArea |
| 512 | 0x200 | PumpConfigurationAndControl |
| 513 | 0x201 | Thermostat |
| 514 | 0x202 | FanControl |
Expand Down
9 changes: 9 additions & 0 deletions examples/chip-tool/commands/pairing/Commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ class PairCodeThread : public PairingCommand
{}
};

class PairCodeWiFiThread : public PairingCommand
{
public:
PairCodeWiFiThread(CredentialIssuerCommands * credsIssuerConfig) :
PairingCommand("code-wifi-thread", PairingMode::Code, PairingNetworkType::WiFiOrThread, credsIssuerConfig)
{}
};

class PairOnNetwork : public PairingCommand
{
public:
Expand Down Expand Up @@ -231,6 +239,7 @@ void registerCommandsPairing(Commands & commands, CredentialIssuerCommands * cre
make_unique<PairCodePase>(credsIssuerConfig),
make_unique<PairCodeWifi>(credsIssuerConfig),
make_unique<PairCodeThread>(credsIssuerConfig),
make_unique<PairCodeWiFiThread>(credsIssuerConfig),
make_unique<PairBleWiFi>(credsIssuerConfig),
make_unique<PairBleThread>(credsIssuerConfig),
make_unique<PairSoftAP>(credsIssuerConfig),
Expand Down
4 changes: 4 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ CommissioningParameters PairingCommand::GetCommissioningParameters()
case PairingNetworkType::Thread:
params.SetThreadOperationalDataset(mOperationalDataset);
break;
case PairingNetworkType::WiFiOrThread:
params.SetWiFiCredentials(Controller::WiFiCredentials(mSSID, mPassword));
params.SetThreadOperationalDataset(mOperationalDataset);
break;
case PairingNetworkType::None:
break;
}
Expand Down
6 changes: 6 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ enum class PairingNetworkType
None,
WiFi,
Thread,
WiFiOrThread,
};

class PairingCommand : public CHIPCommand,
Expand Down Expand Up @@ -85,6 +86,11 @@ class PairingCommand : public CHIPCommand,
case PairingNetworkType::Thread:
AddArgument("operationalDataset", &mOperationalDataset);
break;
case PairingNetworkType::WiFiOrThread:
AddArgument("ssid", &mSSID);
AddArgument("password", &mPassword);
AddArgument("operationalDataset", &mOperationalDataset);
break;
}

switch (mode)
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/silabs/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ check_system_includes = true
default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_openthread_ftd = true
chip_openthread_ftd = false

import("//openthread.gni")
}
13 changes: 10 additions & 3 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,21 @@
#include "AppConfig.h"
#include "AppEvent.h"
#include "AppTask.h"

#include <app/server/Server.h>

#define APP_ACTION_BUTTON 1

#ifdef DISPLAY_ENABLED
#include "lcd.h"
#ifdef QR_CODE_ENABLED
#include "qrcodegen.h"
#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
#include <ProvisionManager.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
#include <assert.h>
Expand Down Expand Up @@ -744,6 +745,11 @@ void BaseApplication::DispatchEvent(AppEvent * aEvent)
void BaseApplication::ScheduleFactoryReset()
{
PlatformMgr().ScheduleWork([](intptr_t) {
// Press both buttons to request provisioning
if (GetPlatform().GetButtonState(APP_ACTION_BUTTON))
{
Provision::Manager::GetInstance().SetProvisionRequired(true);
}
PlatformMgr().HandleServerShuttingDown();
ConfigurationMgr().InitiateFactoryReset();
});
Expand All @@ -765,7 +771,8 @@ void BaseApplication::OutputQrCode(bool refreshLCD)
char setupPayloadBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1];
chip::MutableCharSpan setupPayload(setupPayloadBuffer);

if (Silabs::SilabsDeviceDataProvider::GetDeviceDataProvider().GetSetupPayload(setupPayload) == CHIP_NO_ERROR)
CHIP_ERROR err = Provision::Manager::GetInstance().GetStorage().GetSetupPayload(setupPayload);
if (CHIP_NO_ERROR == err)
{
// Print setup info on LCD if available
#ifdef QR_CODE_ENABLED
Expand Down
16 changes: 8 additions & 8 deletions examples/platform/silabs/MatterConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeystore;
#endif

#include "SilabsDeviceDataProvider.h"
#include <ProvisionManager.h>
#include <app/InteractionModelEngine.h>
#include <app/TimerDelegates.h>

Expand All @@ -80,8 +80,6 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys

#include <DeviceInfoProviderImpl.h>
#include <app/server/Server.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <examples/platform/silabs/SilabsDeviceAttestationCreds.h>

#include <platform/silabs/platformAbstraction/SilabsPlatform.h>

Expand All @@ -92,7 +90,7 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys
using namespace ::chip;
using namespace ::chip::Inet;
using namespace ::chip::DeviceLayer;
using namespace ::chip::Credentials::Silabs;
using namespace ::chip::Credentials;
using namespace chip::DeviceLayer::Silabs;

#if CHIP_ENABLE_OPENTHREAD
Expand Down Expand Up @@ -174,7 +172,7 @@ void ApplicationStart(void * unused)

chip::DeviceLayer::PlatformMgr().LockChipStack();
// Initialize device attestation config
SetDeviceAttestationCredentialsProvider(Credentials::Silabs::GetSilabsDacProvider());
SetDeviceAttestationCredentialsProvider(&Provision::Manager::GetInstance().GetStorage());
chip::DeviceLayer::PlatformMgr().UnlockChipStack();

SILABS_LOG("Starting App Task");
Expand All @@ -190,7 +188,6 @@ void ApplicationStart(void * unused)
void SilabsMatterConfig::AppInit()
{
GetPlatform().Init();

sMainTaskHandle = osThreadNew(ApplicationStart, nullptr, &kMainTaskAttr);
SILABS_LOG("Starting scheduler");
VerifyOrDie(sMainTaskHandle); // We can't proceed if the Main Task creation failed.
Expand Down Expand Up @@ -257,8 +254,11 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)

ReturnErrorOnFailure(PlatformMgr().InitChipStack());

SetDeviceInstanceInfoProvider(&Silabs::SilabsDeviceDataProvider::GetDeviceDataProvider());
SetCommissionableDataProvider(&Silabs::SilabsDeviceDataProvider::GetDeviceDataProvider());
// 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
62 changes: 6 additions & 56 deletions examples/platform/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@ config("chip_examples_project_config") {
include_dirs = [ "project_include" ]

# Link options that provide a replacement for dynamic memory operations in standard
# library with the FreeRTOS malloc in platform code.
# library with the sl_memory_manager in platform code.
ldflags = [
# memory allocation -- these must be re-entrant and do locking
"-Wl,--wrap=malloc",
"-Wl,--wrap=free",
"-Wl,--wrap=realloc",
"-Wl,--wrap=calloc",
"-Wl,--wrap=MemoryAlloc",

# Wrap these in case internal newlib call them (e.g. strdup will)
Expand All @@ -91,10 +86,9 @@ source_set("test-event-trigger") {
"${silabs_common_plat_dir}/SilabsTestEventTriggerDelegate.h",
]

deps = [ "${chip_root}/src/platform/silabs/provision:provision-headers" ]
public_configs = [ ":test-event-trigger-config" ]

public_deps = [
":silabs-factory-data-provider",
"${chip_root}/src/app:test-event-trigger",
"${chip_root}/src/lib/core",
"${chip_root}/src/lib/support",
Expand All @@ -119,46 +113,9 @@ source_set("siwx917-matter-shell") {
}
}

config("attestation-credentials-config") {
include_dirs = [ "${chip_root}" ]
}

source_set("siwx917-attestation-credentials") {
sources = [
"${silabs_common_plat_dir}/SilabsDeviceAttestationCreds.cpp",
"${silabs_common_plat_dir}/SilabsDeviceAttestationCreds.h",
]

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

public_configs = [ ":attestation-credentials-config" ]
}

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/lib/support",
"${chip_root}/src/platform:platform_base",
"${chip_root}/src/setup_payload",
]

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

if (sl_enable_test_event_trigger) {
public_configs += [ ":test-event-trigger-config" ]
}
}

config("siwx917-common-config") {
defines = [ "OTA_PERIODIC_TIMEOUT=${ota_periodic_query_timeout_sec}" ]
libs = [ "${sdk_support_root}/matter/provision/lib/libProvision_si917.a" ]

if (!disable_lcd) {
include_dirs = [ "${silabs_common_plat_dir}/display" ]
Expand Down Expand Up @@ -215,7 +172,7 @@ config("silabs-wifi-config") {
}

source_set("siwx917-common") {
deps = []
deps = [ "${chip_root}/src/platform/silabs/provision:provision-headers" ]
defines = []
public_deps = []
public_configs = [
Expand All @@ -234,7 +191,8 @@ source_set("siwx917-common") {
"${silabs_common_plat_dir}/LEDWidget.cpp",
"${silabs_common_plat_dir}/MatterConfig.cpp",
"${silabs_common_plat_dir}/SoftwareFaultReports.cpp",
"${silabs_common_plat_dir}/heap_4_silabs.c",
"${silabs_common_plat_dir}/provision/ProvisionStorageCustom.cpp",
"${silabs_common_plat_dir}/provision/ProvisionStorageFlash.cpp",
"${silabs_common_plat_dir}/silabs_utils.cpp",
"${silabs_common_plat_dir}/syscalls_stubs.cpp",
"${silabs_plat_si91x_wifi_dir}/dhcp_client.cpp",
Expand Down Expand Up @@ -288,14 +246,6 @@ source_set("siwx917-common") {
]
}

# Attestation Credentials
deps += [ ":siwx917-attestation-credentials" ]

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

public_deps += [
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
Expand Down
Loading

0 comments on commit 14b9b0c

Please sign in to comment.