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 #343

Merged
merged 9 commits into from
Mar 14, 2025
4 changes: 2 additions & 2 deletions examples/air-quality-sensor-app/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ class AppTask : public BaseApplication
static AppTask sAppTask;

/**
* @brief AppTask initialisation function
* @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
*
* @return CHIP_ERROR
*/
CHIP_ERROR Init();
CHIP_ERROR AppInit() override;

/**
* @brief PB0 Button event processing function
Expand Down
8 changes: 1 addition & 7 deletions examples/air-quality-sensor-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ using namespace chip::app::Clusters;

AppTask AppTask::sAppTask;

CHIP_ERROR AppTask::Init()
CHIP_ERROR AppTask::AppInit()
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);
Expand All @@ -77,12 +77,6 @@ CHIP_ERROR AppTask::Init()
GetLCD().SetCustomUI(AirQualitySensorUI::DrawUI);
#endif

err = BaseApplication::Init();
if (err != CHIP_NO_ERROR)
{
ChipLogDetail(AppServer, "BaseApplication::Init() failed");
appError(err);
}
err = SensorManager::SensorMgr().Init();
if (err != CHIP_NO_ERROR)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ CONFIG_CHIP_ENABLE_READ_CLIENT=y
CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000

# Increase heap size
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=32768
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/prj_dfu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ CONFIG_CHIP_FACTORY_DATA_BUILD=y
CONFIG_CHIP_ENABLE_READ_CLIENT=y

# Increase heap size
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=32768
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/prj_release.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ CONFIG_LTO=y
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y

# Increase heap size
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240
CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=32768
23 changes: 11 additions & 12 deletions examples/camera-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,26 @@ import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

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

assert(chip_build_tools)

config("includes") {
config("config") {
cflags = [
"-Wconversion",
"-Wno-shadow",
]

include_dirs = [
".",
"include",
"include/clusters/chime",
"${chip_root}/examples/camera-app/camera-common/include",
"${chip_root}/third_party/libdatachannel/repo/include",
]
}

executable("chip-camera-app") {
configs += [ ":config" ]

sources = [
"${chip_root}/examples/camera-app/linux/src/camera-device.cpp",
"${chip_root}/examples/camera-app/linux/src/clusters/chime/chime-manager.cpp",
Expand All @@ -47,15 +55,6 @@ executable("chip-camera-app") {
lib_dirs =
[ rebase_path("${chip_root}/third_party/libdatachannel/repo/build") ]

include_dirs = [
"include",
"include/clusters/chime",
"${chip_root}/examples/camera-app/camera-common/include",
"${chip_root}/third_party/libdatachannel/repo/include",
]

cflags = [ "-Wconversion" ]

output_dir = root_out_dir
}

Expand Down
8 changes: 6 additions & 2 deletions examples/camera-controller/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@ import("${chip_root}/src/lib/core/core.gni")
assert(chip_build_tools)

config("config") {
cflags = [
"-Wconversion",
"-Wno-shadow",
]

include_dirs = [
".",
"${chip_root}/examples/common",
"${chip_root}/zzz_generated/app-common/app-common",
"${chip_root}/zzz_generated/chip-tool",
"${chip_root}/src/lib",
"${chip_root}/third_party/libdatachannel/repo/include",
]

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

include_dirs = [ "${chip_root}/third_party/libdatachannel/repo/include" ]

output_dir = root_out_dir
}

Expand Down
4 changes: 2 additions & 2 deletions examples/chef/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ class AppTask : public BaseApplication
static AppTask sAppTask;

/**
* @brief AppTask initialisation function
* @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
*
* @return CHIP_ERROR
*/
CHIP_ERROR Init();
CHIP_ERROR AppInit() override;

/**
* @brief PB0 Button event processing function
Expand Down
9 changes: 1 addition & 8 deletions examples/chef/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,11 @@ using namespace ::chip::DeviceLayer;

AppTask AppTask::sAppTask;

CHIP_ERROR AppTask::Init()
CHIP_ERROR AppTask::AppInit()
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

err = BaseApplication::Init();
if (err != CHIP_NO_ERROR)
{
SILABS_LOG("BaseApplication::Init() failed");
appError(err);
}

return err;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

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

#if TARGET_OS_MACCATALYST || TARGET_OS_IOS
#import "HomeKitConnector.h"
#endif

@interface DeviceControllerXPCServerImpl : NSObject <MTRDeviceControllerServerProtocol>
@property (nonatomic, strong) id<MTRDeviceControllerClientProtocol> clientProxy;
@property (nonatomic, strong) NSArray<MTRDeviceController *> * controllers;
Expand Down Expand Up @@ -331,19 +335,25 @@ - (void)start

- (void)stop
{
#if TARGET_OS_MACCATALYST || TARGET_OS_IOS
[[HomeKitConnector sharedInstance] stop];
#endif
}

- (MTRDeviceController *)createController:(NSString *)controllerID serviceName:(NSString *)serviceName error:(NSError * __autoreleasing *)error
{
__auto_type connectBlock = ^NSXPCConnection *
{
NSXPCConnection * (^connectBlock)(void) = nil;
#if TARGET_OS_OSX
connectBlock = ^NSXPCConnection *
{
return [[NSXPCConnection alloc] initWithMachServiceName:serviceName options:0];
#else
ChipLogError(chipTool, "NSXPCConnection::initWithMachServiceName is not supported on this platform.");
return nil;
#endif // TARGET_OS_OSX
};
#elif TARGET_OS_MACCATALYST || TARGET_OS_IOS
connectBlock = [[HomeKitConnector sharedInstance] connectBlockFor:controllerID];
controllerID = [[HomeKitConnector sharedInstance] homeControllerIDFor:controllerID];
#endif

VerifyOrReturnValue(nil != connectBlock, nil, ChipLogError(chipTool, "DeviceControllerXPCServerWithServiceName is not supported on this platform."));
return [MTRDeviceController sharedControllerWithID:controllerID xpcConnectBlock:connectBlock];
}
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2025 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface HomeKitConnector : NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
+ (instancetype)sharedInstance;

- (void)start;
- (void)stop;
- (NSString *)homeControllerIDFor:(NSString *)controllerID;
- (NSXPCConnection * (^)(void) )connectBlockFor:(NSString *)controllerID;
@end

NS_ASSUME_NONNULL_END
Loading
Loading