Skip to content

Commit

Permalink
Fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
srickardti committed Mar 23, 2022
2 parents 1cb1949 + a9bca9b commit 20ba104
Show file tree
Hide file tree
Showing 165 changed files with 6,622 additions and 1,545 deletions.
2 changes: 2 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ ATWC
AudioOutput
auth
AuthMode
autoApplyImage
autocompletion
autoconnect
autocrlf
Expand Down Expand Up @@ -1113,6 +1114,7 @@ showDocumentation
shubhamdp
SIGINT
SiLabs
Silabs's
SiliconLabs
SimpleFileExFlags
SimpleLink
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# TODO ESP32 https://github.com/project-chip/connectedhomeip/issues/1510
esp32:
name: ESP32
timeout-minutes: 80
timeout-minutes: 90

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:

esp32_1:
name: ESP32_1
timeout-minutes: 70
timeout-minutes: 90

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,7 @@ server cluster OnOff = 6 {
readonly attribute boolean globalSceneControl = 16384;
attribute int16u onTime = 16385;
attribute int16u offWaitTime = 16386;
attribute enum8 startUpOnOff = 16387;
attribute nullable enum8 startUpOnOff = 16387;
readonly global attribute bitmap32 featureMap = 65532;
readonly global attribute int16u clusterRevision = 65533;

Expand Down
25 changes: 23 additions & 2 deletions examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
#include "Globals.h"
#include "LEDWidget.h"
#include "WiFiWidget.h"
#include "esp_bt.h"
#include "esp_check.h"
#include "esp_err.h"
#include "esp_heap_caps.h"
#include "esp_log.h"
#include "esp_nimble_hci.h"
#include "nimble/nimble_port.h"
#include "route_hook/esp_route_hook.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
Expand Down Expand Up @@ -114,9 +117,27 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
ESP_LOGI(TAG, "CHIPoBLE disconnected");
break;

case DeviceEventType::kCommissioningComplete:
case DeviceEventType::kCommissioningComplete: {
ESP_LOGI(TAG, "Commissioning complete");
break;
#if CONFIG_BT_NIMBLE_ENABLED && CONFIG_DEINIT_BLE_ON_COMMISSIONING_COMPLETE
int ret = nimble_port_stop();
if (ret == 0)
{
nimble_port_deinit();
esp_err_t err = esp_nimble_hci_and_controller_deinit();
err += esp_bt_mem_release(ESP_BT_MODE_BLE);
if (err == ESP_OK)
{
ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed");
}
}
else
{
ESP_LOGW(TAG, "nimble_port_stop() failed");
}
#endif
}
break;

case DeviceEventType::kInterfaceIpAddressChanged:
if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) ||
Expand Down
5 changes: 5 additions & 0 deletions examples/all-clusters-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ menu "Demo"
help
Each board has a status led, define its pin number.

config DEINIT_BLE_ON_COMMISSIONING_COMPLETE
bool "Disable and DeInit BLE on commissioning complete"
default y
help
Disable and deinit BLE and reclaim all its memory, once the commissioning is successful and Commissioning complete event is received in the application.
endmenu

