Skip to content

Commit

Permalink
[Telink]: Refactored Lock App to support one item NVS storage
Browse files Browse the repository at this point in the history
Refactored Lock App to support one-one continious NVS storage

Signed-off-by: Misha Tkachenko <misha.tkachenko@telink-semi.com>
  • Loading branch information
mishadesh committed Jan 10, 2024
1 parent 6d59d8d commit 9c637ec
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 98 deletions.
6 changes: 6 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,12 @@
#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_DEFAULT_USERS_COUNT 5
#define APP_DEFAULT_CREDENTIAL_COUNT 5
#define APP_DEFAULT_WEEKDAY_SCHEDULE_PER_USER_COUNT 5
Expand Down
13 changes: 7 additions & 6 deletions examples/lock-app/telink/include/LockSettingsStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ 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_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_WEEKDAY_SCHEDULE_PER_USER];
static const char * kConfigKey_YearDaySchedules[APP_MAX_YEARDAY_SCHEDULE_PER_USER];
static const char * kConfigKey_HolidaySchedules[APP_MAX_HOLYDAY_SCHEDULE_PER_USER];

static const char * kConfigKey_Credential[kNumCredentialTypes];
static const char * kConfigKey_CredentialData[kNumCredentialTypes];
};
Expand Down
Loading

0 comments on commit 9c637ec

Please sign in to comment.