Skip to content

Commit

Permalink
Merge branch 'project-chip:master' into infineon-p6-all-clusters-update
Browse files Browse the repository at this point in the history
  • Loading branch information
keithmwheeler authored Jun 6, 2022
2 parents 2564404 + 3c9ae1a commit 25be325
Show file tree
Hide file tree
Showing 71 changed files with 5,119 additions and 2,496 deletions.
4 changes: 4 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
"${chip_root}/src/setup_payload/java",
]
}

if (build_tv_casting_common_a) {
deps += [ "${chip_root}/examples/tv-casting-app/tv-casting-common:tvCastingCommon" ]
}
}

if (chip_build_tools) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2938,12 +2938,16 @@ server cluster Scenes = 5 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2425,6 +2425,10 @@ server cluster Scenes = 5 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

info event SoftwareFault = 0 {
SoftwareFaultStruct softwareFault = 0;
}
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-minimal-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ flashing_script()
if (CONFIG_ENABLE_PW_RPC)
get_filename_component(CHIP_ROOT ./third_party/connectedhomeip REALPATH)
include(third_party/connectedhomeip/third_party/pigweed/repo/pw_build/pigweed.cmake)
pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config)
pw_set_backend(pw_log pw_log_basic)
pw_set_backend(pw_assert pw_assert_log)
pw_set_backend(pw_sys_io pw_sys_io.esp32)
Expand Down
12 changes: 8 additions & 4 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -834,12 +834,16 @@ server cluster OperationalCredentials = 62 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
32 changes: 32 additions & 0 deletions examples/darwin-framework-tool/commands/tests/TestCommandBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,38 @@ class TestCommandBridge : public CHIPCommandBridge,
return CheckConstraintNotValue(itemName, currentValue, @(expected));
}

using ConstraintsChecker::CheckConstraintMinValue;

// Used when the minValue is a saved variable, since ConstraintsChecker does
// not expect Core Foundation types.
template <typename T, std::enable_if_t<std::is_signed<T>::value, int> = 0>
bool CheckConstraintMinValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected)
{
return ConstraintsChecker::CheckConstraintMinValue(itemName, current, [expected longLongValue]);
}

template <typename T, std::enable_if_t<!std::is_signed<T>::value, int> = 0>
bool CheckConstraintMinValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected)
{
return ConstraintsChecker::CheckConstraintMinValue(itemName, current, [expected unsignedLongLongValue]);
}

using ConstraintsChecker::CheckConstraintMaxValue;

// Used when the maxValue is a saved variable, since ConstraintsChecker does
// not expect Core Foundation types.
template <typename T, std::enable_if_t<std::is_signed<T>::value, int> = 0>
bool CheckConstraintMaxValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected)
{
return ConstraintsChecker::CheckConstraintMaxValue(itemName, current, [expected longLongValue]);
}

template <typename T, std::enable_if_t<!std::is_signed<T>::value, int> = 0>
bool CheckConstraintMaxValue(const char * _Nonnull itemName, T current, const NSNumber * _Nonnull expected)
{
return ConstraintsChecker::CheckConstraintMaxValue(itemName, current, [expected unsignedLongLongValue]);
}

