Skip to content

Commit a4305a5

Browse files
Merge branch 'master' into silabs/add_air_quality_app
2 parents 0bdcb6b + e64ab71 commit a4305a5

9 files changed

+48
-32
lines changed

.github/workflows/build.yaml

+8-6
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ jobs:
283283
if: github.actor != 'restyled-io[bot]'
284284

285285
container:
286-
image: ghcr.io/project-chip/chip-build:54
286+
image: ghcr.io/project-chip/chip-build:74
287287
volumes:
288288
- "/:/runner-root-volume"
289289
- "/tmp/log_output:/tmp/test_logs"
@@ -316,9 +316,10 @@ jobs:
316316
run: |
317317
scripts/run_in_build_env.sh 'virtualenv pyenv'
318318
source pyenv/bin/activate
319-
pip3 install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl
320-
pip3 install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl
321-
pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl
319+
python -m ensurepip --upgrade
320+
python -m pip install ./out/controller/python/chip_core-0.0-cp37-abi3-linux_x86_64.whl
321+
python -m pip install ./out/controller/python/chip_clusters-0.0-py3-none-any.whl
322+
python -m pip install ./out/controller/python/chip_repl-0.0-py3-none-any.whl
322323
323324
- name: Run Python tests
324325
shell: bash
@@ -334,7 +335,8 @@ jobs:
334335
scripts/run_in_build_env.sh 'scripts/examples/gn_build_example.sh examples/chip-tool out/'
335336
scripts/run_in_build_env.sh 'virtualenv pyenv'
336337
source pyenv/bin/activate
337-
pip3 install -r scripts/setup/requirements.setuppayload.txt
338+
python -m ensurepip --upgrade
339+
python -m pip install -r scripts/setup/requirements.setuppayload.txt
338340
python3 src/setup_payload/tests/run_python_setup_payload_test.py out/chip-tool
339341
340342
build_linux_python_lighting_device:
@@ -344,7 +346,7 @@ jobs:
344346
if: github.actor != 'restyled-io[bot]'
345347

346348
container:
347-
image: ghcr.io/project-chip/chip-build:54
349+
image: ghcr.io/project-chip/chip-build:74
348350
volumes:
349351
- "/:/runner-root-volume"
350352
- "/tmp/log_output:/tmp/test_logs"

.github/workflows/examples-infineon.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ jobs:
3737
if: github.actor != 'restyled-io[bot]'
3838

3939
container:
40-
image: ghcr.io/project-chip/chip-build-infineon:54
40+
image: ghcr.io/project-chip/chip-build-infineon:74
41+
env:
42+
# TODO: this should probably be part of the dockerfile itself
43+
CY_TOOLS_PATHS: /opt/Tools/ModusToolbox/tools_3.2
4144
volumes:
4245
- "/tmp/bloat_reports:/tmp/bloat_reports"
4346
steps:

.github/workflows/tests.yaml

+3-5
Original file line numberDiff line numberDiff line change
@@ -522,19 +522,17 @@ jobs:
522522
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/controller/python/test/test_scripts/mobile-device-test.py'
523523
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/execute_python_tests.py --env-file /tmp/test_env.yaml --search-directory src/python_testing'
524524
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py --all-clusters out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test-data-model-check-check-failure-die/chip-all-clusters-app'
525-
scripts/run_in_python_env.sh out/venv './src/python_testing/test_testing/test_TC_ICDM_2_1.py'
526525
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestIdChecks.py'
527526
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingDeviceType.py'
528-
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py'
529-
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py'
530527
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceSupport.py'
531528
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestConformanceTest.py'
532529
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestChoiceConformanceSupport.py'
530+
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestMatterTestingSupport.py'
531+
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py'
532+
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_ICDM_2_1.py'
533533
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_IDM_10_4.py'
534534
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/test_TC_SC_7_1.py'
535535
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/test_testing/TestDecorators.py'
536-
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestMatterTestingSupport.py'
537-
scripts/run_in_python_env.sh out/venv 'python3 ./src/python_testing/TestSpecParsingSupport.py'
538536
539537
540538
- name: Uploading core files

scripts/build_python.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ if [ -n "$install_virtual_env" ]; then
217217
fi
218218

219219
source "$ENVIRONMENT_ROOT"/bin/activate
220-
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip
221-
"$ENVIRONMENT_ROOT"/bin/pip install --upgrade "${WHEEL[@]}"
220+
"$ENVIRONMENT_ROOT"/bin/python -m ensurepip --upgrade
221+
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade "${WHEEL[@]}"
222222

223223
if [ "$install_pytest_requirements" = "yes" ]; then
224224
YAMLTESTS_GN_LABEL="//scripts:matter_yamltests_distribution._build_wheel"

scripts/build_python_device.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ virtualenv --clear "$ENVIRONMENT_ROOT"
104104
WHEEL=("$OUTPUT_ROOT"/controller/python/chip_core*.whl)
105105

106106
source "$ENVIRONMENT_ROOT"/bin/activate
107-
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade pip
108-
"$ENVIRONMENT_ROOT"/bin/pip install --upgrade --force-reinstall --no-cache-dir "${WHEEL[@]}"
107+
"$ENVIRONMENT_ROOT"/bin/python -m ensurepip --upgrade
108+
"$ENVIRONMENT_ROOT"/bin/python -m pip install --upgrade --force-reinstall --no-cache-dir "${WHEEL[@]}"
109109

