Skip to content

Commit

Permalink
Merge branch 'master' into bug/fixServerSideEnabledClustersAndAttribu…
Browse files Browse the repository at this point in the history
…tesJavaPythonTemplates/ZAP#898
  • Loading branch information
andy31415 committed Mar 23, 2023
2 parents cf699c9 + bf14eb2 commit cdbb033
Show file tree
Hide file tree
Showing 361 changed files with 11,240 additions and 2,048 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/smoketest-darwin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Smoke Test - Darwin

on:
push:
pull_request:
merge_group:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
cancel-in-progress: true

jobs:
darwin:
name: Smoke Run - Darwin
timeout-minutes: 60

if: github.actor != 'restyled-io[bot]'
runs-on: macos-latest

steps:
- uses: Wandalen/[email protected]
name: Checkout
with:
action: actions/checkout@v3
with: |
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform darwin
- name: Setup Environment
run: brew install [email protected]

- name: Bootstrap cache
uses: actions/cache@v3
timeout-minutes: 10
with:
key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }}
path: |
.environment
build_overrides/pigweed_environment.gni
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v3
if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build Matter TV Casting Bridge
timeout-minutes: 20
run: |
xcodebuild -target "MatterTvCastingBridge" -sdk iphoneos
working-directory: examples/tv-casting-app/darwin/MatterTvCastingBridge
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
[submodule "third_party/silabs/wiseconnect-wifi-bt-sdk"]
path = third_party/silabs/wiseconnect-wifi-bt-sdk
url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk.git
branch = master
branch = 2.7.1-Matter
platforms = efr32,silabs_docker
[submodule "editline"]
path = third_party/editline/repo
Expand Down
2 changes: 0 additions & 2 deletions examples/all-clusters-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ extern "C" void ChipTest(void)

// Set DeviceInstanceInfoProvider after CHIPDeviceManager init
// CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first
#if CONFIG_ENABLE_AMEBA_FACTORY_DATA
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
#endif

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ void ProcessColorControlUnicastBindingCommand(BindingCommandData * data, const E
case Clusters::ColorControl::Commands::ColorLoopSet::Id:
colorLoopSetCommand.updateFlags =
static_cast<chip::BitMask<chip::app::Clusters::ColorControl::ColorLoopUpdateFlags>>(data->args[0]);
colorLoopSetCommand.action = static_cast<EmberAfColorLoopAction>(data->args[1]);
colorLoopSetCommand.direction = static_cast<EmberAfColorLoopDirection>(data->args[2]);
colorLoopSetCommand.action = static_cast<ColorLoopAction>(data->args[1]);
colorLoopSetCommand.direction = static_cast<ColorLoopDirection>(data->args[2]);
colorLoopSetCommand.time = static_cast<uint16_t>(data->args[3]);
colorLoopSetCommand.startHue = static_cast<uint16_t>(data->args[4]);
colorLoopSetCommand.optionsMask = static_cast<uint8_t>(data->args[5]);
Expand Down Expand Up @@ -708,8 +708,8 @@ void ProcessColorControlGroupBindingCommand(BindingCommandData * data, const Emb
case Clusters::ColorControl::Commands::ColorLoopSet::Id:
colorLoopSetCommand.updateFlags =
static_cast<chip::BitMask<chip::app::Clusters::ColorControl::ColorLoopUpdateFlags>>(data->args[0]);
colorLoopSetCommand.action = static_cast<EmberAfColorLoopAction>(data->args[1]);
colorLoopSetCommand.direction = static_cast<EmberAfColorLoopDirection>(data->args[2]);
colorLoopSetCommand.action = static_cast<ColorLoopAction>(data->args[1]);
colorLoopSetCommand.direction = static_cast<ColorLoopDirection>(data->args[2]);
colorLoopSetCommand.time = static_cast<uint16_t>(data->args[3]);
colorLoopSetCommand.startHue = static_cast<uint16_t>(data->args[4]);
colorLoopSetCommand.optionsMask = static_cast<uint8_t>(data->args[5]);
Expand Down
9 changes: 6 additions & 3 deletions examples/chef/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ extern "C" void ChipTest(void)

initPref();

// Initialize device attestation, commissionable data and device instance info
// TODO: Use our own DeviceInstanceInfoProvider
// SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
mFactoryDataProvider.Init();
SetCommissionableDataProvider(&mFactoryDataProvider);
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();

err = deviceMgr.Init(&EchoCallbacks);
Expand All @@ -144,6 +143,10 @@ extern "C" void ChipTest(void)
ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n");
}

// Set DeviceInstanceInfoProvider after CHIPDeviceManager init
// CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0);

statusLED1.Init(STATUS_LED_GPIO_NUM);
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import("//build_overrides/efr32_sdk.gni")
import("//build_overrides/pigweed.gni")

import("${build_root}/config/defaults.gni")
import("${efr32_sdk_build_root}/efr32_executable.gni")
import("${efr32_sdk_build_root}/efr32_sdk.gni")
import("${efr32_sdk_build_root}/silabs_executable.gni")

import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
import("${chip_root}/src/platform/device.gni")
Expand Down Expand Up @@ -81,7 +81,7 @@ efr32_sdk("sdk") {
}
}

