5 * Copyright (C) 2005 Alfredo Pironti
7 * This software is distributed under a BSD-style license. See the
8 * file "COPYING" in the toop-level directory of the distribution for details.
11 #include <sys/types.h>
12 #include "gps.h" //the C library we are going to wrap
17 #include "libQgpsmm_global.h"
18 class LIBQGPSMMSHARED_EXPORT gpsmm {
23 struct gps_data_t* open(const char *host,const char *port); //opens the connection with gpsd, MUST call this before any other method
24 struct gps_data_t* open(void); //open() with default values
25 struct gps_data_t* send(const char *request); //put a command to gpsd and return the updated struct
26 struct gps_data_t* stream(int); //set watcher and policy flags
27 struct gps_data_t* poll(void); //block until gpsd returns new data, then return the updated struct
28 int close(void); // close the GPS
29 bool waiting(void); //nonblocking check for data waitin
31 void enable_debug(int, FILE*);
33 struct gps_data_t *gps_data;
34 struct gps_data_t *to_user; //we return the user a copy of the internal structure. This way she can modify it without
35 //integrity loss for the entire class
36 struct gps_data_t* backup(void) { *to_user=*gps_data; return to_user;}; //return the backup copy
38 #endif // _GPSD_GPSMM_H_