Skip to content

Commit 7b39d2a

Browse files
Sync csa branch with main (#343)
2 parents 5d5e03f + f217707 commit 7b39d2a

File tree

58 files changed

+747
-419
lines changed

Some content is hidden

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

58 files changed

+747
-419
lines changed

examples/air-quality-sensor-app/silabs/include/AppTask.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ class AppTask : public BaseApplication
8989
static AppTask sAppTask;
9090

9191
/**
92-
* @brief AppTask initialisation function
92+
* @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
9393
*
9494
* @return CHIP_ERROR
9595
*/
96-
CHIP_ERROR Init();
96+
CHIP_ERROR AppInit() override;
9797

9898
/**
9999
* @brief PB0 Button event processing function

examples/air-quality-sensor-app/silabs/src/AppTask.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ using namespace chip::app::Clusters;
6868

6969
AppTask AppTask::sAppTask;
7070

71-
CHIP_ERROR AppTask::Init()
71+
CHIP_ERROR AppTask::AppInit()
7272
{
7373
CHIP_ERROR err = CHIP_NO_ERROR;
7474
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);
@@ -77,12 +77,6 @@ CHIP_ERROR AppTask::Init()
7777
GetLCD().SetCustomUI(AirQualitySensorUI::DrawUI);
7878
#endif
7979

80-
err = BaseApplication::Init();
81-
if (err != CHIP_NO_ERROR)
82-
{
83-
ChipLogDetail(AppServer, "BaseApplication::Init() failed");
84-
appError(err);
85-
}
8680
err = SensorManager::SensorMgr().Init();
8781
if (err != CHIP_NO_ERROR)
8882
{

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ CONFIG_CHIP_ENABLE_READ_CLIENT=y
5959
CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000
6060

6161
# Increase heap size
62-
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240
62+
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=32768

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ CONFIG_CHIP_FACTORY_DATA_BUILD=y
5757
CONFIG_CHIP_ENABLE_READ_CLIENT=y
5858

5959
# Increase heap size
60-
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240
60+
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=32768

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ CONFIG_LTO=y
6868
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y
6969

7070
# Increase heap size
71-
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240
71+
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=32768

examples/camera-app/linux/BUILD.gn

+11-12
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,26 @@ import("//build_overrides/build.gni")
1616
import("//build_overrides/chip.gni")
1717

1818
import("${chip_root}/build/chip/tools.gni")
19-
import("${chip_root}/src/app/common_flags.gni")
2019

2120
assert(chip_build_tools)
2221

23-
config("includes") {
22+
config("config") {
23+
cflags = [
24+
"-Wconversion",
25+
"-Wno-shadow",
26+
]
27+
2428
include_dirs = [
25-
".",
2629
"include",
30+
"include/clusters/chime",
31+
"${chip_root}/examples/camera-app/camera-common/include",
32+
"${chip_root}/third_party/libdatachannel/repo/include",
2733
]
2834
}
2935

3036
executable("chip-camera-app") {
37+
configs += [ ":config" ]
38+
3139
sources = [
3240
"${chip_root}/examples/camera-app/linux/src/camera-device.cpp",
3341
"${chip_root}/examples/camera-app/linux/src/clusters/chime/chime-manager.cpp",
@@ -47,15 +55,6 @@ executable("chip-camera-app") {
4755
lib_dirs =
4856
[ rebase_path("${chip_root}/third_party/libdatachannel/repo/build") ]
4957

50-
include_dirs = [
51-
"include",
52-
"include/clusters/chime",
53-
"${chip_root}/examples/camera-app/camera-common/include",
54-
"${chip_root}/third_party/libdatachannel/repo/include",
55-
]
56-
57-
cflags = [ "-Wconversion" ]
58-
5958
output_dir = root_out_dir
6059
}
6160

examples/camera-controller/BUILD.gn

+6-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@ import("${chip_root}/src/lib/core/core.gni")
2323
assert(chip_build_tools)
2424

2525
config("config") {
26+
cflags = [
27+
"-Wconversion",
28+
"-Wno-shadow",
29+
]
30+
2631
include_dirs = [
2732
".",
2833
"${chip_root}/examples/common",
2934
"${chip_root}/zzz_generated/app-common/app-common",
3035
"${chip_root}/zzz_generated/chip-tool",
3136
"${chip_root}/src/lib",
37+
"${chip_root}/third_party/libdatachannel/repo/include",
3238
]
3339

3440
defines = [ "CONFIG_USE_SEPARATE_EVENTLOOP=${config_use_separate_eventloop}" ]
@@ -114,8 +120,6 @@ executable("camera-controller") {
114120
lib_dirs =
115121
[ rebase_path("${chip_root}/third_party/libdatachannel/repo/build") ]
116122

117-
include_dirs = [ "${chip_root}/third_party/libdatachannel/repo/include" ]
118-
119123
output_dir = root_out_dir
120124
}
121125

examples/chef/silabs/include/AppTask.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ class AppTask : public BaseApplication
8080
static AppTask sAppTask;
8181

8282
/**
83-
* @brief AppTask initialisation function
83+
* @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
8484
*
8585
* @return CHIP_ERROR
8686
*/
87-
CHIP_ERROR Init();
87+
CHIP_ERROR AppInit() override;
8888

8989
/**
9090
* @brief PB0 Button event processing function

examples/chef/silabs/src/AppTask.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,11 @@ using namespace ::chip::DeviceLayer;
5858

5959
AppTask AppTask::sAppTask;
6060

61-
CHIP_ERROR AppTask::Init()
61+
CHIP_ERROR AppTask::AppInit()
6262
{
6363
CHIP_ERROR err = CHIP_NO_ERROR;
6464
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);
6565

66-
err = BaseApplication::Init();
67-
if (err != CHIP_NO_ERROR)
68-
{
69-
SILABS_LOG("BaseApplication::Init() failed");
70-
appError(err);
71-
}
72-
7366
return err;
7467
}
7568

examples/darwin-framework-tool/commands/common/xpc/DeviceControllerServer.mm

+16-6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#import <lib/support/logging/CHIPLogging.h>
2222

23+
#if TARGET_OS_MACCATALYST || TARGET_OS_IOS
24+
#import "HomeKitConnector.h"
25+
#endif
26+
2327
@interface DeviceControllerXPCServerImpl : NSObject <MTRDeviceControllerServerProtocol>
2428
@property (nonatomic, strong) id<MTRDeviceControllerClientProtocol> clientProxy;
2529
@property (nonatomic, strong) NSArray<MTRDeviceController *> * controllers;
@@ -331,19 +335,25 @@ - (void)start
331335

332336
- (void)stop
333337
{
338+
#if TARGET_OS_MACCATALYST || TARGET_OS_IOS
339+
[[HomeKitConnector sharedInstance] stop];
340+
#endif
334341
}
335342

336343
- (MTRDeviceController *)createController:(NSString *)controllerID serviceName:(NSString *)serviceName error:(NSError * __autoreleasing *)error
337344
{
338-
__auto_type connectBlock = ^NSXPCConnection *
339-
{
345+
NSXPCConnection * (^connectBlock)(void) = nil;
340346
#if TARGET_OS_OSX
347+
connectBlock = ^NSXPCConnection *
348+
{
341349
return [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:0];
342-
#else
343-
ChipLogError(chipTool, "NSXPCConnection::initWithMachServiceName is not supported on this platform.");
344-
return nil;
345-
#endif // TARGET_OS_OSX
346350
};
351+
#elif TARGET_OS_MACCATALYST || TARGET_OS_IOS
352+
connectBlock = [[HomeKitConnector sharedInstance] connectBlockFor:controllerID];
353+
controllerID = [[HomeKitConnector sharedInstance] homeControllerIDFor:controllerID];
354+
#endif
355+
356+
VerifyOrReturnValue(nil != connectBlock, nil, ChipLogError(chipTool, "DeviceControllerXPCServerWithServiceName is not supported on this platform."));
347357
return [MTRDeviceController sharedControllerWithID:controllerID xpcConnectBlock:connectBlock];
348358
}
349359
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2025 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
#import <Foundation/Foundation.h>
20+
21+
NS_ASSUME_NONNULL_BEGIN
22+
23+
@interface HomeKitConnector : NSObject
24+
- (instancetype)init NS_UNAVAILABLE;
25+
+ (instancetype)new NS_UNAVAILABLE;
26+
+ (instancetype)sharedInstance;
27+
28+
- (void)start;
29+
- (void)stop;
30+
- (NSString *)homeControllerIDFor:(NSString *)controllerID;
31+
- (NSXPCConnection * (^)(void) )connectBlockFor:(NSString *)controllerID;
32+
@end
33+
34+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)