Skip to content

Commit

Permalink
Merge branch 'master' into esp32/multi_interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 authored Apr 26, 2023
2 parents d2cad81 + c2a28c8 commit 9a41702
Show file tree
Hide file tree
Showing 138 changed files with 3,215 additions and 608 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/spell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ jobs:
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- uses: igsekor/pyspelling-any@v0.0.2
- uses: igsekor/pyspelling-any@v1.0.4
8 changes: 8 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ menu "CHIP Core"
help
Build CHIP test binaries.

config DISPATCH_EVENT_LONG_DISPATCH_TIME_WARNING_THRESHOLD_MS
int "Set threshold in ms"
default 700
help
Time threshold for events dispatching. By default set to 0 to
to disable event dispatching time measurement and suppress the
logs for Long dispatch time.

# TODO: add log level selection

endmenu # "General Options"
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/nrfconnect_examples_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ available options for the given command.
are accessible from the shell, but they must preceded by `ot`. For example:

```shell
uart:~$ ot masterkey
uart:~$ ot networkkey
00112233445566778899aabbccddeeff
Done
```
Expand Down
1 change: 1 addition & 0 deletions examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ CHIP_ERROR AppTask::Init()
memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey));
}
#else
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
#endif

Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/nrfconnect/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#if CONFIG_CHIP_FACTORY_DATA
#include <platform/nrfconnect/FactoryDataProvider.h>
#else
#include <platform/nrfconnect/DeviceInstanceInfoProviderImpl.h>
#endif

#ifdef CONFIG_MCUMGR_SMP_BT
Expand Down
7 changes: 6 additions & 1 deletion examples/all-clusters-app/nxp/mw320/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ mw320_executable("shell_mw320") {
"${chip_root}/src/setup_payload",
]

deps = [ "${chip_root}/src/platform:syscalls_stub" ]

