54
if(ALARM){
sec_adminRight(sms);
}
else{
sec_userRight(sms);
}
}
void sec_updateStatus(uint8_t* hpNum){
//ALARM = TRIGGERED
if(ALARM){
//DOOR = OPEN
if(DOOR_OPEN){
//LOCK_ON = TRUE
if(LOCK_ON){
GSM_tx(hpNum,msg1,sizeof(msg1)-1);
}
//LOCK_ON = FALSE
else{
GSM_tx(hpNum,msg2,sizeof(msg2)-1);
}
}
//DOOR = CLOSE
else{
//LOCK_ON = TRUE
if(LOCK_ON){
GSM_tx(hpNum,msg3,sizeof(msg3)-1);
}
//LOCK_ON = FALSE
else{
GSM_tx(hpNum,msg4,sizeof(msg4)-1);
}
}
}
//ALARM = IDLE
else{
//DOOR = OPEN
if(DOOR_OPEN){
//LOCK_ON = TRUE
if(LOCK_ON){
GSM_tx(hpNum,msg5,sizeof(msg5)-1);
}
//LOCK_ON = FALSE
else{
GSM_tx(hpNum,msg6,sizeof(msg6)-1);
}
}
Comentarios a estos manuales