Migrating XTRA from gpsonextra.net to cloud based izatcloud.net
*Added logic to remove xtra1.gpsonextra.net from URLs received from modem. *Added logic to override modem URLs with those configured in gps.conf *Replaced all instances of xtra{1,2,3}.gpsonextra.net domain URLs in gps.conf with xtrapath{1,2,3}.izatcloud.net URLs. *Replaced all commented instances of xtra.bin in gps.conf with xtra2.bin. CRs-fixed: 643816 Change-Id: I5c7f16a2c64e716a6cb005fec33b35a039601341
This commit is contained in:
parent
96d7dd8f82
commit
afbcf661d5
3 changed files with 42 additions and 8 deletions
|
@ -1,8 +1,8 @@
|
||||||
#Uncommenting these urls would only enable
|
#Uncommenting these urls would only enable
|
||||||
#the power up auto injection and force injection(test case).
|
#the power up auto injection and force injection(test case).
|
||||||
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra2.bin
|
XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra2.bin
|
||||||
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra2.bin
|
XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin
|
||||||
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra2.bin
|
XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin
|
||||||
|
|
||||||
# Error Estimate
|
# Error Estimate
|
||||||
# _SET = 1
|
# _SET = 1
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <new>
|
||||||
#include <LocEngAdapter.h>
|
#include <LocEngAdapter.h>
|
||||||
|
|
||||||
#include <cutils/sched_policy.h>
|
#include <cutils/sched_policy.h>
|
||||||
|
@ -84,6 +84,8 @@
|
||||||
#define SAP_CONF_FILE "/etc/sap.conf"
|
#define SAP_CONF_FILE "/etc/sap.conf"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define XTRA1_GPSONEXTRA "xtra1.gpsonextra.net"
|
||||||
|
|
||||||
using namespace loc_core;
|
using namespace loc_core;
|
||||||
|
|
||||||
boolean configAlreadyRead = false;
|
boolean configAlreadyRead = false;
|
||||||
|
@ -119,6 +121,10 @@ static loc_param_s_type loc_parameter_table[] =
|
||||||
{"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'},
|
{"LPP_PROFILE", &gps_conf.LPP_PROFILE, NULL, 'n'},
|
||||||
{"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
|
{"A_GLONASS_POS_PROTOCOL_SELECT", &gps_conf.A_GLONASS_POS_PROTOCOL_SELECT, NULL, 'n'},
|
||||||
{"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'},
|
{"SENSOR_PROVIDER", &sap_conf.SENSOR_PROVIDER, NULL, 'n'},
|
||||||
|
{"XTRA_VERSION_CHECK", &gps_conf.XTRA_VERSION_CHECK, NULL, 'n'},
|
||||||
|
{"XTRA_SERVER_1", &gps_conf.XTRA_SERVER_1, NULL, 's'},
|
||||||
|
{"XTRA_SERVER_2", &gps_conf.XTRA_SERVER_2, NULL, 's'},
|
||||||
|
{"XTRA_SERVER_3", &gps_conf.XTRA_SERVER_3, NULL, 's'}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void loc_default_parameters(void)
|
static void loc_default_parameters(void)
|
||||||
|
@ -909,12 +915,34 @@ LocEngReportXtraServer::LocEngReportXtraServer(void* locEng,
|
||||||
LocMsg(), mLocEng(locEng), mMaxLen(maxlength),
|
LocMsg(), mLocEng(locEng), mMaxLen(maxlength),
|
||||||
mServers(new char[3*(mMaxLen+1)])
|
mServers(new char[3*(mMaxLen+1)])
|
||||||
{
|
{
|
||||||
|
char * cptr = mServers;
|
||||||
memset(mServers, 0, 3*(mMaxLen+1));
|
memset(mServers, 0, 3*(mMaxLen+1));
|
||||||
strlcpy(mServers, url1, mMaxLen);
|
|
||||||
strlcpy(&(mServers[mMaxLen+1]), url2, mMaxLen);
|
// Override modem URLs with uncommented gps.conf urls
|
||||||
strlcpy(&(mServers[(mMaxLen+1)<<1]), url3, mMaxLen);
|
if( gps_conf.XTRA_SERVER_1[0] != '\0' ) {
|
||||||
|
url1 = &gps_conf.XTRA_SERVER_1[0];
|
||||||
|
}
|
||||||
|
if( gps_conf.XTRA_SERVER_2[0] != '\0' ) {
|
||||||
|
url2 = &gps_conf.XTRA_SERVER_2[0];
|
||||||
|
}
|
||||||
|
if( gps_conf.XTRA_SERVER_3[0] != '\0' ) {
|
||||||
|
url3 = &gps_conf.XTRA_SERVER_3[0];
|
||||||
|
}
|
||||||
|
// copy non xtra1.gpsonextra.net URLs into the forwarding buffer.
|
||||||
|
if( NULL == strcasestr(url1, XTRA1_GPSONEXTRA) ) {
|
||||||
|
strlcpy(cptr, url1, mMaxLen + 1);
|
||||||
|
cptr += mMaxLen + 1;
|
||||||
|
}
|
||||||
|
if( NULL == strcasestr(url2, XTRA1_GPSONEXTRA) ) {
|
||||||
|
strlcpy(cptr, url2, mMaxLen + 1);
|
||||||
|
cptr += mMaxLen + 1;
|
||||||
|
}
|
||||||
|
if( NULL == strcasestr(url3, XTRA1_GPSONEXTRA) ) {
|
||||||
|
strlcpy(cptr, url3, mMaxLen + 1);
|
||||||
|
}
|
||||||
locallog();
|
locallog();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocEngReportXtraServer::proc() const {
|
void LocEngReportXtraServer::proc() const {
|
||||||
loc_eng_xtra_data_s_type* locEngXtra =
|
loc_eng_xtra_data_s_type* locEngXtra =
|
||||||
&(((loc_eng_data_s_type*)mLocEng)->xtra_module_data);
|
&(((loc_eng_data_s_type*)mLocEng)->xtra_module_data);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -67,6 +67,8 @@ typedef unsigned char boolean;
|
||||||
#define FAILURE FALSE
|
#define FAILURE FALSE
|
||||||
#define INVALID_ATL_CONNECTION_HANDLE -1
|
#define INVALID_ATL_CONNECTION_HANDLE -1
|
||||||
|
|
||||||
|
#define MAX_XTRA_SERVER_URL_LENGTH 256
|
||||||
|
|
||||||
enum loc_nmea_provider_e_type {
|
enum loc_nmea_provider_e_type {
|
||||||
NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA
|
NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA
|
||||||
NMEA_PROVIDER_MP // Modem Processor Provider of NMEA
|
NMEA_PROVIDER_MP // Modem Processor Provider of NMEA
|
||||||
|
@ -146,6 +148,10 @@ typedef struct loc_gps_cfg_s
|
||||||
unsigned long LPP_PROFILE;
|
unsigned long LPP_PROFILE;
|
||||||
uint8_t NMEA_PROVIDER;
|
uint8_t NMEA_PROVIDER;
|
||||||
unsigned long A_GLONASS_POS_PROTOCOL_SELECT;
|
unsigned long A_GLONASS_POS_PROTOCOL_SELECT;
|
||||||
|
unsigned long XTRA_VERSION_CHECK;
|
||||||
|
char XTRA_SERVER_1[MAX_XTRA_SERVER_URL_LENGTH];
|
||||||
|
char XTRA_SERVER_2[MAX_XTRA_SERVER_URL_LENGTH];
|
||||||
|
char XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH];
|
||||||
} loc_gps_cfg_s_type;
|
} loc_gps_cfg_s_type;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
Loading…
Reference in a new issue