Skip to content

Commit

Permalink
Merge branch 'master' into ci
Browse files Browse the repository at this point in the history
  • Loading branch information
abiradarti authored Feb 6, 2023
2 parents 43032b1 + b878598 commit ed1c812
Show file tree
Hide file tree
Showing 114 changed files with 3,156 additions and 422 deletions.
2 changes: 1 addition & 1 deletion .github/boring-cyborg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ labelPRBasedOnFilePath:
- src/darwin/*

efr32:
- src/platform/EFR32/*
- src/platform/efr32/*

esp32:
- src/platform/ESP32/*
Expand Down
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ darwin:
- examples/darwin-framework-tool/**/*

efr32:
- src/platform/EFR32/*
- src/platform/EFR32/**/*
- src/platform/efr32/*
- src/platform/efr32/**/*

esp32:
- src/platform/ESP32/*
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,30 @@ jobs:
--tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
--bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \
"
- name: Run Tests using chip-repl
- name: Run Tests using chip-repl (skip slow)
timeout-minutes: 45
if: github.event_name == 'pull_request'
run: |
./scripts/run_in_build_env.sh \
"./scripts/tests/run_test_suite.py \
--run-yamltests-with-chip-repl \
--exclude-tags MANUAL \
--exclude-tags FLAKY \
--exclude-tags IN_DEVELOPMENT \
--exclude-tags SLOW \
run \
--iterations 1 \
--test-timeout-seconds 120 \
--all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \
--lock-app ./out/linux-x64-lock-${BUILD_VARIANT}/chip-lock-app \
--ota-provider-app ./out/linux-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \
--ota-requestor-app ./out/linux-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \
--tv-app ./out/linux-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \
--bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \
"
- name: Run Tests using chip-repl (including slow)
timeout-minutes: 45
if: github.event_name == 'push'
run: |
./scripts/run_in_build_env.sh \
"./scripts/tests/run_test_suite.py \
Expand Down
14 changes: 9 additions & 5 deletions docs/guides/chip_tool_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,10 @@ In this command:

- _<node_id\>_ is the user-defined ID of the node being commissioned.
- _<operational_dataset\>_ is the Operational Dataset determined in the
step 3.
[step 4](#step-4-determine-network-pairing-credentials).
- _<pin_code\>_ and _<discriminator\>_ are device-specific keys determined in
the step 4.
the
[step 5](#step-5-determine-matter-devices-discriminator-and-setup-pin-code).

##### Commissioning into Wi-Fi network over Bluetooth LE

Expand All @@ -231,7 +232,8 @@ In this command:
- _<node_id\>_ is the user-defined ID of the node being commissioned.
- _<ssid\>_ and _<password\>_ are credentials determined in the step 3.
- _<pin_code\>_ and _<discriminator\>_ are device-specific keys determined in
the step 4.
the
[step 5](#step-5-determine-matter-devices-discriminator-and-setup-pin-code).

If you prefer the hexadecimal format, use the `hex:` prefix. For example:

Expand Down Expand Up @@ -263,7 +265,8 @@ $ ./chip-tool pairing onnetwork <node_id> <pin_code>
In this command:

- _<node_id\>_ is the user-defined ID of the node being commissioned.
- _<pin_code\>_ is device specific _setup PIN code_ determined in the step 4
- _<pin_code\>_ is device specific _setup PIN code_ determined in the
[step 5](#step-5-determine-matter-devices-discriminator-and-setup-pin-code)
and used to discover the device.

##### Commissioning with long discriminator
Expand All @@ -279,7 +282,8 @@ In this command:

- _<node_id\>_ is the user-defined ID of the node being commissioned.
- _<pin_code\>_ and _<discriminator\>_ are device specific keys determined in
the step 4.
the
[step 5](#step-5-determine-matter-devices-discriminator-and-setup-pin-code).

##### Commissioning with QR code payload or manual pairing code

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/esp32/build_app_and_commission.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ $ out/debug/chip-tool pairing ble-wifi 12345 MY_SSID MY_PASSWORD 20202021 3840
#### Commissioning the Ethernet device (ESP32-Ethernet-Kit)

```
$ out/debug/chip-tool pairing ethernet 12345 20202021 3840 device-remote-ip 5540
$ out/debug/chip-tool pairing onnetwork 12345 20202021
```

Note: In order to commission an ethernet device, from all-clusters-app enable
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ efr32_sdk("sdk") {
]

include_dirs = [
"${chip_root}/src/platform/silabs/EFR32",
"${chip_root}/src/platform/silabs/efr32",
"${efr32_project_dir}/include",
"${examples_plat_dir}",
"${chip_root}/src/lib",
Expand Down
2 changes: 1 addition & 1 deletion examples/chef/efr32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")
import("${chip_root}/src/platform/EFR32/args.gni")
import("${chip_root}/src/platform/efr32/args.gni")

efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain")

Expand Down
2 changes: 1 addition & 1 deletion examples/chef/efr32/build_for_wifi_args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ import("//build_overrides/chip.gni")

efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain")
chip_enable_openthread = false
import("${chip_root}/src/platform/EFR32/wifi_args.gni")
import("${chip_root}/src/platform/efr32/wifi_args.gni")

chip_enable_ota_requestor = true
2 changes: 1 addition & 1 deletion examples/common/pigweed/rpc_services/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class Device : public pw_rpc::nanopb::Device::Service<Device>
if (DeviceLayer::GetDeviceInstanceInfoProvider()->GetSerialNumber(response.serial_number, sizeof(response.serial_number)) !=
CHIP_NO_ERROR)
{
return pw::Status::Internal();
response.serial_number[0] = '\0'; // optional serial field not set.
}

// Create buffer for QR code that can fit max size and null terminator.
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ efr32_executable("light_switch_app") {
]

if (use_wstk_leds) {
#sources += [ "${examples_plat_dir}/LEDWidget.cpp" ]
sources += [ "${examples_plat_dir}/LEDWidget.cpp" ]
}

if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli ||
Expand Down
51 changes: 6 additions & 45 deletions examples/light-switch-app/silabs/SiWx917/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,49 +38,10 @@
/**********************************************************
* Defines
*********************************************************/