bool CheckValueAsString(const char * _Nonnull itemName, const id _Nonnull current, const NSString * _Nonnull expected)
{
NSString * data = current;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1376,12 +1376,16 @@ client cluster Scenes = 5 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
12 changes: 8 additions & 4 deletions examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1358,12 +1358,16 @@ server cluster OperationalCredentials = 62 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
12 changes: 8 additions & 4 deletions examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1568,12 +1568,16 @@ server cluster PowerSourceConfiguration = 46 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
12 changes: 8 additions & 4 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2085,12 +2085,16 @@ server cluster Scenes = 5 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
12 changes: 8 additions & 4 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -2085,12 +2085,16 @@ server cluster Scenes = 5 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
13 changes: 0 additions & 13 deletions examples/platform/linux/CommissionerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,6 @@ class PairingCommand : public Controller::DevicePairingDelegate
void OnPairingDeleted(CHIP_ERROR error) override;
void OnCommissioningComplete(NodeId deviceId, CHIP_ERROR error) override;

CHIP_ERROR UpdateNetworkAddress();

private:
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
static void OnDeviceConnectedFn(void * context, chip::OperationalDeviceProxy * device);
Expand All @@ -238,12 +236,6 @@ class PairingCommand : public Controller::DevicePairingDelegate
PairingCommand gPairingCommand;
NodeId gRemoteId = kTestDeviceNodeId;

CHIP_ERROR PairingCommand::UpdateNetworkAddress()
{
ChipLogProgress(AppServer, "Mdns: Updating NodeId: %" PRIx64 " ...", gRemoteId);
return gCommissioner.UpdateDevice(gRemoteId);
}

void PairingCommand::OnStatusUpdate(DevicePairingDelegate::Status status)
{
switch (status)
Expand All @@ -266,11 +258,6 @@ void PairingCommand::OnPairingComplete(CHIP_ERROR err)
else
{
ChipLogProgress(AppServer, "Pairing Failure: %s", ErrorStr(err));
// For some devices, it may take more time to appear on the network and become discoverable
// over DNS-SD, so don't give up on failure and restart the address update. Note that this
// will not be repeated endlessly as each chip-tool command has a timeout (in the case of
// the `pairing` command it equals 120s).
// UpdateNetworkAddress();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1065,12 +1065,16 @@ client cluster PumpConfigurationAndControl = 512 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,10 @@ server cluster OperationalCredentials = 62 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

info event SoftwareFault = 0 {
SoftwareFaultStruct softwareFault = 0;
}
Expand Down
12 changes: 8 additions & 4 deletions examples/thermostat/thermostat-common/thermostat.matter
Original file line number Diff line number Diff line change
Expand Up @@ -977,12 +977,16 @@ server cluster Scenes = 5 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
12 changes: 8 additions & 4 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1716,12 +1716,16 @@ server cluster RelativeHumidityMeasurement = 1029 {
}

server cluster SoftwareDiagnostics = 52 {
bitmap SoftwareDiagnosticsFeature : BITMAP32 {
kWaterMarks = 0x1;
}

struct ThreadMetrics {
int64u id = 0;
char_string<8> name = 1;
int32u stackFreeCurrent = 2;
int32u stackFreeMinimum = 3;
int32u stackSize = 4;
optional char_string<8> name = 1;
optional int32u stackFreeCurrent = 2;
optional int32u stackFreeMinimum = 3;
optional int32u stackSize = 4;
}

info event SoftwareFault = 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

@interface CastingServerBridge : NSObject

+ (CastingServerBridge *)getSharedInstance;

// TBD: placeholder will be replaced with true CastingServer functions
- (int)add:(int)a secondNum:(int)b;

@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,44 @@
*/

#import "CastingServerBridge.h"
#import "CastingServer.h"

#include <lib/support/CHIPMem.h>
#include <platform/PlatformManager.h>

@implementation CastingServerBridge

+ (CastingServerBridge *)getSharedInstance
{
static CastingServerBridge * instance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[self alloc] init];
});
return instance;
}

- (instancetype)init
{
if (self = [super init]) {
CHIP_ERROR err = chip::Platform::MemoryInit();
if (err != CHIP_NO_ERROR) {
ChipLogError(AppServer, "MemoryInit failed: %s", ErrorStr(err));
return nil;
}

err = chip::DeviceLayer::PlatformMgr().InitChipStack();
if (err != CHIP_NO_ERROR) {
ChipLogError(AppServer, "InitChipStack failed: %s", ErrorStr(err));
return nil;
}

CastingServer::GetInstance()->Init();
}
return self;
}

// TBD: placeholder will be replaced with true CastingServer functions
- (int)add:(int)a secondNum:(int)b
{
return a + b;
Expand Down
Loading

0 comments on commit 25be325

Please sign in to comment.