56
}
if(!USER_EXIST){
GSM_tx(sms >senderNum,secUnregUser,sizeof(secUnregUser));
return;
}
if(txtComp(sms->txt,cmdLock,4)){
// LOCK XXXX
// 012345678
uint8_t pswrd[4]="xxxx";
uint8_t count = 0;
for(uint8_t cnt=5; cnt<9; cnt++){
pswrd[count++]=sms->txt[cnt];
}
if(txtComp(pswrd,&pass[USER_ID][0],4)){
if(isDoorOpen()){
LOCK_PENDING = TRUE;
notify = sms->senderNum;
GSM_tx(notify,secLockPend,sizeof(secLockPend));
return;
}
sec_lock();
sec_updateStatus(sms->senderNum);
}
else{
GSM_tx(sms
>senderNum,secWrongPass,sizeof(secWrongPass));
return;
}
}
else if(txtComp(sms->txt,cmdUnlock,6)){
// UNLOCK XXXX
// 012345678910
uint8_t pswrd[4]="xxxx";
uint8_t count = 0;
for(uint8_t cnt=7; cnt<11; cnt++){
pswrd[count++]=sms->txt[cnt];
}
if(txtComp(pswrd,&pass[USER_ID][0],4)){
sec_unlock();
sec_updateStatus(sms->senderNum);
}
Commentaires sur ces manuels