1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| void GSM_Send_Const_Cmd(char *s1, char *s2, const char *s3, const char *s4, unsigned int *idx, char *attempt, char clr) {
while(strstr(s1, CopyConst2Ram(s2, s3)) == 0) {
UART1_Write_Text(CopyConst2Ram(s2, s4));
Delay_ms(2000);
if(*attempt++ == 3) {
GSM_RESET();
memset(s1, '\0', sizeof(s1));
*attempt = 0;
*idx = 0;
}
}
if(clr)memset(s1, '\0', sizeof(s1));
*attempt = 0;
*idx = 0;
}
void Send_SMS(char *s1, char *s2, const char *s3, const char *s4, const char *s5, const char *s6, const char *s7, char *s8, unsigned int *idx, char *attempt, char clr) {
while(strstr(s1, CopyConst2Ram(s2, s3)) == 0) {
GSM_Send_Const_Cmd(s1, s2, s3, s5, &idx, &attempt, 1);
GSM_Send_Const_Cmd(s1, s2, s3, s6, &idx, &attempt, 1);
GSM_Send_Const_Cmd(s1, s2, s4, s7, &idx, &attempt, 1);
UART1_Write_Text(s8);
Delay_ms(500);
UART1_Write(0x1A);
Delay_ms(8000);
}
memset(s1, '\0', sizeof(s1));
*idx = 0;
} |