kl25zgsmgprs

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
Harshithanagaraju
Date:
Sat Apr 25 11:23:43 2015 +0000
Commit message:
kl25zgsmgprs

Changed in this revision

TextLCD.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 a540c6fcb19b TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Sat Apr 25 11:23:43 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#e4cb7ddee0d3
diff -r 000000000000 -r a540c6fcb19b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Apr 25 11:23:43 2015 +0000
@@ -0,0 +1,104 @@
+#include "mbed.h"
+#include "Serial.h"
+#include "TextLCD.h"
+TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5);
+Serial RFID(PTA2, PTA1);
+char  a=0x1A,e=0x22,c=0x0d;
+char *s1,*str,*s2;
+char num[] = "9972237269";
+int cou=0,t1=1;
+char n1[25];
+char char1;
+//long int p1=25864;
+long int rfidno;
+int b1;
+Serial GPRS(PTE22,PTE23);
+  // tx, rx
+Serial pc(USBTX,USBRX);
+void flush(void); 
+void barrer_set();
+void gprs1_set(long int);
+int main()
+   {
+       pc.baud(9600);
+       GPRS.baud(9600);
+        
+        
+        lcd.printf("Swipe >>       ");// 
+        RFID.scanf("%d", &rfidno);
+        lcd.locate(0,0);
+        lcd.printf("%d  ",rfidno);
+        wait(4);
+        pc.printf("%d",rfidno);
+        pc.printf("\r \n");
+        wait(0.3);
+        lcd.locate(0,0);
+        lcd.cls();
+    barrer_set();
+     gprs1_set(rfidno);
+    
+   
+  
+   }
+void barrer_set()
+{
+    GPRS.printf("AT+SAPBR=0,1\r\n");
+   wait(2);
+   GPRS.printf("AT+SAPBR=3,1,\"Contype\",\"GPRS\"\r\n");
+   wait(2);
+   GPRS.printf("AT+SAPBR=3,1,\"APN\",\"AIRTELGPRS.COM\"\r\n");
+   wait(2);
+   char *f;
+   flush();
+   GPRS.printf("AT+SAPBR=1,1\r\n");
+   while(!GPRS.readable())
+   {}
+   GPRS.scanf("%s",f);
+    GPRS.scanf("%s",f);
+   if(f[0]!='O' && f[1]!='K' )
+   barrer_set();
+    }
+    void gprs1_set(long int rfidno)
+    {
+        char *f;
+        GPRS.printf("AT+HTTPINIT\r\n");
+      wait(5);
+      GPRS.printf("AT+HTTPPARA=\"CID\",1\r\n");
+      wait(5);
+    GPRS.printf("AT+HTTPPARA=\"URL\",\"http://www.abtsystem.netai.net/view.php?rfidno=%ld\"r\n",rfidno);
+    wait(5);
+       GPRS.printf("AT+HTTPDATA=1000,5000\r\n");
+       wait(2);
+   GPRS.printf("AT+HTTPACTION=1\r\n");
+    wait(6);
+     GPRS.printf("AT+HTTPPARA=\"CID\",1\r\n");
+      wait(5);
+      flush();
+   GPRS.printf("AT+SAPBR=1,1\r\n");
+   while(!GPRS.readable())
+   {}
+   GPRS.scanf("%s",f);
+    GPRS.scanf("%s",f);
+   if(f[0]!='O' && f[1]!='K' )
+   wait(4);
+    GPRS.printf("AT+HTTPPARA=\"URL\",\"http://www.abtsystem.netai.net/view.php?rfidno=%ld\"r\n",rfidno);
+    wait(5);
+    GPRS.printf("AT+HTTPACTION=0\r\n");
+    wait(5);
+    GPRS.printf("AT+HTTPREAD\r\n");
+    GPRS.scanf("%s",str);
+    s1=str;
+    pc.printf("%s",s1);
+    lcd.printf("%s",s1);
+    GPRS.scanf("%s",str);
+    s2=str;
+    pc.printf("%s",s2);
+     lcd.printf("%s",s2);   
+        }
+void flush(void)
+{
+char char1 = 0; 
+    while (GPRS.readable())
+     { char1 = GPRS.getc(); } 
+     return;
+      }
diff -r 000000000000 -r a540c6fcb19b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Apr 25 11:23:43 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9ad691361fac
\ No newline at end of file