Skip to content

Commit 1bff3bb

Browse files
Merge branch 'project-chip:master' into TC-CC-2_1
2 parents e61e144 + 80a647c commit 1bff3bb

File tree

67 files changed

+3209
-1089
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+3209
-1089
lines changed

.github/workflows/chef.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,28 @@ jobs:
5151
run: |
5252
./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t linux"
5353
54+
chef_linux_all_devices:
55+
name: Chef - Linux CI Examples (All chef devices)
56+
timeout-minutes: 60
57+
runs-on: ubuntu-latest
58+
if: github.actor != 'restyled-io[bot]'
59+
60+
container:
61+
image: ghcr.io/project-chip/chip-build:119
62+
options: --user root
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
- name: Checkout submodules & Bootstrap
68+
uses: ./.github/actions/checkout-submodules-and-bootstrap
69+
with:
70+
platform: linux
71+
- name: CI Examples Linux
72+
shell: bash
73+
run: |
74+
./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci_linux"
75+
5476
chef_esp32:
5577
name: Chef - ESP32 CI Examples
5678
runs-on: ubuntu-latest

.github/workflows/darwin.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,10 @@ jobs:
116116
117117
export TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1
118118
119-
# Disable BLE (CHIP_IS_BLE=NO) because the app does not have the permission to use it and that may crash the CI.
120119
xcodebuild test -target "Matter" -scheme "Matter Framework Tests" \
121120
-resultBundlePath /tmp/darwin/framework-tests/TestResults.xcresult \
122121
-sdk macosx ${{ matrix.options.arguments }} \
123-
CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} ${{ matrix.options.defines }}' \
122+
GCC_PREPROCESSOR_DEFINITIONS='${inherited} ${{ matrix.options.defines }}' \
124123
> >(tee /tmp/darwin/framework-tests/darwin-tests.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-err.log >&2)
125124
- name: Generate Summary
126125
if: always()

BUILD.gn

+2-2
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
394394
enable_linux_rvc_app_build =
395395
enable_default_builds && (host_os == "linux" || host_os == "mac")
396396

397+
# TODO: #37983: Add darwin support for libdatachannel and then add host_os == "mac" here.
397398
# Build the Linux Camera app example.
398-
enable_linux_camera_app_build =
399-
enable_default_builds && (host_os == "linux" || host_os == "mac")
399+
enable_linux_camera_app_build = enable_default_builds && host_os == "linux"
400400

401401
# Build the cc13x2x7_26x2x7 lock app example.
402402
enable_cc13x2x7_26x2x7_lock_app_build = enable_ti_simplelink_builds

config/esp32/components/chip/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,10 @@ if (CONFIG_SEC_CERT_DAC_PROVIDER)
444444
list(APPEND matter_requires espressif__esp_secure_cert_mgr)
445445
endif()
446446

447+
if (CONFIG_ENABLE_ENCRYPTED_OTA)
448+
list(APPEND matter_requires espressif__esp_encrypted_img)
449+
endif()
450+
447451
add_prebuilt_library(matterlib "${CMAKE_CURRENT_BINARY_DIR}/lib/libCHIP.a"
448452
REQUIRES ${matter_requires})
449453

config/esp32/components/chip/idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
- if: "idf_version >=4.3"
1212

1313
espressif/esp_encrypted_img:
14-
version: "2.1.0"
14+
version: "2.3.0"
1515
require: public
1616
rules:
1717
- if: "idf_version >=4.4"

docs/platforms/esp32/ota.md

