GPRS

Files at this revision

API Documentation at this revision

Comitter:
acafa
Date:
Sun Sep 11 21:10:00 2016 +0000
Commit message:
CODIGO GPRS;

Changed in this revision

envio_tramas.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r d0172354f941 envio_tramas.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/envio_tramas.cpp	Sun Sep 11 21:10:00 2016 +0000
@@ -0,0 +1,54 @@
+#include "mbed.h"
+
+Serial gprs(USBTX, USBRX);
+Timer t;
+DigitalOut led1(LED1);
+int main() 
+{
+    gprs.baud(115200);
+    gprs.format(8,Serial::None,1);
+    while(1)
+    {
+//    t.start();
+//    pc.printf("Hello World! @9600kbps\n",1285);
+//    t.stop();
+//    pc.printf("The time taken was %f seconds\n", t.read());
+//    t.reset();
+
+
+
+     	wait_ms(500);
+    	gprs.printf("ATV1\r\n");
+    	wait_ms(500);
+    	gprs.printf("AT+CMEE=%d\r\n",2);
+    	wait_ms(500);
+    	gprs.printf("AT+CPIN?\r\n");
+    	wait_ms(500);
+    	gprs.printf("AT+CSQ\r\n");
+    	wait_ms(500);
+    	gprs.printf("AT+CREG?\r\n");
+    	wait_ms(500);
+    	gprs.printf("AT+QIMODE=%d\r\n",0);
+    	wait_ms(500);
+    	gprs.printf("AT+QICSGP=1","igprs.claro.com.ar\r\n");
+    	wait_ms(500);
+       	gprs.printf("AT+QIREGAPP\r\n");
+    	wait_ms(500);
+    	gprs.printf("AT+QIACT\r\n");
+    	wait_ms(500);
+    	gprs.printf("AT+QILOCIP\r\n");
+    	wait_ms(500);
+    	gprs.printf("AT+QIDNSIP=%d\r\n",0);
+    	wait_ms(500);
+    	gprs.printf("AT+QIOPEN=\"UDP\",\"24.232.33.179\",2502\r\n");
+    	wait_ms(500);
+    	gprs.printf("AT+QISEND\r\n");
+    	wait_ms(500);
+    	gprs.printf("LELE PUTO\r\n");
+    	wait_ms(500);
+    	gprs.printf("1A\r\n");
+
+        wait(1.0);
+        led1 = !led1;
+    }
+}