Skip to content

Commit

Permalink
Merge branch 'master' into airpurifier_composite
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinpan1 authored Jun 28, 2024
2 parents 750eb87 + 03ae36e commit 58e0a7c
Show file tree
Hide file tree
Showing 184 changed files with 15,758 additions and 2,838 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-efr32:54
image: ghcr.io/project-chip/chip-build-efr32:56
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand Down
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: 1 addition & 1 deletion .github/workflows/release_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: ghcr.io/project-chip/chip-build-efr32:54
image: ghcr.io/project-chip/chip-build-efr32:56
steps:
- name: Checkout
uses: actions/checkout@v4
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
21 changes: 18 additions & 3 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 Expand Up @@ -212,7 +216,12 @@ CHIP_ERROR PairingCommand::PairWithCode(NodeId remoteId)

CHIP_ERROR PairingCommand::Pair(NodeId remoteId, PeerAddress address)
{
auto params = RendezvousParameters().SetSetupPINCode(mSetupPINCode).SetDiscriminator(mDiscriminator).SetPeerAddress(address);
VerifyOrDieWithMsg(mSetupPINCode.has_value(), chipTool, "Using mSetupPINCode in a mode when we have not gotten one");
auto params = RendezvousParameters().SetSetupPINCode(mSetupPINCode.value()).SetPeerAddress(address);
if (mDiscriminator.has_value())
{
params.SetDiscriminator(mDiscriminator.value());
}

CHIP_ERROR err = CHIP_NO_ERROR;
if (mPaseOnly.ValueOr(false))
Expand All @@ -232,9 +241,11 @@ CHIP_ERROR PairingCommand::PairWithMdnsOrBleByIndex(NodeId remoteId, uint16_t in
#if CHIP_DEVICE_LAYER_TARGET_DARWIN
VerifyOrReturnError(IsInteractive(), CHIP_ERROR_INCORRECT_STATE);

VerifyOrDieWithMsg(mSetupPINCode.has_value(), chipTool, "Using mSetupPINCode in a mode when we have not gotten one");

RendezvousParameters params;
ReturnErrorOnFailure(GetDeviceScanner().Get(index, params));
params.SetSetupPINCode(mSetupPINCode);
params.SetSetupPINCode(mSetupPINCode.value());

CHIP_ERROR err = CHIP_NO_ERROR;
if (mPaseOnly.ValueOr(false))
Expand All @@ -254,6 +265,10 @@ CHIP_ERROR PairingCommand::PairWithMdnsOrBleByIndex(NodeId remoteId, uint16_t in

CHIP_ERROR PairingCommand::PairWithMdnsOrBleByIndexWithCode(NodeId remoteId, uint16_t index)
{
// We might or might not have a setup code. We don't know yet, but if we
// do, we'll emplace it at that point.
mSetupPINCode.reset();

#if CHIP_DEVICE_LAYER_TARGET_DARWIN
VerifyOrReturnError(IsInteractive(), CHIP_ERROR_INCORRECT_STATE);

Expand All @@ -277,7 +292,7 @@ CHIP_ERROR PairingCommand::PairWithMdnsOrBleByIndexWithCode(NodeId remoteId, uin
VerifyOrReturnError(payload.isValidManualCode(), CHIP_ERROR_INVALID_ARGUMENT);
}

mSetupPINCode = payload.setUpPINCode;
mSetupPINCode.emplace(payload.setUpPINCode);
return PairWithMdnsOrBleByIndex(remoteId, index);
}

Expand Down
32 changes: 23 additions & 9 deletions examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <lib/support/Span.h>
#include <lib/support/ThreadOperationalDataset.h>

#include <optional>

enum class PairingMode
{
None,
Expand All @@ -44,6 +46,7 @@ enum class PairingNetworkType
None,
WiFi,
Thread,
WiFiOrThread,
};

class PairingCommand : public CHIPCommand,
Expand Down Expand Up @@ -85,6 +88,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 All @@ -101,32 +109,32 @@ class PairingCommand : public CHIPCommand,
break;
case PairingMode::Ble:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("discriminator", 0, 4096, &mDiscriminator);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
AddArgument("discriminator", 0, 4096, &mDiscriminator.emplace());
break;
case PairingMode::OnNetwork:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
AddArgument("pase-only", 0, 1, &mPaseOnly);
break;
case PairingMode::SoftAP:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("discriminator", 0, 4096, &mDiscriminator);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
AddArgument("discriminator", 0, 4096, &mDiscriminator.emplace());
AddArgument("device-remote-ip", &mRemoteAddr);
AddArgument("device-remote-port", 0, UINT16_MAX, &mRemotePort);
AddArgument("pase-only", 0, 1, &mPaseOnly);
break;
case PairingMode::AlreadyDiscovered:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
AddArgument("device-remote-ip", &mRemoteAddr);
AddArgument("device-remote-port", 0, UINT16_MAX, &mRemotePort);
AddArgument("pase-only", 0, 1, &mPaseOnly);
break;
case PairingMode::AlreadyDiscoveredByIndex:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode.emplace());
AddArgument("index", 0, UINT16_MAX, &mIndex);
AddArgument("pase-only", 0, 1, &mPaseOnly);
break;
Expand Down Expand Up @@ -246,8 +254,14 @@ class PairingCommand : public CHIPCommand,
mComplex_DSTOffsets;

uint16_t mRemotePort;
uint16_t mDiscriminator;
uint32_t mSetupPINCode;
// mDiscriminator is only used for some situations, but in those situations
// it's mandatory. Track whether we're actually using it; the cases that do
// will emplace this optional.
std::optional<uint16_t> mDiscriminator;
// mSetupPINCode is only used for some situations, but in those situations
// it's mandatory. Track whether we're actually using it; the cases that do
// will emplace this optional.
std::optional<uint32_t> mSetupPINCode;
uint16_t mIndex;
chip::ByteSpan mOperationalDataset;
chip::ByteSpan mSSID;
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")
}
4 changes: 4 additions & 0 deletions examples/lighting-app/nxp/k32w/k32w0/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ default_args = {

import("//args.gni")

pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ]
pw_build_PIP_REQUIREMENTS =
[ "${chip_root}/scripts/setup/requirements.build.txt" ]

# Import default platform configs
import("${chip_root}/src/platform/nxp/k32w/k32w0/args.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
Loading

0 comments on commit 58e0a7c

Please sign in to comment.