A porting of a GPS decoding and presenting program within the mbos RTOS. It is not a definitive application but a study program to test NMEA full decoding library and a first approach to an RTOS. Many thanks to Andrew Levido for his support and his patience on teaching me the RTOS principles from the other side of the Earth. It uses NMEA library by Tim (xtimor@gmail.com) ported by Ken Todotani (http://mbed.org/users/todotani/) on public mbed library (http://mbed.org/users/todotani/programs/GPS_nmeaLib/5yo4h) also available, as original universal C library, on http://nmea.sourceforge.net
Dependencies: mbos Watchdog TextLCD mbed ConfigFile
nmea/generator.h@3:a2f9eb3b8a16, 2012-02-03 (annotated)
- Committer:
- guiott
- Date:
- Fri Feb 03 16:29:52 2012 +0000
- Revision:
- 3:a2f9eb3b8a16
- Parent:
- 0:d177c0087d1f
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
guiott | 0:d177c0087d1f | 1 | /* |
guiott | 0:d177c0087d1f | 2 | * |
guiott | 0:d177c0087d1f | 3 | * NMEA library |
guiott | 0:d177c0087d1f | 4 | * URL: http://nmea.sourceforge.net |
guiott | 0:d177c0087d1f | 5 | * Author: Tim (xtimor@gmail.com) |
guiott | 0:d177c0087d1f | 6 | * Licence: http://www.gnu.org/licenses/lgpl.html |
guiott | 0:d177c0087d1f | 7 | * $Id: generator.h 4 2007-08-27 13:11:03Z xtimor $ |
guiott | 0:d177c0087d1f | 8 | * |
guiott | 0:d177c0087d1f | 9 | */ |
guiott | 0:d177c0087d1f | 10 | |
guiott | 0:d177c0087d1f | 11 | #ifndef __NMEA_GENERATOR_H__ |
guiott | 0:d177c0087d1f | 12 | #define __NMEA_GENERATOR_H__ |
guiott | 0:d177c0087d1f | 13 | |
guiott | 0:d177c0087d1f | 14 | #include "info.h" |
guiott | 0:d177c0087d1f | 15 | |
guiott | 0:d177c0087d1f | 16 | #ifdef __cplusplus |
guiott | 0:d177c0087d1f | 17 | extern "C" { |
guiott | 0:d177c0087d1f | 18 | #endif |
guiott | 0:d177c0087d1f | 19 | |
guiott | 0:d177c0087d1f | 20 | /* |
guiott | 0:d177c0087d1f | 21 | * high level |
guiott | 0:d177c0087d1f | 22 | */ |
guiott | 0:d177c0087d1f | 23 | |
guiott | 0:d177c0087d1f | 24 | struct _nmeaGENERATOR; |
guiott | 0:d177c0087d1f | 25 | |
guiott | 0:d177c0087d1f | 26 | enum nmeaGENTYPE |
guiott | 0:d177c0087d1f | 27 | { |
guiott | 0:d177c0087d1f | 28 | NMEA_GEN_NOISE = 0, |
guiott | 0:d177c0087d1f | 29 | NMEA_GEN_STATIC, |
guiott | 0:d177c0087d1f | 30 | NMEA_GEN_ROTATE, |
guiott | 0:d177c0087d1f | 31 | |
guiott | 0:d177c0087d1f | 32 | NMEA_GEN_SAT_STATIC, |
guiott | 0:d177c0087d1f | 33 | NMEA_GEN_SAT_ROTATE, |
guiott | 0:d177c0087d1f | 34 | NMEA_GEN_POS_RANDMOVE, |
guiott | 0:d177c0087d1f | 35 | |
guiott | 0:d177c0087d1f | 36 | NMEA_GEN_LAST |
guiott | 0:d177c0087d1f | 37 | }; |
guiott | 0:d177c0087d1f | 38 | |
guiott | 0:d177c0087d1f | 39 | struct _nmeaGENERATOR * nmea_create_generator(int type, nmeaINFO *info); |
guiott | 0:d177c0087d1f | 40 | void nmea_destroy_generator(struct _nmeaGENERATOR *gen); |
guiott | 0:d177c0087d1f | 41 | |
guiott | 0:d177c0087d1f | 42 | int nmea_generate_from( |
guiott | 0:d177c0087d1f | 43 | char *buff, int buff_sz, /* buffer */ |
guiott | 0:d177c0087d1f | 44 | nmeaINFO *info, /* source info */ |
guiott | 0:d177c0087d1f | 45 | struct _nmeaGENERATOR *gen, /* generator */ |
guiott | 0:d177c0087d1f | 46 | int generate_mask /* mask of sentence`s (e.g. GPGGA | GPGSA) */ |
guiott | 0:d177c0087d1f | 47 | ); |
guiott | 0:d177c0087d1f | 48 | |
guiott | 0:d177c0087d1f | 49 | /* |
guiott | 0:d177c0087d1f | 50 | * low level |
guiott | 0:d177c0087d1f | 51 | */ |
guiott | 0:d177c0087d1f | 52 | |
guiott | 0:d177c0087d1f | 53 | typedef int (*nmeaNMEA_GEN_INIT)(struct _nmeaGENERATOR *gen, nmeaINFO *info); |
guiott | 0:d177c0087d1f | 54 | typedef int (*nmeaNMEA_GEN_LOOP)(struct _nmeaGENERATOR *gen, nmeaINFO *info); |
guiott | 0:d177c0087d1f | 55 | typedef int (*nmeaNMEA_GEN_RESET)(struct _nmeaGENERATOR *gen, nmeaINFO *info); |
guiott | 0:d177c0087d1f | 56 | typedef int (*nmeaNMEA_GEN_DESTROY)(struct _nmeaGENERATOR *gen); |
guiott | 0:d177c0087d1f | 57 | |
guiott | 0:d177c0087d1f | 58 | typedef struct _nmeaGENERATOR |
guiott | 0:d177c0087d1f | 59 | { |
guiott | 0:d177c0087d1f | 60 | void *gen_data; |
guiott | 0:d177c0087d1f | 61 | nmeaNMEA_GEN_INIT init_call; |
guiott | 0:d177c0087d1f | 62 | nmeaNMEA_GEN_LOOP loop_call; |
guiott | 0:d177c0087d1f | 63 | nmeaNMEA_GEN_RESET reset_call; |
guiott | 0:d177c0087d1f | 64 | nmeaNMEA_GEN_DESTROY destroy_call; |
guiott | 0:d177c0087d1f | 65 | struct _nmeaGENERATOR *next; |
guiott | 0:d177c0087d1f | 66 | |
guiott | 0:d177c0087d1f | 67 | } nmeaGENERATOR; |
guiott | 0:d177c0087d1f | 68 | |
guiott | 0:d177c0087d1f | 69 | int nmea_gen_init(nmeaGENERATOR *gen, nmeaINFO *info); |
guiott | 0:d177c0087d1f | 70 | int nmea_gen_loop(nmeaGENERATOR *gen, nmeaINFO *info); |
guiott | 0:d177c0087d1f | 71 | int nmea_gen_reset(nmeaGENERATOR *gen, nmeaINFO *info); |
guiott | 0:d177c0087d1f | 72 | void nmea_gen_destroy(nmeaGENERATOR *gen); |
guiott | 0:d177c0087d1f | 73 | void nmea_gen_add(nmeaGENERATOR *to, nmeaGENERATOR *gen); |
guiott | 0:d177c0087d1f | 74 | |
guiott | 0:d177c0087d1f | 75 | #ifdef __cplusplus |
guiott | 0:d177c0087d1f | 76 | } |
guiott | 0:d177c0087d1f | 77 | #endif |
guiott | 0:d177c0087d1f | 78 | |
guiott | 0:d177c0087d1f | 79 | #endif /* __NMEA_GENERATOR_H__ */ |