Skip to content

Commit

Permalink
Merge branch 'master' into silabs/add_air_quality_app
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarthak-Shaha authored Sep 10, 2024
2 parents df4d287 + b1829ff commit c2b1ff6
Show file tree
Hide file tree
Showing 48 changed files with 823 additions and 593 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/minimal-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: Minimal Build (Linux / configure)
on:
push:
branches-ignore:
- 'dependabot/**'
- "dependabot/**"
pull_request:
merge_group:

Expand All @@ -42,11 +42,11 @@ jobs:
- name: Checkout submodules # but don't bootstrap!
uses: ./.github/actions/checkout-submodules
with:
platform: linux
platform: linux

- name: Configure and build All Clusters App
run: |
CC=gcc CXX=g++ scripts/configure --project=examples/all-clusters-app/linux && ./ninja-build
CC=gcc CXX=g++ scripts/configure --project=examples/all-clusters-app/linux --enable-recommended=no && ./ninja-build
minimal-network-manager:
name: Linux / configure build of network-manager-app
Expand All @@ -64,8 +64,8 @@ jobs:
- name: Checkout submodules # but don't bootstrap!
uses: ./.github/actions/checkout-submodules
with:
platform: linux
platform: linux

- name: Configure and build Network Manager App
run: |
CC=gcc CXX=g++ scripts/configure --project=examples/network-manager-app/linux && ./ninja-build
CC=gcc CXX=g++ scripts/configure --project=examples/network-manager-app/linux --enable-recommended=no && ./ninja-build
31 changes: 31 additions & 0 deletions config/recommended.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2024 Project CHIP Authors
#
# 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.

declare_args() {
# Note for SDK developers: As additional features with their own settings
# are added to the SDK, consider using the `matter_enable_recommended`
# meta-setting instead of a default value of 'true', especially where a
# different default is used based on platform (current_os): Often various
# debugging features have previously been defaulted to on for Linux and/or
# Mac but off for embedded platforms (on the assumption that Linux / Mac
# don't have resource constraints?); build settings of that nature should
# instead reference this meta-setting. E.g.
# enable_flux_capacitor = matter_enable_recommended && current_os == "linux"

# Enable recommended settings by default. This is a meta-setting
# that is enabled by default, and acts as a default for various
# other settings. Setting it to false produces a more conservative /
# minimal set of defaults.
matter_enable_recommended = true
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{> header}}

#include <commands/clusters/DataModelLogger.h>
#include <zap-generated/cluster/logging/EntryToText.h>

using namespace chip::app::Clusters;

Expand Down
10 changes: 10 additions & 0 deletions examples/chip-tool/templates/logging/EntryToText-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,14 @@ char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId i
{{/zcl_clusters}}
default: return "Unknown";
}
}

char const * DeviceTypeIdToText(chip::DeviceTypeId id) {
switch(id)
{
{{#zcl_device_types}}
case {{asHex code 8}}: return "{{caption}}";
{{/zcl_device_types}}
default: return "Unknown";
}
}
4 changes: 3 additions & 1 deletion examples/chip-tool/templates/logging/EntryToText.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id);

char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id);

char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id);
char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId id);

char const * DeviceTypeIdToText(chip::DeviceTypeId id);
22 changes: 22 additions & 0 deletions examples/chip-tool/templates/partials/StructLoggerImpl.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,34 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const ch
DataModelLogger::LogString(label, indent, "{");
{{#zcl_struct_items}}
{
{{#if (isEqual type "devtype_id") }}
{{#if isNullable }}
if (value.{{asLowerCamelCase label}}.IsNull())
{
CHIP_ERROR err = LogValue("{{asUpperCamelCase label}}", indent + 1, value.{{asLowerCamelCase label}});
if (err != CHIP_NO_ERROR)
{
DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for '{{asUpperCamelCase label}}'");
return err;
}
}
else
{
std::string item = std::to_string(value.{{asLowerCamelCase label}}.Value()) + " (" + DeviceTypeIdToText(value.{{asLowerCamelCase label}}.Value()) + ")";
DataModelLogger::LogString("{{asUpperCamelCase label}}", indent + 1, item);
}
{{else}}
std::string item = std::to_string(value.{{asLowerCamelCase label}}) + " (" + DeviceTypeIdToText(value.{{asLowerCamelCase label}}) + ")";
DataModelLogger::LogString("{{asUpperCamelCase label}}", indent + 1, item);
{{/if}}
{{else}}
CHIP_ERROR err = LogValue("{{asUpperCamelCase label}}", indent + 1, value.{{asLowerCamelCase label}});
if (err != CHIP_NO_ERROR)
{
DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for '{{asUpperCamelCase label}}'");
return err;
}
{{/if}}
}
{{/zcl_struct_items}}
DataModelLogger::LogString(indent, "}");
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ void BaseApplication::CancelFactoryResetSequence()
if (sIsFactoryResetTriggered)
{
sIsFactoryResetTriggered = false;
ChipLogProgress(AppServer, "Factory Reset has been Canceled");
ChipLogProgress(AppServer, "Factory Reset has been cancelled");
}
}

Expand Down Expand Up @@ -854,7 +854,7 @@ void BaseApplication::OnPlatformEvent(const ChipDeviceEvent * event, intptr_t)
VerifyOrReturn(event->InternetConnectivityChange.IPv4 == kConnectivity_Established);
if (DIC_OK != dic_init(dic::control::subscribeCB))
{
SILABS_LOG("Failed to initialize DIC module\n");
ChipLogError(AppServer, "dic_init failed");
}
#endif // DIC_ENABLE
#ifdef DISPLAY_ENABLED
Expand Down
Loading

0 comments on commit c2b1ff6

Please sign in to comment.