GPS NUEVO

Dependencies:   GPS7 mbed

Files at this revision

API Documentation at this revision

Comitter:
obifandres
Date:
Fri Jun 19 10:44:48 2015 +0000
Commit message:
GPS NUEVO

Changed in this revision

DebouncedIn.cpp Show annotated file Show diff for this revision Revisions of this file
DebouncedIn.h Show annotated file Show diff for this revision Revisions of this file
GPRS.lib Show annotated file Show diff for this revision Revisions of this file
GPS_G.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r b11acb885c4c DebouncedIn.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DebouncedIn.cpp	Fri Jun 19 10:44:48 2015 +0000
@@ -0,0 +1,93 @@
+#include "DebouncedIn.h"
+#include "mbed.h"
+
+/*
+ * Constructor
+ */
+DebouncedIn::DebouncedIn(PinName in) 
+    : _in(in) {    
+        
+    // reset all the flags and counters    
+    _samples = 0;
+    _output = 0;
+    _output_last = 0;
+    _rising_flag = 0;
+    _falling_flag = 0;
+    _state_counter = 0;
+    
+    // Attach ticker
+    _ticker.attach(this, &DebouncedIn::_sample, 0.005);     
+}
+  
+void DebouncedIn::_sample() {
+
+    // take a sample
+    _samples = _samples >> 1; // shift left
+      
+    if (_in) {
+        _samples |= 0x80;
+    }  
+      
+    // examine the sample window, look for steady state
+    if (_samples == 0x00) {
+        _output = 0;
+    } 
+    else if (_samples == 0xFF) {
+        _output = 1;
+    }
+
+
+    // Rising edge detection
+    if ((_output == 1) && (_output_last == 0)) {
+        _rising_flag++;
+        _state_counter = 0;
+    }
+
+    // Falling edge detection
+    else if ((_output == 0) && (_output_last == 1)) {
+        _falling_flag++;
+        _state_counter = 0;
+    }
+    
+    // steady state
+    else {
+        _state_counter++;
+    }
+    
+   // update the output
+    _output_last = _output;
+    
+}
+
+
+
+// return number of rising edges
+int DebouncedIn::rising(void) {
+    int return_value = _rising_flag; 
+    _rising_flag = 0;
+    return(return_value);
+}
+
+// return number of falling edges
+int DebouncedIn::falling(void) {
+    int return_value = _falling_flag; 
+    _falling_flag = 0;
+    return(return_value);
+}
+
+// return number of ticsk we've bene steady for
+int DebouncedIn::steady(void) {
+return(_state_counter);
+}
+
+// return the debounced status
+int DebouncedIn::read(void) {
+    return(_output);
+}
+
+// shorthand for read()
+DebouncedIn::operator int() {
+    return read();
+}
+
+
diff -r 000000000000 -r b11acb885c4c DebouncedIn.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DebouncedIn.h	Fri Jun 19 10:44:48 2015 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+
+    class DebouncedIn {
+        public:      
+             DebouncedIn(PinName in);
+
+             int read (void);
+             operator int();
+              
+             int rising(void);
+             int falling(void);
+             int steady(void);
+              
+        private :    
+               // objects
+               DigitalIn _in;    
+               Ticker _ticker;
+
+               // function to take a sample, and update flags
+               void _sample(void);
+
+               // counters and flags
+               int _samples;
+               int _output;
+               int _output_last;
+               int _rising_flag;
+               int _falling_flag;
+               int _state_counter;
+
+    };
+    
\ No newline at end of file
diff -r 000000000000 -r b11acb885c4c GPRS.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GPRS.lib	Fri Jun 19 10:44:48 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/tony63/code/GPRS/#a7d9a1225b1f
diff -r 000000000000 -r b11acb885c4c GPS_G.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GPS_G.lib	Fri Jun 19 10:44:48 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/tony63/code/GPS7/#8d7c7165ffe2
diff -r 000000000000 -r b11acb885c4c main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jun 19 10:44:48 2015 +0000
@@ -0,0 +1,526 @@
+#include "mbed.h"
+#include "DebouncedIn.h"
+#include "stdio.h"
+#include "string.h"
+#include  "math.h"
+#include  "gprs.h"
+#include "GPS.h"
+Timer t;
+char ES[255];
+int Y,P,Q,LoutON,LinON;
+DigitalOut LedRojo(LED1);
+int Y2,P2,Q2,LoutON2,LinON2;
+
+Serial pc(USBTX,USBRX); //Configura puerto UART de la FRDMKL25Z
+GPS gps(PTE22, PTE23);
+
+Serial GSM(PTE0,PTE1);//Configura puerto USB a la consola serial del PC conectado.
+//void leer(void);
+void Rx_interrupt();
+int position=0;
+int lenpack=6;
+int longi=0;
+char lat1[9];
+char lon1[12];
+char tel[11];
+char buffer[100];
+char buffer1[13];
+char datos[100];
+char NUMBER[13];
+int index;
+char buffermsg[100];
+int count1=0;
+int i = 0;
+int j = 0;
+char c;
+unsigned char CtrlZ = 0x1A;  // comodin de emision controlZ
+bool Flag = false; // bandera
+char v1[]=""; //Cadena de recepcion de la trama PDU si se usa!!
+char v2[]="";
+char msg[256];
+int z=0,g=0;
+char char1;
+char de[255];
+char Link[]={"maps.google.com/?q="};
+char ds[255];
+int k,Lout,Lin,LL;
+float frac_long, frac_lat,frac_long2,frac_lat2,frac_long3,frac_lat3,la,lo,L2,lat4,long4,L3,Lat,Long,Lmens;
+short DS[255];
+int K,LENOUT,C;
+char hexbyte[3]={0};
+int d;
+int msglen[0];
+int lng; 
+ 
+ 
+int readBuffer(char *buffer,int count)
+{
+    int i=0; 
+    t.start(); 
+    while(1) {
+        while (GSM.readable()) {
+            char c = GSM.getc();
+            if (c == '\r' || c == '\n') c = '$';
+            buffer[i++] = c;
+            if(i > count)break;
+        }
+        if(i > count)break;
+        if(t.read() > 3) {
+            t.stop();
+            t.reset();
+            break;
+        }
+    }
+    wait(0.5);
+    while(GSM.readable()) {  
+        char c = GSM.getc();
+    }
+    return 0;
+}
+ 
+
+ 
+int main(void)
+{
+ LedRojo=0;
+
+ 
+    GSM.baud(9600);//configura los baudios de la FRDMKL25Z en 9600
+    GSM.format(8,Serial::None,1); //configura el formato de los datos de la UART
+    
+    //configuracion del modem 
+  
+       pc.printf("Enviamos AT\n");  //chekeo del modem
+    GSM.printf("AT\r\n");
+    GSM.scanf("%s",buffer);
+    pc.printf("ATrdy>:D %s\r\n",buffer);
+  
+   GSM.printf("AT+CNMI=1,1\r\n"); //Habilitado para recibir SMS
+     pc.printf("AT+CNMI=1,1\r\n");
+     GSM.scanf("%s",buffer);
+     pc.printf(">:D %s\r\n",buffer);
+
+   GSM.printf("AT+CMGF=0\r\n"); // modo PDU
+     pc.printf("AT+CMGF=0\r\n");
+     GSM.scanf("%s",buffer);
+     pc.printf(">:3 %s\r\n",buffer);  
+     
+      GSM.printf("ATE\r\n"); // sin eco
+     pc.printf("ATE\r\n");
+     GSM.scanf("%s",buffer);
+     pc.printf(">:x %s\r\n",buffer); 
+     
+      GSM.printf("AT+CBST=0,0,1\r\n"); // AUTOBAUDIOS,ASINCRONICO
+     pc.printf("AT+CBST=0,0,1\r\n");
+     GSM.scanf("%s",buffer);
+     pc.printf(">:) %s\r\n",buffer); 
+     
+      GSM.printf("AT+CMGD=1\r\n"); // AUTOBAUDIOS,ASINCRONICO
+     pc.printf("AT+CMGD=1\r\n");
+     GSM.scanf("%s",buffer);
+     pc.printf(">:) %s\r\n",buffer); 
+// termina configuraicon del modem
+
+    
+   while(1) {
+        //wait(2);
+        
+        
+        
+            if (GSM.readable()) {
+            readBuffer(buffer,100);
+            
+            
+           
+            if(buffer[10]=='S'&& buffer[11]=='M'){
+             pc.printf("Llego mensaje\n\r ");         
+             buffer[10]=' ';
+             buffer[11]=' ';
+             GSM.printf("AT+CMGR=%c\r\n",buffer[14]);
+             pc.printf("AT+CMGR=%c\r\n",buffer[14]);
+             }
+             for(d=66;d<68;d+=2){
+                hexbyte[0]=buffer[d];
+                hexbyte[1]=buffer[d+1];
+                sscanf(hexbyte,"%X",&msglen[(d-66)/2]);
+               printf("%2X\n",msglen[(d-66)/2]);
+            }
+            lng=msglen[0];
+            int msg[lng-1];
+            for(d=68;d<(68+((lng)*2));d+=2){
+                hexbyte[0]=buffer[d];
+                hexbyte[1]=buffer[d+1];
+                sscanf(hexbyte,"%X",&msg[(d-68)/2]);
+               printf("%2X\n",msg[(d-68)/2]);
+            }
+            LENOUT= lng*8/7;
+            K=7;
+            C=0;
+            DS[0]=msg[0] & 0x7F;  // la primera sola
+            printf("%2X,%d,%d\r\n",DS[0],i,K);
+            for (i=1;i < LENOUT;i++){  // inicia el algoritmo
+                DS[i]=(msg[i-1-C]>>K | msg[i-C]<<(8-K))& 0x7F;  //valido para todos
+                printf("%2X,%d,%d\r\n",DS[i],i,K);
+            if (K==0) {K=8;C++;}
+                K--;
+            }
+            for (i=0;i < LENOUT;i++){
+                printf("%c",DS[i]);
+            }
+                printf("\n");
+ 
+             
+//if(buffer[68]=='C'&& buffer[69]=='3'&&buffer[70]=='B'&& buffer[71]=='7'&&buffer[72]=='1'&& buffer[73]=='C')//recibe mensaje Cor
+if(DS[0]=='C'&&DS[1]=='o'&&DS[2]=='r')
+             {
+              pc.printf(":$ %c%c%c%c%c%c%c%c%c%c\r\n",buffer[38],buffer[39],buffer[40],buffer[41],buffer[42],buffer[43],buffer[44],buffer[45],buffer[46],buffer[47]);
+              pc.printf(":) %c%c%c%c%c%c\r\n",buffer[68],buffer[69],buffer[70],buffer[71],buffer[72],buffer[73]);   
+             pc.printf("El mensaje es Cor\n");
+             /*buffer[66]=' ';
+             buffer[67]=' ';*/
+             buffer[68]=' ';
+             buffer[69]=' ';
+             buffer[70]=' ';
+             buffer[71]=' ';
+             buffer[72]=' ';
+             buffer[73]=' ';
+         //GPS
+         // INTENTARE LEER EL PUTO GPS//
+   while(1) {
+       
+        if(gps.sample()) {
+
+            lo=(int)gps.longitude;
+            la=(int)gps.latitude;
+            frac_long=gps.longitude-(int)gps.longitude;
+            
+        frac_lat=gps.latitude-(int)gps.latitude;
+          
+          
+      
+            frac_lat2=frac_lat/1000000;
+            frac_long2=frac_long/100000;
+ 
+            lat4=(int)abs(1000000*frac_lat);
+            long4=(int)abs(1000000*frac_long);
+
+            frac_lat3=frac_lat+frac_lat2;
+            frac_long3=frac_long+frac_long2;
+            
+              
+               Long=gps.longitude;
+              Lat=gps.latitude;    
+              sprintf(v1, "%f", Lat);
+              strcat(Link,v1);
+              strcat(Link,",");
+          
+             
+              sprintf(v2, "%f", Long);
+              strcat(Link,v2);
+              strcat(de,Link);
+              pc.printf("%s\n",Link);
+               pc.printf("esperando again \n");
+              
+           // pasar coordenadas a formato PDU
+       Lin=strlen(de);
+         
+         j=0;k=0;i=0;
+         for (i=0;i < Lin;i++){
+         ds[i]=de[i+k]>>j | de[i+k+1]<<(7-j);
+         if (ds[i]==0x00) {Lout=i; goto salir;}
+         j++;
+         if (j==7) {j=0;k++;} // se chequea que ya se acabaron los bits en un ciclo de conversion.
+         }
+         }
+         }
+         salir:   pc.printf("de\n");
+         for (i=0;i < Lin;i++){
+         pc.printf("%X",de[i]);
+         }
+         pc.printf("\n ds \n");
+         for (i=0;i<Lout;i++){
+         pc.printf("%2X",ds[i]&0x000000FF,i);
+         }
+         
+       // comienza el envio de coordenadas  
+         pc.printf("\n Lout:%d,Lin:%d\r\n",Lout,strlen(de));
+         
+            pc.printf("Comienza SMS \n");
+           
+           
+           GSM.printf("AT+CMGS=%d\r\n",Lout+13);
+            pc.printf("\n AT+CMGS=%d\r\n",Lout+13);
+            wait(0.3);
+           
+        GSM.printf("0011000A91%c%c%c%c%c%c%c%c%c%c0000AA",buffer[38],buffer[39],buffer[40],buffer[41],buffer[42],buffer[43],buffer[44],buffer[45],buffer[46],buffer[47]);
+        pc.printf("0011000A91%c%c%c%c%c%c%c%c%c%c0000AA",buffer[38],buffer[39],buffer[40],buffer[41],buffer[42],buffer[43],buffer[44],buffer[45],buffer[46],buffer[47]);
+           //wait(0.5);
+           GSM.printf("%2X",Lin);
+           pc.printf("%2X",Lin);    
+          
+              
+            for (i=0;i < Lout;i++){
+             GSM.printf("%02X",ds[i]&0x000000FF);  
+             pc.printf("%02X",ds[i]&0x000000FF);
+            // wait(0.3);      
+        } 
+  
+  
+  
+       GSM.putc((char)0x1A);  //no tengo idea de ke hace esto
+         GSM.scanf("%s",buffer);
+      pc.printf("%s",buffer);
+      pc.printf("\n rdy ");
+                
+                    
+                //link desde 18
+                
+                 for (i=0;i < 256;i++){
+             ds[i]=NULL;
+             de[i]=NULL;}  
+        LL=strlen(Link);
+            for (i=19;i < LL+1 ;i++){
+             Link[i]=NULL;}  
+            
+              
+          
+         
+             }// fin if del cor
+       
+ //aki deberia ir lo del on o off
+ for(d=66;d<68;d+=2){
+                hexbyte[0]=buffer[d];
+                hexbyte[1]=buffer[d+1];
+                sscanf(hexbyte,"%X",&msglen[(d-66)/2]);
+                printf("%2X\n",msglen[(d-66)/2]);
+            }
+            lng=msglen[0];
+            int msg1[lng-1];
+            for(d=68;d<(68+((lng)*2));d+=2){
+                hexbyte[0]=buffer[d];
+                hexbyte[1]=buffer[d+1];
+                sscanf(hexbyte,"%X",&msg1[(d-68)/2]);
+                printf("%2X\n",msg1[(d-68)/2]);
+            }
+            LENOUT= lng*8/7;
+            K=7;
+            C=0;
+            DS[0]=msg1[0] & 0x7F;  // la primera sola
+            printf("%2X,%d,%d\r\n",DS[0],i,K);
+            for (i=1;i < LENOUT;i++){  // inicia el algoritmo
+                DS[i]=(msg1[i-1-C]>>K | msg1[i-C]<<(8-K))& 0x7F;  //valido para todos
+                printf("%2X,%d,%d\r\n",DS[i],i,K);
+            if (K==0) {K=8;C++;}
+                K--;
+            }
+            for (i=0;i < LENOUT;i++){
+                printf("%c",DS[i]);
+            }
+                printf("\n");
+ 
+ //if(buffer[68]=='4'&& buffer[69]=='F'&&buffer[70]=='3'&& buffer[71]=='7')//recibe mensaje On
+ if(DS[0]=='O'&&DS[1]=='n')
+             {
+             
+             pc.printf("El mensaje es On\n");
+             /*buffer[66]=' ';
+             buffer[67]=' ';*/
+             buffer[68]=' ';
+             buffer[69]=' ';
+             buffer[70]=' ';
+             buffer[71]=' ';
+             if (LedRojo==1){
+             LedRojo=0;
+             pc.printf("Modo Encendido\n");//AT+CMGS=21 0011000A9113735689900000AA09 45F7B8EC26A7C96F
+             
+             // pasar a PDU Encendido
+             
+            // char EE[255];
+
+
+
+          //numero de caracteres de abajo
+    char EE[]="Carro Encendido";
+         LinON=strlen(EE);
+        
+        //----------------------------------- ---------------------------
+         P=0;Q=0;Y=0;
+         for (Y=0;Y < LinON;Y++){
+         ES[Y]=EE[Y+Q]>>P | EE[Y+Q+1]<<(7-P);
+         if (ES[Y]==0x00) {LoutON=Y; goto salir1;}
+         P++;
+         if (P==7) {P=0;Q++;} // se chequea que ya se acabaron los bits en un ciclo de conversion.
+         }
+
+         //--------------------------------------------------------------
+salir1:   for (Y=0;Y < LinON;Y++){
+         pc.printf("%X",EE[Y]);
+         }
+         pc.printf(":\r\n");
+         for (Y=0;Y<LoutON;Y++){
+         pc.printf("%2X,%d\r\n",ES[Y]&0x000000FF,Y);
+         }
+         pc.printf("LoutON:%d,LinON:%d\r\n",LoutON,strlen(EE));
+         
+             // fin pdu encendido 
+            
+             // envio mensaje de encendido 
+             // comienza el envio de coordenadas  
+
+         
+            pc.printf("Comienza SMS \n");
+           
+           
+           GSM.printf("AT+CMGS=%d\r\n",LoutON+13);
+            pc.printf("\n AT+CMGS=%d\r\n",LoutON+13);
+            wait(0.5);
+           
+        GSM.printf("0011000A91%c%c%c%c%c%c%c%c%c%c0000AA",buffer[38],buffer[39],buffer[40],buffer[41],buffer[42],buffer[43],buffer[44],buffer[45],buffer[46],buffer[47]);
+        pc.printf("0011000A91%c%c%c%c%c%c%c%c%c%c0000AA",buffer[38],buffer[39],buffer[40],buffer[41],buffer[42],buffer[43],buffer[44],buffer[45],buffer[46],buffer[47]);
+           //wait(0.5);
+           GSM.printf("%02X",LinON);
+           pc.printf("%02X",LinON);    
+        
+              
+            for (Y=0;Y < LoutON;Y++){
+             GSM.printf("%02X",ES[Y]&0x000000FF);  
+             pc.printf("%02X",ES[Y]&0x000000FF);}
+             
+             
+               GSM.putc((char)0x1A);  
+     GSM.scanf("%s",buffer);
+       pc.printf("%s",buffer);
+       pc.printf("\n rdy ");
+                
+            wait(1);
+        GSM.printf("AT+CMGD=1\r\n"); // AUTOBAUDIOS,ASINCRONICO
+     pc.printf("AT+CMGD=1\r\n");
+     GSM.scanf("%s",buffer);
+     pc.printf(">:) %s\r\n",buffer);  
+             
+             
+             // termina envio de mensaje de encendido
+             
+             }  //fin if de "modo encendido"
+         
+             
+             } // fin if del on
+             for(d=66;d<68;d+=2){
+                hexbyte[0]=buffer[d];
+                hexbyte[1]=buffer[d+1];
+                sscanf(hexbyte,"%X",&msglen[(d-66)/2]);
+                printf("%2X\n",msglen[(d-66)/2]);
+            }
+            lng=msglen[0];
+            int msg2[lng-1];
+            for(d=68;d<(68+((lng)*2));d+=2){
+                hexbyte[0]=buffer[d];
+                hexbyte[1]=buffer[d+1];
+                sscanf(hexbyte,"%X",&msg2[(d-68)/2]);
+                printf("%2X\n",msg2[(d-68)/2]);
+            }
+            LENOUT= lng*8/7;
+            K=7;
+            C=0;
+            DS[0]=msg2[0] & 0x7F;  // la primera sola
+            printf("%2X,%d,%d\r\n",DS[0],i,K);
+            for (i=1;i < LENOUT;i++){  // inicia el algoritmo
+                DS[i]=(msg2[i-1-C]>>K | msg2[i-C]<<(8-K))& 0x7F;  //valido para todos
+                printf("%2X,%d,%d\r\n",DS[i],i,K);
+            if (K==0) {K=8;C++;}
+                K--;
+            }
+            for (i=0;i < LENOUT;i++){
+                printf("%c",DS[i]);
+            }
+                printf("\n");
+  //if(buffer[68]=='4'&& buffer[69]=='F'&&buffer[70]=='B'&& buffer[71]=='3'&&buffer[72]=='1'&& buffer[73]=='9')//recibe mensaje Off
+  if(DS[0]=='O'&&DS[1]=='f'&&DS[2]=='f')
+             {
+            
+             pc.printf("El mensaje es Off\n");// se borra el mensaje
+             /*buffer[66]=' ';
+             buffer[67]=' ';*/
+             buffer[68]=' ';
+             buffer[69]=' ';
+             buffer[70]=' ';
+             buffer[71]=' ';
+             buffer[72]=' ';
+             buffer[73]=' ';
+               if (LedRojo==0){
+             LedRojo=1;
+        pc.printf("Modo Apagado\n"); // AT+CMGS=20  0011000A9113735689900000AA07 4178F81C26BF01
+        
+        char ES2[255];
+
+          //numero de caracteres de abajo
+    char EE2[]="Carro Apagado";
+         LinON2=strlen(EE2);
+        
+        //----------------------------------- ---------------------------
+         P2=0;Q2=0;Y2=0;
+         for (Y2=0;Y2 < LinON2;Y2++){
+         ES2[Y2]=EE2[Y2+Q2]>>P2 | EE2[Y2+Q2+1]<<(7-P2);
+         if (ES2[Y2]==0x00) {LoutON2=Y2; goto salir12;}
+         P2++;
+         if (P2==7) {P2=0;Q2++;} // se chequea que ya se acabaron los bits en un ciclo de conversion.
+         }
+
+         //--------------------------------------------------------------
+salir12:   for (Y2=0;Y2 < LinON2;Y2++){
+         pc.printf("%X",EE2[Y2]);
+         }
+         pc.printf(":\r\n");
+         for (Y2=0;Y2<LoutON2;Y2++){
+         pc.printf("%2X,%d\r\n",ES2[Y2]&0x000000FF,Y2);
+         }
+         pc.printf("LoutON2:%d,LinON2:%d\r\n",LoutON2,strlen(EE2));
+         
+             // fin pdu Apagado 
+            
+             // envio mensaje de Apagado 
+             
+
+         
+            pc.printf("Comienza SMS \n");
+           
+           
+           GSM.printf("AT+CMGS=%d\r\n",LoutON2+13);
+            pc.printf("\n AT+CMGS=%d\r\n",LoutON2+13);
+            wait(0.5);
+           
+        GSM.printf("0011000A91%c%c%c%c%c%c%c%c%c%c0000AA",buffer[38],buffer[39],buffer[40],buffer[41],buffer[42],buffer[43],buffer[44],buffer[45],buffer[46],buffer[47]);
+        pc.printf("0011000A91%c%c%c%c%c%c%c%c%c%c0000AA",buffer[38],buffer[39],buffer[40],buffer[41],buffer[42],buffer[43],buffer[44],buffer[45],buffer[46],buffer[47]);
+           //wait(0.5);
+           GSM.printf("%02X",LinON2);
+           pc.printf("%02X",LinON2);    
+        
+              
+            for (Y2=0;Y2 < LoutON2;Y2++){
+             GSM.printf("%02X",ES2[Y2]&0x000000FF);  
+             pc.printf("%02X",ES2[Y2]&0x000000FF);}
+             
+             
+               GSM.putc((char)0x1A);  
+     GSM.scanf("%s",buffer);
+       pc.printf("%s",buffer);
+       pc.printf("\n rdy ");
+          wait(1);
+           GSM.printf("AT+CMGD=1\r\n"); // AUTOBAUDIOS,ASINCRONICO
+     pc.printf("AT+CMGD=1\r\n");
+     GSM.scanf("%s",buffer);
+     pc.printf(">:) %s\r\n",buffer); 
+           
+             }// fin de modo "apagado"
+                         
+
+    
+            
+             }// fin if del off
+      
+             
+} //fin del if principal
+ 
+ }//fin del while
+}// fin del main
+// buffer[i] contiene lo que regresa
\ No newline at end of file
diff -r 000000000000 -r b11acb885c4c mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jun 19 10:44:48 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/cbbeb26dbd92
\ No newline at end of file