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@14:d1f114749b3c, 2014-09-30 (annotated)
- Committer:
- aroulin
- Date:
- Tue Sep 30 18:40:54 2014 +0000
- Revision:
- 14:d1f114749b3c
- Parent:
- 11:5354c4819b25
- Child:
- 15:41e3e4613e34
Test of SMS and GPS is working.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| philemonf | 0:164fb9518d1a | 1 | #include "mbed.h" |
| aroulin | 14:d1f114749b3c | 2 | #include "gps_locate.h" |
| aroulin | 14:d1f114749b3c | 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 | 14:d1f114749b3c | 11 | |
| aroulin | 14:d1f114749b3c | 12 | MDMSerial mdm; |
| aroulin | 14:d1f114749b3c | 13 | init_sms_features(&mdm); |
| aroulin | 14:d1f114749b3c | 14 | struct sms_data_t sms; |
| aroulin | 14:d1f114749b3c | 15 | sms.phone_num = "+41774084185"; |
| aroulin | 14:d1f114749b3c | 16 | sms.msg_buf = "Je suis une carte u-blox. Tu veux etre mon ami ?"; |
| aroulin | 14:d1f114749b3c | 17 | printf("Now I will send a SMS\n"); |
| aroulin | 14:d1f114749b3c | 18 | send_sms(&sms); |
| aroulin | 14:d1f114749b3c | 19 | |
| aroulin | 14:d1f114749b3c | 20 | char buf1[32]; |
| aroulin | 14:d1f114749b3c | 21 | char buf2[256]; |
| aroulin | 14:d1f114749b3c | 22 | sms.phone_num = buf1; |
| aroulin | 14:d1f114749b3c | 23 | sms.msg_buf = buf2; |
| aroulin | 14:d1f114749b3c | 24 | while(!read_sms(&sms)); |
| aroulin | 14:d1f114749b3c | 25 | printf("Received sms from %s:\n%s\n", sms.phone_num, sms.msg_buf); |
| aroulin | 7:eeef6f9fa1db | 26 | printf("End"); |
| philemonf | 1:23ffa0e091bc | 27 | return 0; |
| aroulin | 14:d1f114749b3c | 28 | } |