menu "PW RPC Debug channel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class {{filename}}: public TestCommandBridge
{{else}}
{{#if (isString type)}}@"{{/if}}{{definedValue}}{{#if (isString type)}}"{{/if}}
{{~/if~}}
{{/chip_tests_item_parameters}});
{{/chip_tests_item_parameters}}
{{additionalArguments}});
{{else}}
CHIPDevice * device = GetConnectedDevice();
CHIPTest{{asUpperCamelCase cluster}} * cluster = [[CHIPTest{{asUpperCamelCase cluster}} alloc] initWithDevice:device endpoint:{{endpoint}} queue:mCallbackQueue];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ class {{filename}}Suite: public TestCommand
{{~else if (isString type)}}"{{definedValue}}"
{{else}}{{definedValue}}
{{~/if~}}
{{/chip_tests_item_parameters}});
{{/chip_tests_item_parameters}}
{{additionalArguments}});
}
{{else if isWait}}
CHIP_ERROR {{>testCommand}}()
Expand Down
24 changes: 24 additions & 0 deletions examples/light-switch-app/efr32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,27 @@ tracking code inside the `trackAlloc` and `trackFree` function
For the description of Software Update process with EFR32 example applications
see
[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md)
## Building options
All of Silabs's examples within the Matter repo have all the features enabled by
default, as to provide the best end user experience. However some of those
features can easily be toggled on or off. Here is a short list of options :
### Disabling logging
chip_progress_logging, chip_detail_logging, chip_automation_logging
$ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false"
### Debug build / release build
is_debug
$ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "is_debug=false"
### Disabling LCD
show_qr_code
$ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "show_qr_code=false"
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ client cluster OnOff = 6 {
readonly attribute boolean globalSceneControl = 16384;
attribute int16u onTime = 16385;
attribute int16u offWaitTime = 16386;
attribute enum8 startUpOnOff = 16387;
attribute nullable enum8 startUpOnOff = 16387;
readonly global attribute attrib_id attributeList[] = 65531;
readonly global attribute bitmap32 featureMap = 65532;
readonly global attribute int16u clusterRevision = 65533;
Expand Down
25 changes: 25 additions & 0 deletions examples/lighting-app/efr32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,28 @@ commands to multiples devices at once. Please refer to the
[chip-tool documentation](../../chip-tool/README.md) _Configuring the server
side for Group Commands_ and _Using the Client to Send Group (Multicast) Matter
Commands_
## Building options
All of Silabs's examples within the Matter repo have all the features enabled by
default, as to provide the best end user experience. However some of those
features can easily be toggled on or off. Here is a short list of options to be
passed to the build scripts.
### Disabling logging
chip_progress_logging, chip_detail_logging, chip_automation_logging
$ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false"
### Debug build / release build
is_debug
$ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "is_debug=false"
### Disabling LCD
show_qr_code
$ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "show_qr_code=false"
25 changes: 23 additions & 2 deletions examples/lighting-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@
#include "DeviceCallbacks.h"
#include "LEDWidget.h"

#include "esp_bt.h"
#include "esp_err.h"
#include "esp_heap_caps.h"
#include "esp_log.h"
#include "esp_nimble_hci.h"
#include "nimble/nimble_port.h"
#include "route_hook/esp_route_hook.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
Expand Down Expand Up @@ -66,9 +69,27 @@ void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_
ESP_LOGI(TAG, "CHIPoBLE disconnected");
break;

case DeviceEventType::kCommissioningComplete:
case DeviceEventType::kCommissioningComplete: {
ESP_LOGI(TAG, "Commissioning complete");
break;
#if CONFIG_BT_NIMBLE_ENABLED && CONFIG_DEINIT_BLE_ON_COMMISSIONING_COMPLETE
int ret = nimble_port_stop();
if (ret == 0)
{
nimble_port_deinit();
esp_err_t err = esp_nimble_hci_and_controller_deinit();
err += esp_bt_mem_release(ESP_BT_MODE_BLE);
if (err == ESP_OK)
{
ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed");
}
}
else
{
ESP_LOGW(TAG, "nimble_port_stop() failed");
}
#endif
}
break;

case DeviceEventType::kInterfaceIpAddressChanged:
if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) ||
Expand Down
5 changes: 5 additions & 0 deletions examples/lighting-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,9 @@ menu "Demo"
default 4 if RENDEZVOUS_MODE_THREAD
default 8 if RENDEZVOUS_MODE_ETHERNET

