Skip to content

Commit

Permalink
Merge branch 'master' into build_examples/ota_in_efr32
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Mar 16, 2022
2 parents bba029d + 2091ce3 commit e02931e
Show file tree
Hide file tree
Showing 107 changed files with 3,293 additions and 2,841 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
timeout-minutes: 20
run: scripts/run_in_build_env.sh "ninja -C ./out"
build_linux:
name: Build on Linux (fake, gcc_release, clang, mbedtls, simulated)
name: Build on Linux (fake, gcc_release, clang, simulated)
timeout-minutes: 120

runs-on: ubuntu-latest
Expand Down Expand Up @@ -157,12 +157,10 @@ jobs:
- name: Setup Build, Run Build and Run Tests
timeout-minutes: 90
run: |
for BUILD_TYPE in fake gcc_release clang mbedtls; do
for BUILD_TYPE in gcc_release clang; do
case $BUILD_TYPE in
"fake") GN_ARGS='chip_device_platform="fake"';;
"gcc_release") GN_ARGS='is_debug=false';;
"clang") GN_ARGS='is_clang=true pw_command_launcher="`pwd`/../scripts/helpers/clang-tidy-launcher.py"';;
"mbedtls") GN_ARGS='chip_crypto="mbedtls"';;
esac
scripts/build/gn_gen.sh --args="$GN_ARGS"
Expand Down Expand Up @@ -191,18 +189,14 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps \
--target linux-x64-all-clusters \
--target linux-x64-all-clusters-ipv6only \
--target linux-x64-chip-tool \
--target linux-x64-chip-tool-ipv6only \
--target linux-x64-minmdns-ipv6only \
--target linux-x64-rpc-console \
--target linux-x64-thermostat-ipv6only \
--target linux-x64-tv-app-ipv6only \
build \
"
- name: Run fake linux tests
- name: Run fake linux tests with build_examples
timeout-minutes: 15
run: |
./scripts/run_in_build_env.sh \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,12 @@ server cluster DoorLock = 257 {
kForcedDoorOpenUnderDoorLockedCondition = 0x40;
}

bitmap DlCredentialRuleMask : BITMAP8 {
kSingle = 0x1;
kDual = 0x2;
kTri = 0x4;
}

bitmap DlCredentialRulesSupport : BITMAP8 {
kSingle = 0x1;
kDual = 0x2;
Expand Down Expand Up @@ -1154,13 +1160,13 @@ server cluster DoorLock = 257 {
readonly attribute int8u minPINCodeLength = 24;
readonly attribute int8u maxRFIDCodeLength = 25;
readonly attribute int8u minRFIDCodeLength = 26;
readonly attribute bitmap8 credentialRulesSupport = 27;
readonly attribute DlCredentialRuleMask credentialRulesSupport = 27;
attribute char_string<3> language = 33;
attribute int32u autoRelockTime = 35;
attribute int8u soundVolume = 36;
attribute DlOperatingMode operatingMode = 37;
readonly attribute bitmap16 supportedOperatingModes = 38;
readonly attribute bitmap16 defaultConfigurationRegister = 39;
readonly attribute DlSupportedOperatingModes supportedOperatingModes = 38;
readonly attribute DlDefaultConfigurationRegister defaultConfigurationRegister = 39;
attribute boolean enableOneTouchLocking = 41;
attribute boolean enableInsideStatusLED = 42;
attribute boolean enablePrivacyModeButton = 43;
Expand Down
15 changes: 5 additions & 10 deletions examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ constexpr uint32_t kOff_ms{ 950 };
} // namespace StatusLed
} // namespace LedConsts

using namespace ::chip;
using namespace ::chip::Credentials;
using namespace ::chip::DeviceLayer;

Expand Down Expand Up @@ -277,17 +278,11 @@ void AppTask::FunctionHandler(AppEvent * aEvent)
}
}

