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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers generator.h Source File

generator.h

00001 /*
00002  *
00003  * NMEA library
00004  * URL: http://nmea.sourceforge.net
00005  * Author: Tim (xtimor@gmail.com)
00006  * Licence: http://www.gnu.org/licenses/lgpl.html
00007  * $Id: generator.h 4 2007-08-27 13:11:03Z xtimor $
00008  *
00009  */
00010 
00011 #ifndef __NMEA_GENERATOR_H__
00012 #define __NMEA_GENERATOR_H__
00013 
00014 #include "info.h "
00015 
00016 #ifdef  __cplusplus
00017 extern "C" {
00018 #endif
00019 
00020 /*
00021  * high level
00022  */
00023 
00024 struct _nmeaGENERATOR;
00025 
00026 enum nmeaGENTYPE
00027 {
00028     NMEA_GEN_NOISE = 0,
00029     NMEA_GEN_STATIC,
00030     NMEA_GEN_ROTATE,
00031 
00032     NMEA_GEN_SAT_STATIC,
00033     NMEA_GEN_SAT_ROTATE,
00034     NMEA_GEN_POS_RANDMOVE,
00035 
00036     NMEA_GEN_LAST
00037 };
00038 
00039 struct _nmeaGENERATOR * nmea_create_generator(int type, nmeaINFO *info);
00040 void    nmea_destroy_generator(struct _nmeaGENERATOR *gen);
00041 
00042 int     nmea_generate_from(
00043         char *buff, int buff_sz,    /* buffer */
00044         nmeaINFO *info,             /* source info */
00045         struct _nmeaGENERATOR *gen, /* generator */
00046         int generate_mask           /* mask of sentence`s (e.g. GPGGA | GPGSA) */
00047         );
00048 
00049 /*
00050  * low level
00051  */
00052 
00053 typedef int (*nmeaNMEA_GEN_INIT)(struct _nmeaGENERATOR *gen, nmeaINFO *info);
00054 typedef int (*nmeaNMEA_GEN_LOOP)(struct _nmeaGENERATOR *gen, nmeaINFO *info);
00055 typedef int (*nmeaNMEA_GEN_RESET)(struct _nmeaGENERATOR *gen, nmeaINFO *info);
00056 typedef int (*nmeaNMEA_GEN_DESTROY)(struct _nmeaGENERATOR *gen);
00057 
00058 typedef struct _nmeaGENERATOR
00059 {
00060     void                *gen_data;
00061     nmeaNMEA_GEN_INIT    init_call;
00062     nmeaNMEA_GEN_LOOP    loop_call;
00063     nmeaNMEA_GEN_RESET   reset_call;
00064     nmeaNMEA_GEN_DESTROY destroy_call;
00065     struct _nmeaGENERATOR *next;
00066 
00067 } nmeaGENERATOR;
00068 
00069 int     nmea_gen_init(nmeaGENERATOR *gen, nmeaINFO *info);
00070 int     nmea_gen_loop(nmeaGENERATOR *gen, nmeaINFO *info);
00071 int     nmea_gen_reset(nmeaGENERATOR *gen, nmeaINFO *info);
00072 void    nmea_gen_destroy(nmeaGENERATOR *gen);
00073 void    nmea_gen_add(nmeaGENERATOR *to, nmeaGENERATOR *gen);
00074 
00075 #ifdef  __cplusplus
00076 }
00077 #endif
00078 
00079 #endif /* __NMEA_GENERATOR_H__ */