efr32_executable("chef_app") {
silabs_executable("chef_app") {
output_name = "chip-efr32-chef-example.out"
include_dirs = [ "include" ]
defines = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ class PairingCommandBridge : public CHIPCommandBridge
AddArgument("discriminator", 0, 4096, &mDiscriminator);
break;
}

AddArgument("use-device-attestation-delegate", 0, 1, &mUseDeviceAttestationDelegate,
"If true, use a device attestation delegate that always wants to be notified about attestation results. "
"Defaults to false.");
AddArgument("device-attestation-failsafe-time", 0, UINT16_MAX, &mDeviceAttestationFailsafeTime,
"If set, the time to extend the failsafe to before calling the device attestation delegate");
}

/////////// CHIPCommandBridge Interface /////////
Expand All @@ -89,4 +95,6 @@ class PairingCommandBridge : public CHIPCommandBridge
uint16_t mDiscriminator;
uint32_t mSetupPINCode;
char * mOnboardingPayload;
chip::Optional<bool> mUseDeviceAttestationDelegate;
chip::Optional<uint16_t> mDeviceAttestationFailsafeTime;
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@
using namespace ::chip;
using namespace ::chip::Controller;

// A no-op MTRDeviceAttestationDelegate which lets us test (by default, in CI)
// commissioning flows that have such a delegate.
@interface NoOpAttestationDelegate : NSObject <MTRDeviceAttestationDelegate>
@end

@implementation NoOpAttestationDelegate
- (void)deviceAttestationCompletedForController:(MTRDeviceController *)controller
opaqueDeviceHandle:(void *)opaqueDeviceHandle
attestationDeviceInfo:(MTRDeviceAttestationDeviceInfo *)attestationDeviceInfo
error:(NSError * _Nullable)error
{
[controller continueCommissioningDevice:opaqueDeviceHandle ignoreAttestationFailure:NO error:nil];
}

@end

void PairingCommandBridge::SetUpDeviceControllerDelegate()
{
dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.pairing", DISPATCH_QUEUE_SERIAL);
Expand All @@ -49,6 +65,13 @@
break;
}

if (mUseDeviceAttestationDelegate.ValueOr(false)) {
params.deviceAttestationDelegate = [[NoOpAttestationDelegate alloc] init];
if (mDeviceAttestationFailsafeTime.HasValue()) {
params.failSafeTimeout = @(mDeviceAttestationFailsafeTime.Value());
}
}

[deviceControllerDelegate setCommandBridge:this];
[deviceControllerDelegate setParams:params];
[deviceControllerDelegate setCommissioner:commissioner];
Expand Down
9 changes: 6 additions & 3 deletions examples/light-switch-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ extern "C" void ChipTest(void)

initPref();

// Initialize device attestation, commissionable data and device instance info
// TODO: Use our own DeviceInstanceInfoProvider
// SetDeviceInstanceInfoProvider(&mFactoryDataProvider);
mFactoryDataProvider.Init();
SetCommissionableDataProvider(&mFactoryDataProvider);
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);

CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance();

err = deviceMgr.Init(&EchoCallbacks);
Expand All @@ -149,6 +148,10 @@ extern "C" void ChipTest(void)
ChipLogProgress(DeviceLayer, "DeviceManagerInit() - OK\r\n");
}

// Set DeviceInstanceInfoProvider after CHIPDeviceManager init
// CHIPDeviceManager init will set GenericDeviceInsanceInfoProvider first
SetDeviceInstanceInfoProvider(&mFactoryDataProvider);

chip::DeviceLayer::PlatformMgr().ScheduleWork(InitServer, 0);

statusLED1.Init(STATUS_LED_GPIO_NUM);
Expand Down
2 changes: 0 additions & 2 deletions examples/light-switch-app/silabs/SiWx917/.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ check_system_includes = true
default_args = {
target_cpu = "arm"
target_os = "freertos"
chip_openthread_ftd = true

import("//args.gni")
}
Loading

0 comments on commit cdbb033

Please sign in to comment.