From af5fc1119f9d6c223a5f9d2c11679e6d46c772f3 Mon Sep 17 00:00:00 2001 From: Arif Ali Date: Sun, 17 Jul 2011 16:38:34 +0100 Subject: [PATCH] libgps 1.7 (credits tytung) --- libgps/leo-gps-rpc.c | 10 ++++++++-- libgps/leo-gps.c | 12 ++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libgps/leo-gps-rpc.c b/libgps/leo-gps-rpc.c index 792ff8e..f32fbb2 100644 --- a/libgps/leo-gps-rpc.c +++ b/libgps/leo-gps-rpc.c @@ -38,7 +38,9 @@ #define LOG_TAG "gps_leo_rpc" -#define MEASUREMENT_PRECISION 5.0f // in meters +#define ENABLE_NMEA 0 + +#define MEASUREMENT_PRECISION 10.0f // in meters #define DUMP_DATA 0 #define GPS_DEBUG 0 @@ -86,7 +88,11 @@ struct SVCXPRT { static uint32_t client_IDs[16];//highest known value is 0xb static uint32_t can_send=1; //To prevent from sending get_position when EVENT_END hasn't been received static uint32_t has_fix=0; +#if ENABLE_NMEA static uint32_t use_nmea=1; +#else +static uint32_t use_nmea=0; +#endif static struct CLIENT *_clnt; static struct timeval timeout; @@ -726,7 +732,7 @@ int init_gps_rpc() int gps_xtra_set_data(unsigned char *xtra_data_ptr, uint32_t part_len, uint8_t part, uint8_t total_parts) { uint32_t res = -1; - res = pdsm_xtra_set_data(_clnt, 0, client_IDs[0xb], 0, xtra_data_ptr, part_len, part, total_parts, 0); + res = pdsm_xtra_set_data(_clnt, 0, client_IDs[0xb], 0, xtra_data_ptr, part_len, part, total_parts, 1); return res; } diff --git a/libgps/leo-gps.c b/libgps/leo-gps.c index 371f0de..f70812f 100644 --- a/libgps/leo-gps.c +++ b/libgps/leo-gps.c @@ -37,10 +37,10 @@ #define LOG_TAG "gps_leo" #define XTRA_BLOCK_SIZE 400 -#define DISABLE_XTRA_DATA 1 // AGPS data injection not works yet #define DISABLE_CLEANUP 1 // fully shutting down the GPS is temporarily disabled +#define ENABLE_NMEA 0 -#define MEASUREMENT_PRECISION 5.0f // in meters +#define MEASUREMENT_PRECISION 10.0f // in meters #define DUMP_DATA 0 #define GPS_DEBUG 1 @@ -921,7 +921,11 @@ static void gps_state_init( GpsState* state ) { state->init = 1; state->control[0] = -1; state->control[1] = -1; +#if ENABLE_NMEA state->fd = open("/dev/smd27", O_RDONLY); +#else + state->fd; +#endif if ( socketpair( AF_LOCAL, SOCK_STREAM, 0, state->control ) < 0 ) { LOGE("could not create thread control socket pair: %s", strerror(errno)); @@ -965,9 +969,6 @@ static int gps_xtra_init(GpsXtraCallbacks* callbacks) { static int gps_xtra_inject_xtra_data(char* data, int length) { D("%s() is called", __FUNCTION__); D("gps_xtra_inject_xtra_data: xtra size = %d, data ptr = 0x%x\n", length, (int) data); -#if DISABLE_XTRA_DATA - return 0; -#else GpsState* s = _gps_state; if (!s->init) return 0; @@ -1019,7 +1020,6 @@ static int gps_xtra_inject_xtra_data(char* data, int length) { } return ret_val; -#endif } static const GpsXtraInterface sGpsXtraInterface = {