case 20:{ // +COPS: 0,2,47201 or +COPS: 0,2,47202
if(Uart_Read == '1'){ //we have '1', it could be +COPS: 0,2,47201
response = GSM_DhiMobile;
gsm_state = 247; // expecting CR+LF CR+LF OK CR+LF
}
else if(Uart_Read == '2'){ //we have '2', it could be +COPS: 0,2,47202
response = GSM_Ooredoo;
gsm_state = 247; // expecting CR+LF CR+LF OK CR+LF
}
else
break;
case 20:{ // +COPS: 0,2,47201 or +COPS: 0,2,47202
if(Uart_Read == '1'){ //we have '1', it could be +COPS: 0,2,47201
response = GSM_DhiMobile;
gsm_state = 247; // expecting CR+LF CR+LF OK CR+LF
}
else if(Uart_Read == '2'){ //we have '2', it could be +COPS: 0,2,47202
response = GSM_Ooredoo;
gsm_state = 247; // expecting CR+LF CR+LF OK CR+LF
}
else
gsm_state = 0; // reset state machine
break;
}
void GSM_Send_Const_Command(char *s1, char *s2, const char *s3, const char *s4, unsigned int *idx, char *gsmAttempt, char clr) {
// asm clrwdt
while(strstr(s1, CopyConst2Ram(s2, s3)) == 0) {
UART1_Write_Text(CopyConst2Ram(s2, s4));
DelayXSec(2);
(*idx) = 0;
/*
if((*gsmAttempt)++ == 2) {
//GSM_RESET();
//memset(gsmBuffer, '\0', sizeof(gsmBuffer));
(*gsmAttempt) = 0;
(*idx) = 0;
break;
}
*/
}
if(clr)memset(gsmBuffer, '\0', sizeof(gsmBuffer));
(*gsmAttempt) = 0;
(*idx) = 0;
}
if(clr)memset(gsmBuffer, '\0', sizeof(gsmBuffer));
(*gsmAttempt) = 0;
(*idx) = 0;
There is no extra bracket."if(clr)memset(gsmBuffer, '\0', sizeof(gsmBuffer));"
memset(GSM_Buffer,'0',30); // Clear GSM Buffer
memset(buffer1,'0',30); // Clear Buffer1
There is a help file in mikroC for that.But I did figure out why and how to put "0" in the array.
it was not a loss since I learned something..EH!
What do you mean by that ?One thing I noticed is help file does not always help.
It is different. I see that when I google.
GSM_Send_Const_Command(gsmBuffer, buffer1, atResponseR, atCommand1, &gsmBufferIndex, &gsmAttempt, 0);
GSM_Send_Const_Command(gsmBuffer, buffer1, atResponseR, atCommand1, &gsmBufferIndex, &gsmAttempt, 1);
GSM_Send_Const_Command(gsmBuffer, buffer1, atResponseR, atCommand1, &gsmBufferIndex, &gsmAttempt,1);
GSM_Send_Const_Command(gsmBuffer, buffer1, atResponseR, atCommand1, &gsmBufferIndex, &gsmAttempt,0);
| Thread starter | Similar threads | Forum | Replies | Date |
|---|---|---|---|---|
| T | RS232 to TTL custom board, no output from MAX232 | General Electronics Chat | 25 | |
| O | MAX232 for ±25V from 5V supply | General Electronics Chat | 35 | |
| T | Max232 capacitor placing issues | Microcontrollers | 11 | |
|
|
MAX232 Heating issue..! | General Electronics Chat | 23 | |
|
|
Question about serial comms between a pic and a pc using a max232 | Microcontrollers | 11 |