void AppTask::StartBLEAdvertisementHandler(AppEvent * aEvent)
void AppTask::StartBLEAdvertisementHandler(AppEvent *)
{
if (!aEvent)
return;
if (aEvent->ButtonEvent.PinNo != BLE_ADVERTISEMENT_START_BUTTON)
return;

// Don't allow on starting Matter service BLE advertising after Thread provisioning.
if (ConnectivityMgr().IsThreadProvisioned())
if (Server::GetInstance().GetFabricTable().FabricCount() != 0)
{
LOG_INF("Matter service BLE advertising not started - device is commissioned to a Thread network.");
LOG_INF("Matter service BLE advertising not started - device is already commissioned");
return;
}

Expand All @@ -297,7 +292,7 @@ void AppTask::StartBLEAdvertisementHandler(AppEvent * aEvent)
return;
}

if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() != CHIP_NO_ERROR)
if (Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() != CHIP_NO_ERROR)
{
LOG_ERR("OpenBasicCommissioningWindow() failed");
}
Expand Down
3 changes: 3 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ void PairingCommand::OnCommissioningComplete(NodeId nodeId, CHIP_ERROR err)

void PairingCommand::OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData & nodeData)
{
// Ignore nodes with closed comissioning window
VerifyOrReturn(nodeData.commissioningMode != 0);

const uint16_t port = nodeData.port;
char buf[chip::Inet::IPAddress::kMaxStringLength];
nodeData.ipAddress[0].ToString(buf);
Expand Down
10 changes: 8 additions & 2 deletions examples/door-lock-app/door-lock-common/door-lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,12 @@ server cluster DoorLock = 257 {
kForcedDoorOpenUnderDoorLockedCondition = 0x40;
}

bitmap DlCredentialRuleMask : BITMAP8 {
kSingle = 0x1;
kDual = 0x2;
kTri = 0x4;
}

bitmap DlCredentialRulesSupport : BITMAP8 {
kSingle = 0x1;
kDual = 0x2;
Expand Down Expand Up @@ -569,12 +575,12 @@ server cluster DoorLock = 257 {
readonly attribute int8u minPINCodeLength = 24;
readonly attribute int8u maxRFIDCodeLength = 25;
readonly attribute int8u minRFIDCodeLength = 26;
readonly attribute bitmap8 credentialRulesSupport = 27;
readonly attribute DlCredentialRuleMask credentialRulesSupport = 27;
attribute char_string<3> language = 33;
attribute int32u autoRelockTime = 35;
attribute int8u soundVolume = 36;
attribute DlOperatingMode operatingMode = 37;
readonly attribute bitmap16 supportedOperatingModes = 38;
readonly attribute DlSupportedOperatingModes supportedOperatingModes = 38;
attribute boolean enableOneTouchLocking = 41;
attribute boolean enablePrivacyModeButton = 43;
attribute int8u wrongCodeEntryLimit = 48;
Expand Down
10 changes: 7 additions & 3 deletions examples/light-switch-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ declare_args() {
use_rs911x_sockets = false
sl_wfx_config_softap = false
sl_wfx_config_scan = true
}

show_qr_code = true
# Enables LCD Qr Code on supported devices
show_qr_code = true
}

# BRD4166A --> ThunderBoard Sense 2 (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") {
Expand Down Expand Up @@ -149,14 +150,17 @@ efr32_executable("light_switch_app") {
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/heap_4_silabs.c",
"${examples_plat_dir}/init_efrPlatform.cpp",
"${examples_plat_dir}/uart.cpp",
"src/AppTask.cpp",
"src/LightingManager.cpp",
"src/ZclCallbacks.cpp",
"src/binding-handler.cpp",
"src/main.cpp",
]

if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) {
sources += [ "${examples_plat_dir}/uart.cpp" ]
}

deps = [
":sdk",
"${chip_root}/examples/common/QRCode",
Expand Down
3 changes: 2 additions & 1 deletion examples/light-switch-app/efr32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ int main(void)
#else // CHIP_DEVICE_CONFIG_THREAD_FTD
#if CHIP_DEVICE_CONFIG_ENABLE_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
#else // CHIP_DEVICE_CONFIG_ENABLE_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
#endif // CHIP_DEVICE_CONFIG_THREAD_FTD
if (ret != CHIP_NO_ERROR)
{
Expand Down
10 changes: 7 additions & 3 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ declare_args() {
use_rs911x_sockets = false
sl_wfx_config_softap = false
sl_wfx_config_scan = true
}

show_qr_code = true
# Enables LCD Qr Code on supported devices
show_qr_code = true
}

# BRD4166A --> ThunderBoard Sense 2 (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") {
Expand Down Expand Up @@ -148,13 +149,16 @@ efr32_executable("lighting_app") {
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/heap_4_silabs.c",
"${examples_plat_dir}/init_efrPlatform.cpp",
"${examples_plat_dir}/uart.cpp",
"src/AppTask.cpp",
"src/LightingManager.cpp",
"src/ZclCallbacks.cpp",
"src/main.cpp",
]

if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) {
sources += [ "${examples_plat_dir}/uart.cpp" ]
}

deps = [
":sdk",
"${chip_root}/examples/common/QRCode",
Expand Down
3 changes: 2 additions & 1 deletion examples/lighting-app/efr32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ int main(void)
#else // CHIP_DEVICE_CONFIG_THREAD_FTD
#if CHIP_DEVICE_CONFIG_ENABLE_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
#else // CHIP_DEVICE_CONFIG_ENABLE_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
#endif // CHIP_DEVICE_CONFIG_THREAD_FTD
if (ret != CHIP_NO_ERROR)
{
Expand Down
12 changes: 4 additions & 8 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,11 @@ void AppTask::StartThreadHandler(AppEvent * aEvent)
}
}

void AppTask::StartBLEAdvertisementHandler(AppEvent * aEvent)
void AppTask::StartBLEAdvertisementHandler(AppEvent *)
{
if (aEvent->ButtonEvent.PinNo != BLE_ADVERTISEMENT_START_BUTTON)
return;

// Don't allow on starting Matter service BLE advertising after Thread provisioning.
if (ConnectivityMgr().IsThreadProvisioned())
if (Server::GetInstance().GetFabricTable().FabricCount() != 0)
{
LOG_INF("NFC Tag emulation and Matter service BLE advertising not started - device is commissioned to a Thread network.");
LOG_INF("Matter service BLE advertising not started - device is already commissioned");
return;
}

Expand All @@ -435,7 +431,7 @@ void AppTask::StartBLEAdvertisementHandler(AppEvent * aEvent)
return;
}

if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() != CHIP_NO_ERROR)
if (Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() != CHIP_NO_ERROR)
{
LOG_ERR("OpenBasicCommissioningWindow() failed");
}
Expand Down
10 changes: 7 additions & 3 deletions examples/lock-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ declare_args() {
use_rs911x_sockets = false
sl_wfx_config_softap = false
sl_wfx_config_scan = true
}

