Skip to content

Commit

Permalink
Merge branch 'master' into feature/enable-message-cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov authored Feb 2, 2024
2 parents f9d3713 + 8834be1 commit d6a533a
Show file tree
Hide file tree
Showing 91 changed files with 1,836 additions and 435 deletions.
13 changes: 13 additions & 0 deletions config/esp32/components/chip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ menu "CHIP Core"
help
Enable this option to use LwIP default IPv6 route hook for Route Information Option(RIO) feature.

config ENABLE_ENDPOINT_QUEUE_FILTER
bool "Enable UDP Endpoint queue filter for mDNS Broadcast packets"
depends on USE_MINIMAL_MDNS
default y
help
Enable this option to start a UDP Endpoint queue filter for mDNS Broadcast packets

config ENABLE_LWIP_THREAD_SAFETY
bool "Enable LwIP Thread safety options"
default y
Expand Down Expand Up @@ -1038,6 +1045,12 @@ menu "CHIP Device Layer"

endmenu

config CHIP_ENABLE_BDX_LOG_TRANSFER
bool "Enable BDX log transfer"
default n
help
Enables the BDX protocol for diagnostics log transfer

menu "Matter OTA Image"

config CHIP_OTA_IMAGE_BUILD
Expand Down
4 changes: 4 additions & 0 deletions config/telink/chip-module/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ config CHIP_ENABLE_POWER_ON_FACTORY_RESET
first 5 seconds after power on and this sequence repeated 5 times - factory
reset will be involved.

config CHIP_TASK_STACK_SIZE
int
default 8192

config CHIP_USE_MARS_SENSOR
bool "Use Mars board sensor"
depends on SOC_SERIES_RISCV_TELINK_B9X && (BOARD_TLSR9518ADK80D || BOARD_TLSR9518ADK80D_RETENTION)
Expand Down
5 changes: 4 additions & 1 deletion config/telink/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ config SETTINGS_NVS_SECTOR_SIZE_MULT

# Set sector counter of NVS
config SETTINGS_NVS_SECTOR_COUNT
default 10
default 12

# Enable OpenThread

Expand Down Expand Up @@ -329,4 +329,7 @@ config PWM_SHELL
config OPENTHREAD_SHELL
default n

config CHIP_TASK_STACK_SIZE
default 4864 if PM

endif
13 changes: 13 additions & 0 deletions examples/air-quality-sensor-app/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,16 @@ Generate event `CarbonDioxideConcentrationMeasurement`, to change the CO2 value.
```
$ echo '{"Name":"CarbonDioxideConcentrationMeasurement","NewValue":400}' > /tmp/chip_air_quality_fifo_<PID>
```

Generate event `CarbonMonoxideConcentrationMeasurement`, to change the CO value.

```
$ echo '{"Name":"CarbonMonoxideConcentrationMeasurement","NewValue":1}' > /tmp/chip_air_quality_fifo_<PID>
```

Generate event `NitrogenDioxideConcentrationMeasurement`, to change the NO₂
value.

