Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync csa branch with main #373

Merged
merged 31 commits into from
Mar 27, 2025
Merged
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c5bc0d7
fix: missing field initializer build error (#38069)
j0tunn Mar 24, 2025
2c7bc31
ICD: Remove the aborts for ICD manager checks (#37728)
wqx6 Mar 24, 2025
a35ca78
Update PICS Generator tool (#37901)
ReneJosefsen Mar 24, 2025
9363820
esp32: Add API to add extra GATT service and support for nimble ext_a…
wqx6 Mar 24, 2025
ecb6ffa
[NXP] Update NXP docker image (#38055)
jby-nxp Mar 24, 2025
0be4b00
Bump third_party/libdatachannel/repo from `59ce380` to `a318f07` (#38…
dependabot[bot] Mar 24, 2025
96fb1e0
ESP32: Add OTA function for thread border router device (#37099)
Jerry-ESP Mar 24, 2025
c78bb0c
Fix GFW image build with ProvisionStorageFlash option (#38080)
jmartinez-silabs Mar 24, 2025
742fc61
Fixed length comparision of connected SSID (#38085)
arun-silabs Mar 24, 2025
a64a1df
Install Python matter IDL module in matter namespace (#37298)
arkq Mar 24, 2025
d89e121
Clear featuremap from temperature measurement (#38097)
andy31415 Mar 24, 2025
c3a4e1c
Fix chef general commissioning feature map (6 is invalid, replaced it…
andy31415 Mar 24, 2025
bfd7e6b
[Tizen] Fix SDK installer when more than one CPU is selected (#38098)
arkq Mar 24, 2025
44de8d4
Updated Dockerfile in order to make available mock_server to the cert…
rquidute Mar 24, 2025
afad586
Fix general commissioning feature map for 2 more example apps - air p…
andy31415 Mar 24, 2025
7d04796
Fix capitalization of `VidVerification` to `VIDVerification` (#38100)
tcarmelveilleux Mar 24, 2025
8c3de05
temporary workaround: make sure python3-gi is not installed and pulli…
Alami-Amine Mar 25, 2025
6cc5fb1
[nxp][platform][ota] Add runtime ota reboot delay / Add OTA_ServiceDe…
andrei-menzopol Mar 25, 2025
3e9b41b
Nxp upstream sdk v25 03 00 pvw2 (#38096)
jby-nxp Mar 25, 2025
03d3595
Chef RVC: Add support for GoHome command (#38083)
sxb427 Mar 25, 2025
b7899bc
[VID Verification] Add empty handlers to fix ZAP issue (#38118)
tcarmelveilleux Mar 25, 2025
012dfbc
Make sure to cancel the timeout timer whenever we remove an MTRDownlo…
bzbarsky-apple Mar 25, 2025
794cc19
Chef Oven Mode application code (#38106)
sxb427 Mar 25, 2025
cc138f6
[TC-IDM-3.2] Cosmetic update in step 3 as per test-plan update. (#37…
Rajashreekalmane Mar 26, 2025
47550d5
[Silabs] Fixed RS9116 sleep issue (#38078)
bhmanda-silabs Mar 26, 2025
d47da09
Add superset for Mounted device types (#38124)
ReneJosefsen Mar 26, 2025
c79e068
Generate BooleanStateConfiguration in Alchemy (#38104)
tersal Mar 26, 2025
1739c88
[ESP32]: Update the esp-insights component version to use the latest …
shripad621git Mar 26, 2025
4616f83
## Automation REFALM_2_2 ## (#37108)
jtrejoespinoza-grid Mar 26, 2025
3c1ec4b
Merge branch 'main' into automation/update_main
chirag-silabs Mar 27, 2025
61c12ba
[SL-ONLY] Update silabs examples zap generation
chirag-silabs Mar 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
@@ -1171,6 +1171,7 @@ PyFunction
pylint
PyObject
pypi
pyproject
PyRun
pytest
PYTHONPATH
8 changes: 4 additions & 4 deletions .github/workflows/examples-nxp.yaml
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-nxp:120
image: ghcr.io/project-chip/chip-build-nxp:124
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
@@ -149,7 +149,7 @@ jobs:
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target nxp-rt1060-freertos-thermostat-thread-wifi-evkc-iwx12 \
--target nxp-rt1060-freertos-thermostat-thread-wifi-matter-shell-evkc-iwx12 \
build \
--copy-artifacts-to out/artifacts \
"
@@ -181,7 +181,7 @@ jobs:
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target nxp-rt1170-freertos-thermostat-thread-wifi-iwx12 \
--target nxp-rt1170-freertos-thermostat-thread-wifi-matter-shell-iwx12 \
build \
--copy-artifacts-to out/artifacts \
"
@@ -210,7 +210,7 @@ jobs:
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target nxp-rw61x-freertos-thermostat-thread-wifi \
--target nxp-rw61x-freertos-thermostat-thread-wifi-matter-shell \
build \
--copy-artifacts-to out/artifacts \
"
14 changes: 7 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -151,13 +151,13 @@ jobs:
if [ "$idl_file" = './examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter' ]; then continue; fi

# Test files are intentionally small and not spec-compilant, just parse-compliant
if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/cluster_struct_attribute.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/global_struct_attribute.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/optional_argument.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/several_clusters.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/simple_attribute.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/large_lighting_app.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter/idl/tests/inputs/cluster_struct_attribute.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter/idl/tests/inputs/global_struct_attribute.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter/idl/tests/inputs/optional_argument.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter/idl/tests/inputs/several_clusters.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter/idl/tests/inputs/simple_attribute.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter/idl/tests/inputs/large_lighting_app.matter" ]; then continue; fi
if [ "$idl_file" = "./scripts/py_matter_idl/matter/idl/tests/inputs/large_all_clusters_app.matter" ]; then continue; fi

./scripts/run_in_build_env.sh "./scripts/idl_lint.py --log-level warn $idl_file" >/dev/null || exit 1
done
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ jobs:
#
run: |
./scripts/run_in_build_env.sh \
"./scripts/py_matter_idl/matter_idl/zapxml_parser.py \
"./scripts/py_matter_idl/matter/idl/zapxml_parser.py \
--no-print \
--log-level info \
src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \
2 changes: 0 additions & 2 deletions .isort.cfg

This file was deleted.

4 changes: 1 addition & 3 deletions .restyled.yaml
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ exclude:
- "third_party/android_deps/gradlew" # gradle wrapper generated file
- "src/controller/python/chip/clusters/Objects.py" # generated file, no point to restyle
- "src/controller/python/chip/clusters/CHIPClusters.py" # generated file, no point to restyle
- "scripts/py_matter_idl/matter_idl/tests/outputs/**/*" # Matches generated output 1:1
- "scripts/py_matter_idl/matter/idl/tests/outputs/**/*" # Matches generated output 1:1
- "scripts/tools/zap/tests/outputs/**/*" # Matches generated output 1:1
- "examples/chef/sample_app_util/test_files/*.yaml"
- "examples/chef/zzz_generated/**/*"
@@ -228,8 +228,6 @@ restylers:
command:
- autopep8
- "--in-place"
- "--max-line-length"
- "132"
arguments: []
include:
- "**/*.py"
25 changes: 17 additions & 8 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -345,8 +345,8 @@ endif()

set(args_gn "${CMAKE_CURRENT_BINARY_DIR}/args.gn")
add_custom_command(OUTPUT "${args_gn}"
COMMAND ${python}
${CMAKE_CURRENT_LIST_DIR}/create_args_gn.py
COMMAND ${python}
${CMAKE_CURRENT_LIST_DIR}/create_args_gn.py
"${CMAKE_BINARY_DIR}"
"${idf_path}"
"${CMAKE_CURRENT_LIST_DIR}/chip.c"
@@ -468,10 +468,19 @@ endif()

# Build Matter OTA image
if (CONFIG_CHIP_OTA_IMAGE_BUILD)
chip_ota_image(chip-ota-image
INPUT_FILES ${BUILD_DIR}/${CMAKE_PROJECT_NAME}.bin
OUTPUT_FILE ${BUILD_DIR}/${CMAKE_PROJECT_NAME}-ota.bin
)
# Adding dependecy as app target so that this runs after images are ready
add_dependencies(chip-ota-image app)
if (CONFIG_OPENTHREAD_BORDER_ROUTER AND CONFIG_AUTO_UPDATE_RCP)
chip_ota_image(chip-ota-image
INPUT_FILES ${BUILD_DIR}/ota_with_rcp_image
OUTPUT_FILE ${BUILD_DIR}/ota_with_rcp_image-ota.bin
)
# Adding dependecy as app target so that this runs after images are ready
add_dependencies(chip-ota-image gen_ota_image)
else()
chip_ota_image(chip-ota-image
INPUT_FILES ${BUILD_DIR}/${CMAKE_PROJECT_NAME}.bin
OUTPUT_FILE ${BUILD_DIR}/${CMAKE_PROJECT_NAME}-ota.bin
)
# Adding dependecy as app target so that this runs after images are ready
add_dependencies(chip-ota-image app)
endif()
endif()
2 changes: 1 addition & 1 deletion config/esp32/components/chip/idf_component.yml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ dependencies:
- if: "target != esp32h2"

espressif/esp_rcp_update:
version: "1.2.0"
version: "~1.3.0"
rules:
- if: "idf_version >=5.0"

8 changes: 4 additions & 4 deletions docs/guides/matter_idl_tooling.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ Since it is designed to be easy for both machine and humans to read, it is the
basis of some tools to make validating zap-based cluster definitions easier.

More details on the format in
[matter_idl/README.md](../../scripts/py_matter_idl/matter_idl/README.md).
[matter/idl/README.md](../../scripts/py_matter_idl/matter/idl/README.md).

## Parsing CSA XML Data definitions

@@ -20,12 +20,12 @@ information available in [data_model/README.md](../../data_model/README.md).
NOTE: scraper is a work in progress, XML data may be incomplete or have errors
still.

The script `./scripts/py_matter_idl/matter_idl/data_model_xml_parser.py` has the
The script `./scripts/py_matter_idl/matter/idl/data_model_xml_parser.py` has the
ability to parse one or more CSA data model XML files and output their content
in `.matter` format. For example:

```sh
./scripts/py_matter_idl/matter_idl/data_model_xml_parser.py data_model/clusters/BooleanState.xml
./scripts/py_matter_idl/matter/idl/data_model_xml_parser.py data_model/clusters/BooleanState.xml
```

The tool supports several options that are useful for development:
@@ -54,7 +54,7 @@ specification:
As such one can run compares such as:

```sh
./scripts/py_matter_idl/matter_idl/data_model_xml_parser.py \
./scripts/py_matter_idl/matter/idl/data_model_xml_parser.py \
-o out/spec.matter \
--compare-output out/sdk.matter \
--compare src/controller/data_model/controller-clusters.matter \
134 changes: 134 additions & 0 deletions docs/platforms/esp32/ble_settings.md
Original file line number Diff line number Diff line change
@@ -33,3 +33,137 @@ advertising packets.
```

Note: Scan response should be configure before `InitServer`.

## Nimble: additional custom GATT services

The `ConfigureExtraServices` API is used to configure additional services
alongside the Matter services. This API allows users to add their own custom
services for provisioning or other purposes.

### Usage

```
/* Service access callback */
static int gatt_svc_access(uint16_t conn_handle, uint16_t attr_handle,
struct ble_gatt_access_ctxt *ctxt, void *arg);

/* Service UUID */
static const ble_uuid128_t gatt_svr_svc_uuid =
BLE_UUID128_INIT(0x2d, 0x71, 0xa2, 0x59, 0xb4, 0x58, 0xc8, 0x12,
0x99, 0x99, 0x43, 0x95, 0x12, 0x2f, 0x46, 0x59);

/* A characteristic that can be subscribed to */
static uint16_t gatt_svr_chr_val_handle;
static const ble_uuid128_t gatt_svr_chr_uuid =
BLE_UUID128_INIT(0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11,
0x22, 0x22, 0x22, 0x22, 0x33, 0x33, 0x33, 0x33);

/* A custom descriptor */
static const ble_uuid128_t gatt_svr_dsc_uuid =
BLE_UUID128_INIT(0x01, 0x01, 0x01, 0x01, 0x12, 0x12, 0x12, 0x12,
0x23, 0x23, 0x23, 0x23, 0x34, 0x34, 0x34, 0x34);

{
std::vector<struct ble_gatt_svc_def> gatt_svr_svcs = {
{
/*** Service ***/
.type = BLE_GATT_SVC_TYPE_PRIMARY,
.uuid = &gatt_svr_svc_uuid.u,
.characteristics = (struct ble_gatt_chr_def[])
{ {
/*** This characteristic can be subscribed to by writing 0x00 and 0x01 to the CCCD ***/
.uuid = &gatt_svr_chr_uuid.u,
.access_cb = gatt_svc_access,
.flags = BLE_GATT_CHR_F_READ | BLE_GATT_CHR_F_WRITE | BLE_GATT_CHR_F_NOTIFY | BLE_GATT_CHR_F_INDICATE,
.val_handle = &gatt_svr_chr_val_handle,
.descriptors = (struct ble_gatt_dsc_def[]) {
{
.uuid = &gatt_svr_dsc_uuid.u,
.att_flags = BLE_ATT_F_READ,
.access_cb = gatt_svc_access,
}, {
0, /* No more descriptors in this characteristic */
}
},
}, {
0, /* No more characteristics in this service. */
}
},
},
};

/* Add Extra service after Matter service */
CHIP_ERROR err = chip::DeviceLayer::Internal::BLEMgrImpl().ConfigureExtraServices(gatt_svr_svcs, ture);
}
```

Note: Extra service should be configure before `InitServer`.

## Nimble: multiple BLE advertisement

The chips that support BLE 5.0 features can advertise their custom BLE GAP
advertisement alongside Matter's BLE advertisement if `CONFIG_BT_NIMBLE_EXT_ADV`
is enabled and `CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES` is a value greater
than 1.

### Usage

```
static uint8_t connectable_adv_pattern[] = {
0x02, 0x01, 0x06,
0x03, 0x03, 0xab, 0xcd,
0x03, 0x03, 0x18, 0x11,
0x12, 0X09, 'n', 'i', 'm', 'b', 'l', 'e', '-', 'c', 'o', 'n', 'n', 'e', 't', 'a', 'b', 'l', 'e'
};

/* GAP event handler */
static int ble_multi_adv_gap_event(struct ble_gap_event *event, void *arg);

{
/* Use instance except 0 as Matter advertisement uses instance 0 */
uint8_t instance = 1;
struct ble_gap_ext_adv_params params;
int size_pattern = sizeof(connectable_adv_pattern) / sizeof(connectable_adv_pattern[0]);

memset (&params, 0, sizeof(params));

params.connectable = 1;
params.scannable = 1;
params.own_addr_type = BLE_OWN_ADDR_RANDOM;
params.sid = 1;
params.primary_phy = BLE_HCI_LE_PHY_1M;
params.secondary_phy = BLE_HCI_LE_PHY_1M;
params.tx_power = 127;

int rc;
struct os_mbuf *data;
int size_pattern = sizeof(legacy_dur_adv_pattern) / sizeof(legacy_dur_adv_pattern[0]);

if (ble_gap_ext_adv_active(instance)) {
ESP_LOGI(tag, "Instance already advertising");
return;
}

rc = ble_gap_ext_adv_configure(instance, params, NULL,
ble_multi_adv_gap_event, NULL);
assert (rc == 0);

/* get mbuf for adv data */
data = os_msys_get_pkthdr(size_pattern, 0);
assert(data);

/* fill mbuf with adv data */
rc = os_mbuf_append(data, legacy_dur_adv_pattern, size_pattern);
assert(rc == 0);

rc = ble_gap_ext_adv_set_data(instance, data);
assert (rc == 0);

/* start advertising */
rc = ble_gap_ext_adv_start(instance, 500, 0);
assert (rc == 0);
}
```

Note: The custom additional advertisement should be configured after BLE stack
is started.
30 changes: 14 additions & 16 deletions docs/style/CODING_STYLE_GUIDE.md
Original file line number Diff line number Diff line change
@@ -60,22 +60,20 @@ be removed.

We use the following auto-formatters on code:

| Language | Formatter | Style File |
| ----------- | ------------------ | ------------------------------------------------------------------------------------------ |
| C++ | clang-format | [.clang-format](https://github.com/project-chip/connectedhomeip/blob/master/.clang-format) |
| Objective-C | clang-format | [.clang-format](https://github.com/project-chip/connectedhomeip/blob/master/.clang-format) |
| java | google-java-format | N/A |
| Python | pep8, isort, ruff | [.restyled.yaml][restyle_link] (command line), [isort][isort_link], [ruff][ruff_link] |
| YAML | prettier | None |
| JSON | prettier | None |
| markdown | prettier | None |

[restyle_link]:
https://github.com/project-chip/connectedhomeip/blob/master/.restyled.yaml
[isort_link]:
https://github.com/project-chip/connectedhomeip/blob/master/.isort.cfg
[ruff_link]:
https://github.com/project-chip/connectedhomeip/blob/master/ruff.toml
| Language | Formatter | Style File |
| ----------- | ------------------ | ---------------------------------- |
| C++ | clang-format | [.clang-format][clang_format_link] |
| Objective-C | clang-format | [.clang-format][clang_format_link] |
| java | google-java-format | N/A |
| Python | pep8, isort, ruff | [pyproject.toml][pyproject_link] |
| YAML | prettier | None |
| JSON | prettier | None |
| markdown | prettier | None |

[clang_format_link]:
https://github.com/project-chip/connectedhomeip/blob/master/.clang-format
[pyproject_link]:
https://github.com/project-chip/connectedhomeip/blob/master/pyproject.toml

All pull requests run formatting checks using these tools before merge is
allowed. Generated code is not run through restyle.
4 changes: 2 additions & 2 deletions docs/zap_and_codegen/code_generation.md
Original file line number Diff line number Diff line change
@@ -91,7 +91,7 @@ specific codegen.
`*.matter` files are both human and machine readable. Code that can process
these files is available at `scripts/py_matter_idl` and `scripts/codegen.py`.
You can read the
[scripts/py_matter_idl/matter_idl/README.md](../scripts/py_matter_idl/matter_idl/README.md)
[scripts/py_matter_idl/matter/idl/README.md](../scripts/py_matter_idl/matter/idl/README.md)
for details of how things work.

`scripts/codegen.py` can generate various outputs based on an input `*.matter`
@@ -222,7 +222,7 @@ Code pre-generation can be used:
generation at build time or to save the code generation time at the expense
of running code generation for every possible zap/generation type
- To check changes in generated code across versions, beyond the comparisons
of golden image tests in `scripts/py_matter_idl/matter_idl/tests`
of golden image tests in `scripts/py_matter_idl/matter/idl/tests`

The script to trigger code pre-generation is `scripts/codepregen.py` and
requires the pre-generation output directory as an argument
Loading
Loading