show_qr_code = true
# Enables LCD Qr Code on supported devices
show_qr_code = true
}

# BRD4166A --> ThunderBoard Sense 2 (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") {
Expand Down Expand Up @@ -147,13 +148,16 @@ efr32_executable("lock_app") {
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/heap_4_silabs.c",
"${examples_plat_dir}/init_efrPlatform.cpp",
"${examples_plat_dir}/uart.cpp",
"src/AppTask.cpp",
"src/BoltLockManager.cpp",
"src/ZclCallbacks.cpp",
"src/main.cpp",
]

if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) {
sources += [ "${examples_plat_dir}/uart.cpp" ]
}

deps = [
":sdk",
"${chip_root}/examples/common/QRCode",
Expand Down
3 changes: 2 additions & 1 deletion examples/lock-app/efr32/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ int main(void)
#else // CHIP_DEVICE_CONFIG_THREAD_FTD
#if CHIP_DEVICE_CONFIG_ENABLE_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
#else // CHIP_DEVICE_CONFIG_ENABLE_SED
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif // CHIP_DEVICE_CONFIG_ENABLE_SED
#endif // CHIP_DEVICE_CONFIG_THREAD_FTD
if (ret != CHIP_NO_ERROR)
{
Expand Down
12 changes: 4 additions & 8 deletions examples/lock-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,11 @@ void AppTask::StartThreadHandler(AppEvent * aEvent)
}
}

