Prototyping the Adaptable Emergency System on an C027 board.

Dependencies:   C027_Support mbed

Fork of c027_prototyping by Philémon Favrod

Committer:
aroulin
Date:
Tue Sep 30 18:43:42 2014 +0000
Revision:
15:41e3e4613e34
Parent:
14:d1f114749b3c
Parent:
13:3c1f0b8c1d21
Child:
16:2b2f2a3bde5a
Solve conflicts

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 11:5354c4819b25 4 #include "MDM.h"
philemonf 1:23ffa0e091bc 5
philemonf 0:164fb9518d1a 6 int main() {
aroulin 7:eeef6f9fa1db 7 printf("Hello here is the position: ");
aroulin 7:eeef6f9fa1db 8 struct gps_data_t gps_data;
aroulin 7:eeef6f9fa1db 9 gps_locate(&gps_data);
aroulin 7:eeef6f9fa1db 10 printf("https://maps.google.com/?q=%.5f,%.5f\n", gps_data.la, gps_data.lo);
aroulin 13:3c1f0b8c1d21 11
aroulin 14:d1f114749b3c 12 MDMSerial mdm;
aroulin 14:d1f114749b3c 13 init_sms_features(&mdm);
aroulin 15:41e3e4613e34 14
aroulin 13:3c1f0b8c1d21 15 struct sms_data_t sms;
aroulin 13:3c1f0b8c1d21 16 sms.phone_num = "+41774084185";
aroulin 13:3c1f0b8c1d21 17 sms.msg_buf = "Je suis une carte u-blox. Tu veux etre mon ami ?";
aroulin 13:3c1f0b8c1d21 18 printf("Now I will send a SMS\n");
aroulin 13:3c1f0b8c1d21 19 send_sms(&sms);
aroulin 13:3c1f0b8c1d21 20
aroulin 14:d1f114749b3c 21 char buf1[32];
aroulin 14:d1f114749b3c 22 char buf2[256];
aroulin 14:d1f114749b3c 23 sms.phone_num = buf1;
aroulin 14:d1f114749b3c 24 sms.msg_buf = buf2;
aroulin 15:41e3e4613e34 25
aroulin 13:3c1f0b8c1d21 26 while(!read_sms(&sms));
aroulin 13:3c1f0b8c1d21 27 printf("Received sms from %s:\n%s\n", sms.phone_num, sms.msg_buf);
aroulin 7:eeef6f9fa1db 28 printf("End");
philemonf 1:23ffa0e091bc 29 return 0;
aroulin 14:d1f114749b3c 30 }