Skip to content

Commit 400d0e5

Browse files
authored
Merge branch 'master' into feature/unittest-transport-raw-tests
2 parents 130e766 + 742e65b commit 400d0e5

30 files changed

+1493
-1738
lines changed

.github/workflows/build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ jobs:
371371
372372
build_darwin:
373373
name: Build on Darwin (clang, python_lib, simulated)
374-
runs-on: macos-latest
374+
runs-on: macos-13
375375
if: github.actor != 'restyled-io[bot]'
376376

377377
steps:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2024 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Check for changes to data_model directory without a sha update
16+
17+
on:
18+
pull_request:
19+
paths:
20+
- "data_model/**"
21+
22+
jobs:
23+
check-submodule-update-label:
24+
name: Check for changes to data_model directory without a sha update
25+
runs-on: ubuntu-latest
26+
if: "git diff --name-only HEAD^..HEAD data_model/ | grep -q spec_sha"
27+
steps:
28+
- name: Error Message
29+
run: echo This pull request attempts to update data_model directory, but is missing updates to spec_sha file with the latest version of the sha. Files in the data_model directory are generated automatically and should not be updated manually.
30+
- name: Fail Job
31+
run: exit 1

.github/workflows/fuzzing-build.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868

6969
build_darwin_fuzzing:
7070
name: Build on Darwin
71-
runs-on: macos-latest
71+
runs-on: macos-13
7272
if: github.actor != 'restyled-io[bot]'
7373

7474
steps:

.github/workflows/tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ jobs:
330330
LSAN_OPTIONS: detect_leaks=1 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt
331331

332332
if: github.actor != 'restyled-io[bot]'
333-
runs-on: macos-latest
333+
runs-on: macos-13
334334

335335
steps:
336336
- name: Checkout
@@ -588,7 +588,7 @@ jobs:
588588
TSAN_OPTIONS: "halt_on_error=1"
589589

590590
if: github.actor != 'restyled-io[bot]' && false
591-
runs-on: macos-latest
591+
runs-on: macos-13
592592

593593
steps:
594594
- name: Checkout

config/esp32/components/chip/Kconfig

+7-6
Original file line numberDiff line numberDiff line change
@@ -726,12 +726,13 @@ menu "CHIP Device Layer"
726726
should not start advertising automatically after power-up.
727727

728728
config USE_BLE_ONLY_FOR_COMMISSIONING
729-
bool "Use BLE only for commissioning"
730-
default y
731-
help
732-
Disable this flag if BLE is used for any other purpose than commissioning.
733-
When enabled, it deinitialized the BLE on successful commissioning, and on
734-
bootup do not initialize the BLE if device is already provisioned with Wi-Fi/Thread credentials.
729+
depends on BT_ENABLED
730+
bool "Use BLE only for commissioning"
731+
default y
732+
help
733+
Disable this flag if BLE is used for any other purpose than commissioning.
734+
When enabled, it deinitialized the BLE on successful commissioning, and on
735+
bootup do not initialize the BLE if device is already provisioned with Wi-Fi/Thread credentials.
735736

736737
endmenu
737738

docs/guides/BUILDING.md

