Prototyping the Adaptable Emergency System on an C027 board.
Dependencies: C027_Support mbed
Fork of c027_prototyping by
Revision 1:23ffa0e091bc, committed 2014-09-30
- Comitter:
- philemonf
- Date:
- Tue Sep 30 14:38:57 2014 +0000
- Parent:
- 0:164fb9518d1a
- Child:
- 2:0eb41327c023
- Child:
- 3:12e1c2c71cf2
- Commit message:
- Add tests for the CellLocate
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cell_locate.cpp Tue Sep 30 14:38:57 2014 +0000 @@ -0,0 +1,14 @@ +#include "cell_locate.h" + +#include "MDM.h" + +int cell_locate_init(void) +{ + +} + +int cell_locate(cell_locate_data_t *cell_locate_data) +{ + + return 0; +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cell_locate.h Tue Sep 30 14:38:57 2014 +0000 @@ -0,0 +1,12 @@ + +#ifndef __CELL_LOCATE_H__ +#define __CELL_LOCATE_H__ + +struct cell_locate_data_t { + float latitude; + float longitude; +}; + +int cell_locate(cell_locate_data_t *cell_locate_data); + +#endif \ No newline at end of file
--- a/main.cpp Tue Sep 30 13:58:43 2014 +0000 +++ b/main.cpp Tue Sep 30 14:38:57 2014 +0000 @@ -1,15 +1,27 @@ #include "mbed.h" -#ifdef TARGET_UBLOX_C027 - #include "C027_api.h" -#else - #error "This example is targeted for the C027 platform" -#endif +#include "MDM.h" DigitalOut myled(LED); + int main() { - while(1) { - myled = !myled; - wait(0.2); - } + MDMSerial mdm; + + MDMParser::DevStatus devStatus = {}; + + bool mdmOk = mdm.init("5554", &devStatus); + mdm.dumpDevStatus(&devStatus); + + if (!mdmOk) { + printf("ERROR"); + } + + mdm.sendFormated("AT+ULOCCELL=0"); + if (RESP_OK == mdm.waitFinalResp()) { + printf("Receive OK"); + } else { + printf("Does not receive OK"); + } + + return 0; }