Skip to content

Commit

Permalink
Merge branch 'master' into esp32/add_aaaa_query
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 authored Apr 20, 2023
2 parents 1196ef3 + e2341d8 commit 99c97b2
Show file tree
Hide file tree
Showing 236 changed files with 4,764 additions and 9,792 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/examples-infineon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ jobs:
"./scripts/build/build_examples.py \
--target cyw30739-cyw930739m2evb_01-light \
--target cyw30739-cyw930739m2evb_01-lock \
--target cyw30739-cyw930739m2evb_01-ota-requestor-no-progress-logging \
--target cyw30739-cyw930739m2evb_01-ota-requestor \
--target cyw30739-cyw930739m2evb_01-switch \
build \
--copy-artifacts-to out/artifacts \
"
Expand All @@ -163,8 +164,15 @@ jobs:
timeout-minutes: 5
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
cyw30739 cyw930739m2evb_01 ota-requestor-no-progress-logging \
out/artifacts/cyw30739-cyw930739m2evb_01-ota-requestor-no-progress-logging/chip-cyw30739-ota-requestor-example.elf \
cyw30739 cyw930739m2evb_01 ota-requestor \
out/artifacts/cyw30739-cyw930739m2evb_01-ota-requestor/chip-cyw30739-ota-requestor-example.elf \
/tmp/bloat_reports/
- name: Get switch size stats
timeout-minutes: 5
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
cyw30739 cyw930739m2evb_01 switch \
out/artifacts/cyw30739-cyw930739m2evb_01-switch/chip-cyw30739-light-switch-example.elf \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: actions/upload-artifact@v3
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/examples-linux-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@ jobs:
linux debug bridge-app \
out/linux-x64-bridge/chip-bridge-app \
/tmp/bloat_reports/
- name: Build example Dynamic Bridge
timeout-minutes: 10
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target linux-x64-dynamic-bridge-ipv6only \
build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
linux debug dynamic-bridge-app-ipv6only \
out/linux-x64-dynamic-bridge-ipv6only/dynamic-chip-bridge-app \
/tmp/bloat_reports/
- name: Build example OTA Provider
timeout-minutes: 10
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qemu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target tizen-arm-tests-no-ble \
--target tizen-arm-tests-no-ble-no-thread \
build
"
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,6 @@
"files.trimFinalNewlines": true,
"C_Cpp.default.cppStandard": "gnu++14",
"C_Cpp.default.cStandard": "gnu11",
"cmake.configureOnOpen": false
"cmake.configureOnOpen": false,
"search.followSymlinks": false
}
23 changes: 23 additions & 0 deletions config/nrfconnect/chip-module/Kconfig.features
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,27 @@ config CHIP_WIFI_CONNECTION_RECOVERY_JITTER
a random jitter interval is added to it to avoid periodicity. The random jitter is selected
within range [-JITTER; +JITTER].

config CHIP_ICD_SUBSCRIPTION_HANDLING
bool "Enables platform specific handling of ICD subscriptions"
help
Enables platform specific implementation that handles ICD subscription requests
and selects subscription report interval value considering maximum interval preferred
by the publisher.

if CHIP_ICD_SUBSCRIPTION_HANDLING

config CHIP_MAX_PREFERRED_SUBSCRIPTION_REPORT_INTERVAL
int "Maximum preferred interval of sending subscription reports (s)"
default 60
help
Provides maximum preferred interval to be used by a publisher for negotiation
of the final maximum subscription report interval, after receiving a subscription
request from the initiator. This value should be selected as a compromise between
keeping the power consumption low due to not sending reports too often, and allowing
the initiator device to detect the publisher absence reasonably fast due to not sending
the reports too rarely. The current algorithm is to select bigger value from the one
requested by the initiator and the one preferred by the publisher.

endif # CHIP_ICD_SUBSCRIPTION_HANDLING