+30-15
Original file line numberDiff line numberDiff line change
@@ -92,35 +92,50 @@ image can be encrypted/decrypted using an RSA-3072 key pair.
9292
9393
Please follow the steps below to generate an application image for OTA upgrades:
9494
95-
1. Generate a new RSA-3072 key pair or use an existing one.
95+
1. Generate a new RSA-3072 key pair or use an existing one.
9696
97-
- To generate a key pair, use the following command:
97+
- To generate a key pair, use the following command:
9898
9999
```
100100
openssl genrsa -out esp_image_encryption_key.pem 3072
101101
```
102102
103-
- Extract the public key from the key pair:
103+
- Extract the public key from the key pair:
104104
```
105105
openssl rsa -in esp_image_encryption_key.pem -pubout -out esp_image_encryption_public_key.pem
106106
```
107107
108-
2. Encrypt the application binary using the
109-
[esp_enc_img_gen.py](https://github.com/espressif/idf-extra-components/blob/master/esp_encrypted_img/tools/esp_enc_img_gen.py)
110-
script.
108+
2. Encrypt the application binary using the
109+
[esp_enc_img_gen.py](https://github.com/espressif/idf-extra-components/blob/master/esp_encrypted_img/tools/esp_enc_img_gen.py)
110+
script.
111111
112-
- Use the following command to encrypt the OTA image with the public key:
112+
Use the following command to encrypt the OTA image with the public key:
113113
114-
```
115-
python3 esp_enc_img_gen.py encrypt lighting-app.bin esp_image_encryption_public_key.pem lighting-app-encrypted.bin
116-
```
114+
```
115+
python3 esp_enc_img_gen.py encrypt lighting-app.bin esp_image_encryption_public_key.pem lighting-app-encrypted.bin
116+
```
117117
118-
- Append the Matter OTA header:
119-
```
120-
src/app/ota_image_tool.py create --vendor-id 0xFFF1 --product-id 0x8000 --version 2 --version-str "v2.0" -da sha256 lighting-app-encrypted.bin lighting-app-encrypted-ota.bin
121-
```
118+
Optionally, you can use the cmake function `create_esp_enc_img()` to encrypt
119+
the OTA image during the build process. Please find the usage below. This is
120+
also demonstrated in the `examples/lighting-app/esp32/main/CMakeLists.txt`
121+
file.
122+
123+
```
124+
create_esp_enc_img(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
125+
${project_dir}/esp_image_encryption_public_key.pem
126+
${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-encrypted.bin
127+
app)
128+
```
129+
130+
3. Append the Matter OTA header
131+
132+
```
133+
src/app/ota_image_tool.py create --vendor-id 0xFFF1 --product-id 0x8000 \
134+
--version 2 --version-str "v2.0" -da sha256 \
135+
lighting-app-encrypted.bin lighting-app-encrypted-ota.bin
136+
```
122137
123-
3. Use the `lighting-app-encrypted-ota.bin` file with the OTA Provider app.
138+
4. Use the `lighting-app-encrypted-ota.bin` file with the OTA Provider app.
124139
125140
## Delta OTA
126141

examples/all-clusters-app/nrfconnect/prj.conf

+3
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,6 @@ CONFIG_CHIP_ENABLE_READ_CLIENT=y
5757

5858
# Increase the settings partition
5959
CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000
60+
61+
# Increase heap size
62+
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240

examples/all-clusters-app/nrfconnect/prj_dfu.conf

+3
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ CONFIG_CHIP_FACTORY_DATA_BUILD=y
5555

5656
# Enable the Read Client for binding purposes
5757
CONFIG_CHIP_ENABLE_READ_CLIENT=y
58+
59+
# Increase heap size
60+
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240

examples/all-clusters-app/nrfconnect/prj_release.conf

+3
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@ CONFIG_CHIP_ENABLE_READ_CLIENT=y
6666
# Enable LTO to reduce the flash usage
6767
CONFIG_LTO=y
6868
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y
69+
70+
# Increase heap size
71+
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240

examples/camera-app/camera-common/camera-app.matter

+132
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,121 @@ cluster UserLabel = 65 {
21192119
readonly attribute int16u clusterRevision = 65533;
21202120
}
21212121

2122+
/** The WebRTC transport provider cluster provides a way for stream providers (e.g. Cameras) to stream or receive their data through WebRTC. */
2123+
provisional cluster WebRTCTransportProvider = 1363 {
2124+
revision 1;
2125+
2126+
enum StreamUsageEnum : enum8 {
2127+
kInternal = 0;
2128+
kRecording = 1;
2129+
kAnalysis = 2;
2130+
kLiveView = 3;
2131+
}
2132+
2133+
enum WebRTCEndReasonEnum : enum8 {
2134+
kIceFailed = 0;
2135+
kIceTimeout = 1;
2136+
kUserHangup = 2;
2137+
kUserBusy = 3;
2138+
kReplaced = 4;
2139+
kNoUserMedia = 5;
2140+
kInviteTimeout = 6;
2141+
kAnsweredElsewhere = 7;
2142+
kOutOfResources = 8;
2143+
kMediaTimeout = 9;
2144+
kLowPower = 10;
2145+
kUnknownReason = 11;
2146+
}
2147+
2148+
bitmap WebRTCMetadataOptionsBitmap : bitmap8 {
2149+
kDataTLV = 0x1;
2150+
}
2151+
2152+
struct ICEServerStruct {
2153+
char_string urls[] = 1;
2154+
optional char_string username = 2;
2155+
optional char_string credential = 3;
2156+
optional int16u caid = 4;
2157+
}
2158+
2159+
fabric_scoped struct WebRTCSessionStruct {
2160+
int16u id = 1;
2161+
node_id peerNodeID = 2;
2162+
StreamUsageEnum streamUsage = 3;
2163+
nullable int16u videoStreamID = 4;
2164+
nullable int16u audioStreamID = 5;
2165+
WebRTCMetadataOptionsBitmap metadataOptions = 6;
2166+
fabric_idx fabricIndex = 254;
2167+
}
2168+
2169+
readonly attribute access(read: manage) WebRTCSessionStruct currentSessions[] = 0;
2170+
readonly attribute command_id generatedCommandList[] = 65528;
2171+
readonly attribute command_id acceptedCommandList[] = 65529;
2172+
readonly attribute event_id eventList[] = 65530;
2173+
readonly attribute attrib_id attributeList[] = 65531;
2174+
readonly attribute bitmap32 featureMap = 65532;
2175+
readonly attribute int16u clusterRevision = 65533;
2176+
2177+
request struct SolicitOfferRequest {
2178+
StreamUsageEnum streamUsage = 0;
2179+
optional nullable int16u videoStreamID = 1;
2180+
optional nullable int16u audioStreamID = 2;
2181+
optional ICEServerStruct ICEServers[] = 3;
2182+
optional char_string ICETransportPolicy = 4;
2183+
optional WebRTCMetadataOptionsBitmap metadataOptions = 5;
2184+
}
2185+
2186+
response struct SolicitOfferResponse = 2 {
2187+
int16u webRTCSessionID = 0;
2188+
boolean deferredOffer = 1;
2189+
optional nullable int16u videoStreamID = 2;
2190+
optional nullable int16u audioStreamID = 3;
2191+
}
2192+
2193+
request struct ProvideOfferRequest {
2194+
nullable int16u webRTCSessionID = 0;
2195+
char_string sdp = 1;
2196+
StreamUsageEnum streamUsage = 2;
2197+
optional nullable int16u videoStreamID = 3;
2198+
optional nullable int16u audioStreamID = 4;
2199+
optional ICEServerStruct ICEServers[] = 5;
2200+
optional char_string ICETransportPolicy = 6;
2201+
optional WebRTCMetadataOptionsBitmap metadataOptions = 7;
2202+
}
2203+
2204+
response struct ProvideOfferResponse = 4 {
2205+
int16u webRTCSessionID = 0;
2206+
optional nullable int16u videoStreamID = 1;
2207+
optional nullable int16u audioStreamID = 2;
2208+
}
2209+
2210+
request struct ProvideAnswerRequest {
2211+
int16u webRTCSessionID = 0;
2212+
char_string sdp = 1;
2213+
}
2214+
2215+
request struct ProvideICECandidatesRequest {
2216+
int16u webRTCSessionID = 0;
2217+
char_string ICECandidates[] = 1;
2218+
}
2219+
2220+
request struct EndSessionRequest {
2221+
int16u webRTCSessionID = 0;
2222+
WebRTCEndReasonEnum reason = 1;
2223+
}
2224+
2225+
/** Requests that the Provider initiates a new session with the Offer / Answer flow in a way that allows for options to be passed and work with devices needing the standby flow. */
2226+
fabric command SolicitOffer(SolicitOfferRequest): SolicitOfferResponse = 1;
2227+
/** This command allows an SDP Offer to be set and start a new session. */
2228+
fabric command ProvideOffer(ProvideOfferRequest): ProvideOfferResponse = 3;
2229+
/** This command SHALL be initiated from a Node in response to an Offer that was previously received from a remote peer. */
2230+
fabric command ProvideAnswer(ProvideAnswerRequest): DefaultSuccess = 5;
2231+
/** This command allows for string based https://rfc-editor.org/rfc/rfc8839#section-5.1 generated after the initial Offer / Answer exchange, via a JSEP https://datatracker.ietf.org/doc/html/rfc9429#section-4.1.20 event, a DOM https://www.w3.org/TR/webrtc/#dom-rtcpeerconnectioniceevent event, or other WebRTC compliant implementations, to be added to a session during the gathering phase. */
2232+
fabric command ProvideICECandidates(ProvideICECandidatesRequest): DefaultSuccess = 6;
2233+
/** This command instructs the stream provider to end the WebRTC session. */
2234+
fabric command EndSession(EndSessionRequest): DefaultSuccess = 7;
2235+
}
2236+
21222237
/** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */
21232238
provisional cluster Chime = 1366 {
21242239
revision 1;
@@ -2581,6 +2696,23 @@ endpoint 1 {
25812696
handle command SetDefaultNTP;
25822697
}
25832698

2699+
server cluster WebRTCTransportProvider {
2700+
callback attribute currentSessions;
2701+
callback attribute generatedCommandList;
2702+
callback attribute acceptedCommandList;
2703+
callback attribute attributeList;
2704+
ram attribute featureMap default = 0;
2705+
ram attribute clusterRevision default = 1;
2706+
2707+
handle command SolicitOffer;
2708+
handle command SolicitOfferResponse;
2709+
handle command ProvideOffer;
2710+
handle command ProvideOfferResponse;
2711+
handle command ProvideAnswer;
2712+
handle command ProvideICECandidates;
2713+
handle command EndSession;
2714+
}
2715+
25842716
server cluster Chime {
25852717
callback attribute installedChimeSounds;
25862718
callback attribute selectedChime;

0 commit comments

Comments
 (0)