config DEINIT_BLE_ON_COMMISSIONING_COMPLETE
bool "Disable and DeInit BLE on commissioning complete"
default y
help
Disable and deinit BLE and reclaim all its memory, once the commissioning is successful and Commissioning complete event is received in the application.
endmenu
2 changes: 1 addition & 1 deletion examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ server cluster OnOff = 6 {
readonly attribute boolean globalSceneControl = 16384;
attribute int16u onTime = 16385;
attribute int16u offWaitTime = 16386;
attribute enum8 startUpOnOff = 16387;
attribute nullable enum8 startUpOnOff = 16387;
readonly global attribute bitmap32 featureMap = 65532;
readonly global attribute int16u clusterRevision = 65533;

Expand Down
24 changes: 24 additions & 0 deletions examples/lock-app/efr32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,27 @@ tracking code inside the `trackAlloc` and `trackFree` function
For the description of Software Update process with EFR32 example applications
see
[EFR32 OTA Software Update](../../../docs/guides/silabs_efr32_software_update.md)
## Building options
All of Silabs's examples within the Matter repo have all the features enabled by
default, as to provide the best end user experience. However some of those
features can easily be toggled on or off. Here is a short list of options :
### Disabling logging
chip_progress_logging, chip_detail_logging, chip_automation_logging
$ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "chip_detail_logging=false chip_automation_logging=false chip_progress_logging=false"
### Debug build / release build
is_debug
$ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "is_debug=false"
### Disabling LCD
show_qr_code
$ ./scripts/examples/gn_efr32_example.sh ./examples/lighting-app/efr32 ./out/lighting-app BRD4164A "show_qr_code=false"
4 changes: 2 additions & 2 deletions examples/lock-app/esp32/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ CHIP_ERROR AppTask::Init()

sLockLED.Set(!BoltLockMgr().IsUnlocked());

UpdateClusterState();
chip::DeviceLayer::SystemLayer().ScheduleWork(UpdateClusterState, nullptr);

ConfigurationMgr().LogDeviceConfig();

Expand Down Expand Up @@ -462,7 +462,7 @@ void AppTask::DispatchEvent(AppEvent * aEvent)
}

/* if unlocked then it locked it first*/
void AppTask::UpdateClusterState(void)
void AppTask::UpdateClusterState(chip::System::Layer *, void * context)
{
uint8_t newValue = !BoltLockMgr().IsUnlocked();

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/esp32/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class AppTask
static void LockActionEventHandler(AppEvent * aEvent);
static void TimerEventHandler(TimerHandle_t xTimer);

static void UpdateClusterState(void);
static void UpdateClusterState(chip::System::Layer *, void * context);

void StartTimer(uint32_t aTimeoutMs);

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/lock-common/lock-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ server cluster OnOff = 6 {
readonly attribute boolean globalSceneControl = 16384;
attribute int16u onTime = 16385;
attribute int16u offWaitTime = 16386;
attribute enum8 startUpOnOff = 16387;
attribute nullable enum8 startUpOnOff = 16387;
readonly global attribute bitmap32 featureMap = 65532;
readonly global attribute int16u clusterRevision = 65533;

Expand Down
6 changes: 4 additions & 2 deletions examples/ota-provider-app/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug c
| -t/--delayedQueryActionTimeSec <time> | Value in seconds for the DelayedActionTime field in the first QueryImageResponse. <br> Value will revert back to 0 seconds on subsequent QueryImage Responses. |
| -p/--delayedApplyActionTimeSec <time> | Value in seconds for the DelayedActionTime field in the first ApplyUpdateResponse. <br> Value will revert back to 0 seconds on subsequent ApplyUpdate Responses. |
| -u/--userConsentState <granted \| denied \| deferred> | The user consent state for the first QueryImageResponse. For all subsequent responses, the value of granted state will be used. <br> Current user consent state which results in various values for Status field in QueryImageResponse <br> Note that -q/--queryImageStatus overrides this option <li> granted: Status field in QueryImageResponse is set to updateAvailable <li> denied: Status field in QueryImageResponse is set to updateNotAvailable <li> deferred: Status field in QueryImageResponse is set to busy |
| -s/--softwareVersion <version> | Value for the SoftwareVersion field in the QueryImageResponse <br> Note that -o/--otaImageList overrides this option |
| -S/--softwareVersionStr <version string> | Value for the SoftwareVersionString field in the QueryImageResponse <br> Note that -o/--otaImageList overrides this option |
| -c/--UserConsentNeeded | If provided, and value of RequestorCanConsent field in QueryImage Command is true, <br> then value of UserConsentNeeded field in the QueryImageResponse is set to true. <br> Else, value of UserConsentNeeded is false. |

**Using `--filepath` and `--otaImageList`**
Expand All @@ -39,6 +37,10 @@ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug c
- If `--otaImageList` is supplied, the application will parse the JSON file
and extract all required data. The most recent/valid software version will
be selected and the corresponding OTA file will be sent to the OTA Requestor
- The SoftwareVersion and SoftwareVersionString sent in the QueryImageResponse
is derived from the OTA image header. Please note that if the version in the
`--otaImageList` JSON file does not match that in the header, the
application will terminate.

An example of the `--otaImageList` file contents:

Expand Down
Loading

0 comments on commit 20ba104

Please sign in to comment.