endif # CHIP
8 changes: 3 additions & 5 deletions config/telink/app/zephyr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ CONFIG_SERIAL=y
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_PRINTK=y
CONFIG_ASSERT=y
# CONFIG_ASSERT=y
CONFIG_CBPRINTF_LIBC_SUBSTS=y

# Set the maximum log level (DEBUG)
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_MATTER_LOG_LEVEL_DBG=y
CONFIG_MCUBOOT_BOOTUTIL_LIB=y
CONFIG_MCUBOOT_UTIL_LOG_LEVEL_DBG=y
CONFIG_NET_LOG=y
CONFIG_IEEE802154_DRIVER_LOG_LEVEL_DBG=y
CONFIG_NVS_LOG_LEVEL_DBG=y
CONFIG_OPENTHREAD_LOG_LEVEL_DEBG=y
Expand Down Expand Up @@ -125,10 +127,6 @@ CONFIG_TELINK_B91_REBOOT_ON_FAULT=y

# Shell settings
CONFIG_SHELL=n
CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=255

# Legacy
CONFIG_LEGACY_INCLUDE_PATH=y

# BLE MAC address
CONFIG_B91_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000
10 changes: 7 additions & 3 deletions config/telink/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,20 @@ config CHIP_LOG_SIZE_OPTIMIZATION

config CHIP_BUTTON_MANAGER_IRQ_MODE
bool "Use GPIO in an IRQ mode instead of polling the GPIO"
default n
default PM
help
Use GPIO in an IRQ mode to avoid button polling loop and extend the battery lifetime by waking up by GPIO event.
GPIO events are working only with GPIO IRQ. This option changes button matrix configuration.

config CHIP_ENABLE_APPLICATION_STATUS_LED
bool "Enable application status LED"
default y
default !(PM)
help
Enable application status LED.

config CHIP_ENABLE_PM_DURING_BLE
bool "Enable PM during BLE operation"
default y
default PM
help
Enable PM during BLE operation.

Expand All @@ -175,3 +175,7 @@ config CHIP_OPENTHREAD_TX_POWER
default 0
help
OpenThread Transmission power in dBm.

config SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE
int
default 255 if SHELL_BACKEND_SERIAL
16 changes: 16 additions & 0 deletions docs/guides/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,26 @@ sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev \
python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev
```

#### UI builds

If building `-with-ui` variant, also install SDL2:

```
sudo apt-get install libsdl2-dev
```

### Installing prerequisites on macOS

On macOS, install Xcode from the Mac App Store.

#### UI builds

If building `-with-ui` variant, also install SDL2:

```
brew install sdl2
```

### Installing prerequisites on Raspberry Pi 4

Complete the following steps:
Expand Down
4 changes: 3 additions & 1 deletion examples/all-clusters-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ target_include_directories(app PRIVATE
${ALL_CLUSTERS_COMMON_DIR}/include
${GEN_DIR}/app-common
${GEN_DIR}/all-clusters-app
${TELINK_COMMON}/common/include
${TELINK_COMMON}/util/include)

add_definitions(
Expand All @@ -69,11 +70,12 @@ add_definitions(

target_sources(app PRIVATE
src/AppTask.cpp
src/main.cpp
src/ZclDoorLockCallbacks.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-modes-manager.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/bridged-actions-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp
${TELINK_COMMON}/common/src/mainCommon.cpp
${TELINK_COMMON}/common/src/AppTaskCommon.cpp
${TELINK_COMMON}/util/src/LEDWidget.cpp
${TELINK_COMMON}/util/src/ButtonManager.cpp
${TELINK_COMMON}/util/src/ThreadUtil.cpp
Expand Down
18 changes: 6 additions & 12 deletions examples/all-clusters-app/telink/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@
#pragma once

// ---- All Clusters Application example config ----
#define APP_USE_EXAMPLE_START_BUTTON 0
#define APP_USE_THREAD_START_BUTTON 1
#define APP_SET_DEVICE_INFO_PROVIDER 1
#define APP_SET_NETWORK_COMM_ENDPOINT_SEC 1
#define APP_USE_IDENTIFY_PWM 1 // APP_USE_IDENTIFY_PWM must be defined before including "AppConfigCommon.h"

// Buttons config
#define BUTTON_PORT DEVICE_DT_GET(DT_NODELABEL(gpioc))

#define BUTTON_PIN_1 2
#define BUTTON_PIN_3 3
#define BUTTON_PIN_4 1
#define BUTTON_PIN_2 0

// LEDs config
#define LEDS_PORT DEVICE_DT_GET(DT_NODELABEL(gpiob))
#define SYSTEM_STATE_LED 7
#define LIGHTING_PWM_SPEC_IDENTIFY_GREEN PWM_DT_SPEC_GET(DT_ALIAS(pwm_led3))
#include "AppConfigCommon.h"
62 changes: 4 additions & 58 deletions examples/all-clusters-app/telink/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,71 +18,17 @@

#pragma once

#include "AppEvent.h"
#if CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED
#include "LEDWidget.h"
#endif
#include "PWMDevice.h"
#include "AppTaskCommon.h"

#include <zephyr/drivers/gpio.h>

#include <platform/CHIPDeviceLayer.h>

#if CONFIG_CHIP_FACTORY_DATA
#include <platform/telink/FactoryDataProvider.h>
#endif

#include <cstdint>

struct k_timer;
struct Identify;

class AppTask
class AppTask : public AppTaskCommon
{
public:
CHIP_ERROR StartApp(void);

void PostEvent(AppEvent * event);
static void IdentifyEffectHandler(EmberAfIdentifyEffectIdentifier aEffect);

private:
friend AppTask & GetAppTask(void);
friend class AppTaskCommon;

CHIP_ERROR Init(void);

static void ActionIdentifyStateUpdateHandler(k_timer * timer);

void DispatchEvent(AppEvent * event);

#if CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED
static void UpdateLedStateEventHandler(AppEvent * aEvent);
static void LEDStateUpdateHandler(LEDWidget * ledWidget);
static void UpdateStatusLED();
#endif
static void FactoryResetButtonEventHandler(void);
static void StartThreadButtonEventHandler(void);
static void StartBleAdvButtonEventHandler(void);

static void ChipEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);

static void FactoryResetTimerTimeoutCallback(k_timer * timer);

static void FactoryResetTimerEventHandler(AppEvent * aEvent);
static void FactoryResetHandler(AppEvent * aEvent);
static void StartThreadHandler(AppEvent * aEvent);
static void StartBleAdvHandler(AppEvent * aEvent);
static void UpdateIdentifyStateEventHandler(AppEvent * aEvent);

static void InitButtons(void);

static void ThreadProvisioningHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg);
CHIP_ERROR Init();

static AppTask sAppTask;
PWMDevice mPwmIdentifyLed;

#if CONFIG_CHIP_FACTORY_DATA
chip::DeviceLayer::FactoryDataProvider<chip::DeviceLayer::ExternalFlashFactoryData> mFactoryDataProvider;
#endif
};

inline AppTask & GetAppTask(void)
Expand Down
10 changes: 0 additions & 10 deletions examples/all-clusters-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ CONFIG_PWM=y

# OpenThread configs
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n
CONFIG_CHIP_SED_IDLE_INTERVAL=200
CONFIG_CHIP_THREAD_SSED=n

# Default OpenThread network settings
Expand Down Expand Up @@ -63,13 +61,5 @@ CONFIG_CHIP_FACTORY_DATA=n
CONFIG_CHIP_FACTORY_DATA_BUILD=n
CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n

# Enable Button IRQ mode. The poling mode is used by default.
CONFIG_CHIP_BUTTON_MANAGER_IRQ_MODE=n

# Disable Status LED.
CONFIG_CHIP_ENABLE_APPLICATION_STATUS_LED=y

# Enable Power Management
CONFIG_PM=n
CONFIG_PM_DEVICE=n
CONFIG_CHIP_ENABLE_PM_DURING_BLE=n
Loading

0 comments on commit 99c97b2

Please sign in to comment.