Skip to content

Commit

Permalink
[Telink]: Updated lock app to the latest lock cluster signatures
Browse files Browse the repository at this point in the history
Updated lock app to latest cluster, passes TC-DRLK-2.10

Signed-off-by: Misha Tkachenko <[email protected]>
  • Loading branch information
mishadesh committed Nov 3, 2023
1 parent 24d38da commit a3735f4
Show file tree
Hide file tree
Showing 10 changed files with 1,645 additions and 531 deletions.
2 changes: 1 addition & 1 deletion examples/lock-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ add_definitions(
target_sources(app PRIVATE
src/AppTask.cpp
src/ZclCallbacks.cpp
src/BoltLockManager.cpp
src/LockManager.cpp
${TELINK_COMMON}/common/src/mainCommon.cpp
${TELINK_COMMON}/common/src/AppTaskCommon.cpp
${TELINK_COMMON}/util/src/LEDWidget.cpp
Expand Down
11 changes: 2 additions & 9 deletions examples/lock-app/telink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ a reference for creating your own application.
2. Activate the build environment:

```bash
$ source ./scripts/activate.sh -p all,telink
$ source ./scripts/activate.sh
```

3. In the example dir run (replace _<build_target>_ with your board name, for
Expand All @@ -34,13 +34,6 @@ a reference for creating your own application.
$ west build -b <build_target>
```

Also use key `-DFLASH_SIZE`, if your board has memory size different from 2
MB, for example, `-DFLASH_SIZE=1m` or `-DFLASH_SIZE=1m`:

```bash
$ west build -b tlsr9518adk80d -- -DFLASH_SIZE=4m
```

4. Flash binary:

```
Expand Down Expand Up @@ -129,7 +122,7 @@ feature for another Telink example:
After build application with enabled OTA feature, use next binary files:
- zephyr.bin - main binary to flash PCB (Use at least 2MB PCB).
- zephyr.bin - main binary to flash PCB (Use 2MB PCB).
- zephyr-ota.bin - binary for OTA Provider
All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have
Expand Down
16 changes: 13 additions & 3 deletions examples/lock-app/telink/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,21 @@
#pragma once

#include "AppTaskCommon.h"
#include "BoltLockManager.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);
// void UpdateClusterState(BoltLockManager::State state, BoltLockManager::OperationSource source);

private:
friend AppTask & GetAppTask(void);
Expand All @@ -33,7 +42,7 @@ class AppTask : public 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 All @@ -42,3 +51,4 @@ inline AppTask & GetAppTask(void)
{
return AppTask::sAppTask;
}
CHIP_ERROR InitDoorLockHandler();
129 changes: 0 additions & 129 deletions examples/lock-app/telink/include/BoltLockManager.h

This file was deleted.

Loading

0 comments on commit a3735f4

Please sign in to comment.