Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telink] Lock app refactoring & fix TC-DRLK-2.10 #30301

Merged
merged 9 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ jobs:
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink (B92 retention) Lock App with DFU
- name: Build example Telink (B92) Lock App with DFU
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9528a_retention-lock-dfu' build"
"./scripts/build/build_examples.py --target 'telink-tlsr9528a-lock-dfu' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9528a_retention lock-app-dfu \
out/telink-tlsr9528a_retention-lock-dfu/zephyr/zephyr.elf \
telink tlsr9528a lock-app-dfu \
out/telink-tlsr9528a-lock-dfu/zephyr/zephyr.elf \
/tmp/bloat_reports/

- name: clean out build output
Expand Down
3 changes: 2 additions & 1 deletion examples/lock-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ add_definitions(
target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
src/BoltLockManager.cpp
src/LockManager.cpp
src/LockSettingsStorage.cpp
${TELINK_COMMON}/common/src/mainCommon.cpp
${TELINK_COMMON}/common/src/AppTaskCommon.cpp
${TELINK_COMMON}/util/src/LEDWidget.cpp
Expand Down
9 changes: 9 additions & 0 deletions examples/lock-app/telink/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@

// ---- Lock Example App Config ----

#define LOCK_MANAGER_CONFIG_USE_NVM_CREDENTIAL_STORAGE 1
#define LOCK_MANAGER_ACTUATOR_MOVEMENT_TIME_MS 2000

#define APP_DEFAULT_USERS_COUNT 5
#define APP_DEFAULT_CREDENTIAL_COUNT 5
#define APP_DEFAULT_WEEKDAY_SCHEDULE_PER_USER_COUNT 5
#define APP_DEFAULT_YEARDAY_SCHEDULE_PER_USER_COUNT 5
#define APP_DEFAULT_HOLYDAY_SCHEDULE_PER_USER_COUNT 5

#define APP_USE_EXAMPLE_START_BUTTON 1
#define APP_USE_BLE_START_BUTTON 0
#define APP_USE_THREAD_START_BUTTON 0
Expand Down
16 changes: 11 additions & 5 deletions examples/lock-app/telink/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,28 @@

#pragma once

#include "AppConfig.h"
#include "AppTaskCommon.h"
#include "BoltLockManager.h"
#include "LockManager.h"

#define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01)
#define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02)
#define APP_ERROR_UNHANDLED_EVENT CHIP_APPLICATION_ERROR(0x03)
#define APP_ERROR_CREATE_TIMER_FAILED CHIP_APPLICATION_ERROR(0x04)
#define APP_ERROR_START_TIMER_FAILED CHIP_APPLICATION_ERROR(0x05)
#define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06)
#define APP_ERROR_ALLOCATION_FAILED CHIP_APPLICATION_ERROR(0x07)

class AppTask : public AppTaskCommon
{
public:
void UpdateClusterState(BoltLockManager::State state, BoltLockManager::OperationSource source);

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

CHIP_ERROR Init(void);

static void LockActionEventHandler(AppEvent * event);
static void LockStateChanged(BoltLockManager::State state, BoltLockManager::OperationSource source);
static void LockStateChanged(LockManager::State_t state);

static AppTask sAppTask;
};
Expand Down
129 changes: 0 additions & 129 deletions examples/lock-app/telink/include/BoltLockManager.h

This file was deleted.

Loading
Loading