110110
echo ""
111111
echo_green "Compilation completed and WHL package installed in: "

src/darwin/Framework/CHIP/MTRDefines_Internal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ typedef struct {} variable_hidden_by_mtr_hide;
9191
{ \
9292
NSXPCConnection * xpcConnection = XPC_CONNECTION; \
9393
\
94-
[[xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { \
94+
[[xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { \
9595
MTR_LOG_ERROR("Error: %@", error); \
9696
}] PREFIX ADDITIONAL_ARGUMENTS]; \
9797
}

src/darwin/Framework/CHIP/MTRDeviceController_XPC.mm

+3-3
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ - (BOOL)_setupXPCConnection
181181
MTR_LOG("%@ Activating new XPC connection", self);
182182
[self.xpcConnection activate];
183183

184-
[[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
184+
[[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
185185
MTR_LOG_ERROR("Checkin error: %@", error);
186186
}] deviceController:self.uniqueIdentifier checkInWithContext:[NSDictionary dictionary]];
187187

@@ -193,7 +193,7 @@ - (BOOL)_setupXPCConnection
193193
MTR_LOG("%@ => Registering nodeID: %@", self, nodeID);
194194
mtr_weakify(self);
195195

196-
[[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
196+
[[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
197197
mtr_strongify(self);
198198
MTR_LOG_ERROR("%@ Registration error for device nodeID: %@ : %@", self, nodeID, error);
199199
}] deviceController:self.uniqueIdentifier registerNodeID:nodeID];
@@ -288,7 +288,7 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N
288288
MTR_LOG("%s: returning XPC device for node id %@", __PRETTY_FUNCTION__, nodeID);
289289

290290
mtr_weakify(self);
291-
[[self.xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
291+
[[self.xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
292292
mtr_strongify(self);
293293
MTR_LOG_ERROR("%@ Registration error for device nodeID: %@ : %@", self, nodeID, error);
294294
}] deviceController:self.uniqueIdentifier registerNodeID:nodeID];

src/darwin/Framework/CHIP/MTRDevice_Concrete.mm

+24-10
Original file line numberDiff line numberDiff line change
@@ -1852,24 +1852,38 @@ - (void)_handleAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attrib
18521852
[self _reportAttributes:[self _getAttributesToReportWithReportedValues:attributeReport fromSubscription:isFromSubscription]];
18531853
}
18541854

1855-
#ifdef DEBUG
1856-
- (void)unitTestInjectEventReport:(NSArray<NSDictionary<NSString *, id> *> *)eventReport
1855+
// BEGIN DRAGON: This is used by the XPC Server to inject reports into local cache and broadcast them
1856+
- (void)_injectAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport fromSubscription:(BOOL)isFromSubscription
18571857
{
1858+
[_deviceController asyncDispatchToMatterQueue:^{
1859+
[self _handleReportBegin];
1860+
dispatch_async(self.queue, ^{
1861+
[self _handleAttributeReport:attributeReport fromSubscription:isFromSubscription];
1862+
[self _handleReportEnd];
1863+
});
1864+
} errorHandler:nil];
1865+
}
1866+
1867+
- (void)_injectEventReport:(NSArray<NSDictionary<NSString *, id> *> *)eventReport
1868+
{
1869+
// [_deviceController asyncDispatchToMatterQueue:^{ // TODO: This wasn't used previously, not sure why, so keeping it here for thought, but preserving existing behavior
18581870
dispatch_async(self.queue, ^{
18591871
[self _handleEventReport:eventReport];
18601872
});
1873+
// } errorHandler: nil];
1874+
}
1875+
1876+
// END DRAGON: This is used by the XPC Server to inject attribute reports
1877+
1878+
#ifdef DEBUG
1879+
- (void)unitTestInjectEventReport:(NSArray<NSDictionary<NSString *, id> *> *)eventReport
1880+
{
1881+
[self _injectEventReport:eventReport];
18611882
}
18621883

18631884
- (void)unitTestInjectAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport fromSubscription:(BOOL)isFromSubscription
18641885
{
1865-
[_deviceController asyncDispatchToMatterQueue:^{
1866-
[self _handleReportBegin];
1867-
dispatch_async(self.queue, ^{
1868-
[self _handleAttributeReport:attributeReport fromSubscription:isFromSubscription];
1869-
[self _handleReportEnd];
1870-
});
1871-
}
1872-
errorHandler:nil];
1886+
[self _injectAttributeReport:attributeReport fromSubscription:isFromSubscription];
18731887
}
18741888
#endif
18751889

src/darwin/Framework/CHIP/MTRDevice_XPC.mm

+1-2
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID
244244
{
245245
NSXPCConnection * xpcConnection = [(MTRDeviceController_XPC *) [self deviceController] xpcConnection];
246246

247-
// TODO: use asynchronous XPC and register a block with controller to call for this transaction
248-
[[xpcConnection synchronousRemoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
247+
[[xpcConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
249248
MTR_LOG_ERROR("Error: %@", error);
250249
}] deviceController:[[self deviceController] uniqueIdentifier]
251250
nodeID:[self nodeID]

0 commit comments

Comments
 (0)