void AppTask::StartBLEAdvertisementHandler(AppEvent * aEvent)
void AppTask::StartBLEAdvertisementHandler(AppEvent *)
{
if (aEvent->ButtonEvent.PinNo != BLE_ADVERTISEMENT_START_BUTTON)
return;

// Don't allow on starting Matter service BLE advertising after Thread provisioning.
if (ConnectivityMgr().IsThreadProvisioned())
if (Server::GetInstance().GetFabricTable().FabricCount() != 0)
{
LOG_INF("NFC Tag emulation and Matter service BLE advertising not started - device is commissioned to a Thread network.");
LOG_INF("Matter service BLE advertising not started - device is already commissioned");
return;
}

Expand All @@ -411,7 +407,7 @@ void AppTask::StartBLEAdvertisementHandler(AppEvent * aEvent)
return;
}

if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() != CHIP_NO_ERROR)
if (Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() != CHIP_NO_ERROR)
{
LOG_ERR("OpenBasicCommissioningWindow() failed");
}
Expand Down
10 changes: 7 additions & 3 deletions examples/ota-requestor-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ declare_args() {

# Monitor & log memory usage at runtime.
enable_heap_monitoring = false
}

show_qr_code = true
# Enables LCD Qr Code on supported devices
show_qr_code = true
}

# BRD4166A --> ThunderBoard Sense 2 (No LCD)
if (efr32_board == "BRD4166A" || efr32_board == "BRD4180A") {
Expand Down Expand Up @@ -89,13 +90,16 @@ efr32_executable("ota_requestor_app") {
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/heap_4_silabs.c",
"${examples_plat_dir}/init_efrPlatform.cpp",
"${examples_plat_dir}/uart.cpp",
"src/AppTask.cpp",
"src/LightingManager.cpp",
"src/ZclCallbacks.cpp",
"src/main.cpp",
]

if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli) {
sources += [ "${examples_plat_dir}/uart.cpp" ]
}

deps = [
":sdk",
"${chip_root}/examples/common/QRCode",
Expand Down
12 changes: 4 additions & 8 deletions examples/pump-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,11 @@ void AppTask::StartThreadHandler(AppEvent * aEvent)
}
}

void AppTask::StartBLEAdvertisementHandler(AppEvent * aEvent)
void AppTask::StartBLEAdvertisementHandler(AppEvent *)
{
if (aEvent->ButtonEvent.PinNo != BLE_ADVERTISEMENT_START_BUTTON)
return;

// Don't allow on starting Matter service BLE advertising after Thread provisioning.
if (ConnectivityMgr().IsThreadProvisioned())
if (Server::GetInstance().GetFabricTable().FabricCount() != 0)
{
LOG_INF("NFC Tag emulation and Matter service BLE advertising not started - device is commissioned to a Thread network.");
LOG_INF("Matter service BLE advertising not started - device is already commissioned");
return;
}

Expand All @@ -406,7 +402,7 @@ void AppTask::StartBLEAdvertisementHandler(AppEvent * aEvent)
return;
}

if (chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() != CHIP_NO_ERROR)
if (Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow() != CHIP_NO_ERROR)
{
LOG_ERR("OpenBasicCommissioningWindow() failed");
}
Expand Down
Loading

0 comments on commit e02931e

Please sign in to comment.