@@ -117,13 +117,6 @@ bool LockEndpoint::SetUser(uint16_t userIndex, chip::FabricIndex creator, chip::
117
117
mEndpointId , userIndex, creator, modifier, static_cast <int >(userName.size ()), userName.data (), uniqueId,
118
118
to_underlying (userStatus), to_underlying (usertype), to_underlying (credentialRule), credentials,
119
119
static_cast <unsigned int >(totalCredentials));
120
- printf (" \033 [44m Lock App: LockEndpoint::SetUser "
121
- " [endpoint=%d,userIndex=%u,creator=%d,modifier=%d,userName=\" %.*s\" ,uniqueId=%" PRIx32
122
- " ,userStatus=%u,userType=%u,"
123
- " credentialRule=%u,credentials=%p,totalCredentials=%u] \033 [0m\n " ,
124
- mEndpointId , userIndex, creator, modifier, static_cast <int >(userName.size ()), userName.data (), uniqueId,
125
- to_underlying (userStatus), to_underlying (usertype), to_underlying (credentialRule), credentials,
126
- static_cast <unsigned int >(totalCredentials));
127
120
128
121
auto adjustedUserIndex = static_cast <uint16_t >(userIndex - 1 );
129
122
if (adjustedUserIndex > mLockUsers .size ())
@@ -264,6 +257,7 @@ bool LockEndpoint::SetCredential(uint16_t credentialIndex, chip::FabricIndex cre
264
257
return false ;
265
258
}
266
259
260
+ // Assign to arrary by credentialIndex. Note: 0 is reserved for programmingPIN only
267
261
auto & credentialInStorage = mLockCredentials [to_underlying (credentialType)][credentialIndex];
268
262
if (credentialData.size () > DOOR_LOCK_CREDENTIAL_INFO_MAX_DATA_SIZE)
269
263
{
@@ -285,13 +279,6 @@ bool LockEndpoint::SetCredential(uint16_t credentialIndex, chip::FabricIndex cre
285
279
mEndpointId , credentialIndex, to_underlying (credentialType), credentialInStorage.createdBy ,
286
280
credentialInStorage.modifiedBy );
287
281
288
- printf (" \033 [41m %s, %d \033 [0m \n credential=" , __func__, __LINE__);
289
- for (size_t i=0 ; i < credentialData.size (); i++)
290
- {
291
- printf (" %c" , credentialInStorage.credentialData [i]);
292
- }
293
- printf (" \n \033 [41m %s, %d \033 [0m \n " , __func__, __LINE__);
294
-
295
282
return true ;
296
283
}
297
284
@@ -467,13 +454,6 @@ bool LockEndpoint::setLockState(const Nullable<chip::FabricIndex> & fabricIdx, c
467
454
return false ;
468
455
}
469
456
470
- printf (" \033 [41m %s, %d \033 [0m \n pin=" , __func__, __LINE__);
471
- for (size_t i=0 ; i < pin.Value ().size (); i++)
472
- {
473
- printf (" %c" , pin.Value ()[i]);
474
- }
475
- printf (" \n \033 [41m %s, %d \033 [0m \n " , __func__, __LINE__);
476
-
477
457
// Find the credential so we can make sure it is not absent right away
478
458
auto & pinCredentials = mLockCredentials [to_underlying (CredentialTypeEnum::kPin )];
479
459
auto credential = std::find_if (pinCredentials.begin (), pinCredentials.end (), [&pin](const LockCredentialInfo & c) {
@@ -627,7 +607,6 @@ bool LockEndpoint::weekDayScheduleForbidsAccess(uint16_t userIndex, bool * haveS
627
607
auto endTime = s.schedule .endHour * chip::kSecondsPerHour + s.schedule .endMinute * chip::kSecondsPerMinute ;
628
608
bool ret = (s.status == DlScheduleStatus::kOccupied && (to_underlying (s.schedule .daysMask ) & (1 << calendarTime.tm_wday )) &&
629
609
startTime <= currentTime && currentTime <= endTime);
630
- printf (" \033 [44m %s, %d, s.status=%d, ret=%d \033 [0m \n " , __func__, __LINE__, to_underlying (s.status ), static_cast <int >(ret));
631
610
return s.status == DlScheduleStatus::kOccupied && (to_underlying (s.schedule .daysMask ) & (1 << calendarTime.tm_wday )) &&
632
611
startTime <= currentTime && currentTime <= endTime;
633
612
});
0 commit comments