29
29
30
30
#include < lib/support/DefaultStorageKeyAllocator.h>
31
31
32
- struct WeekDayScheduleInfo
33
- {
34
- DlScheduleStatus status;
35
- EmberAfPluginDoorLockWeekDaySchedule schedule;
36
- };
37
-
38
- struct YearDayScheduleInfo
39
- {
40
- DlScheduleStatus status;
41
- EmberAfPluginDoorLockYearDaySchedule schedule;
42
- };
43
-
44
- struct HolidayScheduleInfo
45
- {
46
- DlScheduleStatus status;
47
- EmberAfPluginDoorLockHolidaySchedule schedule;
48
- };
49
-
50
32
namespace EFR32DoorLock {
51
33
namespace ResourceRanges {
52
34
// Used to size arrays
@@ -58,8 +40,6 @@ static constexpr uint8_t kMaxHolidaySchedules = 10;
58
40
static constexpr uint8_t kMaxCredentialSize = 20 ;
59
41
static constexpr uint8_t kNumCredentialTypes = 6 ;
60
42
61
- static constexpr uint8_t kMaxCredentials = kMaxUsers * kMaxCredentialsPerUser ;
62
-
63
43
} // namespace ResourceRanges
64
44
65
45
namespace LockInitParams {
@@ -109,34 +89,56 @@ class ParamBuilder
109
89
};
110
90
111
91
} // namespace LockInitParams
92
+ namespace Storage {
93
+
94
+ using namespace EFR32DoorLock ::ResourceRanges;
95
+ struct WeekDayScheduleInfo
96
+ {
97
+ DlScheduleStatus status;
98
+ EmberAfPluginDoorLockWeekDaySchedule schedule;
99
+ };
100
+
101
+ struct YearDayScheduleInfo
102
+ {
103
+ DlScheduleStatus status;
104
+ EmberAfPluginDoorLockYearDaySchedule schedule;
105
+ };
106
+
107
+ struct HolidayScheduleInfo
108
+ {
109
+ DlScheduleStatus status;
110
+ EmberAfPluginDoorLockHolidaySchedule schedule;
111
+ };
112
+
113
+ struct LockUserInfo
114
+ {
115
+ char userName[DOOR_LOCK_MAX_USER_NAME_SIZE];
116
+ size_t userNameSize;
117
+ uint32_t userUniqueId;
118
+ UserStatusEnum userStatus;
119
+ UserTypeEnum userType;
120
+ CredentialRuleEnum credentialRule;
121
+ chip::EndpointId endpointId;
122
+ chip::FabricIndex createdBy;
123
+ chip::FabricIndex lastModifiedBy;
124
+ uint16_t currentCredentialCount;
125
+ };
126
+
127
+ struct LockCredentialInfo
128
+ {
129
+ DlCredentialStatus status;
130
+ CredentialTypeEnum credentialType;
131
+ chip::FabricIndex createdBy;
132
+ chip::FabricIndex lastModifiedBy;
133
+ uint8_t credentialData[kMaxCredentialSize ];
134
+ size_t credentialDataSize;
135
+ };
136
+ } // namespace Storage
112
137
} // namespace EFR32DoorLock
113
138
114
139
using namespace ::chip;
115
140
using namespace EFR32DoorLock ::ResourceRanges;
116
-
117
- struct LockUserInfo
118
- {
119
- char userName[DOOR_LOCK_MAX_USER_NAME_SIZE];
120
- size_t userNameSize;
121
- uint32_t userUniqueId;
122
- UserStatusEnum userStatus;
123
- UserTypeEnum userType;
124
- CredentialRuleEnum credentialRule;
125
- chip::EndpointId endpointId;
126
- chip::FabricIndex createdBy;
127
- chip::FabricIndex lastModifiedBy;
128
- uint16_t currentCredentialCount;
129
- };
130
-
131
- struct LockCredentialInfo
132
- {
133
- DlCredentialStatus status;
134
- CredentialTypeEnum credentialType;
135
- chip::FabricIndex createdBy;
136
- chip::FabricIndex lastModifiedBy;
137
- uint8_t credentialData[kMaxCredentialSize ];
138
- size_t credentialDataSize;
139
- };
141
+ using namespace EFR32DoorLock ::Storage;
140
142
141
143
class LockManager
142
144
{
0 commit comments