Skip to content

Commit 4309778

Browse files
committed
restyle
1 parent 7fb40ab commit 4309778

File tree

3 files changed

+128
-106
lines changed

3 files changed

+128
-106
lines changed

examples/lock-app/silabs/include/LockManager.h

+28-11
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ using namespace EFR32DoorLock::ResourceRanges;
116116

117117
struct LockUserInfo
118118
{
119-
char userName[DOOR_LOCK_USER_NAME_BUFFER_SIZE];
119+
char userName[DOOR_LOCK_USER_NAME_BUFFER_SIZE];
120120
size_t userNameSize;
121-
uint32_t userUniqueId;
122-
UserStatusEnum userStatus;
121+
uint32_t userUniqueId;
122+
UserStatusEnum userStatus;
123123
UserTypeEnum userType;
124124
CredentialRuleEnum credentialRule;
125125
chip::EndpointId endpointId;
@@ -271,21 +271,38 @@ class LockManager
271271

272272
EFR32DoorLock::LockInitParams::LockParam LockParams;
273273

274-
static StorageKeyName LockUserEndpoint(uint16_t userIndex, chip::EndpointId endpoint) { return StorageKeyName::Formatted("g/lu/%x/e/%x", userIndex, endpoint); }
275-
static StorageKeyName LockCredentialEndpoint(uint16_t credentialIndex, chip::EndpointId endpoint) { return StorageKeyName::Formatted("g/lc/%x/e/%x", credentialIndex, endpoint); }
276-
static StorageKeyName LockUserCredentialMap(uint16_t userIndex) { return StorageKeyName::Formatted("g/lu/%x/lc", userIndex); } // Stores all the credential indices that belong to a user
277-
static StorageKeyName LockUserWeekDayScheduleEndpoint(uint16_t userIndex, uint16_t scheduleIndex, chip::EndpointId endpoint) { return StorageKeyName::Formatted("g/lu/%x/lw/%x/e/%x", userIndex, scheduleIndex, endpoint); }
278-
static StorageKeyName LockUserYearDayScheduleEndpoint(uint16_t userIndex, uint16_t scheduleIndex, chip::EndpointId endpoint) { return StorageKeyName::Formatted("g/lu/%x/ly/%x/e/%x", userIndex, scheduleIndex, endpoint); }
279-
static StorageKeyName LockHolidayScheduleEndpoint(uint16_t scheduleIndex, chip::EndpointId endpoint) { return StorageKeyName::Formatted("g/lh/%x/e/%x", scheduleIndex, endpoint); }
274+
static StorageKeyName LockUserEndpoint(uint16_t userIndex, chip::EndpointId endpoint)
275+
{
276+
return StorageKeyName::Formatted("g/lu/%x/e/%x", userIndex, endpoint);
277+
}
278+
static StorageKeyName LockCredentialEndpoint(uint16_t credentialIndex, chip::EndpointId endpoint)
279+
{
280+
return StorageKeyName::Formatted("g/lc/%x/e/%x", credentialIndex, endpoint);
281+
}
282+
static StorageKeyName LockUserCredentialMap(uint16_t userIndex)
283+
{
284+
return StorageKeyName::Formatted("g/lu/%x/lc", userIndex);
285+
} // Stores all the credential indices that belong to a user
286+
static StorageKeyName LockUserWeekDayScheduleEndpoint(uint16_t userIndex, uint16_t scheduleIndex, chip::EndpointId endpoint)
287+
{
288+
return StorageKeyName::Formatted("g/lu/%x/lw/%x/e/%x", userIndex, scheduleIndex, endpoint);
289+
}
290+
static StorageKeyName LockUserYearDayScheduleEndpoint(uint16_t userIndex, uint16_t scheduleIndex, chip::EndpointId endpoint)
291+
{
292+
return StorageKeyName::Formatted("g/lu/%x/ly/%x/e/%x", userIndex, scheduleIndex, endpoint);
293+
}
294+
static StorageKeyName LockHolidayScheduleEndpoint(uint16_t scheduleIndex, chip::EndpointId endpoint)
295+
{
296+
return StorageKeyName::Formatted("g/lh/%x/e/%x", scheduleIndex, endpoint);
297+
}
280298

281299
LockUserInfo userInStorage;
282-
LockCredentialInfo credentialInStorage;
300+
LockCredentialInfo credentialInStorage;
283301
WeekDayScheduleInfo weekDayScheduleInStorage;
284302
YearDayScheduleInfo yearDayScheduleInStorage;
285303
HolidayScheduleInfo holidayScheduleInStorage;
286304
CredentialStruct mCredential;
287305
CredentialStruct mCredentials[kMaxCredentialsPerUser];
288-
289306
};
290307

291308
LockManager & LockMgr();

examples/lock-app/silabs/src/AppTask.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
#include <app-common/zap-generated/cluster-objects.h>
3838

3939
#include <app/clusters/door-lock-server/door-lock-server.h>
40-
#include <setup_payload/OnboardingCodesUtil.h>
4140
#include <app/server/Server.h>
4241
#include <app/util/attribute-storage.h>
42+
#include <setup_payload/OnboardingCodesUtil.h>
4343

4444
#include <assert.h>
4545

@@ -266,7 +266,6 @@ void AppTask::AppTaskMain(void * pvParameter)
266266

267267
SILABS_LOG("App Task started");
268268

269-
270269
while (true)
271270
{
272271
osStatus_t eventReceived = osMessageQueueGet(sAppEventQueue, &event, NULL, osWaitForever);
@@ -410,4 +409,3 @@ void AppTask::UpdateClusterState(intptr_t context)
410409
SILABS_LOG("ERR: updating lock state %x", to_underlying(status));
411410
}
412411
}
413-

0 commit comments

Comments
 (0)