include_dirs = [
"${chip_root}/src/platform/nxp/mw320",
"${examples_plat_dir}/app/project_include",
Expand All @@ -84,7 +86,10 @@ mw320_executable("shell_mw320") {

ldscript = "${examples_plat_dir}/app/ldscripts/88MW320_xx_xxxx_flash.ld"

ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ]
ldflags = [
"-T" + rebase_path(ldscript, root_build_dir),
"-Wl,--no-warn-rwx-segment",
]
defines = [
"MW320_SHELL_STREAMER",
"SHELL_STREAMER_APP_SPECIFIC",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ CHIP_ERROR AppTask::Init()
SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider);
SetCommissionableDataProvider(&mFactoryDataProvider);
#else
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#if CONFIG_CHIP_FACTORY_DATA
#include <platform/nrfconnect/FactoryDataProvider.h>
#else
#include <platform/nrfconnect/DeviceInstanceInfoProviderImpl.h>
#endif

#ifdef CONFIG_MCUMGR_SMP_BT
Expand Down
8 changes: 1 addition & 7 deletions examples/chef/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
#include "AppConfig.h"
#include "AppEvent.h"

#ifdef ENABLE_WSTK_LEDS
#include "LEDWidget.h"
#include "sl_simple_led_instances.h"
#endif // ENABLE_WSTK_LEDS

#ifdef DISPLAY_ENABLED
#include "lcd.h"
Expand All @@ -51,10 +48,7 @@

#include <platform/CHIPDeviceLayer.h>

#ifdef ENABLE_WSTK_LEDS
#define SYSTEM_STATE_LED &sl_led_led0
#endif // ENABLE_WSTK_LEDS

#define SYSTEM_STATE_LED 0
#define APP_FUNCTION_BUTTON &sl_button_btn0

using namespace chip;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{~#if hasExpectedValue}}
{{~>valueEquals actual=(asPropertyValue dontUnwrapValue=true) label=(asLowerCamelCase name) expected=expectedValue depth=0~}}
{{~>valueEquals actual=(asPropertyValue dontUnwrapValue=true) label=(asLowerCamelCase name) expected=expectedValue cluster=cluster depth=0~}}
{{~/if~}}
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
{{else}}
{{#if_is_struct type}}

{{#zcl_struct_items_by_struct_name type}}
{{#zcl_struct_items_by_struct_and_cluster_name type ns}}
{{#if_include_struct_item_value ../definedValue name}}
{{>commandValue ns=parent.ns container=(concat parent.container "." (asLowerCamelCase label)) definedValue=(lookup ../definedValue name) depth=(incrementDepth ../depth)}}
{{/if_include_struct_item_value}}
{{/zcl_struct_items_by_struct_name}}
{{/zcl_struct_items_by_struct_and_cluster_name}}

{{else}}
{{container}} =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ switch(mTestSubStepIndex)
{{asDecodableType}} value;
VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value)));
{{#chip_tests_item_response_parameters}}
{{>maybeCheckExpectedValue}}
{{>maybeCheckExpectedValue cluster=../cluster}}
{{>maybeCheckExpectedConstraints}}
{{>maybeSaveAs}}
{{/chip_tests_item_response_parameters}}
Expand Down
18 changes: 9 additions & 9 deletions examples/chip-tool/templates/tests/partials/value_equals.zapt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#if isOptional}}
VerifyOrReturn(CheckValuePresent("{{label}}", {{actual}}));
{{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=expected isOptional=false depth=(incrementDepth depth)}}
{{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=expected isOptional=false cluster=cluster depth=(incrementDepth depth)}}
{{else if isNullable}}
{{#if (isLiteralNull expected)}}
VerifyOrReturn(CheckValueNull("{{label}}", {{actual}}));
Expand All @@ -14,15 +14,15 @@
else
{
VerifyOrReturn(CheckValueNonNull("{{label}}", {{actual}}));
{{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=(concat expected ".Value()") isNullable=false keepAsExpected=true depth=(incrementDepth depth)}}
{{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=(concat expected ".Value()") isNullable=false keepAsExpected=true cluster=cluster depth=(incrementDepth depth)}}
}
{{else}}
VerifyOrReturn(CheckValueNonNull("{{label}}", {{actual}}));
{{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=expected isNullable=false keepAsExpected=true depth=(incrementDepth depth)}}
{{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=expected isNullable=false keepAsExpected=true cluster=cluster depth=(incrementDepth depth)}}
{{/if}}
{{else}}
VerifyOrReturn(CheckValueNonNull("{{label}}", {{actual}}));
{{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=expected isNullable=false depth=(incrementDepth depth)}}
{{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=expected isNullable=false cluster=cluster depth=(incrementDepth depth)}}
{{/if}}
{{/if}}
{{else if isArray}}
Expand All @@ -31,26 +31,26 @@
auto iter_{{depth}} = {{actual}}.begin();
{{#each expected}}
VerifyOrReturn(CheckNextListItemDecodes<decltype({{../actual}})>("{{../label}}", iter_{{../depth}}, {{@index}}));
{{>valueEquals label=(concat ../label "[" @index "]") actual=(concat "iter_" ../depth ".GetValue()") expected=this isArray=false type=../type chipType=../chipType depth=(incrementDepth ../depth) parent=../parent}}
{{>valueEquals label=(concat ../label "[" @index "]") actual=(concat "iter_" ../depth ".GetValue()") expected=this isArray=false type=../type chipType=../chipType cluster=../cluster depth=(incrementDepth ../depth) parent=../parent}}
{{/each}}
VerifyOrReturn(CheckNoMoreListItems<decltype({{actual}})>("{{label}}", iter_{{depth}}, {{expected.length}}));
}
{{else if isEvent}}
{{#zcl_events_fields_by_event_name type}}
{{#if (hasProperty ../expected label)}}
{{>valueEquals label=(concat ../label "." (asLowerCamelCase label)) actual=(concat ../actual "." (asLowerCamelCase label)) expected=(lookup ../expected label) depth=(incrementDepth ../depth)}}
{{>valueEquals label=(concat ../label "." (asLowerCamelCase label)) actual=(concat ../actual "." (asLowerCamelCase label)) expected=(lookup ../expected label) cluster=../cluster depth=(incrementDepth ../depth)}}
{{/if}}
{{/zcl_events_fields_by_event_name}}
{{else}}
{{#if_is_struct type}}
{{! Iterate over the actual types in the struct, so we pick up the right
type/optionality/nullability information for them for our recursive
call. }}
{{#zcl_struct_items_by_struct_name type}}
{{#zcl_struct_items_by_struct_and_cluster_name type cluster}}
{{#if (hasProperty ../expected label)}}
{{>valueEquals label=(concat ../label "." (asLowerCamelCase label)) actual=(concat ../actual "." (asLowerCamelCase label)) expected=(lookup ../expected label) depth=(incrementDepth ../depth)}}
{{>valueEquals label=(concat ../label "." (asLowerCamelCase label)) actual=(concat ../actual "." (asLowerCamelCase label)) expected=(lookup ../expected label) cluster=../cluster depth=(incrementDepth ../depth)}}
{{/if}}
{{/zcl_struct_items_by_struct_name}}
{{/zcl_struct_items_by_struct_and_cluster_name}}
{{! Maybe we should add a check for properties in the expected object (other
than "global") that are not present in the struct ? }}
{{else}}
Expand Down
1 change: 1 addition & 0 deletions examples/contact-sensor-app/nxp/k32w/k32w0/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ k32w0_executable("contact_sensor_app") {
"${chip_root}/examples/contact-sensor-app/contact-sensor-common",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/platform:syscalls_stub",
"${chip_root}/third_party/mbedtls:mbedtls",
"${k32w0_platform_dir}/app/support:freertos_mbedtls_utils",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
{{else}}
{{#if_is_struct type}}
{{target}} = [{{asObjectiveCClass type cluster forceNotList=true}} new];
{{#zcl_struct_items_by_struct_name type}}
{{#zcl_struct_items_by_struct_and_cluster_name type cluster}}
{{>decodable_value target=(concat ../target "." (asStructPropertyName label)) source=(concat ../source "." (asLowerCamelCase label)) cluster=../cluster depth=(incrementDepth ../depth) }}
{{/zcl_struct_items_by_struct_name}}
{{/zcl_struct_items_by_struct_and_cluster_name}}
{{else}}
{{#if_is_strongly_typed_chip_enum type}}
{{target}} = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:chip::to_underlying({{source}})];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
{{! Iterate over the actual types in the struct, so we pick up the right
type/optionality/nullability information for them for our recursive
call. }}
{{#zcl_struct_items_by_struct_name type}}
{{#zcl_struct_items_by_struct_and_cluster_name type cluster}}
{{#if (hasProperty ../expected label)}}
{{>check_test_value actual=(concat "((MTR" (asUpperCamelCase ../cluster) "Cluster" (asUpperCamelCase ../type) " *)" ../actual ")." (asStructPropertyName label)) expected=(lookup ../expected label) cluster=../cluster}}
{{/if}}
{{/zcl_struct_items_by_struct_name}}
{{/zcl_struct_items_by_struct_and_cluster_name}}
{{! Maybe we should add a check for properties in the expected object (other
than "global") that are not present in the struct ? }}
{{else}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
{{else}}
{{#if_is_struct type}}
{{target}} = [[MTR{{asUpperCamelCase cluster}}Cluster{{asUpperCamelCase type}} alloc] init];
{{#zcl_struct_items_by_struct_name type}}
{{#zcl_struct_items_by_struct_and_cluster_name type cluster}}
{{#if_include_struct_item_value ../definedValue name}}
{{! target may be some place where we lost type information (e.g. an
id), so add explicit cast when trying to assign to our
properties. }}
{{>test_value target=(concat "((MTR" (asUpperCamelCase ../cluster) "Cluster" (asUpperCamelCase ../type) " *)" ../target ")." (asStructPropertyName label)) definedValue=(lookup ../definedValue name) cluster=../cluster depth=(incrementDepth ../depth)}}
{{/if_include_struct_item_value}}
{{/zcl_struct_items_by_struct_name}}
{{/zcl_struct_items_by_struct_and_cluster_name}}

{{else}}
{{target}} =
Expand Down
1 change: 1 addition & 0 deletions examples/light-switch-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ CHIP_ERROR AppTask::Init()
memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey));
}
#else
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
#endif

Expand Down
2 changes: 2 additions & 0 deletions examples/light-switch-app/nrfconnect/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#if CONFIG_CHIP_FACTORY_DATA
#include <platform/nrfconnect/FactoryDataProvider.h>
#else
#include <platform/nrfconnect/DeviceInstanceInfoProviderImpl.h>
#endif

#ifdef CONFIG_MCUMGR_SMP_BT
Expand Down
2 changes: 0 additions & 2 deletions examples/light-switch-app/silabs/SiWx917/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
#include "AppEvent.h"
#include "BindingHandler.h"

#ifdef ENABLE_WSTK_LEDS
#include "LEDWidget.h"
#endif // ENABLE_WSTK_LEDS

#include "LightSwitchMgr.h"

Expand Down
3 changes: 0 additions & 3 deletions examples/light-switch-app/silabs/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
#include "AppEvent.h"
#include "BindingHandler.h"

#ifdef ENABLE_WSTK_LEDS
#include "LEDWidget.h"
#include "sl_simple_led_instances.h"
#endif // ENABLE_WSTK_LEDS

#include "LightSwitchMgr.h"

Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ CHIP_ERROR AppTask::Init()
memset(sTestEventTriggerEnableKey, 0, sizeof(sTestEventTriggerEnableKey));
}
#else
SetDeviceInstanceInfoProvider(&DeviceInstanceInfoProviderMgrImpl());
SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider());
#endif

Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/nrfconnect/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#if CONFIG_CHIP_FACTORY_DATA
#include <platform/nrfconnect/FactoryDataProvider.h>
#else
#include <platform/nrfconnect/DeviceInstanceInfoProviderImpl.h>
#endif

#ifdef CONFIG_CHIP_PW_RPC
Expand Down
1 change: 1 addition & 0 deletions examples/lighting-app/nxp/k32w/k32w0/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ k32w0_executable("light_app") {
"${chip_root}/examples/lighting-app/nxp/zap/",
"${chip_root}/examples/providers:device_info_provider",
"${chip_root}/src/lib",
"${chip_root}/src/platform:syscalls_stub",
"${chip_root}/third_party/mbedtls:mbedtls",
"${k32w0_platform_dir}/app/support:freertos_mbedtls_utils",
]
Expand Down
6 changes: 0 additions & 6 deletions examples/lighting-app/silabs/SiWx917/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,15 @@

#include <platform/CHIPDeviceLayer.h>

#ifdef ENABLE_WSTK_LEDS
#include "LEDWidget.h"
#define APP_ACTION_LED 1
#endif // ENABLE_WSTK_LEDS

using namespace chip;
using namespace ::chip::DeviceLayer;

namespace {

#ifdef ENABLE_WSTK_LEDS
LEDWidget sLightLED;
#endif // ENABLE_WSTK_LEDS

EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT;

Expand Down Expand Up @@ -143,10 +139,8 @@ CHIP_ERROR AppTask::Init()

LightMgr().SetCallbacks(ActionInitiated, ActionCompleted);

#ifdef ENABLE_WSTK_LEDS
sLightLED.Init(APP_ACTION_LED);
sLightLED.Set(LightMgr().IsLightOn());
#endif // ENABLE_WSTK_LEDS

return err;
}
Expand Down
15 changes: 2 additions & 13 deletions examples/lighting-app/silabs/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
#include "AppConfig.h"
#include "AppEvent.h"

#ifdef ENABLE_WSTK_LEDS
#include "LEDWidget.h"
#include "sl_simple_led_instances.h"
#endif // ENABLE_WSTK_LEDS

#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/on-off-server/on-off-server.h>
Expand All @@ -41,13 +38,11 @@

#include <platform/CHIPDeviceLayer.h>

#ifdef ENABLE_WSTK_LEDS
#if defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)
#define LIGHT_LED &sl_led_led1
#define LIGHT_LED 1
#else
#define LIGHT_LED &sl_led_led0
#define LIGHT_LED 0
#endif
#endif // ENABLE_WSTK_LEDS

#ifdef SL_CATALOG_SIMPLE_BUTTON_PRESENT

Expand All @@ -60,9 +55,7 @@ using namespace ::chip::DeviceLayer;

namespace {

#ifdef ENABLE_WSTK_LEDS
LEDWidget sLightLED;
#endif // ENABLE_WSTK_LEDS

EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT;

Expand Down Expand Up @@ -157,10 +150,8 @@ CHIP_ERROR AppTask::Init()

LightMgr().SetCallbacks(ActionInitiated, ActionCompleted);

#ifdef ENABLE_WSTK_LEDS
sLightLED.Init(LIGHT_LED);
sLightLED.Set(LightMgr().IsLightOn());
#endif // ENABLE_WSTK_LEDS

// Update the LCD with the Stored value. Show QR Code if not provisioned
#ifdef DISPLAY_ENABLED
Expand Down Expand Up @@ -298,9 +289,7 @@ void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor)
bool lightOn = aAction == LightingManager::ON_ACTION;
SILABS_LOG("Turning light %s", (lightOn) ? "On" : "Off")

#ifdef ENABLE_WSTK_LEDS
sLightLED.Set(lightOn);
#endif // ENABLE_WSTK_LEDS

#ifdef DISPLAY_ENABLED
sAppTask.GetLCD().WriteDemoUI(lightOn);
Expand Down
Loading

0 comments on commit 9a41702

Please sign in to comment.