libgps 1.7 (credits tytung)

This commit is contained in:
Arif Ali 2011-07-17 16:38:34 +01:00
parent f078808c05
commit af5fc1119f
2 changed files with 14 additions and 8 deletions

View File

@ -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;
}

View File

@ -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 = {