Andy & Phil / Mbed 2 deprecated c027_prototyping

Dependencies:   C027_Support mbed

Fork of c027_prototyping by Philémon Favrod

Committer:
aroulin
Date:
Tue Sep 30 18:24:49 2014 +0000
Revision:
13:3c1f0b8c1d21
Parent:
7:eeef6f9fa1db
Child:
15:41e3e4613e34
Testing sms and gps

Who changed what in which revision?

UserRevisionLine numberNew contents of line
philemonf 0:164fb9518d1a 1 #include "mbed.h"
aroulin 7:eeef6f9fa1db 2 #include "gps_locate.h"
aroulin 13:3c1f0b8c1d21 3 #include "sms_lib.h"
philemonf 1:23ffa0e091bc 4
philemonf 0:164fb9518d1a 5 int main() {
aroulin 7:eeef6f9fa1db 6 printf("Hello here is the position: ");
aroulin 7:eeef6f9fa1db 7 struct gps_data_t gps_data;
aroulin 7:eeef6f9fa1db 8 gps_locate(&gps_data);
aroulin 7:eeef6f9fa1db 9 printf("https://maps.google.com/?q=%.5f,%.5f\n", gps_data.la, gps_data.lo);
aroulin 13:3c1f0b8c1d21 10
aroulin 13:3c1f0b8c1d21 11 struct sms_data_t sms;
aroulin 13:3c1f0b8c1d21 12 sms.phone_num = "+41774084185";
aroulin 13:3c1f0b8c1d21 13 sms.msg_buf = "Je suis une carte u-blox. Tu veux etre mon ami ?";
aroulin 13:3c1f0b8c1d21 14 printf("Now I will send a SMS\n");
aroulin 13:3c1f0b8c1d21 15 send_sms(&sms);
aroulin 13:3c1f0b8c1d21 16
aroulin 13:3c1f0b8c1d21 17 sms.phone_num = new char[32];
aroulin 13:3c1f0b8c1d21 18 sms.msg_buf = new char[256];
aroulin 13:3c1f0b8c1d21 19 while(!read_sms(&sms));
aroulin 13:3c1f0b8c1d21 20 printf("Received sms from %s:\n%s\n", sms.phone_num, sms.msg_buf);
aroulin 7:eeef6f9fa1db 21 printf("End");
philemonf 1:23ffa0e091bc 22 return 0;
philemonf 0:164fb9518d1a 23 }