+17-12
Original file line numberDiff line numberDiff line change
@@ -199,22 +199,27 @@ permanently, you need to make the following changes:
199199
200200
## Installing ZAP tool
201201
202-
`bootstrap.sh` will download a compatible ZAP tool version and set it up in
203-
`$PATH`. If you want to install or use a different version of the tool, you may
204-
download one from the ZAP project's
205-
[Releases](https://github.com/project-chip/zap/releases) page.
202+
For platforms defined in [`scripts/setup/zap.json`](/scripts/setup/zap.json),
203+
`bootstrap.sh` will download a compatible ZAP tool version from CIPD and set it
204+
up in `$PATH`.
206205
207-
### Linux ARM
206+
ZAP releases are copied to CIPD by an automated bot. You can check if a release
207+
was copied by looking at tags created for
208+
[ZAP CIPD Packages](https://chrome-infra-packages.appspot.com/p/fuchsia/third_party/zap)
209+
in various platforms.
208210
209-
Zap does not provide binary releases for arm. Rosetta solves this for Darwin,
210-
however for linux arm you will have to use a local ZAP, generally through
211-
setting `$ZAP_DEVELOPMENT_PATH` (see the section `Which zap to use` below).
211+
### Custom ZAP
212+
213+
If you want to install or use a different version of the tool, you may download
214+
one from the [ZAP releases](https://github.com/project-chip/zap/releases) or
215+
build it from source.
212216
213217
The file `scripts/setup/zap.json` contains the version that CIPD would download,
214-
so you can download a compatible version from the zap project
215-
[Releases](https://github.com/project-chip/zap/releases). To checkout as source
216-
code the corresponding tag should exist in the zap
217-
[repository tags](https://github.com/project-chip/zap/tags) list.
218+
so you can refer to it to find a compatible version. The version is also
219+
maintained at [`scripts/setup/zap.version`](/scripts/setup/zap.version).
220+
221+
To check out as source code, the corresponding tag should exist in the
222+
[ZAP repository tags](https://github.com/project-chip/zap/tags) list.
218223
219224
Example commands:
220225

examples/platform/esp32/common/CommonDeviceCallbacks.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, i
5151

5252
case DeviceEventType::kCHIPoBLEConnectionClosed:
5353
ESP_LOGI(TAG, "CHIPoBLE disconnected");
54-
Esp32AppServer::DeInitBLEIfCommissioned();
5554
break;
5655

5756
case DeviceEventType::kDnssdInitialized:
@@ -67,6 +66,7 @@ void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, i
6766

6867
case DeviceEventType::kCommissioningComplete: {
6968
ESP_LOGI(TAG, "Commissioning complete");
69+
Esp32AppServer::DeInitBLEIfCommissioned();
7070
}
7171
break;
7272

examples/platform/esp32/common/Esp32AppServer.cpp

+5-40
Original file line numberDiff line numberDiff line change
@@ -111,47 +111,12 @@ static size_t hex_string_to_binary(const char * hex_string, uint8_t * buf, size_
111111

112112
void Esp32AppServer::DeInitBLEIfCommissioned(void)
113113
{
114-
#if CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING
114+
#ifdef CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING
115115
if (chip::Server::GetInstance().GetFabricTable().FabricCount() > 0)
116116
{
117-
esp_err_t err = ESP_OK;
118-
119-
#if CONFIG_BT_NIMBLE_ENABLED
120-
if (!ble_hs_is_enabled())
121-
{
122-
ESP_LOGI(TAG, "BLE already deinited");
123-
return;
124-
}
125-
if (nimble_port_stop() != 0)
126-
{
127-
ESP_LOGE(TAG, "nimble_port_stop() failed");
128-
return;
129-
}
130-
vTaskDelay(100);
131-
nimble_port_deinit();
132-
133-
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)
134-
err = esp_nimble_hci_and_controller_deinit();
135-
#endif
136-
#endif /* CONFIG_BT_NIMBLE_ENABLED */
137-
138-
#if CONFIG_IDF_TARGET_ESP32
139-
err |= esp_bt_mem_release(ESP_BT_MODE_BTDM);
140-
#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 || \
141-
CONFIG_IDF_TARGET_ESP32C6
142-
err |= esp_bt_mem_release(ESP_BT_MODE_BLE);
143-
#endif
144-
145-
if (err != ESP_OK)
146-
{
147-
ESP_LOGE(TAG, "BLE deinit failed");
148-
}
149-
else
150-
{
151-
ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed");
152-
}
117+
chip::DeviceLayer::Internal::BLEMgr().Shutdown();
153118
}
154-
#endif /* CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */
119+
#endif /* CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */
155120
}
156121

157122
void Esp32AppServer::Init(AppDelegate * sAppDelegate)
@@ -162,7 +127,7 @@ void Esp32AppServer::Init(AppDelegate * sAppDelegate)
162127
if (hex_string_to_binary(CONFIG_TEST_EVENT_TRIGGER_ENABLE_KEY, sTestEventTriggerEnableKey,
163128
sizeof(sTestEventTriggerEnableKey)) == 0)
164129
{
165-
ESP_LOGE(TAG, "Failed to convert the EnableKey string to octstr type value");
130+
ChipLogError(DeviceLayer, "Failed to convert the EnableKey string to octstr type value");
166131
memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey));
167132
}
168133
static SimpleTestEventTriggerDelegate sTestEventTriggerDelegate{};
@@ -190,7 +155,7 @@ void Esp32AppServer::Init(AppDelegate * sAppDelegate)
190155
if (chip::DeviceLayer::ConnectivityMgr().IsThreadProvisioned() &&
191156
(chip::Server::GetInstance().GetFabricTable().FabricCount() != 0))
192157
{
193-
ESP_LOGI(TAG, "Thread has been provisioned, publish the dns service now");
158+
ChipLogProgress(DeviceLayer, "Thread has been provisioned, publish the dns service now");
194159
chip::app::DnssdServer::Instance().StartServer();
195160
}
196161
#endif

src/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ if (chip_build_tests) {
9898
"${chip_root}/src/credentials/tests",
9999
"${chip_root}/src/lib/format/tests",
100100
"${chip_root}/src/lib/support/tests",
101+
"${chip_root}/src/lib/support/tests:tests_nltest",
101102
"${chip_root}/src/protocols/secure_channel/tests",
102103
"${chip_root}/src/system/tests",
103104
"${chip_root}/src/transport/tests",

src/crypto/tests/BUILD.gn

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414

1515
import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
17-
import("//build_overrides/nlunit_test.gni")
1817

1918
import("${chip_root}/build/chip/chip_test_suite.gni")
2019
import("${chip_root}/src/crypto/crypto.gni")
2120

22-
chip_test_suite_using_nltest("tests") {
21+
chip_test_suite("tests") {
2322
output_name = "libChipCryptoTests"
2423

2524
sources = [
@@ -70,8 +69,6 @@ chip_test_suite_using_nltest("tests") {
7069
"${chip_root}/src/crypto",
7170
"${chip_root}/src/lib/core",
7271
"${chip_root}/src/lib/support:testing",
73-
"${chip_root}/src/lib/support:testing_nlunit",
7472
"${chip_root}/src/platform",
75-
"${nlunit_test_root}:nlunit-test",
7673
]
7774
}

0 commit comments

Comments
 (0)