#define SL_SIMPLE_BUTTON_MODE_POLL 0U ///< BUTTON input capture using polling
#define SL_SIMPLE_BUTTON_MODE_POLL_AND_DEBOUNCE 1U ///< BUTTON input capture using polling and debouncing
#define SL_SIMPLE_BUTTON_MODE_INTERRUPT 2U ///< BUTTON input capture using interrupt

#define SL_SIMPLE_BUTTON_DISABLED 2U ///< BUTTON state is disabled
#define SL_SIMPLE_BUTTON_PRESSED 1U ///< BUTTON state is pressed
#define SL_SIMPLE_BUTTON_RELEASED 0U ///< BUTTON state is released

typedef uint8_t sl_button_mode_t; ///< BUTTON mode
typedef uint8_t sl_button_state_t; ///< BUTTON state
typedef struct sl_button sl_button_t;

/// A BUTTON instance
typedef struct sl_button
{
void * context; ///< The context for this BUTTON instance
void (*init)(const sl_button_t * handle); ///< Member function to initialize BUTTON instance
void (*poll)(const sl_button_t * handle); ///< Member function to poll BUTTON
void (*enable)(const sl_button_t * handle); ///< Member function to enable BUTTON
void (*disable)(const sl_button_t * handle); ///< Member function to disable BUTTON
sl_button_state_t (*get_state)(const sl_button_t * handle); ///< Member function to retrieve BUTTON state
} sl_button;

const sl_button_t sl_button_btn0 = {
.context = NULL,
.init = NULL,
.poll = NULL,
.enable = NULL,
.disable = NULL,
.get_state = NULL,
};
#define APP_FUNCTION_BUTTON &sl_button_btn0

const sl_button_t sl_button_btn1 = {
.context = NULL,
.init = NULL,
.poll = NULL,
.enable = NULL,
.disable = NULL,
.get_state = NULL,
};
#define APP_LIGHT_SWITCH &sl_button_btn1
// Button specific defines for SiWx917
#define SL_SIMPLE_BUTTON_PRESSED 1U
#define SIWx917_BTN0 0
#define SIWx917_BTN1 1

// Application-defined error codes in the CHIP_ERROR space.
#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01)
Expand Down Expand Up @@ -115,11 +76,11 @@ class AppTask : public BaseApplication
* @brief Event handler when a button is pressed
* Function posts an event for button processing
*
* @param buttonHandle APP_LIGHT_SWITCH or APP_FUNCTION_BUTTON
* @param button - btn0 or btn1
* @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED,
* SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED
*/
void ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAction);
void ButtonEventHandler(uint8_t button, uint8_t btnAction);

