![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
gsm
Dependencies: DebouncedIn mbed
Fork of CLASEDELGSM1 by
Revision 7:08dac00ecff7, committed 2016-05-11
- Comitter:
- tony63
- Date:
- Wed May 11 01:36:00 2016 +0000
- Parent:
- 6:4cece0df6a3b
- Commit message:
- mas mejoras mas estable
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue May 10 12:52:36 2016 +0000 +++ b/main.cpp Wed May 11 01:36:00 2016 +0000 @@ -309,10 +309,10 @@ int recibe_ok(){ GSM.printf("AT+CMGS=32\n\r"); pc.printf("AT+CMGS=32\n\r"); - wait_ms(200); + wait_ms(100); GSM.printf("0011000A91%s0000AA15CDB27B1E569741F2F2382D4E93DFA0E7321402",tel); pc.printf("0011000A91%s0000AA15CDB27B1E569741F2F2382D4E93DFA0E7321402",tel); - wait_ms(500); + wait_ms(100); GSM.putc((char)0x1A); return 0; } @@ -336,7 +336,7 @@ LedVerde=0; } else{ - wait(5); + wait(1); goto inicio1; } @@ -354,9 +354,9 @@ //**********se envia la palabra "Hay Intrusos En La Finca de Rionegro" //******Gustavo GSM.printf("AT+CMGS=50\n\r"); - wait_ms(200); + wait_ms(100); GSM.printf("0011000A9113223717370000AA2A21970B19CE83926EBABC3E7FCF41453788190699D3EE7118442E83A4E9B7BB7C96BF5DAE10"); - wait_ms(200); + wait_ms(100); GSM.putc((char)0x1A); for(i=0;i<60;i++){ //por mas ruido se envia un mensaje cada minuto LedVerde=1; @@ -386,15 +386,13 @@ if(strcmp("$$+CM",resp) == 0){ //COMPARA resp con "+CMTI" pc.printf("llego MSG\r\n"); cleanBuffer(buffer,10); - wait(0.5); GSM.printf("AT+CMGL=0\r\n");//envio comando para leer mensaje pc.printf("AT+CMGL=0\r\n"); //if (GSM.readable()) { GSM.printf("AT+CMGD=0\r\n"); - readBuffer(buffer,100); + readBuffer(buffer,110); pc.printf("%s\r\n",buffer); - wait(5); - //leer telefono + //leer telefono for(i=0;i<10;i++){ tel[i]=buffer[i+40]; } @@ -467,7 +465,8 @@ //recibe_ok(); //ejecurar orden si esta es mas que prender leds - cleanBuffer(buffer,100); + readBuffer(buffer,200); + cleanBuffer(buffer,110); } }