00001 #ifndef __CBGPS_H_ 00002 #define __CBGPS_H_ 00003 00004 #include "cbser.h" 00005 00045 #define DEFAULT_SYSTEM WGS84 00046 00047 #ifdef __cplusplus 00048 extern "C" { 00049 #endif 00050 00053 typedef enum { 00055 WGS84 = 0, 00057 GRS80 = 1, 00059 WGS72 = 2, 00061 AUSTRALIAN1965 = 3, 00063 KRASOVSKY1940 = 4, 00065 INTERNATIONAL1924 = 5, 00067 CLAKE1880 = 6, 00069 CLARKE1866 = 7, 00071 AIRY1830 = 8, 00073 BESSEL1841 = 9, 00075 EVEREST1830 = 10 00076 } t_cbgps_utmsys; 00077 00090 typedef void (*t_cbgpscb)(double,double,double,double,double,double,void*); 00091 00094 typedef struct { 00097 t_comport hcom; 00100 t_cbgpscb rdCb; 00103 void *ctx; 00106 t_cbgps_utmsys system; 00107 } t_cbgps; 00108 00183 int cbgps_gga(const char *aGGASeq, 00184 t_cbgps_utmsys aUTMSystem, 00185 double *theUTC, 00186 double *theNLat, 00187 double *theELong, 00188 double *theAlt, 00189 double *theUTMN, 00190 double *theUTME); 00191 00218 int cbgpsopen(t_cbgps *theHandle, 00219 const char *aComPort, 00220 const t_cbserparam *aSpeed, 00221 const t_cbserparam *databits, 00222 const t_cbserparam *aParity, 00223 const t_cbserparam *stopbits, 00224 int aTimeout, 00225 t_cbgps_utmsys aSystem, 00226 t_cbgpscb rdCb, 00227 void *aCtx); 00228 00257 int cbgpsopenstr(t_cbgps *theHandle, 00258 const char *aComPort, 00259 const char *aSpeed, 00260 const char *databits, 00261 const char *aParity, 00262 const char *stopbits, 00263 int aTimeout, 00264 t_cbgps_utmsys aSystem, 00265 t_cbgpscb rdCb, 00266 void *aCtx); 00267 00296 int cbgpsopenwstr(t_cbgps *theHandle, 00297 const wchar_t *aComPort, 00298 const wchar_t *aSpeed, 00299 const wchar_t *databits, 00300 const wchar_t *aParity, 00301 const wchar_t *stopbits, 00302 int aTimeout, 00303 t_cbgps_utmsys aSystem, 00304 t_cbgpscb rdCb, 00305 void *aCtx); 00306 00310 int cbgpsclose(t_cbgps *aHandle); 00311 00319 void cbgpsinit(t_cbgps *theHandle); 00320 00321 #ifdef __cplusplus 00322 } 00323 #endif 00324 00325 #endif 00326