/**
* @brief Callback called by the identify-server when an identify command is received
Expand Down
20 changes: 11 additions & 9 deletions examples/light-switch-app/silabs/SiWx917/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@

#define SYSTEM_STATE_LED &sl_led_led0

#define APP_FUNCTION_BUTTON &sl_button_btn0
#define APP_LIGHT_SWITCH &sl_button_btn1

namespace {

constexpr chip::EndpointId kLightSwitchEndpoint = 1;
Expand Down Expand Up @@ -258,14 +255,19 @@ void AppTask::SwitchActionEventHandler(AppEvent * aEvent)
}
}

void AppTask::ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAction)
void AppTask::ButtonEventHandler(uint8_t button, uint8_t btnAction)
{
VerifyOrReturn(buttonHandle != NULL);

AppEvent button_event = {};
button_event.Type = AppEvent::kEventType_Button;
button_event.ButtonEvent.Action = btnAction;

button_event.Handler = SwitchActionEventHandler;
sAppTask.PostEvent(&button_event);
if (button == SIWx917_BTN1)
{
button_event.Handler = SwitchActionEventHandler;
sAppTask.PostEvent(&button_event);
}
else if (button == SIWx917_BTN0)
{
button_event.Handler = BaseApplication::ButtonHandler;
sAppTask.PostEvent(&button_event);
}
}
6 changes: 3 additions & 3 deletions examples/light-switch-app/silabs/SiWx917/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define BLE_DEV_NAME "SiLabs-Light-Switch"

extern "C" void sl_button_on_change();
extern "C" void sl_button_on_change(uint8_t btn, uint8_t btnAction);

using namespace ::chip;
using namespace ::chip::Inet;
Expand Down Expand Up @@ -81,7 +81,7 @@ int main(void)
appError(CHIP_ERROR_INTERNAL);
}

void sl_button_on_change()
void sl_button_on_change(uint8_t btn, uint8_t btnAction)
{
AppTask::GetAppTask().ButtonEventHandler(APP_LIGHT_SWITCH, SL_SIMPLE_BUTTON_PRESSED);
AppTask::GetAppTask().ButtonEventHandler(btn, btnAction);
}
2 changes: 1 addition & 1 deletion examples/light-switch-app/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ efr32_sdk("sdk") {

include_dirs = [
"${chip_root}/examples/light-switch-app/silabs/common",
"${chip_root}/src/platform/silabs/EFR32",
"${chip_root}/src/platform/silabs/efr32",
"${efr32_project_dir}/include",
"${examples_plat_dir}",
"${chip_root}/src/lib",
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/silabs/efr32/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import("//build_overrides/chip.gni")
import("${chip_root}/config/standalone/args.gni")
import("${chip_root}/src/platform/silabs/EFR32/args.gni")
import("${chip_root}/src/platform/silabs/efr32/args.gni")

efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import("${chip_root}/config/standalone/args.gni")

efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain")
chip_enable_openthread = false
import("${chip_root}/src/platform/silabs/EFR32/wifi_args.gni")
import("${chip_root}/src/platform/silabs/efr32/wifi_args.gni")

chip_enable_ota_requestor = true
app_data_model = "${chip_root}/examples/light-switch-app/light-switch-common"
3 changes: 1 addition & 2 deletions examples/lighting-app/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ efr32_executable("lighting_app") {
]

if (use_wstk_leds) {
# TODO: Commentting for CCP till the bring up of this is done
#sources += [ "${examples_plat_dir}/LEDWidget.cpp" ]
sources += [ "${examples_plat_dir}/LEDWidget.cpp" ]
}

if (chip_enable_pw_rpc || chip_build_libshell || use_rs911x) {
Expand Down
14 changes: 14 additions & 0 deletions examples/lighting-app/silabs/SiWx917/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
/**********************************************************
* Defines
*********************************************************/
// Button specific defines for SiWx917
#define SL_SIMPLE_BUTTON_PRESSED 1
#define SIWx917_BTN0 0
#define SIWx917_BTN1 1

// Application-defined error codes in the CHIP_ERROR space.
#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01)
Expand Down Expand Up @@ -69,6 +73,16 @@ class AppTask : public BaseApplication

CHIP_ERROR StartAppTask();

/**
* @brief Event handler when a button is pressed
* Function posts an event for button processing
*
* @param button - btn0 or btn1
* @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED,
* SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED
*/
void ButtonEventHandler(uint8_t button, uint8_t btnAction);

/**
* @brief Callback called by the identify-server when an identify command is received
*
Expand Down
Loading

0 comments on commit ed1c812

Please sign in to comment.