```
$ echo '{"Name":"NitrogenDioxideConcentrationMeasurement","NewValue":1}' > /tmp/chip_air_quality_fifo_<PID>
```
Original file line number Diff line number Diff line change
Expand Up @@ -2789,7 +2789,6 @@ endpoint 0 {
ram attribute clusterRevision default = 1;

handle command OpenCommissioningWindow;
handle command OpenBasicCommissioningWindow;
handle command RevokeCommissioning;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3879,14 +3879,6 @@
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "OpenBasicCommissioningWindow",
"code": 1,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "RevokeCommissioning",
"code": 2,
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/silabs/openthread.gni
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true

# Openthread Configuration flags
sl_ot_idle_interval_ms = 30000 # 30s Idle Intervals
sl_ot_idle_interval_ms = 15000 # 15s Idle Intervals
sl_ot_active_interval_ms = 500 # 500ms Active Intervals

# ICD Matter Configuration flags
Expand Down
7 changes: 1 addition & 6 deletions examples/light-switch-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,24 @@
#include "AppConfig.h"
#include "AppEvent.h"
#include "BindingHandler.h"

#include "LEDWidget.h"

#include "LightSwitchMgr.h"

#ifdef DISPLAY_ENABLED
#include "lcd.h"
#ifdef QR_CODE_ENABLED
#include "qrcodegen.h"
#endif // QR_CODE_ENABLED
#endif // DISPLAY_ENABLED

#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
#include <assert.h>
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>
#include <platform/silabs/platformAbstraction/SilabsPlatform.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
#include <setup_payload/SetupPayload.h>

#include <platform/silabs/platformAbstraction/SilabsPlatform.h>

/**********************************************************
* Defines and Constants
*********************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2615,7 +2615,6 @@ endpoint 0 {
ram attribute clusterRevision default = 1;

handle command OpenCommissioningWindow;
handle command OpenBasicCommissioningWindow;
handle command RevokeCommissioning;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2968,14 +2968,6 @@
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "OpenBasicCommissioningWindow",
"code": 1,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "RevokeCommissioning",
"code": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,6 @@ endpoint 0 {
ram attribute clusterRevision default = 1;

handle command OpenCommissioningWindow;
handle command OpenBasicCommissioningWindow;
handle command RevokeCommissioning;
}

Expand Down
8 changes: 0 additions & 8 deletions examples/lighting-app/silabs/data_model/lighting-wifi-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -2152,14 +2152,6 @@
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "OpenBasicCommissioningWindow",
"code": 1,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "RevokeCommissioning",
"code": 2,
Expand Down
3 changes: 3 additions & 0 deletions examples/lighting-app/telink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,8 @@ CONFIG_CHIP_FACTORY_DATA_BUILD=n
CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n
CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n

#Enable PWM
CONFIG_PWM=y

# Enable Power Management
CONFIG_PM=n
11 changes: 11 additions & 0 deletions examples/lock-app/telink/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,16 @@
#
mainmenu "Matter Telink Lock Example Application"

if BOARD_TLSR9528A_RETENTION || BOARD_TLSR9518ADK80D_RETENTION
config COMMON_LIBC_MALLOC_ARENA_SIZE
default 9216
endif

config SETTINGS_NVS_NAME_CACHE
default y

config SETTINGS_NVS_NAME_CACHE_SIZE
default 256

rsource "../../../config/telink/chip-module/Kconfig.defaults"
source "Kconfig.zephyr"
16 changes: 16 additions & 0 deletions examples/lock-app/telink/boards/tlsr9518adk80d.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/ {
keys {
compatible = "gpio-keys";
key_5: button_5 {
gpios = <&gpioe 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
key_6: button_6 {
gpios = <&gpioe 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
};
};

&gpioe {
interrupts = <38 1>;
status = "okay";
};
16 changes: 16 additions & 0 deletions examples/lock-app/telink/boards/tlsr9528a.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/ {
keys {
compatible = "gpio-keys";
key_5: button_5 {
gpios = <&gpiob 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
key_6: button_6 {
gpios = <&gpiob 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
};
};

&gpiob {
interrupts = <39 1>;
status = "okay";
};
16 changes: 16 additions & 0 deletions examples/lock-app/telink/boards/tlsr9528a_retention.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/ {
keys {
compatible = "gpio-keys";
key_5: button_5 {
gpios = <&gpiob 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
key_6: button_6 {
gpios = <&gpiob 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
};
};

&gpiob {
interrupts = <39 1>;
status = "okay";
};
8 changes: 8 additions & 0 deletions examples/lock-app/telink/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
#define LOCK_MANAGER_CONFIG_USE_NVM_CREDENTIAL_STORAGE 1
#define LOCK_MANAGER_ACTUATOR_MOVEMENT_TIME_MS 2000

#define APP_MAX_USERS 10
#define APP_MAX_CREDENTIAL 10
#define APP_MAX_WEEKDAY_SCHEDULE_PER_USER 10
#define APP_MAX_YEARDAY_SCHEDULE_PER_USER 10
#define APP_MAX_HOLYDAY_SCHEDULE_PER_USER 10

#define APP_MAX_SCHEDULES_TOTAL 100

#define APP_DEFAULT_USERS_COUNT 5
#define APP_DEFAULT_CREDENTIAL_COUNT 5
#define APP_DEFAULT_WEEKDAY_SCHEDULE_PER_USER_COUNT 5
Expand Down
4 changes: 4 additions & 0 deletions examples/lock-app/telink/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ class AppTask : public AppTaskCommon

static void LockActionEventHandler(AppEvent * event);
static void LockStateChanged(LockManager::State_t state);
static void LockJammedEventHandler(void);
static void LockJammedActionHandler(AppEvent * aEvent);
static void LockStateEventHandler(void);
static void LockStateActionHandler(AppEvent * aEvent);

static AppTask sAppTask;
};
Expand Down
37 changes: 14 additions & 23 deletions examples/lock-app/telink/include/LockManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,27 @@

struct WeekDaysScheduleInfo
{
DlScheduleStatus status;
DlScheduleStatus status = DlScheduleStatus::kAvailable;
EmberAfPluginDoorLockWeekDaySchedule schedule;
};

struct YearDayScheduleInfo
{
DlScheduleStatus status;
DlScheduleStatus status = DlScheduleStatus::kAvailable;
EmberAfPluginDoorLockYearDaySchedule schedule;
};

struct HolidayScheduleInfo
{
DlScheduleStatus status;
DlScheduleStatus status = DlScheduleStatus::kAvailable;
EmberAfPluginDoorLockHolidaySchedule schedule;
};

namespace TelinkDoorLock {
namespace ResourceRanges {
// Used to size arrays
static constexpr uint16_t kMaxUsers = 10;
static constexpr uint8_t kMaxCredentialsPerUser = 10;
static constexpr uint8_t kMaxWeekdaySchedulesPerUser = 10;
static constexpr uint8_t kMaxYeardaySchedulesPerUser = 10;
static constexpr uint8_t kMaxHolidaySchedules = 10;
static constexpr uint8_t kMaxCredentialSize = 20;
static constexpr uint8_t kNumCredentialTypes = 6;

static constexpr uint8_t kMaxCredentials = kMaxUsers * kMaxCredentialsPerUser;
static constexpr uint8_t kMaxCredentialSize = 20;
static constexpr uint8_t kNumCredentialTypes = 6;

} // namespace ResourceRanges

Expand Down Expand Up @@ -197,26 +190,24 @@ class LockManager
OperationSource mActuatorOperationSource = OperationSource::kButton;
k_timer mActuatorTimer = {};

#if LOCK_MANAGER_CONFIG_USE_NVM_CREDENTIAL_STORAGE
bool ReadConfigValues();
#endif

bool setLockState(chip::EndpointId endpointId, DlLockState lockState, OperationSource source, OperationErrorEnum & err,
const Nullable<chip::FabricIndex> & fabricIdx, const Nullable<chip::NodeId> & nodeId,
const Optional<chip::ByteSpan> & pin);

static void ActuatorTimerEventHandler(k_timer * timer);
static void ActuatorAppEventHandler(const AppEvent & event);

EmberAfPluginDoorLockUserInfo mLockUsers[kMaxUsers];
EmberAfPluginDoorLockCredentialInfo mLockCredentials[kNumCredentialTypes][kMaxCredentials];
WeekDaysScheduleInfo mWeekdaySchedule[kMaxUsers][kMaxWeekdaySchedulesPerUser];
YearDayScheduleInfo mYeardaySchedule[kMaxUsers][kMaxYeardaySchedulesPerUser];
HolidayScheduleInfo mHolidaySchedule[kMaxHolidaySchedules];
#if !LOCK_MANAGER_CONFIG_USE_NVM_CREDENTIAL_STORAGE
EmberAfPluginDoorLockUserInfo mLockUsers[APP_MAX_USERS];
EmberAfPluginDoorLockCredentialInfo mLockCredentials[kNumCredentialTypes][APP_MAX_CREDENTIAL];
WeekDaysScheduleInfo mWeekdaySchedule[APP_MAX_USERS][APP_MAX_WEEKDAY_SCHEDULE_PER_USER];
YearDayScheduleInfo mYeardaySchedule[APP_MAX_USERS][APP_MAX_YEARDAY_SCHEDULE_PER_USER];
HolidayScheduleInfo mHolidaySchedule[APP_MAX_HOLYDAY_SCHEDULE_PER_USER];

char mUserNames[ArraySize(mLockUsers)][DOOR_LOCK_MAX_USER_NAME_SIZE];
uint8_t mCredentialData[kNumCredentialTypes][kMaxCredentials][kMaxCredentialSize];
CredentialStruct mCredentials[kMaxUsers][kMaxCredentials];
uint8_t mCredentialData[kNumCredentialTypes][APP_MAX_CREDENTIAL][kMaxCredentialSize];
CredentialStruct mCredentials[APP_MAX_USERS][APP_MAX_CREDENTIAL];
#endif

static LockManager sLock;
TelinkDoorLock::LockInitParams::LockParam LockParams;
Expand Down
27 changes: 19 additions & 8 deletions examples/lock-app/telink/include/LockSettingsStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,25 @@ namespace Internal {
class LockSettingsStorage : ZephyrConfig
{
public:
static const ZephyrConfig::Key kConfigKey_LockUser;
static const ZephyrConfig::Key kConfigKey_LockUserName;
static const ZephyrConfig::Key kConfigKey_UserCredentials;
static const ZephyrConfig::Key kConfigKey_WeekDaySchedules;
static const ZephyrConfig::Key kConfigKey_YearDaySchedules;
static const ZephyrConfig::Key kConfigKey_HolidaySchedules;
static const char * kConfigKey_Credential[kNumCredentialTypes];
static const char * kConfigKey_CredentialData[kNumCredentialTypes];
static const char * kConfigKey_LockUser[APP_MAX_USERS];
static const char * kConfigKey_LockUserName[APP_MAX_USERS];
static const char * kConfigKey_UserCredentials[APP_MAX_CREDENTIAL];
static const char * kConfigKey_WeekDaySchedules[APP_MAX_USERS][APP_MAX_WEEKDAY_SCHEDULE_PER_USER];
static const char * kConfigKey_YearDaySchedules[APP_MAX_USERS][APP_MAX_YEARDAY_SCHEDULE_PER_USER];
static const char * kConfigKey_HolidaySchedules[APP_MAX_HOLYDAY_SCHEDULE_PER_USER];

static const char * kConfigKey_CredentialPin[APP_MAX_CREDENTIAL];
static const char * kConfigKey_CredentialFace[APP_MAX_CREDENTIAL];
static const char * kConfigKey_CredentialFingerprint[APP_MAX_CREDENTIAL];
static const char * kConfigKey_CredentialFingervein[APP_MAX_CREDENTIAL];
static const char * kConfigKey_CredentialRfid[APP_MAX_CREDENTIAL];

static const char * kConfigKey_CredentialData[APP_MAX_CREDENTIAL];
static const char * kConfigKey_CredentialDataPin[APP_MAX_CREDENTIAL];
static const char * kConfigKey_CredentialDataFace[APP_MAX_CREDENTIAL];
static const char * kConfigKey_CredentialDataFingerprint[APP_MAX_CREDENTIAL];
static const char * kConfigKey_CredentialDataFingerVein[APP_MAX_CREDENTIAL];
static const char * kConfigKey_CredentialDataRfid[APP_MAX_CREDENTIAL];
};
} // namespace Internal
} // namespace DeviceLayer
Expand Down
Loading

0 comments on commit d6a533a

Please sign in to comment.