Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C027_Support mbed
Fork of c027_prototyping by
main.cpp@13:3c1f0b8c1d21, 2014-09-30 (annotated)
- 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?
| User | Revision | Line number | New 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 | } |
