Decouple libhardware usage on LE for gnss models
Remove all usage of gps.h and fused_location.h from all gnss models except gps/fpl hal librarys Change-Id: I90ba233c6bbe5c31a4cacceeb981833719c871f2 CRs-Fixed: 1067953
This commit is contained in:
parent
f871943dc5
commit
4bb940c067
39 changed files with 4293 additions and 618 deletions
10
configure.ac
10
configure.ac
|
@ -45,16 +45,6 @@ PKG_CHECK_MODULES([LOCPLA], [loc-pla])
|
|||
AC_SUBST([LOCPLA_CFLAGS])
|
||||
AC_SUBST([LOCPLA_LIBS])
|
||||
|
||||
AC_ARG_WITH([libhardware_includes],
|
||||
AC_HELP_STRING([--with-libhardware-includes=@<:@dir@:>@],
|
||||
[Specify the location of the libhardware headers]),
|
||||
[libhardware_incdir=$withval],
|
||||
with_libhardware_includes=no)
|
||||
|
||||
if test "x$with_libhardware_includes" != "xno"; then
|
||||
CPPFLAGS="${CPPFLAGS} -I${libhardware_incdir}"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([core_includes],
|
||||
AC_HELP_STRING([--with-core-includes=@<:@dir@:>@],
|
||||
[Specify the location of the core headers]),
|
||||
|
|
|
@ -48,6 +48,7 @@ LOCAL_COPY_HEADERS:= \
|
|||
LocDualContext.h \
|
||||
LBSProxyBase.h \
|
||||
UlpProxyBase.h \
|
||||
loc_gps.h \
|
||||
gps_extended_c.h \
|
||||
gps_extended.h \
|
||||
loc_core_log.h \
|
||||
|
|
|
@ -80,7 +80,7 @@ void LocAdapterBase::
|
|||
}
|
||||
|
||||
void LocAdapterBase::
|
||||
reportSv(GnssSvStatus &svStatus,
|
||||
reportSv(LocGnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt)
|
||||
DEFAULT_IMPL()
|
||||
|
@ -94,7 +94,7 @@ void LocAdapterBase::
|
|||
DEFAULT_IMPL()
|
||||
|
||||
void LocAdapterBase::
|
||||
reportStatus(GpsStatusValue status)
|
||||
reportStatus(LocGpsStatusValue status)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
|
||||
|
@ -120,7 +120,7 @@ bool LocAdapterBase::
|
|||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestATL(int connHandle, AGpsType agps_type)
|
||||
requestATL(int connHandle, LocAGpsType agps_type)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
|
@ -140,15 +140,15 @@ bool LocAdapterBase::
|
|||
DEFAULT_IMPL(false)
|
||||
|
||||
bool LocAdapterBase::
|
||||
requestNiNotify(GpsNiNotification ¬ify, const void* data)
|
||||
requestNiNotify(LocGpsNiNotification ¬ify, const void* data)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
void LocAdapterBase::
|
||||
reportGnssMeasurementData(GnssData &gnssMeasurementData)
|
||||
reportGnssMeasurementData(LocGnssData &gnssMeasurementData)
|
||||
DEFAULT_IMPL()
|
||||
|
||||
bool LocAdapterBase::
|
||||
reportWwanZppFix(GpsLocation &zppLoc)
|
||||
reportWwanZppFix(LocGpsLocation &zppLoc)
|
||||
DEFAULT_IMPL(false)
|
||||
|
||||
} // namespace loc_core
|
||||
|
|
|
@ -102,29 +102,29 @@ public:
|
|||
void* locationExt,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
virtual void reportSv(GnssSvStatus &svStatus,
|
||||
virtual void reportSv(LocGnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt);
|
||||
virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
||||
virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial);
|
||||
virtual void reportStatus(GpsStatusValue status);
|
||||
virtual void reportStatus(LocGpsStatusValue status);
|
||||
virtual void reportNmea(const char* nmea, int length);
|
||||
virtual bool reportXtraServer(const char* url1, const char* url2,
|
||||
const char* url3, const int maxlength);
|
||||
virtual bool requestXtraData();
|
||||
virtual bool requestTime();
|
||||
virtual bool requestLocation();
|
||||
virtual bool requestATL(int connHandle, AGpsType agps_type);
|
||||
virtual bool requestATL(int connHandle, LocAGpsType agps_type);
|
||||
virtual bool releaseATL(int connHandle);
|
||||
virtual bool requestSuplES(int connHandle);
|
||||
virtual bool reportDataCallOpened();
|
||||
virtual bool reportDataCallClosed();
|
||||
virtual bool requestNiNotify(GpsNiNotification ¬ify,
|
||||
virtual bool requestNiNotify(LocGpsNiNotification ¬ify,
|
||||
const void* data);
|
||||
inline virtual bool isInSession() { return false; }
|
||||
ContextBase* getContext() const { return mContext; }
|
||||
virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData);
|
||||
virtual bool reportWwanZppFix(GpsLocation &zppLoc);
|
||||
virtual void reportGnssMeasurementData(LocGnssData &gnssMeasurementData);
|
||||
virtual bool reportWwanZppFix(LocGpsLocation &zppLoc);
|
||||
};
|
||||
|
||||
} // namespace loc_core
|
||||
|
|
|
@ -259,13 +259,13 @@ void LocApiBase::reportPosition(UlpLocation &location,
|
|||
);
|
||||
}
|
||||
|
||||
void LocApiBase::reportWwanZppFix(GpsLocation &zppLoc)
|
||||
void LocApiBase::reportWwanZppFix(LocGpsLocation &zppLoc)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportWwanZppFix(zppLoc));
|
||||
}
|
||||
|
||||
void LocApiBase::reportSv(GnssSvStatus &svStatus,
|
||||
void LocApiBase::reportSv(LocGnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt)
|
||||
{
|
||||
|
@ -277,7 +277,7 @@ void LocApiBase::reportSv(GnssSvStatus &svStatus,
|
|||
" sv: constellation svid cN0"
|
||||
" elevation azimuth flags",
|
||||
svStatus.num_svs);
|
||||
for (int i = 0; i < svStatus.num_svs && i < GNSS_MAX_SVS; i++) {
|
||||
for (int i = 0; i < svStatus.num_svs && i < LOC_GNSS_MAX_SVS; i++) {
|
||||
if (svStatus.gnss_sv_list[i].constellation >
|
||||
sizeof(constellationString) / sizeof(constellationString[0]) - 1) {
|
||||
svStatus.gnss_sv_list[i].constellation = 0;
|
||||
|
@ -316,7 +316,7 @@ void LocApiBase::reportSvPolynomial(GnssSvPolynomial &svPolynomial)
|
|||
);
|
||||
}
|
||||
|
||||
void LocApiBase::reportStatus(GpsStatusValue status)
|
||||
void LocApiBase::reportStatus(LocGpsStatusValue status)
|
||||
{
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportStatus(status));
|
||||
|
@ -354,7 +354,7 @@ void LocApiBase::requestLocation()
|
|||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation());
|
||||
}
|
||||
|
||||
void LocApiBase::requestATL(int connHandle, AGpsType agps_type)
|
||||
void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type));
|
||||
|
@ -384,7 +384,7 @@ void LocApiBase::reportDataCallClosed()
|
|||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->reportDataCallClosed());
|
||||
}
|
||||
|
||||
void LocApiBase::requestNiNotify(GpsNiNotification ¬ify, const void* data)
|
||||
void LocApiBase::requestNiNotify(LocGpsNiNotification ¬ify, const void* data)
|
||||
{
|
||||
// loop through adapters, and deliver to the first handling adapter.
|
||||
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestNiNotify(notify, data));
|
||||
|
@ -406,7 +406,7 @@ void* LocApiBase :: getSibling()
|
|||
LocApiProxyBase* LocApiBase :: getLocApiProxy()
|
||||
DEFAULT_IMPL(NULL)
|
||||
|
||||
void LocApiBase::reportGnssMeasurementData(GnssData &gnssMeasurementData)
|
||||
void LocApiBase::reportGnssMeasurementData(LocGnssData &gnssMeasurementData)
|
||||
{
|
||||
// loop through adapters, and deliver to all adapters.
|
||||
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportGnssMeasurementData(gnssMeasurementData));
|
||||
|
@ -429,7 +429,7 @@ enum loc_api_adapter_err LocApiBase::
|
|||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
deleteAidingData(GpsAidingData f)
|
||||
deleteAidingData(LocGpsAidingData f)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
|
@ -445,7 +445,7 @@ enum loc_api_adapter_err LocApiBase::
|
|||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
setTime(GpsUtcTime time, int64_t timeReference, int uncertainty)
|
||||
setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
|
@ -458,7 +458,7 @@ DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
|||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
atlOpenStatus(int handle, int is_succ, char* apn,
|
||||
AGpsBearerType bear, AGpsType agpsType)
|
||||
AGpsBearerType bear, LocAGpsType agpsType)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
|
@ -479,7 +479,7 @@ enum loc_api_adapter_err LocApiBase::
|
|||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
informNiResponse(GpsUserResponseType userResponse,
|
||||
informNiResponse(LocGpsUserResponseType userResponse,
|
||||
const void* passThroughData)
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
|
@ -539,14 +539,14 @@ enum loc_api_adapter_err LocApiBase::
|
|||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
getBestAvailableZppFix(GpsLocation& zppLoc)
|
||||
getBestAvailableZppFix(LocGpsLocation& zppLoc)
|
||||
{
|
||||
memset(&zppLoc, 0, sizeof(zppLoc));
|
||||
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
|
||||
}
|
||||
|
||||
enum loc_api_adapter_err LocApiBase::
|
||||
getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask)
|
||||
getBestAvailableZppFix(LocGpsLocation & zppLoc, LocPosTechMask & tech_mask)
|
||||
{
|
||||
memset(&zppLoc, 0, sizeof(zppLoc));
|
||||
memset(&tech_mask, 0, sizeof(tech_mask));
|
||||
|
@ -578,7 +578,7 @@ int LocApiBase::
|
|||
DEFAULT_IMPL(-1)
|
||||
|
||||
void LocApiBase::
|
||||
installAGpsCert(const DerEncodedCertificate* pData,
|
||||
installAGpsCert(const LocDerEncodedCertificate* pData,
|
||||
size_t length,
|
||||
uint32_t slotBitMask)
|
||||
DEFAULT_IMPL()
|
||||
|
|
|
@ -115,28 +115,28 @@ public:
|
|||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask =
|
||||
LOC_POS_TECH_MASK_DEFAULT);
|
||||
void reportSv(GnssSvStatus &svStatus,
|
||||
void reportSv(LocGnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt);
|
||||
void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
||||
void reportSvPolynomial(GnssSvPolynomial &svPolynomial);
|
||||
void reportStatus(GpsStatusValue status);
|
||||
void reportStatus(LocGpsStatusValue status);
|
||||
void reportNmea(const char* nmea, int length);
|
||||
void reportXtraServer(const char* url1, const char* url2,
|
||||
const char* url3, const int maxlength);
|
||||
void requestXtraData();
|
||||
void requestTime();
|
||||
void requestLocation();
|
||||
void requestATL(int connHandle, AGpsType agps_type);
|
||||
void requestATL(int connHandle, LocAGpsType agps_type);
|
||||
void releaseATL(int connHandle);
|
||||
void requestSuplES(int connHandle);
|
||||
void reportDataCallOpened();
|
||||
void reportDataCallClosed();
|
||||
void requestNiNotify(GpsNiNotification ¬ify, const void* data);
|
||||
void requestNiNotify(LocGpsNiNotification ¬ify, const void* data);
|
||||
void saveSupportedMsgList(uint64_t supportedMsgList);
|
||||
void reportGnssMeasurementData(GnssData &gnssMeasurementData);
|
||||
void reportGnssMeasurementData(LocGnssData &gnssMeasurementData);
|
||||
void saveSupportedFeatureList(uint8_t *featureList);
|
||||
void reportWwanZppFix(GpsLocation &zppLoc);
|
||||
void reportWwanZppFix(LocGpsLocation &zppLoc);
|
||||
|
||||
// downward calls
|
||||
// All below functions are to be defined by adapter specific modules:
|
||||
|
@ -149,7 +149,7 @@ public:
|
|||
virtual enum loc_api_adapter_err
|
||||
stopFix();
|
||||
virtual enum loc_api_adapter_err
|
||||
deleteAidingData(GpsAidingData f);
|
||||
deleteAidingData(LocGpsAidingData f);
|
||||
virtual enum loc_api_adapter_err
|
||||
enableData(int enable);
|
||||
virtual enum loc_api_adapter_err
|
||||
|
@ -157,13 +157,13 @@ public:
|
|||
virtual enum loc_api_adapter_err
|
||||
injectPosition(double latitude, double longitude, float accuracy);
|
||||
virtual enum loc_api_adapter_err
|
||||
setTime(GpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
virtual enum loc_api_adapter_err
|
||||
setXtraData(char* data, int length);
|
||||
virtual enum loc_api_adapter_err
|
||||
requestXtraServer();
|
||||
virtual enum loc_api_adapter_err
|
||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType);
|
||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, LocAGpsType agpsType);
|
||||
virtual enum loc_api_adapter_err
|
||||
atlCloseStatus(int handle, int is_succ);
|
||||
virtual enum loc_api_adapter_err
|
||||
|
@ -174,7 +174,7 @@ public:
|
|||
setServer(unsigned int ip, int port,
|
||||
LocServerType type);
|
||||
virtual enum loc_api_adapter_err
|
||||
informNiResponse(GpsUserResponseType userResponse, const void* passThroughData);
|
||||
informNiResponse(LocGpsUserResponseType userResponse, const void* passThroughData);
|
||||
virtual enum loc_api_adapter_err
|
||||
setSUPLVersion(uint32_t version);
|
||||
virtual enum loc_api_adapter_err
|
||||
|
@ -212,15 +212,15 @@ public:
|
|||
virtual enum loc_api_adapter_err
|
||||
getWwanZppFix();
|
||||
virtual enum loc_api_adapter_err
|
||||
getBestAvailableZppFix(GpsLocation & zppLoc);
|
||||
getBestAvailableZppFix(LocGpsLocation & zppLoc);
|
||||
virtual enum loc_api_adapter_err
|
||||
getBestAvailableZppFix(GpsLocation & zppLoc, LocPosTechMask & tech_mask);
|
||||
getBestAvailableZppFix(LocGpsLocation & zppLoc, LocPosTechMask & tech_mask);
|
||||
virtual int initDataServiceClient(bool isDueToSsr);
|
||||
virtual int openAndStartDataCall();
|
||||
virtual void stopDataCall();
|
||||
virtual void closeDataCall();
|
||||
virtual void releaseDataServiceClient();
|
||||
virtual void installAGpsCert(const DerEncodedCertificate* pData,
|
||||
virtual void installAGpsCert(const LocDerEncodedCertificate* pData,
|
||||
size_t length,
|
||||
uint32_t slotBitMask);
|
||||
inline virtual void setInSession(bool inSession) {
|
||||
|
|
|
@ -12,6 +12,7 @@ libloc_core_la_h_sources = \
|
|||
LocDualContext.h \
|
||||
LBSProxyBase.h \
|
||||
UlpProxyBase.h \
|
||||
loc_gps.h \
|
||||
gps_extended_c.h \
|
||||
gps_extended.h \
|
||||
loc_core_log.h \
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
(void)loc_technology_mask;
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportSv(GnssSvStatus &svStatus,
|
||||
inline virtual bool reportSv(LocGnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt) {
|
||||
(void)svStatus;
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
(void)svPolynomial;
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportStatus(GpsStatusValue status) {
|
||||
inline virtual bool reportStatus(LocGpsStatusValue status) {
|
||||
|
||||
(void)status;
|
||||
return false;
|
||||
|
@ -107,7 +107,7 @@ public:
|
|||
(void)number_of_locations;
|
||||
return false;
|
||||
}
|
||||
inline virtual bool reportDeleteAidingData(GpsAidingData aidingData)
|
||||
inline virtual bool reportDeleteAidingData(LocGpsAidingData aidingData)
|
||||
{
|
||||
(void)aidingData;
|
||||
return false;
|
||||
|
|
|
@ -46,14 +46,14 @@ extern "C" {
|
|||
struct LocPosMode
|
||||
{
|
||||
LocPositionMode mode;
|
||||
GpsPositionRecurrence recurrence;
|
||||
LocGpsPositionRecurrence recurrence;
|
||||
uint32_t min_interval;
|
||||
uint32_t preferred_accuracy;
|
||||
uint32_t preferred_time;
|
||||
bool share_position;
|
||||
char credentials[14];
|
||||
char provider[8];
|
||||
LocPosMode(LocPositionMode m, GpsPositionRecurrence recr,
|
||||
LocPosMode(LocPositionMode m, LocGpsPositionRecurrence recr,
|
||||
uint32_t gap, uint32_t accu, uint32_t time,
|
||||
bool sp, const char* cred, const char* prov) :
|
||||
mode(m), recurrence(recr),
|
||||
|
@ -73,7 +73,7 @@ struct LocPosMode
|
|||
|
||||
inline LocPosMode() :
|
||||
mode(LOC_POSITION_MODE_MS_BASED),
|
||||
recurrence(GPS_POSITION_RECURRENCE_PERIODIC),
|
||||
recurrence(LOC_GPS_POSITION_RECURRENCE_PERIODIC),
|
||||
min_interval(GPS_DEFAULT_FIX_INTERVAL_MS),
|
||||
preferred_accuracy(50), preferred_time(120000),
|
||||
share_position(true) {
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <loc_gps.h>
|
||||
#include <time.h>
|
||||
|
||||
/**
|
||||
|
@ -47,14 +47,14 @@ extern "C" {
|
|||
|
||||
/** Location has valid source information. */
|
||||
#define LOCATION_HAS_SOURCE_INFO 0x0020
|
||||
/** GpsLocation has valid "is indoor?" flag */
|
||||
#define GPS_LOCATION_HAS_IS_INDOOR 0x0040
|
||||
/** GpsLocation has valid floor number */
|
||||
#define GPS_LOCATION_HAS_FLOOR_NUMBER 0x0080
|
||||
/** GpsLocation has valid map URL*/
|
||||
#define GPS_LOCATION_HAS_MAP_URL 0x0100
|
||||
/** GpsLocation has valid map index */
|
||||
#define GPS_LOCATION_HAS_MAP_INDEX 0x0200
|
||||
/** LocGpsLocation has valid "is indoor?" flag */
|
||||
#define LOC_GPS_LOCATION_HAS_IS_INDOOR 0x0040
|
||||
/** LocGpsLocation has valid floor number */
|
||||
#define LOC_GPS_LOCATION_HAS_FLOOR_NUMBER 0x0080
|
||||
/** LocGpsLocation has valid map URL*/
|
||||
#define LOC_GPS_LOCATION_HAS_MAP_URL 0x0100
|
||||
/** LocGpsLocation has valid map index */
|
||||
#define LOC_GPS_LOCATION_HAS_MAP_INDEX 0x0200
|
||||
|
||||
/** Sizes for indoor fields */
|
||||
#define GPS_LOCATION_MAP_URL_SIZE 400
|
||||
|
@ -81,10 +81,10 @@ extern "C" {
|
|||
#define ULP_MAX_NMEA_STRING_SIZE 201
|
||||
|
||||
/*Emergency SUPL*/
|
||||
#define GPS_NI_TYPE_EMERGENCY_SUPL 4
|
||||
#define LOC_GPS_NI_TYPE_EMERGENCY_SUPL 4
|
||||
|
||||
#define AGPS_CERTIFICATE_MAX_LENGTH 2000
|
||||
#define AGPS_CERTIFICATE_MAX_SLOTS 10
|
||||
#define LOC_AGPS_CERTIFICATE_MAX_LENGTH 2000
|
||||
#define LOC_AGPS_CERTIFICATE_MAX_SLOTS 10
|
||||
|
||||
enum loc_registration_mask_status {
|
||||
LOC_REGISTRATION_MASK_ENABLED,
|
||||
|
@ -99,7 +99,7 @@ typedef enum {
|
|||
typedef struct {
|
||||
/** set to sizeof(UlpLocation) */
|
||||
size_t size;
|
||||
GpsLocation gpsLocation;
|
||||
LocGpsLocation gpsLocation;
|
||||
/* Provider indicator for HYBRID or GPS */
|
||||
uint16_t position_source;
|
||||
/*allows HAL to pass additional information related to the location */
|
||||
|
@ -121,13 +121,13 @@ typedef struct {
|
|||
|
||||
/** AGPS type */
|
||||
typedef int16_t AGpsExtType;
|
||||
#define AGPS_TYPE_INVALID -1
|
||||
#define AGPS_TYPE_ANY 0
|
||||
#define AGPS_TYPE_SUPL 1
|
||||
#define AGPS_TYPE_C2K 2
|
||||
#define AGPS_TYPE_WWAN_ANY 3
|
||||
#define AGPS_TYPE_WIFI 4
|
||||
#define AGPS_TYPE_SUPL_ES 5
|
||||
#define LOC_AGPS_TYPE_INVALID -1
|
||||
#define LOC_AGPS_TYPE_ANY 0
|
||||
#define LOC_AGPS_TYPE_SUPL 1
|
||||
#define LOC_AGPS_TYPE_C2K 2
|
||||
#define LOC_AGPS_TYPE_WWAN_ANY 3
|
||||
#define LOC_AGPS_TYPE_WIFI 4
|
||||
#define LOC_AGPS_TYPE_SUPL_ES 5
|
||||
|
||||
/** SSID length */
|
||||
#define SSID_BUF_SIZE (32+1)
|
||||
|
@ -140,13 +140,13 @@ typedef int16_t AGpsBearerType;
|
|||
|
||||
/** GPS extended callback structure. */
|
||||
typedef struct {
|
||||
/** set to sizeof(GpsCallbacks) */
|
||||
/** set to sizeof(LocGpsCallbacks) */
|
||||
size_t size;
|
||||
gps_set_capabilities set_capabilities_cb;
|
||||
gps_acquire_wakelock acquire_wakelock_cb;
|
||||
gps_release_wakelock release_wakelock_cb;
|
||||
gps_create_thread create_thread_cb;
|
||||
gps_request_utc_time request_utc_time_cb;
|
||||
loc_gps_set_capabilities set_capabilities_cb;
|
||||
loc_gps_acquire_wakelock acquire_wakelock_cb;
|
||||
loc_gps_release_wakelock release_wakelock_cb;
|
||||
loc_gps_create_thread create_thread_cb;
|
||||
loc_gps_request_utc_time request_utc_time_cb;
|
||||
} GpsExtCallbacks;
|
||||
|
||||
/** Callback to report the xtra server url to the client.
|
||||
|
@ -157,8 +157,8 @@ typedef void (* report_xtra_server)(const char*, const char*, const char*);
|
|||
|
||||
/** Callback structure for the XTRA interface. */
|
||||
typedef struct {
|
||||
gps_xtra_download_request download_request_cb;
|
||||
gps_create_thread create_thread_cb;
|
||||
loc_gps_xtra_download_request download_request_cb;
|
||||
loc_gps_create_thread create_thread_cb;
|
||||
report_xtra_server report_xtra_server_cb;
|
||||
} GpsXtraExtCallbacks;
|
||||
|
||||
|
@ -168,7 +168,7 @@ typedef struct {
|
|||
size_t size;
|
||||
|
||||
AGpsExtType type;
|
||||
AGpsStatusValue status;
|
||||
LocAGpsStatusValue status;
|
||||
uint32_t ipv4_addr;
|
||||
struct sockaddr_storage addr;
|
||||
char ssid[SSID_BUF_SIZE];
|
||||
|
@ -183,11 +183,11 @@ typedef void (* agps_status_extended)(AGpsExtStatus* status);
|
|||
/** Callback structure for the AGPS interface. */
|
||||
typedef struct {
|
||||
agps_status_extended status_cb;
|
||||
gps_create_thread create_thread_cb;
|
||||
loc_gps_create_thread create_thread_cb;
|
||||
} AGpsExtCallbacks;
|
||||
|
||||
|
||||
typedef void (*loc_ni_notify_callback)(GpsNiNotification *notification, bool esEnalbed);
|
||||
typedef void (*loc_ni_notify_callback)(LocGpsNiNotification *notification, bool esEnalbed);
|
||||
/** GPS NI callback structure. */
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
@ -51,16 +51,16 @@ void LocPosMode::logv() const
|
|||
/* GPS status names */
|
||||
static const loc_name_val_s_type gps_status_name[] =
|
||||
{
|
||||
NAME_VAL( GPS_STATUS_NONE ),
|
||||
NAME_VAL( GPS_STATUS_SESSION_BEGIN ),
|
||||
NAME_VAL( GPS_STATUS_SESSION_END ),
|
||||
NAME_VAL( GPS_STATUS_ENGINE_ON ),
|
||||
NAME_VAL( GPS_STATUS_ENGINE_OFF ),
|
||||
NAME_VAL( LOC_GPS_STATUS_NONE ),
|
||||
NAME_VAL( LOC_GPS_STATUS_SESSION_BEGIN ),
|
||||
NAME_VAL( LOC_GPS_STATUS_SESSION_END ),
|
||||
NAME_VAL( LOC_GPS_STATUS_ENGINE_ON ),
|
||||
NAME_VAL( LOC_GPS_STATUS_ENGINE_OFF ),
|
||||
};
|
||||
static const int gps_status_num = sizeof(gps_status_name) / sizeof(loc_name_val_s_type);
|
||||
|
||||
/* Find Android GPS status name */
|
||||
const char* loc_get_gps_status_name(GpsStatusValue gps_status)
|
||||
const char* loc_get_gps_status_name(LocGpsStatusValue gps_status)
|
||||
{
|
||||
return loc_get_name_from_val(gps_status_name, gps_status_num,
|
||||
(long) gps_status);
|
||||
|
@ -81,7 +81,7 @@ static const loc_name_val_s_type loc_eng_position_modes[] =
|
|||
};
|
||||
static const int loc_eng_position_mode_num = sizeof(loc_eng_position_modes) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_position_mode_name(GpsPositionMode mode)
|
||||
const char* loc_get_position_mode_name(LocGpsPositionMode mode)
|
||||
{
|
||||
return loc_get_name_from_val(loc_eng_position_modes, loc_eng_position_mode_num, (long) mode);
|
||||
}
|
||||
|
@ -90,12 +90,12 @@ const char* loc_get_position_mode_name(GpsPositionMode mode)
|
|||
|
||||
static const loc_name_val_s_type loc_eng_position_recurrences[] =
|
||||
{
|
||||
NAME_VAL( GPS_POSITION_RECURRENCE_PERIODIC ),
|
||||
NAME_VAL( GPS_POSITION_RECURRENCE_SINGLE )
|
||||
NAME_VAL( LOC_GPS_POSITION_RECURRENCE_PERIODIC ),
|
||||
NAME_VAL( LOC_GPS_POSITION_RECURRENCE_SINGLE )
|
||||
};
|
||||
static const int loc_eng_position_recurrence_num = sizeof(loc_eng_position_recurrences) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur)
|
||||
const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence recur)
|
||||
{
|
||||
return loc_get_name_from_val(loc_eng_position_recurrences, loc_eng_position_recurrence_num, (long) recur);
|
||||
}
|
||||
|
@ -104,23 +104,23 @@ const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur)
|
|||
|
||||
static const loc_name_val_s_type loc_eng_aiding_data_bits[] =
|
||||
{
|
||||
NAME_VAL( GPS_DELETE_EPHEMERIS ),
|
||||
NAME_VAL( GPS_DELETE_ALMANAC ),
|
||||
NAME_VAL( GPS_DELETE_POSITION ),
|
||||
NAME_VAL( GPS_DELETE_TIME ),
|
||||
NAME_VAL( GPS_DELETE_IONO ),
|
||||
NAME_VAL( GPS_DELETE_UTC ),
|
||||
NAME_VAL( GPS_DELETE_HEALTH ),
|
||||
NAME_VAL( GPS_DELETE_SVDIR ),
|
||||
NAME_VAL( GPS_DELETE_SVSTEER ),
|
||||
NAME_VAL( GPS_DELETE_SADATA ),
|
||||
NAME_VAL( GPS_DELETE_RTI ),
|
||||
NAME_VAL( GPS_DELETE_CELLDB_INFO ),
|
||||
NAME_VAL( GPS_DELETE_ALL)
|
||||
NAME_VAL( LOC_GPS_DELETE_EPHEMERIS ),
|
||||
NAME_VAL( LOC_GPS_DELETE_ALMANAC ),
|
||||
NAME_VAL( LOC_GPS_DELETE_POSITION ),
|
||||
NAME_VAL( LOC_GPS_DELETE_TIME ),
|
||||
NAME_VAL( LOC_GPS_DELETE_IONO ),
|
||||
NAME_VAL( LOC_GPS_DELETE_UTC ),
|
||||
NAME_VAL( LOC_GPS_DELETE_HEALTH ),
|
||||
NAME_VAL( LOC_GPS_DELETE_SVDIR ),
|
||||
NAME_VAL( LOC_GPS_DELETE_SVSTEER ),
|
||||
NAME_VAL( LOC_GPS_DELETE_SADATA ),
|
||||
NAME_VAL( LOC_GPS_DELETE_RTI ),
|
||||
NAME_VAL( LOC_GPS_DELETE_CELLDB_INFO ),
|
||||
NAME_VAL( LOC_GPS_DELETE_ALL)
|
||||
};
|
||||
static const int loc_eng_aiding_data_bit_num = sizeof(loc_eng_aiding_data_bits) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_aiding_data_mask_names(GpsAidingData data)
|
||||
const char* loc_get_aiding_data_mask_names(LocGpsAidingData data)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
@ -128,15 +128,15 @@ const char* loc_get_aiding_data_mask_names(GpsAidingData data)
|
|||
|
||||
static const loc_name_val_s_type loc_eng_agps_types[] =
|
||||
{
|
||||
NAME_VAL( AGPS_TYPE_INVALID ),
|
||||
NAME_VAL( AGPS_TYPE_ANY ),
|
||||
NAME_VAL( AGPS_TYPE_SUPL ),
|
||||
NAME_VAL( AGPS_TYPE_C2K ),
|
||||
NAME_VAL( AGPS_TYPE_WWAN_ANY )
|
||||
NAME_VAL( LOC_AGPS_TYPE_INVALID ),
|
||||
NAME_VAL( LOC_AGPS_TYPE_ANY ),
|
||||
NAME_VAL( LOC_AGPS_TYPE_SUPL ),
|
||||
NAME_VAL( LOC_AGPS_TYPE_C2K ),
|
||||
NAME_VAL( LOC_AGPS_TYPE_WWAN_ANY )
|
||||
};
|
||||
static const int loc_eng_agps_type_num = sizeof(loc_eng_agps_types) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_agps_type_name(AGpsType type)
|
||||
const char* loc_get_agps_type_name(LocAGpsType type)
|
||||
{
|
||||
return loc_get_name_from_val(loc_eng_agps_types, loc_eng_agps_type_num, (long) type);
|
||||
}
|
||||
|
@ -144,14 +144,14 @@ const char* loc_get_agps_type_name(AGpsType type)
|
|||
|
||||
static const loc_name_val_s_type loc_eng_ni_types[] =
|
||||
{
|
||||
NAME_VAL( GPS_NI_TYPE_VOICE ),
|
||||
NAME_VAL( GPS_NI_TYPE_UMTS_SUPL ),
|
||||
NAME_VAL( GPS_NI_TYPE_UMTS_CTRL_PLANE ),
|
||||
NAME_VAL( GPS_NI_TYPE_EMERGENCY_SUPL )
|
||||
NAME_VAL( LOC_GPS_NI_TYPE_VOICE ),
|
||||
NAME_VAL( LOC_GPS_NI_TYPE_UMTS_SUPL ),
|
||||
NAME_VAL( LOC_GPS_NI_TYPE_UMTS_CTRL_PLANE ),
|
||||
NAME_VAL( LOC_GPS_NI_TYPE_EMERGENCY_SUPL )
|
||||
};
|
||||
static const int loc_eng_ni_type_num = sizeof(loc_eng_ni_types) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_ni_type_name(GpsNiType type)
|
||||
const char* loc_get_ni_type_name(LocGpsNiType type)
|
||||
{
|
||||
return loc_get_name_from_val(loc_eng_ni_types, loc_eng_ni_type_num, (long) type);
|
||||
}
|
||||
|
@ -159,13 +159,13 @@ const char* loc_get_ni_type_name(GpsNiType type)
|
|||
|
||||
static const loc_name_val_s_type loc_eng_ni_responses[] =
|
||||
{
|
||||
NAME_VAL( GPS_NI_RESPONSE_ACCEPT ),
|
||||
NAME_VAL( GPS_NI_RESPONSE_DENY ),
|
||||
NAME_VAL( GPS_NI_RESPONSE_DENY )
|
||||
NAME_VAL( LOC_GPS_NI_RESPONSE_ACCEPT ),
|
||||
NAME_VAL( LOC_GPS_NI_RESPONSE_DENY ),
|
||||
NAME_VAL( LOC_GPS_NI_RESPONSE_DENY )
|
||||
};
|
||||
static const int loc_eng_ni_reponse_num = sizeof(loc_eng_ni_responses) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_ni_response_name(GpsUserResponseType response)
|
||||
const char* loc_get_ni_response_name(LocGpsUserResponseType response)
|
||||
{
|
||||
return loc_get_name_from_val(loc_eng_ni_responses, loc_eng_ni_reponse_num, (long) response);
|
||||
}
|
||||
|
@ -173,15 +173,15 @@ const char* loc_get_ni_response_name(GpsUserResponseType response)
|
|||
|
||||
static const loc_name_val_s_type loc_eng_ni_encodings[] =
|
||||
{
|
||||
NAME_VAL( GPS_ENC_NONE ),
|
||||
NAME_VAL( GPS_ENC_SUPL_GSM_DEFAULT ),
|
||||
NAME_VAL( GPS_ENC_SUPL_UTF8 ),
|
||||
NAME_VAL( GPS_ENC_SUPL_UCS2 ),
|
||||
NAME_VAL( GPS_ENC_UNKNOWN )
|
||||
NAME_VAL( LOC_GPS_ENC_NONE ),
|
||||
NAME_VAL( LOC_GPS_ENC_SUPL_GSM_DEFAULT ),
|
||||
NAME_VAL( LOC_GPS_ENC_SUPL_UTF8 ),
|
||||
NAME_VAL( LOC_GPS_ENC_SUPL_UCS2 ),
|
||||
NAME_VAL( LOC_GPS_ENC_UNKNOWN )
|
||||
};
|
||||
static const int loc_eng_ni_encoding_num = sizeof(loc_eng_ni_encodings) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding)
|
||||
const char* loc_get_ni_encoding_name(LocGpsNiEncodingType encoding)
|
||||
{
|
||||
return loc_get_name_from_val(loc_eng_ni_encodings, loc_eng_ni_encoding_num, (long) encoding);
|
||||
}
|
||||
|
@ -229,15 +229,15 @@ const char* loc_get_position_sess_status_name(enum loc_sess_status status)
|
|||
|
||||
static const loc_name_val_s_type loc_eng_agps_status_names[] =
|
||||
{
|
||||
NAME_VAL( GPS_REQUEST_AGPS_DATA_CONN ),
|
||||
NAME_VAL( GPS_RELEASE_AGPS_DATA_CONN ),
|
||||
NAME_VAL( GPS_AGPS_DATA_CONNECTED ),
|
||||
NAME_VAL( GPS_AGPS_DATA_CONN_DONE ),
|
||||
NAME_VAL( GPS_AGPS_DATA_CONN_FAILED )
|
||||
NAME_VAL( LOC_GPS_REQUEST_AGPS_DATA_CONN ),
|
||||
NAME_VAL( LOC_GPS_RELEASE_AGPS_DATA_CONN ),
|
||||
NAME_VAL( LOC_GPS_AGPS_DATA_CONNECTED ),
|
||||
NAME_VAL( LOC_GPS_AGPS_DATA_CONN_DONE ),
|
||||
NAME_VAL( LOC_GPS_AGPS_DATA_CONN_FAILED )
|
||||
};
|
||||
static const int loc_eng_agps_status_num = sizeof(loc_eng_agps_status_names) / sizeof(loc_name_val_s_type);
|
||||
|
||||
const char* loc_get_agps_status_name(AGpsStatusValue status)
|
||||
const char* loc_get_agps_status_name(LocAGpsStatusValue status)
|
||||
{
|
||||
return loc_get_name_from_val(loc_eng_agps_status_names, loc_eng_agps_status_num, (long) status);
|
||||
}
|
||||
|
|
|
@ -38,18 +38,18 @@ extern "C"
|
|||
#include <ctype.h>
|
||||
#include <gps_extended.h>
|
||||
|
||||
const char* loc_get_gps_status_name(GpsStatusValue gps_status);
|
||||
const char* loc_get_position_mode_name(GpsPositionMode mode);
|
||||
const char* loc_get_position_recurrence_name(GpsPositionRecurrence recur);
|
||||
const char* loc_get_aiding_data_mask_names(GpsAidingData data);
|
||||
const char* loc_get_agps_type_name(AGpsType type);
|
||||
const char* loc_get_ni_type_name(GpsNiType type);
|
||||
const char* loc_get_ni_response_name(GpsUserResponseType response);
|
||||
const char* loc_get_ni_encoding_name(GpsNiEncodingType encoding);
|
||||
const char* loc_get_gps_status_name(LocGpsStatusValue gps_status);
|
||||
const char* loc_get_position_mode_name(LocGpsPositionMode mode);
|
||||
const char* loc_get_position_recurrence_name(LocGpsPositionRecurrence recur);
|
||||
const char* loc_get_aiding_data_mask_names(LocGpsAidingData data);
|
||||
const char* loc_get_agps_type_name(LocAGpsType type);
|
||||
const char* loc_get_ni_type_name(LocGpsNiType type);
|
||||
const char* loc_get_ni_response_name(LocGpsUserResponseType response);
|
||||
const char* loc_get_ni_encoding_name(LocGpsNiEncodingType encoding);
|
||||
const char* loc_get_agps_bear_name(AGpsBearerType bear);
|
||||
const char* loc_get_server_type_name(LocServerType type);
|
||||
const char* loc_get_position_sess_status_name(enum loc_sess_status status);
|
||||
const char* loc_get_agps_status_name(AGpsStatusValue status);
|
||||
const char* loc_get_agps_status_name(LocAGpsStatusValue status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
2205
core/loc_gps.h
Normal file
2205
core/loc_gps.h
Normal file
File diff suppressed because it is too large
Load diff
|
@ -6,5 +6,5 @@ includedir=@includedir@
|
|||
Name: loc-hal
|
||||
Description: QTI GPS Loc HAL
|
||||
Version: @VERSION
|
||||
Libs: -L${libdir} -lgps_utils_so -lloc_core -lloc_eng_so -lgps_default_so -lloc_ds_api -lloc_api_v02
|
||||
Libs: -L${libdir} -lgps_utils_so -lloc_core -lloc_eng_so -lloc_ds_api -lloc_api_v02
|
||||
Cflags: -I${includedir} -I${includedir}/loc-hal/utils -I${includedir}/loc-hal/core -I${includedir}/loc-hal
|
||||
|
|
|
@ -20,6 +20,7 @@ libloc_eng_so_la_h_sources = \
|
|||
loc_eng_dmn_conn_thread_helper.h
|
||||
|
||||
libloc_eng_so_la_SOURCES = \
|
||||
libloc_api_50001/loc.cpp \
|
||||
libloc_api_50001/loc_eng.cpp \
|
||||
libloc_api_50001/loc_eng_agps.cpp \
|
||||
libloc_api_50001/loc_eng_xtra.cpp \
|
||||
|
@ -47,24 +48,6 @@ endif
|
|||
|
||||
libloc_eng_so_la_LIBADD = -lstdc++ -ldl -llog $(LOCPLA_LIBS) ../utils/libgps_utils_so.la ../core/libloc_core.la
|
||||
|
||||
|
||||
libgps_default_so_la_SOURCES = \
|
||||
libloc_api_50001/loc.cpp \
|
||||
libloc_api_50001/gps.c
|
||||
|
||||
if USE_GLIB
|
||||
libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libgps_default_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libgps_default_so_la_LIBADD = -lstdc++ -llog $(LOCPLA_LIBS) ../utils/libgps_utils_so.la ../core/libloc_core.la -ldl libloc_eng_so.la
|
||||
|
||||
|
||||
libloc_ds_api_CFLAGS = \
|
||||
$(QMIF_CFLAGS) \
|
||||
$(QMI_CFLAGS) \
|
||||
|
@ -134,4 +117,4 @@ library_include_HEADERS = \
|
|||
library_includedir = $(pkgincludedir)
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_eng_so.la libgps_default_so.la libloc_ds_api.la libloc_api_v02.la
|
||||
lib_LTLIBRARIES = libloc_eng_so.la libloc_ds_api.la libloc_api_v02.la
|
||||
|
|
|
@ -51,8 +51,8 @@ private:
|
|||
static rpc_loc_event_mask_type convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask);
|
||||
static rpc_loc_lock_e_type convertGpsLockMask(LOC_GPS_LOCK_MASK lockMask);
|
||||
static enum loc_api_adapter_err convertErr(int rpcErr);
|
||||
static GpsNiEncodingType convertNiEncodingType(int loc_encoding);
|
||||
static int NIEventFillVerfiyType(GpsNiNotification ¬if,
|
||||
static LocGpsNiEncodingType convertNiEncodingType(int loc_encoding);
|
||||
static int NIEventFillVerfiyType(LocGpsNiNotification ¬if,
|
||||
rpc_loc_ni_notify_verify_e_type notif_priv);
|
||||
|
||||
void reportPosition(const rpc_loc_parsed_position_s_type *location_report_ptr);
|
||||
|
@ -93,13 +93,13 @@ public:
|
|||
virtual enum loc_api_adapter_err
|
||||
enableData(int enable, boolean force);
|
||||
virtual enum loc_api_adapter_err
|
||||
setTime(GpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
virtual enum loc_api_adapter_err
|
||||
injectPosition(double latitude, double longitude, float accuracy);
|
||||
virtual enum loc_api_adapter_err
|
||||
deleteAidingData(GpsAidingData f);
|
||||
deleteAidingData(LocGpsAidingData f);
|
||||
virtual enum loc_api_adapter_err
|
||||
informNiResponse(GpsUserResponseType userResponse, const void* passThroughData);
|
||||
informNiResponse(LocGpsUserResponseType userResponse, const void* passThroughData);
|
||||
inline virtual enum loc_api_adapter_err
|
||||
setAPN(char* apn, int len) { return setAPN(apn, len, false); }
|
||||
virtual enum loc_api_adapter_err
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
virtual enum loc_api_adapter_err
|
||||
requestXtraServer();
|
||||
virtual enum loc_api_adapter_err
|
||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType);
|
||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, LocAGpsType agpsType);
|
||||
virtual enum loc_api_adapter_err
|
||||
atlCloseStatus(int handle, int is_succ);
|
||||
virtual enum loc_api_adapter_err
|
||||
|
|
|
@ -423,10 +423,10 @@ LocApiRpc::setPositionMode(const LocPosMode& posMode)
|
|||
}
|
||||
|
||||
switch (fixCriteria->recurrence) {
|
||||
case GPS_POSITION_RECURRENCE_SINGLE:
|
||||
case LOC_GPS_POSITION_RECURRENCE_SINGLE:
|
||||
fix_criteria_ptr->recurrence_type = RPC_LOC_SINGLE_FIX;
|
||||
break;
|
||||
case GPS_POSITION_RECURRENCE_PERIODIC:
|
||||
case LOC_GPS_POSITION_RECURRENCE_PERIODIC:
|
||||
default:
|
||||
fix_criteria_ptr->recurrence_type = RPC_LOC_PERIODIC_FIX;
|
||||
break;
|
||||
|
@ -443,7 +443,7 @@ LocApiRpc::setPositionMode(const LocPosMode& posMode)
|
|||
}
|
||||
|
||||
enum loc_api_adapter_err
|
||||
LocApiRpc::setTime(GpsUtcTime time, int64_t timeReference, int uncertainty)
|
||||
LocApiRpc::setTime(LocGpsUtcTime time, int64_t timeReference, int uncertainty)
|
||||
{
|
||||
rpc_loc_ioctl_data_u_type ioctl_data;
|
||||
rpc_loc_assist_data_time_s_type *time_info_ptr;
|
||||
|
@ -508,7 +508,7 @@ LocApiRpc::injectPosition(double latitude, double longitude, float accuracy)
|
|||
}
|
||||
|
||||
enum loc_api_adapter_err
|
||||
LocApiRpc::informNiResponse(GpsUserResponseType userResponse,
|
||||
LocApiRpc::informNiResponse(LocGpsUserResponseType userResponse,
|
||||
const void* passThroughData)
|
||||
{
|
||||
rpc_loc_ioctl_data_u_type data;
|
||||
|
@ -520,15 +520,15 @@ LocApiRpc::informNiResponse(GpsUserResponseType userResponse,
|
|||
rpc_loc_ni_user_resp_e_type resp;
|
||||
switch (userResponse)
|
||||
{
|
||||
case GPS_NI_RESPONSE_ACCEPT:
|
||||
case LOC_GPS_NI_RESPONSE_ACCEPT:
|
||||
data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp =
|
||||
RPC_LOC_NI_LCS_NOTIFY_VERIFY_ACCEPT;
|
||||
break;
|
||||
case GPS_NI_RESPONSE_DENY:
|
||||
case LOC_GPS_NI_RESPONSE_DENY:
|
||||
data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp =
|
||||
RPC_LOC_NI_LCS_NOTIFY_VERIFY_DENY;
|
||||
break;
|
||||
case GPS_NI_RESPONSE_NORESP:
|
||||
case LOC_GPS_NI_RESPONSE_NORESP:
|
||||
default:
|
||||
data.rpc_loc_ioctl_data_u_type_u.user_verify_resp.user_resp =
|
||||
RPC_LOC_NI_LCS_NOTIFY_VERIFY_NORESP;
|
||||
|
@ -672,7 +672,7 @@ LocApiRpc::enableData(int enable, boolean force)
|
|||
}
|
||||
|
||||
enum loc_api_adapter_err
|
||||
LocApiRpc::deleteAidingData(GpsAidingData bits)
|
||||
LocApiRpc::deleteAidingData(LocGpsAidingData bits)
|
||||
{
|
||||
rpc_loc_ioctl_data_u_type ioctl_data = {RPC_LOC_IOCTL_DELETE_ASSIST_DATA, {0}};
|
||||
ioctl_data.rpc_loc_ioctl_data_u_type_u.assist_data_delete.type = bits;
|
||||
|
@ -707,7 +707,7 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re
|
|||
(location_report_ptr->latitude != 0 ||
|
||||
location_report_ptr->longitude != 0))
|
||||
{
|
||||
location.gpsLocation.flags |= GPS_LOCATION_HAS_LAT_LONG;
|
||||
location.gpsLocation.flags |= LOC_GPS_LOCATION_HAS_LAT_LONG;
|
||||
location.gpsLocation.latitude = location_report_ptr->latitude;
|
||||
location.gpsLocation.longitude = location_report_ptr->longitude;
|
||||
|
||||
|
@ -720,28 +720,28 @@ void LocApiRpc::reportPosition(const rpc_loc_parsed_position_s_type *location_re
|
|||
// Altitude
|
||||
if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_ALTITUDE_WRT_ELLIPSOID )
|
||||
{
|
||||
location.gpsLocation.flags |= GPS_LOCATION_HAS_ALTITUDE;
|
||||
location.gpsLocation.flags |= LOC_GPS_LOCATION_HAS_ALTITUDE;
|
||||
location.gpsLocation.altitude = location_report_ptr->altitude_wrt_ellipsoid;
|
||||
}
|
||||
|
||||
// Speed
|
||||
if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_SPEED_HORIZONTAL)
|
||||
{
|
||||
location.gpsLocation.flags |= GPS_LOCATION_HAS_SPEED;
|
||||
location.gpsLocation.flags |= LOC_GPS_LOCATION_HAS_SPEED;
|
||||
location.gpsLocation.speed = location_report_ptr->speed_horizontal;
|
||||
}
|
||||
|
||||
// Heading
|
||||
if (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HEADING)
|
||||
{
|
||||
location.gpsLocation.flags |= GPS_LOCATION_HAS_BEARING;
|
||||
location.gpsLocation.flags |= LOC_GPS_LOCATION_HAS_BEARING;
|
||||
location.gpsLocation.bearing = location_report_ptr->heading;
|
||||
}
|
||||
|
||||
// Uncertainty (circular)
|
||||
if ( (location_report_ptr->valid_mask & RPC_LOC_POS_VALID_HOR_UNC_CIRCULAR) )
|
||||
{
|
||||
location.gpsLocation.flags |= GPS_LOCATION_HAS_ACCURACY;
|
||||
location.gpsLocation.flags |= LOC_GPS_LOCATION_HAS_ACCURACY;
|
||||
location.gpsLocation.accuracy = location_report_ptr->hor_unc_circular;
|
||||
}
|
||||
|
||||
|
@ -816,9 +816,9 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr)
|
|||
if (gnss_report_ptr->valid_mask & RPC_LOC_GNSS_INFO_VALID_SV_COUNT)
|
||||
{
|
||||
num_svs_max = gnss_report_ptr->sv_count;
|
||||
if (num_svs_max > GPS_MAX_SVS)
|
||||
if (num_svs_max > LOC_GPS_MAX_SVS)
|
||||
{
|
||||
num_svs_max = GPS_MAX_SVS;
|
||||
num_svs_max = LOC_GPS_MAX_SVS;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -833,7 +833,7 @@ void LocApiRpc::reportSv(const rpc_loc_gnss_info_s_type *gnss_report_ptr)
|
|||
{
|
||||
if (sv_info_ptr->system == RPC_LOC_SV_SYSTEM_GPS)
|
||||
{
|
||||
SvStatus.sv_list[SvStatus.num_svs].size = sizeof(GpsSvInfo);
|
||||
SvStatus.sv_list[SvStatus.num_svs].size = sizeof(LocGpsSvInfo);
|
||||
SvStatus.sv_list[SvStatus.num_svs].prn = sv_info_ptr->prn;
|
||||
|
||||
// We only have the data field to report gps eph and alm mask
|
||||
|
@ -923,17 +923,17 @@ void LocApiRpc::reportStatus(const rpc_loc_status_event_s_type *status_report_pt
|
|||
if (status_report_ptr->event == RPC_LOC_STATUS_EVENT_ENGINE_STATE) {
|
||||
if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_ON)
|
||||
{
|
||||
LocApiBase::reportStatus(GPS_STATUS_ENGINE_ON);
|
||||
LocApiBase::reportStatus(GPS_STATUS_SESSION_BEGIN);
|
||||
LocApiBase::reportStatus(LOC_GPS_STATUS_ENGINE_ON);
|
||||
LocApiBase::reportStatus(LOC_GPS_STATUS_SESSION_BEGIN);
|
||||
}
|
||||
else if (status_report_ptr->payload.rpc_loc_status_event_payload_u_type_u.engine_state == RPC_LOC_ENGINE_STATE_OFF)
|
||||
{
|
||||
LocApiBase::reportStatus(GPS_STATUS_SESSION_END);
|
||||
LocApiBase::reportStatus(GPS_STATUS_ENGINE_OFF);
|
||||
LocApiBase::reportStatus(LOC_GPS_STATUS_SESSION_END);
|
||||
LocApiBase::reportStatus(LOC_GPS_STATUS_ENGINE_OFF);
|
||||
}
|
||||
else
|
||||
{
|
||||
LocApiBase::reportStatus(GPS_STATUS_NONE);
|
||||
LocApiBase::reportStatus(LOC_GPS_STATUS_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1079,12 +1079,12 @@ LocApiRpc::requestXtraServer()
|
|||
}
|
||||
|
||||
enum loc_api_adapter_err
|
||||
LocApiRpc::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType)
|
||||
LocApiRpc::atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, LocAGpsType agpsType)
|
||||
{
|
||||
rpc_loc_server_open_status_e_type open_status = is_succ ? RPC_LOC_SERVER_OPEN_SUCCESS : RPC_LOC_SERVER_OPEN_FAIL;
|
||||
rpc_loc_ioctl_data_u_type ioctl_data;
|
||||
|
||||
if (AGPS_TYPE_INVALID == agpsType) {
|
||||
if (LOC_AGPS_TYPE_INVALID == agpsType) {
|
||||
rpc_loc_server_open_status_s_type *conn_open_status_ptr =
|
||||
&ioctl_data.rpc_loc_ioctl_data_u_type_u.conn_open_status;
|
||||
|
||||
|
@ -1176,7 +1176,7 @@ LocApiRpc::atlCloseStatus(int handle, int is_succ)
|
|||
void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr)
|
||||
{
|
||||
int connHandle;
|
||||
AGpsType agps_type;
|
||||
LocAGpsType agps_type;
|
||||
|
||||
LOC_LOGV("RPC_LOC_EVENT_ASSISTANCE_DATA_REQUEST event %s)",
|
||||
loc_get_event_atl_open_name(server_request_ptr->event));
|
||||
|
@ -1186,18 +1186,18 @@ void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr
|
|||
connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.multi_open_req.conn_handle;
|
||||
if (server_request_ptr->payload.rpc_loc_server_request_u_type_u.multi_open_req.connection_type
|
||||
== RPC_LOC_SERVER_CONNECTION_LBS) {
|
||||
agps_type = AGPS_TYPE_SUPL;
|
||||
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - AGPS_TYPE_SUPL\n handle - %d", connHandle);
|
||||
agps_type = LOC_AGPS_TYPE_SUPL;
|
||||
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - LOC_AGPS_TYPE_SUPL\n handle - %d", connHandle);
|
||||
} else {
|
||||
agps_type = AGPS_TYPE_WWAN_ANY;
|
||||
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - AGPS_TYPE_WWAN_ANY\n handle - %d", connHandle);
|
||||
agps_type = LOC_AGPS_TYPE_WWAN_ANY;
|
||||
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_MULTI_OPEN\n type - LOC_AGPS_TYPE_WWAN_ANY\n handle - %d", connHandle);
|
||||
}
|
||||
requestATL(connHandle, agps_type);
|
||||
break;
|
||||
case RPC_LOC_SERVER_REQUEST_OPEN:
|
||||
connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.open_req.conn_handle;
|
||||
LOC_LOGV("ATLEvent: event - RPC_LOC_SERVER_REQUEST_OPEN\n handle - %d", connHandle);
|
||||
requestATL(connHandle, AGPS_TYPE_INVALID);
|
||||
requestATL(connHandle, LOC_AGPS_TYPE_INVALID);
|
||||
break;
|
||||
case RPC_LOC_SERVER_REQUEST_CLOSE:
|
||||
connHandle = server_request_ptr->payload.rpc_loc_server_request_u_type_u.close_req.conn_handle;
|
||||
|
@ -1211,7 +1211,7 @@ void LocApiRpc::ATLEvent(const rpc_loc_server_request_s_type *server_request_ptr
|
|||
|
||||
void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req)
|
||||
{
|
||||
GpsNiNotification notif = {0};
|
||||
LocGpsNiNotification notif = {0};
|
||||
|
||||
switch (ni_req->event)
|
||||
{
|
||||
|
@ -1220,7 +1220,7 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req)
|
|||
const rpc_loc_ni_vx_notify_verify_req_s_type *vx_req =
|
||||
&ni_req->payload.rpc_loc_ni_event_payload_u_type_u.vx_req;
|
||||
LOC_LOGI("VX Notification");
|
||||
notif.ni_type = GPS_NI_TYPE_VOICE;
|
||||
notif.ni_type = LOC_GPS_NI_TYPE_VOICE;
|
||||
// Requestor ID
|
||||
hexcode(notif.requestor_id, sizeof notif.requestor_id,
|
||||
vx_req->requester_id.requester_id,
|
||||
|
@ -1236,7 +1236,7 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req)
|
|||
const rpc_loc_ni_umts_cp_notify_verify_req_s_type *umts_cp_req =
|
||||
&ni_req->payload.rpc_loc_ni_event_payload_u_type_u.umts_cp_req;
|
||||
LOC_LOGI("UMTS CP Notification\n");
|
||||
notif.ni_type= GPS_NI_TYPE_UMTS_CTRL_PLANE; // Stores notification text
|
||||
notif.ni_type= LOC_GPS_NI_TYPE_UMTS_CTRL_PLANE; // Stores notification text
|
||||
#if (AMSS_VERSION==3200)
|
||||
hexcode(notif.text, sizeof notif.text,
|
||||
umts_cp_req->notification_text.notification_text_val,
|
||||
|
@ -1289,7 +1289,7 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req)
|
|||
const rpc_loc_ni_supl_notify_verify_req_s_type *supl_req =
|
||||
&ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req;
|
||||
LOC_LOGI("SUPL Notification\n");
|
||||
notif.ni_type = GPS_NI_TYPE_UMTS_SUPL;
|
||||
notif.ni_type = LOC_GPS_NI_TYPE_UMTS_SUPL;
|
||||
|
||||
if (supl_req->flags & RPC_LOC_NI_CLIENT_NAME_PRESENT)
|
||||
{
|
||||
|
@ -1337,7 +1337,7 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req)
|
|||
notif.requestor_id_encoding = notif.text_encoding;
|
||||
}
|
||||
else {
|
||||
notif.text_encoding = notif.requestor_id_encoding = GPS_ENC_UNKNOWN;
|
||||
notif.text_encoding = notif.requestor_id_encoding = LOC_GPS_ENC_UNKNOWN;
|
||||
}
|
||||
|
||||
NIEventFillVerfiyType(notif, ni_req->payload.rpc_loc_ni_event_payload_u_type_u.supl_req.notification_priv_type);
|
||||
|
@ -1355,30 +1355,30 @@ void LocApiRpc::NIEvent(const rpc_loc_ni_event_s_type *ni_req)
|
|||
requestNiNotify(notif, (const void*)copy);
|
||||
}
|
||||
|
||||
int LocApiRpc::NIEventFillVerfiyType(GpsNiNotification ¬if,
|
||||
int LocApiRpc::NIEventFillVerfiyType(LocGpsNiNotification ¬if,
|
||||
rpc_loc_ni_notify_verify_e_type notif_priv)
|
||||
{
|
||||
switch (notif_priv)
|
||||
{
|
||||
case RPC_LOC_NI_USER_NO_NOTIFY_NO_VERIFY:
|
||||
notif.notify_flags = 0;
|
||||
notif.default_response = GPS_NI_RESPONSE_NORESP;
|
||||
notif.default_response = LOC_GPS_NI_RESPONSE_NORESP;
|
||||
return 1;
|
||||
case RPC_LOC_NI_USER_NOTIFY_ONLY:
|
||||
notif.notify_flags = GPS_NI_NEED_NOTIFY;
|
||||
notif.default_response = GPS_NI_RESPONSE_NORESP;
|
||||
notif.notify_flags = LOC_GPS_NI_NEED_NOTIFY;
|
||||
notif.default_response = LOC_GPS_NI_RESPONSE_NORESP;
|
||||
return 1;
|
||||
case RPC_LOC_NI_USER_NOTIFY_VERIFY_ALLOW_NO_RESP:
|
||||
notif.notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY;
|
||||
notif.default_response = GPS_NI_RESPONSE_ACCEPT;
|
||||
notif.notify_flags = LOC_GPS_NI_NEED_NOTIFY | LOC_GPS_NI_NEED_VERIFY;
|
||||
notif.default_response = LOC_GPS_NI_RESPONSE_ACCEPT;
|
||||
return 1;
|
||||
case RPC_LOC_NI_USER_NOTIFY_VERIFY_NOT_ALLOW_NO_RESP:
|
||||
notif.notify_flags = GPS_NI_NEED_NOTIFY | GPS_NI_NEED_VERIFY;
|
||||
notif.default_response = GPS_NI_RESPONSE_DENY;
|
||||
notif.notify_flags = LOC_GPS_NI_NEED_NOTIFY | LOC_GPS_NI_NEED_VERIFY;
|
||||
notif.default_response = LOC_GPS_NI_RESPONSE_DENY;
|
||||
return 1;
|
||||
case RPC_LOC_NI_USER_PRIVACY_OVERRIDE:
|
||||
notif.notify_flags = GPS_NI_PRIVACY_OVERRIDE;
|
||||
notif.default_response = GPS_NI_RESPONSE_NORESP;
|
||||
notif.notify_flags = LOC_GPS_NI_PRIVACY_OVERRIDE;
|
||||
notif.default_response = LOC_GPS_NI_RESPONSE_NORESP;
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
@ -1399,20 +1399,20 @@ LocApiRpc::setSUPLVersion(uint32_t version)
|
|||
);
|
||||
}
|
||||
|
||||
GpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding)
|
||||
LocGpsNiEncodingType LocApiRpc::convertNiEncodingType(int loc_encoding)
|
||||
{
|
||||
switch (loc_encoding)
|
||||
{
|
||||
case RPC_LOC_NI_SUPL_UTF8:
|
||||
return GPS_ENC_SUPL_UTF8;
|
||||
return LOC_GPS_ENC_SUPL_UTF8;
|
||||
case RPC_LOC_NI_SUPL_UCS2:
|
||||
return GPS_ENC_SUPL_UCS2;
|
||||
return LOC_GPS_ENC_SUPL_UCS2;
|
||||
case RPC_LOC_NI_SUPL_GSM_DEFAULT:
|
||||
return GPS_ENC_SUPL_GSM_DEFAULT;
|
||||
return LOC_GPS_ENC_SUPL_GSM_DEFAULT;
|
||||
case RPC_LOC_NI_SS_LANGUAGE_UNSPEC:
|
||||
return GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM
|
||||
return LOC_GPS_ENC_SUPL_GSM_DEFAULT; // SS_LANGUAGE_UNSPEC = GSM
|
||||
default:
|
||||
return GPS_ENC_UNKNOWN;
|
||||
return LOC_GPS_ENC_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ LOCAL_SHARED_LIBRARIES := \
|
|||
libloc_pla
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
loc.cpp \
|
||||
loc_eng.cpp \
|
||||
loc_eng_agps.cpp \
|
||||
loc_eng_xtra.cpp \
|
||||
|
@ -84,7 +85,8 @@ ifneq ($(filter $(TARGET_DEVICE), apq8084 msm8960), false)
|
|||
endif
|
||||
|
||||
LOCAL_SRC_FILES += \
|
||||
loc.cpp \
|
||||
gps_interface.cpp \
|
||||
gps_converter.cpp \
|
||||
gps.c
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
|
|
|
@ -376,14 +376,14 @@ void LocEngAdapter::reportPosition(UlpLocation &location,
|
|||
}
|
||||
}
|
||||
|
||||
void LocInternalAdapter::reportSv(GnssSvStatus &svStatus,
|
||||
void LocInternalAdapter::reportSv(LocGnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt){
|
||||
sendMsg(new LocEngReportSv(mLocEngAdapter, svStatus,
|
||||
locationExtended, svExt));
|
||||
}
|
||||
|
||||
void LocEngAdapter::reportSv(GnssSvStatus &svStatus,
|
||||
void LocEngAdapter::reportSv(LocGnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt)
|
||||
{
|
||||
|
@ -422,12 +422,12 @@ void LocEngAdapter::setInSession(bool inSession)
|
|||
}
|
||||
}
|
||||
|
||||
void LocInternalAdapter::reportStatus(GpsStatusValue status)
|
||||
void LocInternalAdapter::reportStatus(LocGpsStatusValue status)
|
||||
{
|
||||
sendMsg(new LocEngReportStatus(mLocEngAdapter, status));
|
||||
}
|
||||
|
||||
void LocEngAdapter::reportStatus(GpsStatusValue status)
|
||||
void LocEngAdapter::reportStatus(LocGpsStatusValue status)
|
||||
{
|
||||
if (!mUlp->reportStatus(status)) {
|
||||
mInternalAdapter->reportStatus(status);
|
||||
|
@ -461,7 +461,7 @@ bool LocEngAdapter::reportXtraServer(const char* url1,
|
|||
}
|
||||
|
||||
inline
|
||||
bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type)
|
||||
bool LocEngAdapter::requestATL(int connHandle, LocAGpsType agps_type)
|
||||
{
|
||||
if (mSupportsAgpsRequests) {
|
||||
sendMsg(new LocEngRequestATL(mOwner,
|
||||
|
@ -498,7 +498,7 @@ bool LocEngAdapter::requestTime()
|
|||
}
|
||||
|
||||
inline
|
||||
bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data)
|
||||
bool LocEngAdapter::requestNiNotify(LocGpsNiNotification ¬if, const void* data)
|
||||
{
|
||||
if (mSupportsAgpsRequests) {
|
||||
notif.size = sizeof(notif);
|
||||
|
@ -545,7 +545,7 @@ void LocEngAdapter::handleEngineUpEvent()
|
|||
sendMsg(new LocEngUp(mOwner));
|
||||
}
|
||||
|
||||
enum loc_api_adapter_err LocEngAdapter::setTime(GpsUtcTime time,
|
||||
enum loc_api_adapter_err LocEngAdapter::setTime(LocGpsUtcTime time,
|
||||
int64_t timeReference,
|
||||
int uncertainty)
|
||||
{
|
||||
|
@ -588,7 +588,7 @@ enum loc_api_adapter_err LocEngAdapter::setXtraVersionCheck(int check)
|
|||
return ret;
|
||||
}
|
||||
|
||||
void LocEngAdapter::reportGnssMeasurementData(GnssData &gnssMeasurementData)
|
||||
void LocEngAdapter::reportGnssMeasurementData(LocGnssData &gnssMeasurementData)
|
||||
{
|
||||
sendMsg(new LocEngReportGnssMeasurement(mOwner,
|
||||
gnssMeasurementData));
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#define LOC_API_ENG_ADAPTER_H
|
||||
|
||||
#include <ctype.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <loc.h>
|
||||
#include <loc_eng_log.h>
|
||||
#include <LocAdapterBase.h>
|
||||
|
@ -54,10 +53,10 @@ public:
|
|||
void* locationExt,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
virtual void reportSv(GnssSvStatus &svStatus,
|
||||
virtual void reportSv(LocGnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt);
|
||||
virtual void reportStatus(GpsStatusValue status);
|
||||
virtual void reportStatus(LocGpsStatusValue status);
|
||||
virtual void setPositionModeInt(LocPosMode& posMode);
|
||||
virtual void startFixInt();
|
||||
virtual void stopFixInt();
|
||||
|
@ -87,7 +86,7 @@ public:
|
|||
bool mSupportsAgpsRequests;
|
||||
bool mSupportsPositionInjection;
|
||||
bool mSupportsTimeInjection;
|
||||
GnssSystemInfo mGnssInfo;
|
||||
LocGnssSystemInfo mGnssInfo;
|
||||
|
||||
LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask,
|
||||
void* owner, ContextBase* context,
|
||||
|
@ -143,7 +142,7 @@ public:
|
|||
return mLocApi->stopFix();
|
||||
}
|
||||
inline enum loc_api_adapter_err
|
||||
deleteAidingData(GpsAidingData f)
|
||||
deleteAidingData(LocGpsAidingData f)
|
||||
{
|
||||
return mLocApi->deleteAidingData(f);
|
||||
}
|
||||
|
@ -173,7 +172,7 @@ public:
|
|||
return mLocApi->requestXtraServer();
|
||||
}
|
||||
inline enum loc_api_adapter_err
|
||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, AGpsType agpsType)
|
||||
atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bearer, LocAGpsType agpsType)
|
||||
{
|
||||
return mLocApi->atlOpenStatus(handle, is_succ, apn, bearer, agpsType);
|
||||
}
|
||||
|
@ -202,7 +201,7 @@ public:
|
|||
return mLocApi->setServer(ip, port, type);
|
||||
}
|
||||
inline enum loc_api_adapter_err
|
||||
informNiResponse(GpsUserResponseType userResponse, const void* passThroughData)
|
||||
informNiResponse(LocGpsUserResponseType userResponse, const void* passThroughData)
|
||||
{
|
||||
return mLocApi->informNiResponse(userResponse, passThroughData);
|
||||
}
|
||||
|
@ -282,15 +281,15 @@ public:
|
|||
mLocApi->releaseDataServiceClient();
|
||||
}
|
||||
inline enum loc_api_adapter_err
|
||||
getZpp(GpsLocation &zppLoc, LocPosTechMask &tech_mask)
|
||||
getZpp(LocGpsLocation &zppLoc, LocPosTechMask &tech_mask)
|
||||
{
|
||||
return mLocApi->getBestAvailableZppFix(zppLoc, tech_mask);
|
||||
}
|
||||
enum loc_api_adapter_err setTime(GpsUtcTime time,
|
||||
enum loc_api_adapter_err setTime(LocGpsUtcTime time,
|
||||
int64_t timeReference,
|
||||
int uncertainty);
|
||||
enum loc_api_adapter_err setXtraVersionCheck(int check);
|
||||
inline virtual void installAGpsCert(const DerEncodedCertificate* pData,
|
||||
inline virtual void installAGpsCert(const LocDerEncodedCertificate* pData,
|
||||
size_t length,
|
||||
uint32_t slotBitMask)
|
||||
{
|
||||
|
@ -303,24 +302,24 @@ public:
|
|||
void* locationExt,
|
||||
enum loc_sess_status status,
|
||||
LocPosTechMask loc_technology_mask);
|
||||
virtual void reportSv(GnssSvStatus &svStatus,
|
||||
virtual void reportSv(LocGnssSvStatus &svStatus,
|
||||
GpsLocationExtended &locationExtended,
|
||||
void* svExt);
|
||||
virtual void reportSvMeasurement(GnssSvMeasurementSet &svMeasurementSet);
|
||||
virtual void reportSvPolynomial(GnssSvPolynomial &svPolynomial);
|
||||
virtual void reportStatus(GpsStatusValue status);
|
||||
virtual void reportStatus(LocGpsStatusValue status);
|
||||
virtual void reportNmea(const char* nmea, int length);
|
||||
virtual bool reportXtraServer(const char* url1, const char* url2,
|
||||
const char* url3, const int maxlength);
|
||||
virtual bool requestXtraData();
|
||||
virtual bool requestTime();
|
||||
virtual bool requestATL(int connHandle, AGpsType agps_type);
|
||||
virtual bool requestATL(int connHandle, LocAGpsType agps_type);
|
||||
virtual bool releaseATL(int connHandle);
|
||||
virtual bool requestNiNotify(GpsNiNotification ¬ify, const void* data);
|
||||
virtual bool requestNiNotify(LocGpsNiNotification ¬ify, const void* data);
|
||||
virtual bool requestSuplES(int connHandle);
|
||||
virtual bool reportDataCallOpened();
|
||||
virtual bool reportDataCallClosed();
|
||||
virtual void reportGnssMeasurementData(GnssData &gnssMeasurementData);
|
||||
virtual void reportGnssMeasurementData(LocGnssData &gnssMeasurementData);
|
||||
|
||||
inline const LocPosMode& getPositionMode() const
|
||||
{return mFixCriteria;}
|
||||
|
|
|
@ -1,78 +1,62 @@
|
|||
AM_CFLAGS = \
|
||||
-I../../utils \
|
||||
-I../../platform_lib_abstractions \
|
||||
-I$(WORKSPACE)/gps-noship/flp \
|
||||
-fno-short-enums \
|
||||
-D__func__=__PRETTY_FUNCTION__ \
|
||||
-DFEATURE_GNSS_BIT_API
|
||||
|
||||
libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp
|
||||
|
||||
if USE_GLIB
|
||||
libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_adapter_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_adapter_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la
|
||||
|
||||
|
||||
libloc_eng_so_la_SOURCES = \
|
||||
loc_eng.cpp \
|
||||
loc_eng_agps.cpp \
|
||||
loc_eng_xtra.cpp \
|
||||
loc_eng_ni.cpp \
|
||||
loc_eng_log.cpp \
|
||||
loc_eng_dmn_conn.cpp \
|
||||
loc_eng_dmn_conn_handler.cpp \
|
||||
loc_eng_dmn_conn_thread_helper.c \
|
||||
loc_eng_dmn_conn_glue_msg.c \
|
||||
loc_eng_dmn_conn_glue_pipe.c
|
||||
|
||||
|
||||
if USE_GLIB
|
||||
libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_eng_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la
|
||||
|
||||
|
||||
libgps_default_so_la_SOURCES = \
|
||||
loc.cpp \
|
||||
gps.c
|
||||
|
||||
if USE_GLIB
|
||||
libgps_default_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libgps_default_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libgps_default_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libgps_default_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libgps_default_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libgps_default_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la -ldl libloc_eng_so.la
|
||||
|
||||
library_include_HEADERS = \
|
||||
LocEngAdapter.h \
|
||||
loc.h \
|
||||
loc_eng.h \
|
||||
loc_eng_xtra.h \
|
||||
loc_eng_ni.h \
|
||||
loc_eng_agps.h \
|
||||
loc_eng_msg.h \
|
||||
loc_eng_log.h
|
||||
|
||||
library_includedir = $(pkgincludedir)/libloc_api_50001
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_adapter_so.la libloc_eng_so.la libgps_default_so.la
|
||||
AM_CFLAGS = \
|
||||
-I../../utils \
|
||||
-I../../platform_lib_abstractions \
|
||||
-I$(WORKSPACE)/gps-noship/flp \
|
||||
-fno-short-enums \
|
||||
-D__func__=__PRETTY_FUNCTION__ \
|
||||
-DFEATURE_GNSS_BIT_API
|
||||
|
||||
libloc_adapter_so_la_SOURCES = loc_eng_log.cpp LocEngAdapter.cpp
|
||||
|
||||
if USE_GLIB
|
||||
libloc_adapter_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_adapter_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_adapter_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_adapter_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_adapter_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_adapter_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
libloc_adapter_so_la_LIBADD = -lstdc++ -lcutils ../../utils/libgps_utils_so.la
|
||||
|
||||
|
||||
libloc_eng_so_la_SOURCES = \
|
||||
loc.cpp \
|
||||
loc_eng.cpp \
|
||||
loc_eng_agps.cpp \
|
||||
loc_eng_xtra.cpp \
|
||||
loc_eng_ni.cpp \
|
||||
loc_eng_log.cpp \
|
||||
loc_eng_dmn_conn.cpp \
|
||||
loc_eng_dmn_conn_handler.cpp \
|
||||
loc_eng_dmn_conn_thread_helper.c \
|
||||
loc_eng_dmn_conn_glue_msg.c \
|
||||
loc_eng_dmn_conn_glue_pipe.c
|
||||
|
||||
|
||||
if USE_GLIB
|
||||
libloc_eng_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@
|
||||
libloc_eng_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@
|
||||
else
|
||||
libloc_eng_so_la_CFLAGS = $(AM_CFLAGS)
|
||||
libloc_eng_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0
|
||||
libloc_eng_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS)
|
||||
endif
|
||||
|
||||
libloc_eng_so_la_LIBADD = -lstdc++ -lcutils -ldl ../../utils/libgps_utils_so.la libloc_adapter_so.la
|
||||
|
||||
library_include_HEADERS = \
|
||||
LocEngAdapter.h \
|
||||
loc.h \
|
||||
loc_eng.h \
|
||||
loc_eng_xtra.h \
|
||||
loc_eng_ni.h \
|
||||
loc_eng_agps.h \
|
||||
loc_eng_msg.h \
|
||||
loc_eng_log.h
|
||||
|
||||
library_includedir = $(pkgincludedir)/libloc_api_50001
|
||||
|
||||
#Create and Install libraries
|
||||
lib_LTLIBRARIES = libloc_adapter_so.la libloc_eng_so.la
|
||||
|
|
255
loc_api/libloc_api_50001/gps_converter.cpp
Normal file
255
loc_api/libloc_api_50001/gps_converter.cpp
Normal file
|
@ -0,0 +1,255 @@
|
|||
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gps_converter.h>
|
||||
|
||||
void A2Q_DerEncodedCertificate(const DerEncodedCertificate& in, LocDerEncodedCertificate& out) {
|
||||
memset(&out, 0, sizeof(LocDerEncodedCertificate));
|
||||
out.length = in.length;
|
||||
out.data = in.data;
|
||||
}
|
||||
|
||||
void Q2A_GpsLocation(const LocGpsLocation& in, GpsLocation& out) {
|
||||
memset(&out, 0, sizeof(GpsLocation));
|
||||
out.size = sizeof(GpsLocation);
|
||||
out.flags = (LocGpsLocationFlags)in.flags;
|
||||
out.latitude = in.latitude;
|
||||
out.longitude = in.longitude;
|
||||
out.altitude = in.altitude;
|
||||
out.speed = in.speed;
|
||||
out.bearing = in.bearing;
|
||||
out.accuracy = in.accuracy;
|
||||
out.timestamp = Q2A_GpsUtcTime(in.timestamp);
|
||||
}
|
||||
|
||||
void Q2A_GpsSvInfo(const LocGpsSvInfo& in, GpsSvInfo& out) {
|
||||
memset(&out, 0, sizeof(GpsSvInfo));
|
||||
out.size = sizeof(GpsSvInfo);
|
||||
out.prn = in.prn;
|
||||
out.snr = in.snr;
|
||||
out.elevation = in.elevation;
|
||||
out.azimuth = in.azimuth;
|
||||
}
|
||||
|
||||
void Q2A_GpsSvStatus(const LocGpsSvStatus& in, GpsSvStatus& out) {
|
||||
memset(&out, 0, sizeof(GpsSvStatus));
|
||||
out.size = sizeof(GpsSvStatus);
|
||||
out.num_svs = in.num_svs;
|
||||
int len = LOC_GPS_MAX_SVS < GPS_MAX_SVS ? LOC_GPS_MAX_SVS : GPS_MAX_SVS;
|
||||
for (int i = 0; i < len; i++) {
|
||||
Q2A_GpsSvInfo(in.sv_list[i], out.sv_list[i]);
|
||||
}
|
||||
out.ephemeris_mask = in.ephemeris_mask;
|
||||
out.almanac_mask = in.almanac_mask;
|
||||
out.used_in_fix_mask = in.used_in_fix_mask;
|
||||
}
|
||||
|
||||
void Q2A_GnssSvInfo(const LocGnssSvInfo& in, GnssSvInfo& out) {
|
||||
memset(&out, 0, sizeof(GnssSvInfo));
|
||||
out.size = sizeof(GnssSvInfo);
|
||||
out.svid = in.svid;
|
||||
out.constellation = (GnssConstellationType)in.constellation;
|
||||
out.c_n0_dbhz = in.c_n0_dbhz;
|
||||
out.elevation = in.elevation;
|
||||
out.azimuth = in.azimuth;
|
||||
out.flags = (GnssSvFlags)in.flags;
|
||||
}
|
||||
|
||||
void Q2A_GnssSvStatus(const LocGnssSvStatus& in, GnssSvStatus& out) {
|
||||
memset(&out, 0, sizeof(GnssSvStatus));
|
||||
out.size = sizeof(GnssSvStatus);
|
||||
out.num_svs = in.num_svs;
|
||||
int len = LOC_GNSS_MAX_SVS < GNSS_MAX_SVS ? LOC_GNSS_MAX_SVS : GNSS_MAX_SVS;
|
||||
for (int i = 0; i < len; i++) {
|
||||
Q2A_GnssSvInfo(in.gnss_sv_list[i], out.gnss_sv_list[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void Q2A_GpsNiNotification(const LocGpsNiNotification& in, GpsNiNotification& out) {
|
||||
memset(&out, 0, sizeof(GpsNiNotification));
|
||||
out.size = sizeof(GpsNiNotification);
|
||||
out.notification_id = in.notification_id;
|
||||
out.ni_type = (GpsNiType)in.ni_type;
|
||||
out.notify_flags = (GpsNiNotifyFlags)in.notify_flags;
|
||||
out.timeout = in.timeout;
|
||||
out.default_response = (GpsUserResponseType)in.default_response;
|
||||
int len = LOC_GPS_NI_SHORT_STRING_MAXLEN < GPS_NI_SHORT_STRING_MAXLEN
|
||||
? LOC_GPS_NI_SHORT_STRING_MAXLEN : GPS_NI_SHORT_STRING_MAXLEN;
|
||||
for (int i = 0; i < len; i++) {
|
||||
out.requestor_id[i] = in.requestor_id[i];
|
||||
}
|
||||
len = LOC_GPS_NI_LONG_STRING_MAXLEN < GPS_NI_LONG_STRING_MAXLEN
|
||||
? LOC_GPS_NI_LONG_STRING_MAXLEN : GPS_NI_LONG_STRING_MAXLEN;
|
||||
for (int i = 0; i < len; i++) {
|
||||
out.text[i] = in.text[i];
|
||||
}
|
||||
out.requestor_id_encoding = (GpsNiEncodingType)in.requestor_id_encoding;
|
||||
out.text_encoding = (GpsNiEncodingType)in.text_encoding;
|
||||
len = LOC_GPS_NI_LONG_STRING_MAXLEN < GPS_NI_LONG_STRING_MAXLEN
|
||||
? LOC_GPS_NI_LONG_STRING_MAXLEN : GPS_NI_LONG_STRING_MAXLEN;
|
||||
for (int i = 0; i < len; i++) {
|
||||
out.extras[i] = in.extras[i];
|
||||
}
|
||||
}
|
||||
|
||||
void Q2A_GpsStatus(const LocGpsStatus& in, GpsStatus& out) {
|
||||
memset(&out, 0, sizeof(GpsStatus));
|
||||
out.size = sizeof(GpsStatus);
|
||||
out.status = (GpsStatusValue)in.status;
|
||||
}
|
||||
|
||||
void Q2A_GnssSystemInfo(const LocGnssSystemInfo& in, GnssSystemInfo& out) {
|
||||
memset(&out, 0, sizeof(GnssSystemInfo));
|
||||
out.size = sizeof(GnssSystemInfo);
|
||||
out.year_of_hw = in.year_of_hw;
|
||||
}
|
||||
|
||||
void Q2A_AGpsStatus(const LocAGpsStatus& in, AGpsStatus& out) {
|
||||
memset(&out, 0, sizeof(AGpsStatus));
|
||||
out.size = sizeof(AGpsStatus);
|
||||
out.type = (AGpsType)in.type;
|
||||
out.status = (AGpsStatusValue)in.status;
|
||||
out.ipaddr = in.ipaddr;
|
||||
memcpy(&out.addr, &in.addr, sizeof(sockaddr_storage));
|
||||
}
|
||||
|
||||
void Q2A_GpsMeasurement(const LocGpsMeasurement& in, GpsMeasurement& out) {
|
||||
memset(&out, 0, sizeof(GpsMeasurement));
|
||||
out.size = sizeof(GpsMeasurement);
|
||||
out.flags = (GpsMeasurementFlags)in.flags;
|
||||
out.prn = in.prn;
|
||||
out.time_offset_ns = in.time_offset_ns;
|
||||
out.state = (GpsMeasurementState)in.state;
|
||||
out.received_gps_tow_ns = in.received_gps_tow_ns;
|
||||
out.received_gps_tow_uncertainty_ns = in.received_gps_tow_uncertainty_ns;
|
||||
out.c_n0_dbhz = in.c_n0_dbhz;
|
||||
out.pseudorange_rate_mps = in.pseudorange_rate_mps;
|
||||
out.pseudorange_rate_uncertainty_mps = in.pseudorange_rate_uncertainty_mps;
|
||||
out.accumulated_delta_range_state = (GpsAccumulatedDeltaRangeState)in.accumulated_delta_range_state;
|
||||
out.accumulated_delta_range_m = in.accumulated_delta_range_m;
|
||||
out.accumulated_delta_range_uncertainty_m = in.accumulated_delta_range_uncertainty_m;
|
||||
out.pseudorange_m = in.pseudorange_m;
|
||||
out.pseudorange_uncertainty_m = in.pseudorange_uncertainty_m;
|
||||
out.code_phase_chips = in.code_phase_chips;
|
||||
out.code_phase_uncertainty_chips = in.code_phase_uncertainty_chips;
|
||||
out.carrier_frequency_hz = in.carrier_frequency_hz;
|
||||
out.carrier_cycles = in.carrier_cycles;
|
||||
out.carrier_phase = in.carrier_phase;
|
||||
out.carrier_phase_uncertainty = in.carrier_phase_uncertainty;
|
||||
out.loss_of_lock = (GpsLossOfLock)in.loss_of_lock;
|
||||
out.bit_number = in.bit_number;
|
||||
out.time_from_last_bit_ms = in.time_from_last_bit_ms;
|
||||
out.doppler_shift_hz = in.doppler_shift_hz;
|
||||
out.doppler_shift_uncertainty_hz = in.doppler_shift_uncertainty_hz;
|
||||
out.multipath_indicator = (GpsMultipathIndicator)in.multipath_indicator;
|
||||
out.snr_db = in.snr_db;
|
||||
out.elevation_deg = in.elevation_deg;
|
||||
out.elevation_uncertainty_deg = in.elevation_uncertainty_deg;
|
||||
out.azimuth_deg = in.azimuth_deg;
|
||||
out.azimuth_uncertainty_deg = in.azimuth_uncertainty_deg;
|
||||
out.used_in_fix = in.used_in_fix;
|
||||
}
|
||||
|
||||
void Q2A_GpsClock(const LocGpsClock& in, GpsClock& out) {
|
||||
memset(&out, 0, sizeof(GpsClock));
|
||||
out.size = sizeof(GpsClock);
|
||||
out.flags = (GpsClockFlags)in.flags;
|
||||
out.leap_second = in.leap_second;
|
||||
out.type = (GpsClockType)in.type;
|
||||
out.time_ns = in.time_ns;
|
||||
out.time_uncertainty_ns = in.time_uncertainty_ns;
|
||||
out.full_bias_ns = in.full_bias_ns;
|
||||
out.bias_ns = in.bias_ns;
|
||||
out.bias_uncertainty_ns = in.bias_uncertainty_ns;
|
||||
out.drift_nsps = in.drift_nsps;
|
||||
out.drift_uncertainty_nsps = in.drift_uncertainty_nsps;
|
||||
}
|
||||
|
||||
void Q2A_GpsData(const LocGpsData& in, GpsData& out) {
|
||||
memset(&out, 0, sizeof(GpsData));
|
||||
out.size = sizeof(GpsData);
|
||||
out.measurement_count = in.measurement_count;
|
||||
int len = LOC_GPS_MAX_MEASUREMENT < GPS_MAX_MEASUREMENT
|
||||
? LOC_GPS_MAX_MEASUREMENT : GPS_MAX_MEASUREMENT;
|
||||
for (int i = 0; i < len; i++) {
|
||||
Q2A_GpsMeasurement(in.measurements[i], out.measurements[i]);
|
||||
}
|
||||
Q2A_GpsClock(in.clock, out.clock);
|
||||
}
|
||||
|
||||
void Q2A_GnssMeasurement(const LocGnssMeasurement& in, GnssMeasurement& out) {
|
||||
memset(&out, 0, sizeof(GnssMeasurement));
|
||||
out.size = sizeof(GnssMeasurement);
|
||||
out.flags = (GpsMeasurementFlags)in.flags;
|
||||
out.svid = in.svid;
|
||||
out.constellation = (GnssConstellationType)in.constellation;
|
||||
out.time_offset_ns = in.time_offset_ns;
|
||||
out.state = (GnssMeasurementState)in.state;
|
||||
out.received_sv_time_in_ns = in.received_sv_time_in_ns;
|
||||
out.received_sv_time_uncertainty_in_ns = in.received_sv_time_uncertainty_in_ns;
|
||||
out.c_n0_dbhz = in.c_n0_dbhz;
|
||||
out.pseudorange_rate_mps = in.pseudorange_rate_mps;
|
||||
out.pseudorange_rate_uncertainty_mps = in.pseudorange_rate_uncertainty_mps;
|
||||
out.accumulated_delta_range_state = (GnssAccumulatedDeltaRangeState)in.accumulated_delta_range_state;
|
||||
out.accumulated_delta_range_m = in.accumulated_delta_range_m;
|
||||
out.accumulated_delta_range_uncertainty_m = in.accumulated_delta_range_uncertainty_m;
|
||||
out.carrier_frequency_hz = in.carrier_frequency_hz;
|
||||
out.carrier_cycles = in.carrier_cycles;
|
||||
out.carrier_phase = in.carrier_phase;
|
||||
out.carrier_phase_uncertainty = in.carrier_phase_uncertainty;
|
||||
out.multipath_indicator = (GnssMultipathIndicator)in.multipath_indicator;
|
||||
out.snr_db = in.snr_db;
|
||||
}
|
||||
|
||||
void Q2A_GnssClock(const LocGnssClock& in, GnssClock& out) {
|
||||
memset(&out, 0, sizeof(GnssClock));
|
||||
out.size = sizeof(GnssClock);
|
||||
out.flags = (GnssClockFlags)in.flags;
|
||||
out.leap_second = in.leap_second;
|
||||
out.time_ns = in.time_ns;
|
||||
out.time_uncertainty_ns = in.time_uncertainty_ns;
|
||||
out.full_bias_ns = in.full_bias_ns;
|
||||
out.bias_ns = in.bias_ns;
|
||||
out.bias_uncertainty_ns = in.bias_uncertainty_ns;
|
||||
out.drift_nsps = in.drift_nsps;
|
||||
out.drift_uncertainty_nsps = in.drift_uncertainty_nsps;
|
||||
out.hw_clock_discontinuity_count = in.hw_clock_discontinuity_count;
|
||||
}
|
||||
|
||||
void Q2A_GnssData(const LocGnssData& in, GnssData& out) {
|
||||
memset(&out, 0, sizeof(GnssData));
|
||||
out.size = sizeof(GnssData);
|
||||
out.measurement_count = in.measurement_count;
|
||||
int len = LOC_GNSS_MAX_MEASUREMENT < GNSS_MAX_MEASUREMENT
|
||||
? LOC_GNSS_MAX_MEASUREMENT : GNSS_MAX_MEASUREMENT;
|
||||
for (int i = 0; i < len; i++) {
|
||||
Q2A_GnssMeasurement(in.measurements[i], out.measurements[i]);
|
||||
}
|
||||
Q2A_GnssClock(in.clock, out.clock);
|
||||
}
|
69
loc_api/libloc_api_50001/gps_converter.h
Normal file
69
loc_api/libloc_api_50001/gps_converter.h
Normal file
|
@ -0,0 +1,69 @@
|
|||
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* * Neither the name of The Linux Foundation, nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __GPS_CONVERTER_H__
|
||||
#define __GPS_CONVERTER_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <gps_extended.h>
|
||||
|
||||
#define A2Q_GpsAidingData(in) (LocGpsAidingData)in
|
||||
#define A2Q_GpsUserResponseType(in) (LocGpsUserResponseType)in
|
||||
#define A2Q_GpsPositionRecurrence(in) (LocGpsPositionRecurrence)in
|
||||
#define A2Q_GpsUtcTime(in) (LocGpsUtcTime)in
|
||||
#define A2Q_GpsPositionMode(in) (LocGpsPositionMode)in
|
||||
#define A2Q_GpsPositionRecurrence(in) (LocGpsPositionRecurrence)in
|
||||
#define A2Q_ApnIpType(in) (LocApnIpType)in
|
||||
#define A2Q_AGpsType(in) (LocAGpsType)in
|
||||
#define A2Q_GpsPositionRecurrence(in) (LocGpsPositionRecurrence)in
|
||||
|
||||
#define Q2A_GpsUtcTime(in) (GpsUtcTime)in
|
||||
|
||||
void A2Q_DerEncodedCertificate(const DerEncodedCertificate& in, LocDerEncodedCertificate& out);
|
||||
|
||||
void Q2A_GpsLocation(const LocGpsLocation& in, GpsLocation& out);
|
||||
void Q2A_GpsSvStatus(const LocGpsSvStatus& in, GpsSvStatus& out);
|
||||
void Q2A_GnssSvStatus(const LocGnssSvStatus& in, GnssSvStatus& out);
|
||||
void Q2A_GpsNiNotification(const LocGpsNiNotification& in, GpsNiNotification& out);
|
||||
void Q2A_GpsStatus(const LocGpsStatus& in, GpsStatus& out);
|
||||
void Q2A_GnssSystemInfo(const LocGnssSystemInfo& in, GnssSystemInfo& out);
|
||||
void Q2A_AGpsStatus(const LocAGpsStatus& in, AGpsStatus& out);
|
||||
void Q2A_GpsData(const LocGpsData& in, GpsData& out);
|
||||
void Q2A_GnssData(const LocGnssData& in, GnssData& out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif //__GPS_CONVERTER_H__
|
1196
loc_api/libloc_api_50001/gps_interface.cpp
Normal file
1196
loc_api/libloc_api_50001/gps_interface.cpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -30,7 +30,6 @@
|
|||
#define LOG_NDDEBUG 0
|
||||
#define LOG_TAG "LocSvc_afw"
|
||||
|
||||
#include <hardware/gps.h>
|
||||
#include <gps_extended.h>
|
||||
#include <loc_eng.h>
|
||||
#include <loc_target.h>
|
||||
|
@ -48,39 +47,33 @@
|
|||
|
||||
using namespace loc_core;
|
||||
|
||||
#define LOC_PM_CLIENT_NAME "GPS"
|
||||
// All functions and variables should be static
|
||||
// except loc_eng_gps_get_hardware_interface() and loc_eng_get_gps_interface()
|
||||
|
||||
//Globals defns
|
||||
static gps_location_callback gps_loc_cb = NULL;
|
||||
static gps_sv_status_callback gps_sv_cb = NULL;
|
||||
static gps_ni_notify_callback gps_ni_cb = NULL;
|
||||
static loc_gps_location_callback gps_loc_cb = NULL;
|
||||
static loc_gps_sv_status_callback gps_sv_cb = NULL;
|
||||
|
||||
static void local_loc_cb(UlpLocation* location, void* locExt);
|
||||
static void local_sv_cb(GpsSvStatus* sv_status, void* svExt);
|
||||
static void local_ni_cb(GpsNiNotification *notification, bool esEnalbed);
|
||||
static void local_sv_cb(LocGpsSvStatus* sv_status, void* svExt);
|
||||
|
||||
GpsNiExtCallbacks sGpsNiExtCallbacks = {
|
||||
local_ni_cb
|
||||
};
|
||||
|
||||
static const GpsGeofencingInterface* get_geofence_interface(void);
|
||||
static const LocGpsGeofencingInterface* get_geofence_interface(void);
|
||||
|
||||
// Function declarations for sLocEngInterface
|
||||
static int loc_init(GpsCallbacks* callbacks);
|
||||
static int loc_init(LocGpsCallbacks* callbacks);
|
||||
static int loc_start();
|
||||
static int loc_stop();
|
||||
static void loc_cleanup();
|
||||
static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
static int loc_inject_time(LocGpsUtcTime time, int64_t timeReference, int uncertainty);
|
||||
static int loc_inject_location(double latitude, double longitude, float accuracy);
|
||||
static void loc_delete_aiding_data(GpsAidingData f);
|
||||
static int loc_set_position_mode(GpsPositionMode mode, GpsPositionRecurrence recurrence,
|
||||
static void loc_delete_aiding_data(LocGpsAidingData f);
|
||||
static int loc_set_position_mode(LocGpsPositionMode mode, LocGpsPositionRecurrence recurrence,
|
||||
uint32_t min_interval, uint32_t preferred_accuracy,
|
||||
uint32_t preferred_time);
|
||||
static const void* loc_get_extension(const char* name);
|
||||
// Defines the GpsInterface in gps.h
|
||||
static const GpsInterface sLocEngInterface =
|
||||
static const LocGpsInterface sLocEngInterface =
|
||||
{
|
||||
sizeof(GpsInterface),
|
||||
sizeof(LocGpsInterface),
|
||||
loc_init,
|
||||
loc_start,
|
||||
loc_stop,
|
||||
|
@ -93,16 +86,16 @@ static const GpsInterface sLocEngInterface =
|
|||
};
|
||||
|
||||
// Function declarations for sLocEngAGpsInterface
|
||||
static void loc_agps_init(AGpsCallbacks* callbacks);
|
||||
static void loc_agps_init(LocAGpsCallbacks* callbacks);
|
||||
static int loc_agps_open(const char* apn);
|
||||
static int loc_agps_closed();
|
||||
static int loc_agps_open_failed();
|
||||
static int loc_agps_set_server(AGpsType type, const char *hostname, int port);
|
||||
static int loc_agps_open_with_apniptype( const char* apn, ApnIpType apnIpType);
|
||||
static int loc_agps_set_server(LocAGpsType type, const char *hostname, int port);
|
||||
static int loc_agps_open_with_apniptype( const char* apn, LocApnIpType apnIpType);
|
||||
|
||||
static const AGpsInterface sLocEngAGpsInterface =
|
||||
static const LocAGpsInterface sLocEngAGpsInterface =
|
||||
{
|
||||
sizeof(AGpsInterface),
|
||||
sizeof(LocAGpsInterface),
|
||||
loc_agps_init,
|
||||
loc_agps_open,
|
||||
loc_agps_closed,
|
||||
|
@ -111,46 +104,53 @@ static const AGpsInterface sLocEngAGpsInterface =
|
|||
loc_agps_open_with_apniptype
|
||||
};
|
||||
|
||||
static int loc_xtra_init(GpsXtraCallbacks* callbacks);
|
||||
static int loc_xtra_init(LocGpsXtraCallbacks* callbacks);
|
||||
static int loc_xtra_inject_data(char* data, int length);
|
||||
|
||||
static const GpsXtraInterface sLocEngXTRAInterface =
|
||||
static const LocGpsXtraInterface sLocEngXTRAInterface =
|
||||
{
|
||||
sizeof(GpsXtraInterface),
|
||||
sizeof(LocGpsXtraInterface),
|
||||
loc_xtra_init,
|
||||
loc_xtra_inject_data
|
||||
};
|
||||
|
||||
static void loc_ni_init(GpsNiCallbacks *callbacks);
|
||||
static void loc_ni_respond(int notif_id, GpsUserResponseType user_response);
|
||||
static loc_gps_ni_notify_callback gps_ni_cb = NULL;
|
||||
static void local_ni_cb(LocGpsNiNotification *notification, bool esEnalbed);
|
||||
|
||||
static const GpsNiInterface sLocEngNiInterface =
|
||||
static GpsNiExtCallbacks sGpsNiExtCallbacks = {
|
||||
local_ni_cb
|
||||
};
|
||||
|
||||
static void loc_ni_init(LocGpsNiCallbacks *callbacks);
|
||||
static void loc_ni_respond(int notif_id, LocGpsUserResponseType user_response);
|
||||
|
||||
static const LocGpsNiInterface sLocEngNiInterface =
|
||||
{
|
||||
sizeof(GpsNiInterface),
|
||||
sizeof(LocGpsNiInterface),
|
||||
loc_ni_init,
|
||||
loc_ni_respond,
|
||||
};
|
||||
|
||||
static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks);
|
||||
static int loc_gps_measurement_init(LocGpsMeasurementCallbacks* callbacks);
|
||||
static void loc_gps_measurement_close();
|
||||
|
||||
static const GpsMeasurementInterface sLocEngGpsMeasurementInterface =
|
||||
static const LocGpsMeasurementInterface sLocEngGpsMeasurementInterface =
|
||||
{
|
||||
sizeof(GpsMeasurementInterface),
|
||||
sizeof(LocGpsMeasurementInterface),
|
||||
loc_gps_measurement_init,
|
||||
loc_gps_measurement_close
|
||||
};
|
||||
|
||||
static void loc_agps_ril_init( AGpsRilCallbacks* callbacks );
|
||||
static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct);
|
||||
static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid);
|
||||
static void loc_agps_ril_init( LocAGpsRilCallbacks* callbacks );
|
||||
static void loc_agps_ril_set_ref_location(const LocAGpsRefLocation *agps_reflocation, size_t sz_struct);
|
||||
static void loc_agps_ril_set_set_id(LocAGpsSetIDType type, const char* setid);
|
||||
static void loc_agps_ril_ni_message(uint8_t *msg, size_t len);
|
||||
static void loc_agps_ril_update_network_state(int connected, int type, int roaming, const char* extra_info);
|
||||
static void loc_agps_ril_update_network_availability(int avaiable, const char* apn);
|
||||
|
||||
static const AGpsRilInterface sLocEngAGpsRilInterface =
|
||||
static const LocAGpsRilInterface sLocEngAGpsRilInterface =
|
||||
{
|
||||
sizeof(AGpsRilInterface),
|
||||
sizeof(LocAGpsRilInterface),
|
||||
loc_agps_ril_init,
|
||||
loc_agps_ril_set_ref_location,
|
||||
loc_agps_ril_set_set_id,
|
||||
|
@ -159,23 +159,23 @@ static const AGpsRilInterface sLocEngAGpsRilInterface =
|
|||
loc_agps_ril_update_network_availability
|
||||
};
|
||||
|
||||
static int loc_agps_install_certificates(const DerEncodedCertificate* certificates,
|
||||
static int loc_agps_install_certificates(const LocDerEncodedCertificate* certificates,
|
||||
size_t length);
|
||||
static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints,
|
||||
static int loc_agps_revoke_certificates(const LocSha1CertificateFingerprint* fingerprints,
|
||||
size_t length);
|
||||
|
||||
static const SuplCertificateInterface sLocEngAGpsCertInterface =
|
||||
static const LocSuplCertificateInterface sLocEngAGpsCertInterface =
|
||||
{
|
||||
sizeof(SuplCertificateInterface),
|
||||
sizeof(LocSuplCertificateInterface),
|
||||
loc_agps_install_certificates,
|
||||
loc_agps_revoke_certificates
|
||||
};
|
||||
|
||||
static void loc_configuration_update(const char* config_data, int32_t length);
|
||||
|
||||
static const GnssConfigurationInterface sLocEngConfigInterface =
|
||||
static const LocGnssConfigurationInterface sLocEngConfigInterface =
|
||||
{
|
||||
sizeof(GnssConfigurationInterface),
|
||||
sizeof(LocGnssConfigurationInterface),
|
||||
loc_configuration_update
|
||||
};
|
||||
|
||||
|
@ -183,10 +183,10 @@ static loc_eng_data_s_type loc_afw_data;
|
|||
static int gss_fd = -1;
|
||||
static int sGnssType = GNSS_UNKNOWN;
|
||||
/*===========================================================================
|
||||
FUNCTION gps_get_hardware_interface
|
||||
FUNCTION loc_eng_gps_get_hardware_interface
|
||||
|
||||
DESCRIPTION
|
||||
Returns the GPS hardware interaface based on LOC API
|
||||
Returns LocGpsInterface
|
||||
if GPS is enabled.
|
||||
|
||||
DEPENDENCIES
|
||||
|
@ -199,10 +199,10 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
extern "C" const GpsInterface* gps_get_hardware_interface ()
|
||||
extern "C" const LocGpsInterface* loc_eng_gps_get_hardware_interface ()
|
||||
{
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
const GpsInterface* ret_val;
|
||||
const LocGpsInterface* ret_val;
|
||||
|
||||
char propBuf[PROPERTY_VALUE_MAX];
|
||||
memset(propBuf, 0, sizeof(propBuf));
|
||||
|
@ -225,8 +225,7 @@ extern "C" const GpsInterface* gps_get_hardware_interface ()
|
|||
return ret_val;
|
||||
}
|
||||
|
||||
// for gps.c
|
||||
extern "C" const GpsInterface* get_gps_interface()
|
||||
extern "C" const LocGpsInterface* loc_eng_get_gps_interface()
|
||||
{
|
||||
unsigned int target = TARGET_DEFAULT;
|
||||
loc_eng_read_config();
|
||||
|
@ -240,7 +239,7 @@ extern "C" const GpsInterface* get_gps_interface()
|
|||
case GNSS_GSS:
|
||||
case GNSS_AUTO:
|
||||
//APQ8064
|
||||
gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB);
|
||||
gps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB);
|
||||
gss_fd = open("/dev/gss", O_RDONLY);
|
||||
if (gss_fd < 0) {
|
||||
LOC_LOGE("GSS open failed: %s\n", strerror(errno));
|
||||
|
@ -256,7 +255,7 @@ extern "C" const GpsInterface* get_gps_interface()
|
|||
return NULL;
|
||||
case GNSS_QCA1530:
|
||||
// qca1530 chip is present
|
||||
gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB);
|
||||
gps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB);
|
||||
LOC_LOGD("qca1530 present: CAPABILITIES %0lx\n", gps_conf.CAPABILITIES);
|
||||
break;
|
||||
}
|
||||
|
@ -280,7 +279,7 @@ SIDE EFFECTS
|
|||
N/Ax
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_init(GpsCallbacks* callbacks)
|
||||
static int loc_init(LocGpsCallbacks* callbacks)
|
||||
{
|
||||
int retVal = -1;
|
||||
unsigned int target = (unsigned int) -1;
|
||||
|
@ -453,8 +452,8 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_set_position_mode(GpsPositionMode mode,
|
||||
GpsPositionRecurrence recurrence,
|
||||
static int loc_set_position_mode(LocGpsPositionMode mode,
|
||||
LocGpsPositionRecurrence recurrence,
|
||||
uint32_t min_interval,
|
||||
uint32_t preferred_accuracy,
|
||||
uint32_t preferred_time)
|
||||
|
@ -463,10 +462,10 @@ static int loc_set_position_mode(GpsPositionMode mode,
|
|||
int ret_val = -1;
|
||||
LocPositionMode locMode;
|
||||
switch (mode) {
|
||||
case GPS_POSITION_MODE_MS_BASED:
|
||||
case LOC_GPS_POSITION_MODE_MS_BASED:
|
||||
locMode = LOC_POSITION_MODE_MS_BASED;
|
||||
break;
|
||||
case GPS_POSITION_MODE_MS_ASSISTED:
|
||||
case LOC_GPS_POSITION_MODE_MS_ASSISTED:
|
||||
locMode = LOC_POSITION_MODE_MS_ASSISTED;
|
||||
break;
|
||||
default:
|
||||
|
@ -502,7 +501,7 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty)
|
||||
static int loc_inject_time(LocGpsUtcTime time, int64_t timeReference, int uncertainty)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
int ret_val = 0;
|
||||
|
@ -553,7 +552,7 @@ DESCRIPTION
|
|||
will happen when gps engine is turned off.
|
||||
|
||||
DEPENDENCIES
|
||||
Assumes the aiding data type specified in GpsAidingData matches with
|
||||
Assumes the aiding data type specified in LocGpsAidingData matches with
|
||||
LOC API specification.
|
||||
|
||||
RETURN VALUE
|
||||
|
@ -563,7 +562,7 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static void loc_delete_aiding_data(GpsAidingData f)
|
||||
static void loc_delete_aiding_data(LocGpsAidingData f)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
|
||||
|
@ -574,14 +573,14 @@ static void loc_delete_aiding_data(GpsAidingData f)
|
|||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
const GpsGeofencingInterface* get_geofence_interface(void)
|
||||
static const LocGpsGeofencingInterface* get_geofence_interface(void)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
void *handle;
|
||||
const char *error;
|
||||
typedef const GpsGeofencingInterface* (*get_gps_geofence_interface_function) (void);
|
||||
typedef const LocGpsGeofencingInterface* (*get_gps_geofence_interface_function) (void);
|
||||
get_gps_geofence_interface_function get_gps_geofence_interface;
|
||||
static const GpsGeofencingInterface* geofence_interface = NULL;
|
||||
static const LocGpsGeofencingInterface* geofence_interface = NULL;
|
||||
|
||||
dlerror(); /* Clear any existing error */
|
||||
|
||||
|
@ -595,7 +594,7 @@ const GpsGeofencingInterface* get_geofence_interface(void)
|
|||
goto exit;
|
||||
}
|
||||
dlerror(); /* Clear any existing error */
|
||||
get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "gps_geofence_get_interface");
|
||||
get_gps_geofence_interface = (get_gps_geofence_interface_function)dlsym(handle, "loc_gps_geofence_get_interface");
|
||||
if ((error = dlerror()) != NULL) {
|
||||
LOC_LOGE ("%s, dlsym for get_gps_geofence_interface failed, error = %s\n", __func__, error);
|
||||
goto exit;
|
||||
|
@ -633,19 +632,19 @@ const void* loc_get_extension(const char* name)
|
|||
const void* ret_val = NULL;
|
||||
|
||||
LOC_LOGD("%s:%d] For Interface = %s\n",__func__, __LINE__, name);
|
||||
if (strcmp(name, GPS_XTRA_INTERFACE) == 0)
|
||||
if (strcmp(name, LOC_GPS_XTRA_INTERFACE) == 0)
|
||||
{
|
||||
ret_val = &sLocEngXTRAInterface;
|
||||
}
|
||||
else if (strcmp(name, AGPS_INTERFACE) == 0)
|
||||
else if (strcmp(name, LOC_AGPS_INTERFACE) == 0)
|
||||
{
|
||||
ret_val = &sLocEngAGpsInterface;
|
||||
}
|
||||
else if (strcmp(name, GPS_NI_INTERFACE) == 0)
|
||||
else if (strcmp(name, LOC_GPS_NI_INTERFACE) == 0)
|
||||
{
|
||||
ret_val = &sLocEngNiInterface;
|
||||
}
|
||||
else if (strcmp(name, AGPS_RIL_INTERFACE) == 0)
|
||||
else if (strcmp(name, LOC_AGPS_RIL_INTERFACE) == 0)
|
||||
{
|
||||
char baseband[PROPERTY_VALUE_MAX];
|
||||
platform_lib_abstraction_property_get("ro.baseband", baseband, "msm");
|
||||
|
@ -654,21 +653,21 @@ const void* loc_get_extension(const char* name)
|
|||
ret_val = &sLocEngAGpsRilInterface;
|
||||
}
|
||||
}
|
||||
else if (strcmp(name, GPS_GEOFENCING_INTERFACE) == 0)
|
||||
else if (strcmp(name, LOC_GPS_GEOFENCING_INTERFACE) == 0)
|
||||
{
|
||||
if ((gps_conf.CAPABILITIES | GPS_CAPABILITY_GEOFENCING) == gps_conf.CAPABILITIES ){
|
||||
if ((gps_conf.CAPABILITIES | LOC_GPS_CAPABILITY_GEOFENCING) == gps_conf.CAPABILITIES ){
|
||||
ret_val = get_geofence_interface();
|
||||
}
|
||||
}
|
||||
else if (strcmp(name, SUPL_CERTIFICATE_INTERFACE) == 0)
|
||||
else if (strcmp(name, LOC_SUPL_CERTIFICATE_INTERFACE) == 0)
|
||||
{
|
||||
ret_val = &sLocEngAGpsCertInterface;
|
||||
}
|
||||
else if (strcmp(name, GNSS_CONFIGURATION_INTERFACE) == 0)
|
||||
else if (strcmp(name, LOC_GNSS_CONFIGURATION_INTERFACE) == 0)
|
||||
{
|
||||
ret_val = &sLocEngConfigInterface;
|
||||
}
|
||||
else if (strcmp(name, GPS_MEASUREMENT_INTERFACE) == 0)
|
||||
else if (strcmp(name, LOC_GPS_MEASUREMENT_INTERFACE) == 0)
|
||||
{
|
||||
ret_val = &sLocEngGpsMeasurementInterface;
|
||||
}
|
||||
|
@ -696,7 +695,7 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static void loc_agps_init(AGpsCallbacks* callbacks)
|
||||
static void loc_agps_init(LocAGpsCallbacks* callbacks)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
loc_eng_agps_init(loc_afw_data, (AGpsExtCallbacks*)callbacks);
|
||||
|
@ -723,7 +722,7 @@ SIDE EFFECTS
|
|||
static int loc_agps_open(const char* apn)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
AGpsType agpsType = AGPS_TYPE_SUPL;
|
||||
LocAGpsType agpsType = LOC_AGPS_TYPE_SUPL;
|
||||
AGpsBearerType bearerType = AGPS_APN_BEARER_IPV4;
|
||||
int ret_val = loc_eng_agps_open(loc_afw_data, agpsType, apn, bearerType);
|
||||
|
||||
|
@ -748,20 +747,20 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_agps_open_with_apniptype(const char* apn, ApnIpType apnIpType)
|
||||
static int loc_agps_open_with_apniptype(const char* apn, LocApnIpType apnIpType)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
AGpsType agpsType = AGPS_TYPE_SUPL;
|
||||
LocAGpsType agpsType = LOC_AGPS_TYPE_SUPL;
|
||||
AGpsBearerType bearerType;
|
||||
|
||||
switch (apnIpType) {
|
||||
case APN_IP_IPV4:
|
||||
case LOC_APN_IP_IPV4:
|
||||
bearerType = AGPS_APN_BEARER_IPV4;
|
||||
break;
|
||||
case APN_IP_IPV6:
|
||||
case LOC_APN_IP_IPV6:
|
||||
bearerType = AGPS_APN_BEARER_IPV6;
|
||||
break;
|
||||
case APN_IP_IPV4V6:
|
||||
case LOC_APN_IP_IPV4V6:
|
||||
bearerType = AGPS_APN_BEARER_IPV4V6;
|
||||
break;
|
||||
default:
|
||||
|
@ -795,7 +794,7 @@ SIDE EFFECTS
|
|||
static int loc_agps_closed()
|
||||
{
|
||||
ENTRY_LOG();
|
||||
AGpsType agpsType = AGPS_TYPE_SUPL;
|
||||
LocAGpsType agpsType = LOC_AGPS_TYPE_SUPL;
|
||||
int ret_val = loc_eng_agps_closed(loc_afw_data, agpsType);
|
||||
|
||||
EXIT_LOG(%d, ret_val);
|
||||
|
@ -822,7 +821,7 @@ SIDE EFFECTS
|
|||
int loc_agps_open_failed()
|
||||
{
|
||||
ENTRY_LOG();
|
||||
AGpsType agpsType = AGPS_TYPE_SUPL;
|
||||
LocAGpsType agpsType = LOC_AGPS_TYPE_SUPL;
|
||||
int ret_val = loc_eng_agps_open_failed(loc_afw_data, agpsType);
|
||||
|
||||
EXIT_LOG(%d, ret_val);
|
||||
|
@ -847,15 +846,15 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_agps_set_server(AGpsType type, const char* hostname, int port)
|
||||
static int loc_agps_set_server(LocAGpsType type, const char* hostname, int port)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
LocServerType serverType;
|
||||
switch (type) {
|
||||
case AGPS_TYPE_SUPL:
|
||||
case LOC_AGPS_TYPE_SUPL:
|
||||
serverType = LOC_AGPS_SUPL_SERVER;
|
||||
break;
|
||||
case AGPS_TYPE_C2K:
|
||||
case LOC_AGPS_TYPE_C2K:
|
||||
serverType = LOC_AGPS_CDMA_PDE_SERVER;
|
||||
break;
|
||||
default:
|
||||
|
@ -884,7 +883,7 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_xtra_init(GpsXtraCallbacks* callbacks)
|
||||
static int loc_xtra_init(LocGpsXtraCallbacks* callbacks)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
GpsXtraExtCallbacks extCallbacks;
|
||||
|
@ -942,7 +941,7 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static int loc_gps_measurement_init(GpsMeasurementCallbacks* callbacks)
|
||||
static int loc_gps_measurement_init(LocGpsMeasurementCallbacks* callbacks)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
int ret_val = loc_eng_gps_measurement_init(loc_afw_data,
|
||||
|
@ -992,7 +991,7 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
void loc_ni_init(GpsNiCallbacks *callbacks)
|
||||
void loc_ni_init(LocGpsNiCallbacks *callbacks)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
gps_ni_cb = callbacks->notify_cb;
|
||||
|
@ -1016,7 +1015,7 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
void loc_ni_respond(int notif_id, GpsUserResponseType user_response)
|
||||
void loc_ni_respond(int notif_id, LocGpsUserResponseType user_response)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
loc_eng_ni_respond(loc_afw_data, notif_id, user_response);
|
||||
|
@ -1024,9 +1023,9 @@ void loc_ni_respond(int notif_id, GpsUserResponseType user_response)
|
|||
}
|
||||
|
||||
// Below stub functions are members of sLocEngAGpsRilInterface
|
||||
static void loc_agps_ril_init( AGpsRilCallbacks* callbacks ) {}
|
||||
static void loc_agps_ril_set_ref_location(const AGpsRefLocation *agps_reflocation, size_t sz_struct) {}
|
||||
static void loc_agps_ril_set_set_id(AGpsSetIDType type, const char* setid) {}
|
||||
static void loc_agps_ril_init( LocAGpsRilCallbacks* callbacks ) {}
|
||||
static void loc_agps_ril_set_ref_location(const LocAGpsRefLocation *agps_reflocation, size_t sz_struct) {}
|
||||
static void loc_agps_ril_set_set_id(LocAGpsSetIDType type, const char* setid) {}
|
||||
static void loc_agps_ril_ni_message(uint8_t *msg, size_t len) {}
|
||||
static void loc_agps_ril_update_network_state(int connected, int type, int roaming, const char* extra_info) {}
|
||||
|
||||
|
@ -1054,7 +1053,7 @@ static void loc_agps_ril_update_network_availability(int available, const char*
|
|||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
static int loc_agps_install_certificates(const DerEncodedCertificate* certificates,
|
||||
static int loc_agps_install_certificates(const LocDerEncodedCertificate* certificates,
|
||||
size_t length)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
|
@ -1062,12 +1061,12 @@ static int loc_agps_install_certificates(const DerEncodedCertificate* certificat
|
|||
EXIT_LOG(%d, ret_val);
|
||||
return ret_val;
|
||||
}
|
||||
static int loc_agps_revoke_certificates(const Sha1CertificateFingerprint* fingerprints,
|
||||
static int loc_agps_revoke_certificates(const LocSha1CertificateFingerprint* fingerprints,
|
||||
size_t length)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
LOC_LOGE("%s:%d]: agps_revoke_certificates not supported");
|
||||
int ret_val = AGPS_CERTIFICATE_ERROR_GENERIC;
|
||||
LOC_LOGE("%s:%d] agps_revoke_certificates not supported", __func__, __LINE__);
|
||||
int ret_val = LOC_AGPS_CERTIFICATE_ERROR_GENERIC;
|
||||
EXIT_LOG(%d, ret_val);
|
||||
return ret_val;
|
||||
}
|
||||
|
@ -1082,7 +1081,7 @@ static void loc_configuration_update(const char* config_data, int32_t length)
|
|||
case GNSS_AUTO:
|
||||
case GNSS_QCA1530:
|
||||
//APQ
|
||||
gps_conf.CAPABILITIES &= ~(GPS_CAPABILITY_MSA | GPS_CAPABILITY_MSB);
|
||||
gps_conf.CAPABILITIES &= ~(LOC_GPS_CAPABILITY_MSA | LOC_GPS_CAPABILITY_MSB);
|
||||
break;
|
||||
}
|
||||
EXIT_LOG(%s, VOID_RET);
|
||||
|
@ -1101,7 +1100,7 @@ static void local_loc_cb(UlpLocation* location, void* locExt)
|
|||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
static void local_sv_cb(GpsSvStatus* sv_status, void* svExt)
|
||||
static void local_sv_cb(LocGpsSvStatus* sv_status, void* svExt)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
if (NULL != gps_sv_cb) {
|
||||
|
@ -1111,7 +1110,7 @@ static void local_sv_cb(GpsSvStatus* sv_status, void* svExt)
|
|||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
static void local_ni_cb(GpsNiNotification *notification, bool esEnalbed)
|
||||
static void local_ni_cb(LocGpsNiNotification *notification, bool esEnalbed)
|
||||
{
|
||||
if (NULL != gps_ni_cb) {
|
||||
gps_ni_cb(notification);
|
||||
|
|
|
@ -35,29 +35,28 @@ extern "C" {
|
|||
#endif /* __cplusplus */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <gps_extended.h>
|
||||
|
||||
#define XTRA_DATA_MAX_SIZE 100000 /*bytes*/
|
||||
|
||||
typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt);
|
||||
typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt);
|
||||
typedef void (*loc_sv_status_cb_ext) (LocGpsSvStatus* sv_status, void* svExt);
|
||||
typedef void* (*loc_ext_parser)(void* data);
|
||||
|
||||
typedef struct {
|
||||
loc_location_cb_ext location_cb;
|
||||
gps_status_callback status_cb;
|
||||
loc_gps_status_callback status_cb;
|
||||
loc_sv_status_cb_ext sv_status_cb;
|
||||
gps_nmea_callback nmea_cb;
|
||||
gps_set_capabilities set_capabilities_cb;
|
||||
gps_acquire_wakelock acquire_wakelock_cb;
|
||||
gps_release_wakelock release_wakelock_cb;
|
||||
gps_create_thread create_thread_cb;
|
||||
loc_gps_nmea_callback nmea_cb;
|
||||
loc_gps_set_capabilities set_capabilities_cb;
|
||||
loc_gps_acquire_wakelock acquire_wakelock_cb;
|
||||
loc_gps_release_wakelock release_wakelock_cb;
|
||||
loc_gps_create_thread create_thread_cb;
|
||||
loc_ext_parser location_ext_parser;
|
||||
loc_ext_parser sv_ext_parser;
|
||||
gps_request_utc_time request_utc_time_cb;
|
||||
gnss_set_system_info set_system_info_cb;
|
||||
gnss_sv_status_callback gnss_sv_status_cb;
|
||||
loc_gps_request_utc_time request_utc_time_cb;
|
||||
loc_gnss_set_system_info set_system_info_cb;
|
||||
loc_gnss_sv_status_callback gnss_sv_status_cb;
|
||||
} LocCallbacks;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -193,11 +193,11 @@ static int loc_eng_set_server(loc_eng_data_s_type &loc_eng_data,
|
|||
LocServerType type, const char *hostname, int port);
|
||||
// Internal functions
|
||||
static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data,
|
||||
GpsStatusValue status);
|
||||
LocGpsStatusValue status);
|
||||
static void loc_eng_report_status(loc_eng_data_s_type &loc_eng_data,
|
||||
GpsStatusValue status);
|
||||
LocGpsStatusValue status);
|
||||
static void loc_eng_process_conn_request(loc_eng_data_s_type &loc_eng_data,
|
||||
int connHandle, AGpsType agps_type);
|
||||
int connHandle, LocAGpsType agps_type);
|
||||
static void loc_eng_agps_close_status(loc_eng_data_s_type &loc_eng_data, int is_succ);
|
||||
static void loc_eng_handle_engine_down(loc_eng_data_s_type &loc_eng_data) ;
|
||||
static void loc_eng_handle_engine_up(loc_eng_data_s_type &loc_eng_data) ;
|
||||
|
@ -211,7 +211,7 @@ getAgpsStateMachine(loc_eng_data_s_type& logEng, AGpsExtType agpsType);
|
|||
static void createAgnssNifs(loc_eng_data_s_type& locEng);
|
||||
static int dataCallCb(void *cb_data);
|
||||
static void update_aiding_data_for_deletion(loc_eng_data_s_type& loc_eng_data) {
|
||||
if (loc_eng_data.engine_status != GPS_STATUS_ENGINE_ON &&
|
||||
if (loc_eng_data.engine_status != LOC_GPS_STATUS_ENGINE_ON &&
|
||||
loc_eng_data.aiding_data_for_deletion != 0)
|
||||
{
|
||||
loc_eng_data.adapter->deleteAidingData(loc_eng_data.aiding_data_for_deletion);
|
||||
|
@ -229,7 +229,7 @@ static void* noProc(void* data)
|
|||
*********************************************************************/
|
||||
// case LOC_ENG_MSG_REQUEST_NI:
|
||||
LocEngRequestNi::LocEngRequestNi(void* locEng,
|
||||
GpsNiNotification ¬if,
|
||||
LocGpsNiNotification ¬if,
|
||||
const void* data) :
|
||||
LocMsg(), mLocEng(locEng), mNotify(notif), mPayload(data) {
|
||||
locallog();
|
||||
|
@ -347,11 +347,11 @@ void LocEngGetZpp::send() const {
|
|||
|
||||
struct LocEngSetTime : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
const GpsUtcTime mTime;
|
||||
const LocGpsUtcTime mTime;
|
||||
const int64_t mTimeReference;
|
||||
const int mUncertainty;
|
||||
inline LocEngSetTime(LocEngAdapter* adapter,
|
||||
GpsUtcTime t, int64_t tf, int unc) :
|
||||
LocGpsUtcTime t, int64_t tf, int unc) :
|
||||
LocMsg(), mAdapter(adapter),
|
||||
mTime(t), mTimeReference(tf), mUncertainty(unc)
|
||||
{
|
||||
|
@ -804,7 +804,7 @@ void LocEngReportPosition::proc() const {
|
|||
mTechMask)) ||
|
||||
(LOC_SESS_INTERMEDIATE == locEng->intermediateFix &&
|
||||
!((mLocation.gpsLocation.flags &
|
||||
GPS_LOCATION_HAS_ACCURACY) &&
|
||||
LOC_GPS_LOCATION_HAS_ACCURACY) &&
|
||||
(gps_conf.ACCURACY_THRES != 0) &&
|
||||
(mLocation.gpsLocation.accuracy >
|
||||
gps_conf.ACCURACY_THRES)))) {
|
||||
|
@ -821,7 +821,7 @@ void LocEngReportPosition::proc() const {
|
|||
// if we have reported this fix
|
||||
if (reported &&
|
||||
// and if this is a singleshot
|
||||
GPS_POSITION_RECURRENCE_SINGLE ==
|
||||
LOC_GPS_POSITION_RECURRENCE_SINGLE ==
|
||||
locEng->adapter->getPositionMode().recurrence) {
|
||||
if (LOC_SESS_INTERMEDIATE == mStatus) {
|
||||
// modem could be still working for a final fix,
|
||||
|
@ -869,7 +869,7 @@ void LocEngReportPosition::send() const {
|
|||
|
||||
// case LOC_ENG_MSG_REPORT_SV:
|
||||
LocEngReportSv::LocEngReportSv(LocAdapterBase* adapter,
|
||||
GnssSvStatus &sv,
|
||||
LocGnssSvStatus &sv,
|
||||
GpsLocationExtended &locExtended,
|
||||
void* svExt) :
|
||||
LocMsg(), mAdapter(adapter), mSvStatus(sv),
|
||||
|
@ -886,8 +886,8 @@ void LocEngReportSv::proc() const {
|
|||
|
||||
if (locEng->mute_session_state != LOC_MUTE_SESS_IN_SESSION)
|
||||
{
|
||||
GnssSvStatus gnssSvStatus;
|
||||
memcpy(&gnssSvStatus,&mSvStatus,sizeof(GnssSvStatus));
|
||||
LocGnssSvStatus gnssSvStatus;
|
||||
memcpy(&gnssSvStatus,&mSvStatus,sizeof(LocGnssSvStatus));
|
||||
if (adapter->isGnssSvIdUsedInPosAvail())
|
||||
{
|
||||
GnssSvUsedInPosition gnssSvIdUsedInPosition =
|
||||
|
@ -924,18 +924,18 @@ void LocEngReportSv::proc() const {
|
|||
// flag, else clear the USED_IN_FIX flag.
|
||||
if (svUsedIdMask & (1 << (gnssSvId - prnMin)))
|
||||
{
|
||||
gnssSvStatus.gnss_sv_list[i].flags |= GNSS_SV_FLAGS_USED_IN_FIX;
|
||||
gnssSvStatus.gnss_sv_list[i].flags |= LOC_GNSS_SV_FLAGS_USED_IN_FIX;
|
||||
}
|
||||
else
|
||||
{
|
||||
gnssSvStatus.gnss_sv_list[i].flags &= ~GNSS_SV_FLAGS_USED_IN_FIX;
|
||||
gnssSvStatus.gnss_sv_list[i].flags &= ~LOC_GNSS_SV_FLAGS_USED_IN_FIX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (locEng->gnss_sv_status_cb != NULL) {
|
||||
LOC_LOGE("Calling gnss_sv_status_cb");
|
||||
locEng->gnss_sv_status_cb((GnssSvStatus*)&(gnssSvStatus));
|
||||
locEng->gnss_sv_status_cb((LocGnssSvStatus*)&(gnssSvStatus));
|
||||
}
|
||||
|
||||
if (locEng->generateNmea)
|
||||
|
@ -956,7 +956,7 @@ void LocEngReportSv::send() const {
|
|||
|
||||
// case LOC_ENG_MSG_REPORT_STATUS:
|
||||
LocEngReportStatus::LocEngReportStatus(LocAdapterBase* adapter,
|
||||
GpsStatusValue engineStatus) :
|
||||
LocGpsStatusValue engineStatus) :
|
||||
LocMsg(), mAdapter(adapter), mStatus(engineStatus)
|
||||
{
|
||||
locallog();
|
||||
|
@ -1216,7 +1216,7 @@ void LocEngRequestATL::proc() const {
|
|||
ATLSubscriber s(mID,
|
||||
sm,
|
||||
locEng->adapter,
|
||||
AGPS_TYPE_INVALID == mType);
|
||||
LOC_AGPS_TYPE_INVALID == mType);
|
||||
sm->subscribeRsrc((Subscriber*)&s);
|
||||
} else {
|
||||
locEng->adapter->atlOpenStatus(mID, 0, NULL, -1, mType);
|
||||
|
@ -1350,7 +1350,7 @@ LocEngRequestTime::LocEngRequestTime(void* locEng) :
|
|||
}
|
||||
void LocEngRequestTime::proc() const {
|
||||
loc_eng_data_s_type* locEng = (loc_eng_data_s_type*)mLocEng;
|
||||
if (gps_conf.CAPABILITIES & GPS_CAPABILITY_ON_DEMAND_TIME) {
|
||||
if (gps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_ON_DEMAND_TIME) {
|
||||
if (locEng->request_utc_time_cb != NULL) {
|
||||
locEng->request_utc_time_cb();
|
||||
} else {
|
||||
|
@ -1368,9 +1368,9 @@ inline void LocEngRequestTime::log() const {
|
|||
// case LOC_ENG_MSG_DELETE_AIDING_DATA:
|
||||
struct LocEngDelAidData : public LocMsg {
|
||||
loc_eng_data_s_type* mLocEng;
|
||||
const GpsAidingData mType;
|
||||
const LocGpsAidingData mType;
|
||||
inline LocEngDelAidData(loc_eng_data_s_type* locEng,
|
||||
GpsAidingData f) :
|
||||
LocGpsAidingData f) :
|
||||
LocMsg(), mLocEng(locEng), mType(f)
|
||||
{
|
||||
locallog();
|
||||
|
@ -1645,14 +1645,14 @@ struct LocEngInstallAGpsCert : public LocMsg {
|
|||
LocEngAdapter* mpAdapter;
|
||||
const size_t mNumberOfCerts;
|
||||
const uint32_t mSlotBitMask;
|
||||
DerEncodedCertificate* mpData;
|
||||
LocDerEncodedCertificate* mpData;
|
||||
inline LocEngInstallAGpsCert(LocEngAdapter* adapter,
|
||||
const DerEncodedCertificate* pData,
|
||||
const LocDerEncodedCertificate* pData,
|
||||
size_t numberOfCerts,
|
||||
uint32_t slotBitMask) :
|
||||
LocMsg(), mpAdapter(adapter),
|
||||
mNumberOfCerts(numberOfCerts), mSlotBitMask(slotBitMask),
|
||||
mpData(new DerEncodedCertificate[mNumberOfCerts])
|
||||
mpData(new LocDerEncodedCertificate[mNumberOfCerts])
|
||||
{
|
||||
for (int i=0; i < mNumberOfCerts; i++) {
|
||||
mpData[i].data = new u_char[pData[i].length];
|
||||
|
@ -1694,10 +1694,10 @@ struct LocEngGnssConstellationConfig : public LocMsg {
|
|||
locallog();
|
||||
}
|
||||
inline virtual void proc() const {
|
||||
mAdapter->mGnssInfo.size = sizeof(GnssSystemInfo);
|
||||
mAdapter->mGnssInfo.size = sizeof(LocGnssSystemInfo);
|
||||
if (mAdapter->gnssConstellationConfig()) {
|
||||
LOC_LOGV("Modem supports GNSS measurements\n");
|
||||
gps_conf.CAPABILITIES |= GPS_CAPABILITY_MEASUREMENTS;
|
||||
gps_conf.CAPABILITIES |= LOC_GPS_CAPABILITY_MEASUREMENTS;
|
||||
mAdapter->mGnssInfo.year_of_hw = 2016;
|
||||
} else {
|
||||
mAdapter->mGnssInfo.year_of_hw = 2015;
|
||||
|
@ -1714,7 +1714,7 @@ struct LocEngGnssConstellationConfig : public LocMsg {
|
|||
|
||||
// case LOC_ENG_MSG_REPORT_GNSS_MEASUREMENT:
|
||||
LocEngReportGnssMeasurement::LocEngReportGnssMeasurement(void* locEng,
|
||||
GnssData &gnssData) :
|
||||
LocGnssData &gnssData) :
|
||||
LocMsg(), mLocEng(locEng), mGnssData(gnssData)
|
||||
{
|
||||
locallog();
|
||||
|
@ -1725,7 +1725,7 @@ void LocEngReportGnssMeasurement::proc() const {
|
|||
{
|
||||
if (locEng->gnss_measurement_cb != NULL) {
|
||||
LOC_LOGV("Calling gnss_measurement_cb");
|
||||
locEng->gnss_measurement_cb((GnssData*)&(mGnssData));
|
||||
locEng->gnss_measurement_cb((LocGnssData*)&(mGnssData));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1734,7 +1734,7 @@ void LocEngReportGnssMeasurement::locallog() const {
|
|||
LOC_LOGV("%s:%d]: Received in GPS HAL."
|
||||
"GNSS Measurements count: %d \n",
|
||||
__func__, __LINE__, mGnssData.measurement_count);
|
||||
for (int i =0; i< mGnssData.measurement_count && i < GNSS_MAX_SVS; i++) {
|
||||
for (int i =0; i< mGnssData.measurement_count && i < LOC_GNSS_MAX_SVS; i++) {
|
||||
LOC_LOGV(" GNSS measurement data in GPS HAL: \n"
|
||||
" GPS_HAL => Measurement ID | svid | time_offset_ns | state |"
|
||||
" c_n0_dbhz | pseudorange_rate_mps |"
|
||||
|
@ -1835,8 +1835,8 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
|
|||
callbacks->sv_ext_parser : noProc;
|
||||
loc_eng_data.intermediateFix = gps_conf.INTERMEDIATE_POS;
|
||||
// initial states taken care of by the memset above
|
||||
// loc_eng_data.engine_status -- GPS_STATUS_NONE;
|
||||
// loc_eng_data.fix_session_status -- GPS_STATUS_NONE;
|
||||
// loc_eng_data.engine_status -- LOC_GPS_STATUS_NONE;
|
||||
// loc_eng_data.fix_session_status -- LOC_GPS_STATUS_NONE;
|
||||
// loc_eng_data.mute_session_state -- LOC_MUTE_SESS_NONE;
|
||||
|
||||
if ((event & LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT) && (gps_conf.NMEA_PROVIDER == NMEA_PROVIDER_AP))
|
||||
|
@ -1853,7 +1853,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
|
|||
new LocEngAdapter(event, &loc_eng_data, context,
|
||||
(LocThread::tCreate)callbacks->create_thread_cb);
|
||||
|
||||
loc_eng_data.adapter->mGnssInfo.size = sizeof(GnssSystemInfo);
|
||||
loc_eng_data.adapter->mGnssInfo.size = sizeof(LocGnssSystemInfo);
|
||||
loc_eng_data.adapter->mGnssInfo.year_of_hw = 2015;
|
||||
LOC_LOGD("loc_eng_init created client, id = %p\n",
|
||||
loc_eng_data.adapter);
|
||||
|
@ -2122,8 +2122,8 @@ int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data,
|
|||
INIT_CHECK(loc_eng_data.adapter, return -1);
|
||||
|
||||
// The position mode for AUTO/GSS/QCA1530 can only be standalone
|
||||
if (!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB) &&
|
||||
!(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) &&
|
||||
if (!(gps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSB) &&
|
||||
!(gps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSA) &&
|
||||
(params.mode != LOC_POSITION_MODE_STANDALONE)) {
|
||||
params.mode = LOC_POSITION_MODE_STANDALONE;
|
||||
LOC_LOGD("Position mode changed to standalone for target with AUTO/GSS/qca1530.");
|
||||
|
@ -2155,7 +2155,7 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, GpsUtcTime time,
|
||||
int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data, LocGpsUtcTime time,
|
||||
int64_t timeReference, int uncertainty)
|
||||
{
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
|
@ -2213,7 +2213,7 @@ DESCRIPTION
|
|||
will happen when gps engine is turned off.
|
||||
|
||||
DEPENDENCIES
|
||||
Assumes the aiding data type specified in GpsAidingData matches with
|
||||
Assumes the aiding data type specified in LocGpsAidingData matches with
|
||||
LOC API specification.
|
||||
|
||||
RETURN VALUE
|
||||
|
@ -2223,7 +2223,7 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, GpsAidingData f)
|
||||
void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data, LocGpsAidingData f)
|
||||
{
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
INIT_CHECK(loc_eng_data.adapter, return);
|
||||
|
@ -2253,13 +2253,13 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, GpsStatusValue status)
|
||||
static void loc_inform_gps_status(loc_eng_data_s_type &loc_eng_data, LocGpsStatusValue status)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
|
||||
if (loc_eng_data.status_cb)
|
||||
{
|
||||
GpsStatus gs = { sizeof(gs),status };
|
||||
LocGpsStatus gs = { sizeof(gs),status };
|
||||
CALLBACK_LOG_CALLFLOW("status_cb", %s,
|
||||
loc_get_gps_status_name(gs.status));
|
||||
loc_eng_data.status_cb(&gs);
|
||||
|
@ -2305,12 +2305,12 @@ static int dataCallCb(void *cb_data)
|
|||
if(cb_data != NULL) {
|
||||
dsCbData *cbData = (dsCbData *)cb_data;
|
||||
LocEngAdapter *locAdapter = (LocEngAdapter *)cbData->mAdapter;
|
||||
if(cbData->action == GPS_REQUEST_AGPS_DATA_CONN) {
|
||||
LOC_LOGD("dataCallCb GPS_REQUEST_AGPS_DATA_CONN\n");
|
||||
if(cbData->action == LOC_GPS_REQUEST_AGPS_DATA_CONN) {
|
||||
LOC_LOGD("dataCallCb LOC_GPS_REQUEST_AGPS_DATA_CONN\n");
|
||||
ret = locAdapter->openAndStartDataCall();
|
||||
}
|
||||
else if(cbData->action == GPS_RELEASE_AGPS_DATA_CONN) {
|
||||
LOC_LOGD("dataCallCb GPS_RELEASE_AGPS_DATA_CONN\n");
|
||||
else if(cbData->action == LOC_GPS_RELEASE_AGPS_DATA_CONN) {
|
||||
LOC_LOGD("dataCallCb LOC_GPS_RELEASE_AGPS_DATA_CONN\n");
|
||||
locAdapter->stopDataCall();
|
||||
}
|
||||
}
|
||||
|
@ -2436,7 +2436,7 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call
|
|||
}
|
||||
|
||||
static void deleteAidingData(loc_eng_data_s_type &logEng) {
|
||||
if (logEng.engine_status != GPS_STATUS_ENGINE_ON &&
|
||||
if (logEng.engine_status != LOC_GPS_STATUS_ENGINE_ON &&
|
||||
logEng.aiding_data_for_deletion != 0) {
|
||||
logEng.adapter->deleteAidingData(logEng.aiding_data_for_deletion);
|
||||
logEng.aiding_data_for_deletion = 0;
|
||||
|
@ -2445,21 +2445,21 @@ static void deleteAidingData(loc_eng_data_s_type &logEng) {
|
|||
|
||||
// must be called under msg handler context
|
||||
static void createAgnssNifs(loc_eng_data_s_type& locEng) {
|
||||
bool agpsCapable = ((gps_conf.CAPABILITIES & GPS_CAPABILITY_MSA) ||
|
||||
(gps_conf.CAPABILITIES & GPS_CAPABILITY_MSB));
|
||||
bool agpsCapable = ((gps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSA) ||
|
||||
(gps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSB));
|
||||
LocEngAdapter* adapter = locEng.adapter;
|
||||
if (NULL != adapter && adapter->mSupportsAgpsRequests) {
|
||||
if (NULL == locEng.internet_nif) {
|
||||
locEng.internet_nif= new AgpsStateMachine(servicerTypeAgps,
|
||||
(void *)locEng.agps_status_cb,
|
||||
AGPS_TYPE_WWAN_ANY,
|
||||
LOC_AGPS_TYPE_WWAN_ANY,
|
||||
false);
|
||||
}
|
||||
if (agpsCapable) {
|
||||
if (NULL == locEng.agnss_nif) {
|
||||
locEng.agnss_nif = new AgpsStateMachine(servicerTypeAgps,
|
||||
(void *)locEng.agps_status_cb,
|
||||
AGPS_TYPE_SUPL,
|
||||
LOC_AGPS_TYPE_SUPL,
|
||||
false);
|
||||
}
|
||||
if (NULL == locEng.ds_nif &&
|
||||
|
@ -2478,12 +2478,12 @@ static AgpsStateMachine*
|
|||
getAgpsStateMachine(loc_eng_data_s_type &locEng, AGpsExtType agpsType) {
|
||||
AgpsStateMachine* stateMachine;
|
||||
switch (agpsType) {
|
||||
case AGPS_TYPE_INVALID:
|
||||
case AGPS_TYPE_SUPL: {
|
||||
case LOC_AGPS_TYPE_INVALID:
|
||||
case LOC_AGPS_TYPE_SUPL: {
|
||||
stateMachine = locEng.agnss_nif;
|
||||
break;
|
||||
}
|
||||
case AGPS_TYPE_SUPL_ES: {
|
||||
case LOC_AGPS_TYPE_SUPL_ES: {
|
||||
if (gps_conf.USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL) {
|
||||
if (NULL == locEng.ds_nif) {
|
||||
createAgnssNifs(locEng);
|
||||
|
@ -2797,11 +2797,11 @@ void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_d
|
|||
}
|
||||
|
||||
int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data,
|
||||
const DerEncodedCertificate* certificates,
|
||||
const LocDerEncodedCertificate* certificates,
|
||||
size_t numberOfCerts)
|
||||
{
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
int ret_val = AGPS_CERTIFICATE_OPERATION_SUCCESS;
|
||||
int ret_val = LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS;
|
||||
|
||||
uint32_t slotBitMask = gps_conf.AGPS_CERT_WRITABLE_MASK;
|
||||
uint32_t slotCount = 0;
|
||||
|
@ -2815,26 +2815,26 @@ int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data,
|
|||
|
||||
if (numberOfCerts == 0) {
|
||||
LOC_LOGE("No certs to install, since numberOfCerts is zero");
|
||||
ret_val = AGPS_CERTIFICATE_OPERATION_SUCCESS;
|
||||
ret_val = LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS;
|
||||
} else if (!adapter) {
|
||||
LOC_LOGE("adapter is null!");
|
||||
ret_val = AGPS_CERTIFICATE_ERROR_GENERIC;
|
||||
ret_val = LOC_AGPS_CERTIFICATE_ERROR_GENERIC;
|
||||
} else if (slotCount < numberOfCerts) {
|
||||
LOC_LOGE("Not enough cert slots (%u) to install %u certs!",
|
||||
slotCount, numberOfCerts);
|
||||
ret_val = AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES;
|
||||
ret_val = LOC_AGPS_CERTIFICATE_ERROR_TOO_MANY_CERTIFICATES;
|
||||
} else {
|
||||
for (int i=0; i < numberOfCerts; ++i)
|
||||
{
|
||||
if (certificates[i].length > AGPS_CERTIFICATE_MAX_LENGTH) {
|
||||
if (certificates[i].length > LOC_AGPS_CERTIFICATE_MAX_LENGTH) {
|
||||
LOC_LOGE("cert#(%u) length of %u is too big! greater than %u",
|
||||
certificates[i].length, AGPS_CERTIFICATE_MAX_LENGTH);
|
||||
ret_val = AGPS_CERTIFICATE_ERROR_GENERIC;
|
||||
certificates[i].length, LOC_AGPS_CERTIFICATE_MAX_LENGTH);
|
||||
ret_val = LOC_AGPS_CERTIFICATE_ERROR_GENERIC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret_val == AGPS_CERTIFICATE_OPERATION_SUCCESS) {
|
||||
if (ret_val == LOC_AGPS_CERTIFICATE_OPERATION_SUCCESS) {
|
||||
adapter->sendMsg(new LocEngInstallAGpsCert(adapter,
|
||||
certificates,
|
||||
numberOfCerts,
|
||||
|
@ -2907,11 +2907,11 @@ SIDE EFFECTS
|
|||
N/A
|
||||
|
||||
===========================================================================*/
|
||||
static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusValue status)
|
||||
static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, LocGpsStatusValue status)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
// Switch from WAIT to MUTE, for "engine on" or "session begin" event
|
||||
if (status == GPS_STATUS_SESSION_BEGIN || status == GPS_STATUS_ENGINE_ON)
|
||||
if (status == LOC_GPS_STATUS_SESSION_BEGIN || status == LOC_GPS_STATUS_ENGINE_ON)
|
||||
{
|
||||
if (loc_eng_data.mute_session_state == LOC_MUTE_SESS_WAIT)
|
||||
{
|
||||
|
@ -2922,7 +2922,7 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV
|
|||
|
||||
// Switch off MUTE session
|
||||
if (loc_eng_data.mute_session_state == LOC_MUTE_SESS_IN_SESSION &&
|
||||
(status == GPS_STATUS_SESSION_END || status == GPS_STATUS_ENGINE_OFF))
|
||||
(status == LOC_GPS_STATUS_SESSION_END || status == LOC_GPS_STATUS_ENGINE_OFF))
|
||||
{
|
||||
LOC_LOGD("loc_eng_report_status: mute_session_state changed from IN SESSION to NONE");
|
||||
loc_eng_data.mute_session_state = LOC_MUTE_SESS_NONE;
|
||||
|
@ -2930,9 +2930,9 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV
|
|||
|
||||
// Session End is not reported during Android navigating state
|
||||
boolean navigating = loc_eng_data.adapter->isInSession();
|
||||
if (status != GPS_STATUS_NONE &&
|
||||
!(status == GPS_STATUS_SESSION_END && navigating) &&
|
||||
!(status == GPS_STATUS_SESSION_BEGIN && !navigating))
|
||||
if (status != LOC_GPS_STATUS_NONE &&
|
||||
!(status == LOC_GPS_STATUS_SESSION_END && navigating) &&
|
||||
!(status == LOC_GPS_STATUS_SESSION_BEGIN && !navigating))
|
||||
{
|
||||
if (loc_eng_data.mute_session_state != LOC_MUTE_SESS_IN_SESSION)
|
||||
{
|
||||
|
@ -2945,13 +2945,13 @@ static void loc_eng_report_status (loc_eng_data_s_type &loc_eng_data, GpsStatusV
|
|||
}
|
||||
|
||||
// Only keeps ENGINE ON/OFF in engine_status
|
||||
if (status == GPS_STATUS_ENGINE_ON || status == GPS_STATUS_ENGINE_OFF)
|
||||
if (status == LOC_GPS_STATUS_ENGINE_ON || status == LOC_GPS_STATUS_ENGINE_OFF)
|
||||
{
|
||||
loc_eng_data.engine_status = status;
|
||||
}
|
||||
|
||||
// Only keeps SESSION BEGIN/END in fix_session_status
|
||||
if (status == GPS_STATUS_SESSION_BEGIN || status == GPS_STATUS_SESSION_END)
|
||||
if (status == LOC_GPS_STATUS_SESSION_BEGIN || status == LOC_GPS_STATUS_SESSION_END)
|
||||
{
|
||||
loc_eng_data.fix_session_status = status;
|
||||
}
|
||||
|
@ -2981,7 +2981,7 @@ void loc_eng_handle_engine_down(loc_eng_data_s_type &loc_eng_data)
|
|||
{
|
||||
ENTRY_LOG();
|
||||
loc_eng_ni_reset_on_engine_restart(loc_eng_data);
|
||||
loc_eng_report_status(loc_eng_data, GPS_STATUS_ENGINE_OFF);
|
||||
loc_eng_report_status(loc_eng_data, LOC_GPS_STATUS_ENGINE_OFF);
|
||||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
||||
|
@ -3070,28 +3070,28 @@ SIDE EFFECTS
|
|||
|
||||
===========================================================================*/
|
||||
int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data,
|
||||
GpsMeasurementCallbacks* callbacks)
|
||||
LocGpsMeasurementCallbacks* callbacks)
|
||||
{
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
|
||||
STATE_CHECK((NULL == loc_eng_data.gnss_measurement_cb),
|
||||
"gnss measurement already initialized",
|
||||
return GPS_MEASUREMENT_ERROR_ALREADY_INIT);
|
||||
return LOC_GPS_MEASUREMENT_ERROR_ALREADY_INIT);
|
||||
STATE_CHECK((callbacks != NULL),
|
||||
"callbacks can not be NULL",
|
||||
return GPS_MEASUREMENT_ERROR_GENERIC);
|
||||
return LOC_GPS_MEASUREMENT_ERROR_GENERIC);
|
||||
STATE_CHECK(loc_eng_data.adapter,
|
||||
"GpsInterface must be initialized first",
|
||||
return GPS_MEASUREMENT_ERROR_GENERIC);
|
||||
"LocGpsInterface must be initialized first",
|
||||
return LOC_GPS_MEASUREMENT_ERROR_GENERIC);
|
||||
|
||||
// updated the mask
|
||||
LOC_API_ADAPTER_EVENT_MASK_T event = LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT;
|
||||
loc_eng_data.adapter->updateEvtMask(event, LOC_REGISTRATION_MASK_ENABLED);
|
||||
// set up the callback
|
||||
loc_eng_data.gnss_measurement_cb = callbacks->gnss_measurement_callback;
|
||||
loc_eng_data.gnss_measurement_cb = callbacks->loc_gnss_measurement_callback;
|
||||
LOC_LOGD ("%s, event masks updated successfully", __func__);
|
||||
|
||||
return GPS_MEASUREMENT_OPERATION_SUCCESS;
|
||||
return LOC_GPS_MEASUREMENT_OPERATION_SUCCESS;
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
|
|
|
@ -85,20 +85,20 @@ typedef struct loc_eng_data_s
|
|||
{
|
||||
LocEngAdapter *adapter;
|
||||
loc_location_cb_ext location_cb;
|
||||
gps_status_callback status_cb;
|
||||
loc_gps_status_callback status_cb;
|
||||
loc_sv_status_cb_ext sv_status_cb;
|
||||
agps_status_extended agps_status_cb;
|
||||
gps_nmea_callback nmea_cb;
|
||||
loc_gps_nmea_callback nmea_cb;
|
||||
loc_ni_notify_callback ni_notify_cb;
|
||||
gps_set_capabilities set_capabilities_cb;
|
||||
gps_acquire_wakelock acquire_wakelock_cb;
|
||||
gps_release_wakelock release_wakelock_cb;
|
||||
gps_request_utc_time request_utc_time_cb;
|
||||
gnss_set_system_info set_system_info_cb;
|
||||
gnss_sv_status_callback gnss_sv_status_cb;
|
||||
gnss_measurement_callback gnss_measurement_cb;
|
||||
loc_gps_set_capabilities set_capabilities_cb;
|
||||
loc_gps_acquire_wakelock acquire_wakelock_cb;
|
||||
loc_gps_release_wakelock release_wakelock_cb;
|
||||
loc_gps_request_utc_time request_utc_time_cb;
|
||||
loc_gnss_set_system_info set_system_info_cb;
|
||||
loc_gnss_sv_status_callback gnss_sv_status_cb;
|
||||
loc_gnss_measurement_callback gnss_measurement_cb;
|
||||
boolean intermediateFix;
|
||||
AGpsStatusValue agps_status;
|
||||
LocAGpsStatusValue agps_status;
|
||||
loc_eng_xtra_data_s_type xtra_module_data;
|
||||
loc_eng_ni_data_s_type loc_eng_ni_data;
|
||||
|
||||
|
@ -109,11 +109,11 @@ typedef struct loc_eng_data_s
|
|||
AgpsStateMachine* ds_nif;
|
||||
|
||||
// GPS engine status
|
||||
GpsStatusValue engine_status;
|
||||
GpsStatusValue fix_session_status;
|
||||
LocGpsStatusValue engine_status;
|
||||
LocGpsStatusValue fix_session_status;
|
||||
|
||||
// Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off
|
||||
GpsAidingData aiding_data_for_deletion;
|
||||
LocGpsAidingData aiding_data_for_deletion;
|
||||
|
||||
// For muting session broadcast
|
||||
loc_mute_session_e_type mute_session_state;
|
||||
|
@ -151,13 +151,13 @@ int loc_eng_start(loc_eng_data_s_type &loc_eng_data);
|
|||
int loc_eng_stop(loc_eng_data_s_type &loc_eng_data);
|
||||
void loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data);
|
||||
int loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data,
|
||||
GpsUtcTime time, int64_t timeReference,
|
||||
LocGpsUtcTime time, int64_t timeReference,
|
||||
int uncertainty);
|
||||
int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data,
|
||||
double latitude, double longitude,
|
||||
float accuracy);
|
||||
void loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data,
|
||||
GpsAidingData f);
|
||||
LocGpsAidingData f);
|
||||
int loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data,
|
||||
LocPosMode ¶ms);
|
||||
const void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data,
|
||||
|
@ -177,7 +177,7 @@ int loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agp
|
|||
void loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data,
|
||||
int avaiable, const char* apn);
|
||||
int loc_eng_agps_install_certificates(loc_eng_data_s_type &loc_eng_data,
|
||||
const DerEncodedCertificate* certificates,
|
||||
const LocDerEncodedCertificate* certificates,
|
||||
size_t length);
|
||||
|
||||
//loc_eng_xtra functions
|
||||
|
@ -192,16 +192,16 @@ void loc_eng_xtra_version_check(loc_eng_data_s_type &loc_eng_data, int check);
|
|||
extern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data,
|
||||
GpsNiExtCallbacks *callbacks);
|
||||
extern void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data,
|
||||
int notif_id, GpsUserResponseType user_response);
|
||||
int notif_id, LocGpsUserResponseType user_response);
|
||||
extern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
|
||||
const GpsNiNotification *notif,
|
||||
const LocGpsNiNotification *notif,
|
||||
const void* passThrough);
|
||||
extern void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data);
|
||||
|
||||
void loc_eng_configuration_update (loc_eng_data_s_type &loc_eng_data,
|
||||
const char* config_data, int32_t length);
|
||||
int loc_eng_gps_measurement_init(loc_eng_data_s_type &loc_eng_data,
|
||||
GpsMeasurementCallbacks* callbacks);
|
||||
LocGpsMeasurementCallbacks* callbacks);
|
||||
void loc_eng_gps_measurement_close(loc_eng_data_s_type &loc_eng_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -156,7 +156,7 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification)
|
|||
case RSRC_DENIED:
|
||||
{
|
||||
AGpsExtType type = mBackwardCompatibleMode ?
|
||||
AGPS_TYPE_INVALID : mStateMachine->getType();
|
||||
LOC_AGPS_TYPE_INVALID : mStateMachine->getType();
|
||||
((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 0,
|
||||
(char*)mStateMachine->getAPN(),
|
||||
mStateMachine->getBearer(),
|
||||
|
@ -166,7 +166,7 @@ bool ATLSubscriber::notifyRsrcStatus(Notification ¬ification)
|
|||
case RSRC_GRANTED:
|
||||
{
|
||||
AGpsExtType type = mBackwardCompatibleMode ?
|
||||
AGPS_TYPE_INVALID : mStateMachine->getType();
|
||||
LOC_AGPS_TYPE_INVALID : mStateMachine->getType();
|
||||
((LocEngAdapter*)mLocAdapter)->atlOpenStatus(ID, 1,
|
||||
(char*)mStateMachine->getAPN(),
|
||||
mStateMachine->getBearer(),
|
||||
|
@ -275,7 +275,7 @@ AgpsState* AgpsReleasedState::onRsrcEvent(AgpsRsrcStatus event, void* data)
|
|||
//The if condition is added so that if the data call setup fails
|
||||
//for DS State Machine, we want to retry in released state.
|
||||
//for AGps State Machine, sendRsrcRequest() will always return success
|
||||
if(!mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN)) {
|
||||
if(!mStateMachine->sendRsrcRequest(LOC_GPS_REQUEST_AGPS_DATA_CONN)) {
|
||||
// move the state to PENDING
|
||||
nextState = mPendingState;
|
||||
}
|
||||
|
@ -354,13 +354,13 @@ AgpsState* AgpsPendingState::onRsrcEvent(AgpsRsrcStatus event, void* data)
|
|||
nextState = mReleasedState;
|
||||
|
||||
// tell connecivity service we can release NIF
|
||||
mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN);
|
||||
mStateMachine->sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN);
|
||||
} else if (!mStateMachine->hasActiveSubscribers()) {
|
||||
// only inactive subscribers, move to RELEASING state
|
||||
nextState = mReleasingState;
|
||||
|
||||
// tell connecivity service we can release NIF
|
||||
mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN);
|
||||
mStateMachine->sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -453,13 +453,13 @@ AgpsState* AgpsAcquiredState::onRsrcEvent(AgpsRsrcStatus event, void* data)
|
|||
nextState = mReleasedState;
|
||||
|
||||
// tell connecivity service we can release NIF
|
||||
mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN);
|
||||
mStateMachine->sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN);
|
||||
} else if (!mStateMachine->hasActiveSubscribers()) {
|
||||
// only inactive subscribers, move to RELEASING state
|
||||
nextState = mReleasingState;
|
||||
|
||||
// tell connecivity service we can release NIF
|
||||
mStateMachine->sendRsrcRequest(GPS_RELEASE_AGPS_DATA_CONN);
|
||||
mStateMachine->sendRsrcRequest(LOC_GPS_RELEASE_AGPS_DATA_CONN);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -559,7 +559,7 @@ AgpsState* AgpsReleasingState::onRsrcEvent(AgpsRsrcStatus event, void* data)
|
|||
if (mStateMachine->hasActiveSubscribers()) {
|
||||
nextState = mPendingState;
|
||||
// request from connecivity service for NIF
|
||||
mStateMachine->sendRsrcRequest(GPS_REQUEST_AGPS_DATA_CONN);
|
||||
mStateMachine->sendRsrcRequest(LOC_GPS_REQUEST_AGPS_DATA_CONN);
|
||||
} else {
|
||||
nextState = mReleasedState;
|
||||
}
|
||||
|
@ -611,7 +611,7 @@ int ExtServicer :: requestRsrc(void *cb_data)
|
|||
|
||||
int AGpsServicer :: requestRsrc(void *cb_data)
|
||||
{
|
||||
callbackAGps((AGpsStatus *)cb_data);
|
||||
callbackAGps((LocAGpsStatus *)cb_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -746,14 +746,14 @@ void AgpsStateMachine::addSubscriber(Subscriber* subscriber) const
|
|||
}
|
||||
}
|
||||
|
||||
int AgpsStateMachine::sendRsrcRequest(AGpsStatusValue action) const
|
||||
int AgpsStateMachine::sendRsrcRequest(LocAGpsStatusValue action) const
|
||||
{
|
||||
Subscriber* s = NULL;
|
||||
Notification notification(Notification::BROADCAST_ACTIVE);
|
||||
linked_list_search(mSubscribers, (void**)&s, hasSubscriber,
|
||||
(void*)¬ification, false);
|
||||
|
||||
if ((NULL == s) == (GPS_RELEASE_AGPS_DATA_CONN == action)) {
|
||||
if ((NULL == s) == (LOC_GPS_RELEASE_AGPS_DATA_CONN == action)) {
|
||||
AGpsExtStatus nifRequest;
|
||||
nifRequest.size = sizeof(nifRequest);
|
||||
nifRequest.type = mType;
|
||||
|
@ -827,7 +827,7 @@ err:
|
|||
|
||||
DSStateMachine :: DSStateMachine(servicerType type, void *cb_func,
|
||||
LocEngAdapter* adapterHandle):
|
||||
AgpsStateMachine(type, cb_func, AGPS_TYPE_INVALID,false),
|
||||
AgpsStateMachine(type, cb_func, LOC_AGPS_TYPE_INVALID,false),
|
||||
mLocAdapter(adapterHandle)
|
||||
{
|
||||
LOC_LOGD("%s:%d]: New DSStateMachine\n", __func__, __LINE__);
|
||||
|
@ -848,7 +848,7 @@ void DSStateMachine :: retryCallback(void)
|
|||
return;
|
||||
}
|
||||
|
||||
int DSStateMachine :: sendRsrcRequest(AGpsStatusValue action) const
|
||||
int DSStateMachine :: sendRsrcRequest(LocAGpsStatusValue action) const
|
||||
{
|
||||
DSSubscriber* s = NULL;
|
||||
dsCbData cbData;
|
||||
|
@ -954,13 +954,13 @@ void DSStateMachine :: informStatus(AgpsRsrcStatus status, int ID) const
|
|||
break;
|
||||
case RSRC_DENIED:
|
||||
((DSStateMachine *)this)->mRetries = 0;
|
||||
mLocAdapter->requestATL(ID, AGPS_TYPE_SUPL);
|
||||
mLocAdapter->requestATL(ID, LOC_AGPS_TYPE_SUPL);
|
||||
break;
|
||||
case RSRC_GRANTED:
|
||||
mLocAdapter->atlOpenStatus(ID, 1,
|
||||
NULL,
|
||||
AGPS_APN_BEARER_INVALID,
|
||||
AGPS_TYPE_INVALID);
|
||||
LOC_AGPS_TYPE_INVALID);
|
||||
break;
|
||||
default:
|
||||
LOC_LOGW("DSStateMachine :: informStatus - unknown status");
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <gps_extended.h>
|
||||
#include <loc_core_log.h>
|
||||
#include <linked_list.h>
|
||||
|
@ -68,7 +67,7 @@ typedef enum {
|
|||
//DS Callback struct
|
||||
typedef struct {
|
||||
LocEngAdapter *mAdapter;
|
||||
AGpsStatusValue action;
|
||||
LocAGpsStatusValue action;
|
||||
}dsCbData;
|
||||
|
||||
// information bundle for subscribers
|
||||
|
@ -171,12 +170,12 @@ public:
|
|||
};
|
||||
|
||||
class AGpsServicer : public Servicer {
|
||||
void (*callbackAGps)(AGpsStatus* status);
|
||||
void (*callbackAGps)(LocAGpsStatus* status);
|
||||
public:
|
||||
int requestRsrc(void *cb_data);
|
||||
AGpsServicer() {}
|
||||
AGpsServicer(void *cb_func)
|
||||
{ callbackAGps = (void(*)(AGpsStatus *))(cb_func); }
|
||||
{ callbackAGps = (void(*)(LocAGpsStatus *))(cb_func); }
|
||||
virtual ~AGpsServicer(){}
|
||||
inline virtual char *whoami() {return (char*)"AGpsServicer";}
|
||||
};
|
||||
|
@ -232,7 +231,7 @@ public:
|
|||
virtual void onRsrcEvent(AgpsRsrcStatus event);
|
||||
|
||||
// put the data together and send the FW
|
||||
virtual int sendRsrcRequest(AGpsStatusValue action) const;
|
||||
virtual int sendRsrcRequest(LocAGpsStatusValue action) const;
|
||||
|
||||
//if list is empty, linked_list_empty returns 1
|
||||
//else if list is not empty, returns 0
|
||||
|
@ -260,7 +259,7 @@ public:
|
|||
DSStateMachine(servicerType type,
|
||||
void *cb_func,
|
||||
LocEngAdapter* adapterHandle);
|
||||
int sendRsrcRequest(AGpsStatusValue action) const;
|
||||
int sendRsrcRequest(LocAGpsStatusValue action) const;
|
||||
void onRsrcEvent(AgpsRsrcStatus event);
|
||||
void retryCallback();
|
||||
void informStatus(AgpsRsrcStatus status, int ID) const;
|
||||
|
|
|
@ -53,19 +53,19 @@ int loc_eng_dmn_conn_loc_api_server_if_request_handler(struct ctrl_msgbuf *pmsg,
|
|||
case IF_REQUEST_TYPE_SUPL:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_TYPE_SUPL");
|
||||
type = AGPS_TYPE_SUPL;
|
||||
type = LOC_AGPS_TYPE_SUPL;
|
||||
break;
|
||||
}
|
||||
case IF_REQUEST_TYPE_WIFI:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_TYPE_WIFI");
|
||||
type = AGPS_TYPE_WIFI;
|
||||
type = LOC_AGPS_TYPE_WIFI;
|
||||
break;
|
||||
}
|
||||
case IF_REQUEST_TYPE_ANY:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_TYPE_ANY");
|
||||
type = AGPS_TYPE_ANY;
|
||||
type = LOC_AGPS_TYPE_ANY;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -149,19 +149,19 @@ int loc_eng_dmn_conn_loc_api_server_if_release_handler(struct ctrl_msgbuf *pmsg,
|
|||
case IF_REQUEST_TYPE_SUPL:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_TYPE_SUPL");
|
||||
type = AGPS_TYPE_SUPL;
|
||||
type = LOC_AGPS_TYPE_SUPL;
|
||||
break;
|
||||
}
|
||||
case IF_REQUEST_TYPE_WIFI:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_TYPE_WIFI");
|
||||
type = AGPS_TYPE_WIFI;
|
||||
type = LOC_AGPS_TYPE_WIFI;
|
||||
break;
|
||||
}
|
||||
case IF_REQUEST_TYPE_ANY:
|
||||
{
|
||||
LOC_LOGD("IF_REQUEST_TYPE_ANY");
|
||||
type = AGPS_TYPE_ANY;
|
||||
type = LOC_AGPS_TYPE_ANY;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
#include <arpa/inet.h>
|
||||
|
||||
//for SSID_BUF_SIZE
|
||||
#include <hardware/gps.h>
|
||||
|
||||
#ifndef SSID_BUF_SIZE
|
||||
#define SSID_BUF_SIZE (32+1)
|
||||
#endif
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#define LOC_ENG_MSG_H
|
||||
|
||||
|
||||
#include <hardware/gps.h>
|
||||
#include <gps_extended.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -105,11 +104,11 @@ struct LocEngReportPosition : public LocMsg {
|
|||
|
||||
struct LocEngReportSv : public LocMsg {
|
||||
LocAdapterBase* mAdapter;
|
||||
const GnssSvStatus mSvStatus;
|
||||
const LocGnssSvStatus mSvStatus;
|
||||
const GpsLocationExtended mLocationExtended;
|
||||
const void* mSvExt;
|
||||
LocEngReportSv(LocAdapterBase* adapter,
|
||||
GnssSvStatus &sv,
|
||||
LocGnssSvStatus &sv,
|
||||
GpsLocationExtended &locExtended,
|
||||
void* svExtended);
|
||||
virtual void proc() const;
|
||||
|
@ -120,9 +119,9 @@ struct LocEngReportSv : public LocMsg {
|
|||
|
||||
struct LocEngReportStatus : public LocMsg {
|
||||
LocAdapterBase* mAdapter;
|
||||
const GpsStatusValue mStatus;
|
||||
const LocGpsStatusValue mStatus;
|
||||
LocEngReportStatus(LocAdapterBase* adapter,
|
||||
GpsStatusValue engineStatus);
|
||||
LocGpsStatusValue engineStatus);
|
||||
virtual void proc() const;
|
||||
void locallog() const;
|
||||
virtual void log() const;
|
||||
|
@ -254,10 +253,10 @@ struct LocEngRequestTime : public LocMsg {
|
|||
|
||||
struct LocEngRequestNi : public LocMsg {
|
||||
void* mLocEng;
|
||||
const GpsNiNotification mNotify;
|
||||
const LocGpsNiNotification mNotify;
|
||||
const void *mPayload;
|
||||
LocEngRequestNi(void* locEng,
|
||||
GpsNiNotification ¬if,
|
||||
LocGpsNiNotification ¬if,
|
||||
const void* data);
|
||||
virtual void proc() const;
|
||||
void locallog() const;
|
||||
|
@ -291,9 +290,9 @@ struct LocEngGetZpp : public LocMsg {
|
|||
|
||||
struct LocEngReportGnssMeasurement : public LocMsg {
|
||||
void* mLocEng;
|
||||
const GnssData mGnssData;
|
||||
const LocGnssData mGnssData;
|
||||
LocEngReportGnssMeasurement(void* locEng,
|
||||
GnssData &gnssData);
|
||||
LocGnssData &gnssData);
|
||||
virtual void proc() const;
|
||||
void locallog() const;
|
||||
virtual void log() const;
|
||||
|
|
|
@ -62,10 +62,10 @@ static void* ni_thread_proc(void *args);
|
|||
|
||||
struct LocEngInformNiResponse : public LocMsg {
|
||||
LocEngAdapter* mAdapter;
|
||||
const GpsUserResponseType mResponse;
|
||||
const LocGpsUserResponseType mResponse;
|
||||
const void *mPayload;
|
||||
inline LocEngInformNiResponse(LocEngAdapter* adapter,
|
||||
GpsUserResponseType resp,
|
||||
LocGpsUserResponseType resp,
|
||||
const void* data) :
|
||||
LocMsg(), mAdapter(adapter),
|
||||
mResponse(resp), mPayload(data)
|
||||
|
@ -109,7 +109,7 @@ RETURN VALUE
|
|||
|
||||
===========================================================================*/
|
||||
void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
|
||||
const GpsNiNotification *notif,
|
||||
const LocGpsNiNotification *notif,
|
||||
const void* passThrough)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
|
@ -122,7 +122,7 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
|
|||
return;
|
||||
}
|
||||
|
||||
if (notif->ni_type == GPS_NI_TYPE_EMERGENCY_SUPL) {
|
||||
if (notif->ni_type == LOC_GPS_NI_TYPE_EMERGENCY_SUPL) {
|
||||
if (NULL != loc_eng_ni_data_p->sessionEs.rawRequest) {
|
||||
LOC_LOGW("loc_eng_ni_request_handler, supl es NI in progress, new supl es NI ignored, type: %d",
|
||||
notif->ni_type);
|
||||
|
@ -153,9 +153,9 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
|
|||
pSession->adapter = loc_eng_data.adapter;
|
||||
|
||||
/* Fill in notification */
|
||||
((GpsNiNotification*)notif)->notification_id = pSession->reqID;
|
||||
((LocGpsNiNotification*)notif)->notification_id = pSession->reqID;
|
||||
|
||||
if (notif->notify_flags == GPS_NI_PRIVACY_OVERRIDE)
|
||||
if (notif->notify_flags == LOC_GPS_NI_PRIVACY_OVERRIDE)
|
||||
{
|
||||
loc_eng_mute_one_session(loc_eng_data);
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
|
|||
}
|
||||
|
||||
CALLBACK_LOG_CALLFLOW("ni_notify_cb - id", %d, notif->notification_id);
|
||||
loc_eng_data.ni_notify_cb((GpsNiNotification*)notif, gps_conf.SUPL_ES != 0);
|
||||
loc_eng_data.ni_notify_cb((LocGpsNiNotification*)notif, gps_conf.SUPL_ES != 0);
|
||||
}
|
||||
EXIT_LOG(%s, VOID_RET);
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ static void* ni_thread_proc(void *args)
|
|||
&expire_time);
|
||||
if (rc == ETIMEDOUT)
|
||||
{
|
||||
pSession->resp = GPS_NI_RESPONSE_NORESP;
|
||||
pSession->resp = LOC_GPS_NI_RESPONSE_NORESP;
|
||||
LOC_LOGD("ni_thread_proc-Thread time out after valting for specified time. Ret Val %d\n",rc );
|
||||
break;
|
||||
}
|
||||
|
@ -242,8 +242,8 @@ static void* ni_thread_proc(void *args)
|
|||
LocEngInformNiResponse *msg = NULL;
|
||||
|
||||
if (NULL != pSession->rawRequest) {
|
||||
if (pSession->resp != GPS_NI_RESPONSE_IGNORE) {
|
||||
LOC_LOGD("pSession->resp != GPS_NI_RESPONSE_IGNORE \n");
|
||||
if (pSession->resp != LOC_GPS_NI_RESPONSE_IGNORE) {
|
||||
LOC_LOGD("pSession->resp != LOC_GPS_NI_RESPONSE_IGNORE \n");
|
||||
msg = new LocEngInformNiResponse(adapter,
|
||||
pSession->resp,
|
||||
pSession->rawRequest);
|
||||
|
@ -369,7 +369,7 @@ SIDE EFFECTS
|
|||
|
||||
===========================================================================*/
|
||||
void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data,
|
||||
int notif_id, GpsUserResponseType user_response)
|
||||
int notif_id, LocGpsUserResponseType user_response)
|
||||
{
|
||||
ENTRY_LOG_CALLFLOW();
|
||||
loc_eng_ni_data_s_type* loc_eng_ni_data_p = &loc_eng_data.loc_eng_ni_data;
|
||||
|
@ -384,10 +384,10 @@ void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data,
|
|||
NULL != loc_eng_ni_data_p->sessionEs.rawRequest) {
|
||||
pSession = &loc_eng_ni_data_p->sessionEs;
|
||||
// ignore any SUPL NI non-Es session if a SUPL NI ES is accepted
|
||||
if (user_response == GPS_NI_RESPONSE_ACCEPT &&
|
||||
if (user_response == LOC_GPS_NI_RESPONSE_ACCEPT &&
|
||||
NULL != loc_eng_ni_data_p->session.rawRequest) {
|
||||
pthread_mutex_lock(&loc_eng_ni_data_p->session.tLock);
|
||||
loc_eng_ni_data_p->session.resp = GPS_NI_RESPONSE_IGNORE;
|
||||
loc_eng_ni_data_p->session.resp = LOC_GPS_NI_RESPONSE_IGNORE;
|
||||
loc_eng_ni_data_p->session.respRecvd = TRUE;
|
||||
pthread_cond_signal(&loc_eng_ni_data_p->session.tCond);
|
||||
pthread_mutex_unlock(&loc_eng_ni_data_p->session.tLock);
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
#define LOC_NI_NO_RESPONSE_TIME 20 /* secs */
|
||||
#define LOC_NI_NOTIF_KEY_ADDRESS "Address"
|
||||
#define GPS_NI_RESPONSE_IGNORE 4
|
||||
#define LOC_GPS_NI_RESPONSE_IGNORE 4
|
||||
|
||||
typedef struct {
|
||||
pthread_t thread; /* NI thread */
|
||||
|
@ -43,7 +43,7 @@ typedef struct {
|
|||
bool respRecvd; /* NI User reponse received or not from Java layer*/
|
||||
void* rawRequest;
|
||||
int reqID; /* ID to check against response */
|
||||
GpsUserResponseType resp;
|
||||
LocGpsUserResponseType resp;
|
||||
pthread_cond_t tCond;
|
||||
pthread_mutex_t tLock;
|
||||
LocEngAdapter* adapter;
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
typedef struct loc_nmea_sv_meta_s
|
||||
{
|
||||
char talker[3];
|
||||
GnssConstellationType svType;
|
||||
LocGnssConstellationType svType;
|
||||
uint32_t mask;
|
||||
uint32_t svIdOffset;
|
||||
} loc_nmea_sv_meta;
|
||||
|
@ -61,7 +61,7 @@ SIDE EFFECTS
|
|||
|
||||
===========================================================================*/
|
||||
static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_eng_data_s_type *loc_eng_data_p,
|
||||
loc_nmea_sv_meta& sv_meta, GnssConstellationType svType, bool needCombine)
|
||||
loc_nmea_sv_meta& sv_meta, LocGnssConstellationType svType, bool needCombine)
|
||||
{
|
||||
if (!loc_eng_data_p)
|
||||
return NULL;
|
||||
|
@ -72,17 +72,17 @@ static loc_nmea_sv_meta* loc_nmea_sv_meta_init(loc_eng_data_s_type *loc_eng_data
|
|||
|
||||
switch (svType)
|
||||
{
|
||||
case GNSS_CONSTELLATION_GPS:
|
||||
case LOC_GNSS_CONSTELLATION_GPS:
|
||||
sv_meta.talker[1] = 'P';
|
||||
sv_meta.mask = loc_eng_data_p->gps_used_mask;
|
||||
break;
|
||||
case GNSS_CONSTELLATION_GLONASS:
|
||||
case LOC_GNSS_CONSTELLATION_GLONASS:
|
||||
sv_meta.talker[1] = 'L';
|
||||
sv_meta.mask = loc_eng_data_p->glo_used_mask;
|
||||
// GLONASS SV ids are from 65-96
|
||||
sv_meta.svIdOffset = GLONASS_SV_ID_OFFSET;
|
||||
break;
|
||||
case GNSS_CONSTELLATION_GALILEO:
|
||||
case LOC_GNSS_CONSTELLATION_GALILEO:
|
||||
sv_meta.talker[1] = 'A';
|
||||
sv_meta.mask = loc_eng_data_p->gal_used_mask;
|
||||
break;
|
||||
|
@ -251,7 +251,7 @@ uint32_t loc_eng_nmea_generate_GSA(loc_eng_data_s_type *loc_eng_data_p,
|
|||
mask = mask >> 1;
|
||||
}
|
||||
|
||||
if (svUsedCount == 0 && GNSS_CONSTELLATION_GPS != sv_meta_p->svType)
|
||||
if (svUsedCount == 0 && LOC_GNSS_CONSTELLATION_GPS != sv_meta_p->svType)
|
||||
return 0;
|
||||
|
||||
if (svUsedCount == 0)
|
||||
|
@ -345,7 +345,7 @@ SIDE EFFECTS
|
|||
|
||||
===========================================================================*/
|
||||
void loc_eng_nmea_generate_GSV(loc_eng_data_s_type *loc_eng_data_p,
|
||||
const GnssSvStatus &svStatus,
|
||||
const LocGnssSvStatus &svStatus,
|
||||
char* sentence,
|
||||
int bufSize,
|
||||
loc_nmea_sv_meta* sv_meta_p)
|
||||
|
@ -500,7 +500,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
// -------------------
|
||||
|
||||
count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence),
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GPS, true));
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GPS, true));
|
||||
if (count > 0)
|
||||
{
|
||||
svUsedCount += count;
|
||||
|
@ -512,7 +512,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
// -------------------
|
||||
|
||||
count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence),
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GLONASS, true));
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GLONASS, true));
|
||||
if (count > 0)
|
||||
{
|
||||
svUsedCount += count;
|
||||
|
@ -524,7 +524,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
// -------------------
|
||||
|
||||
count = loc_eng_nmea_generate_GSA(loc_eng_data_p, locationExtended, sentence, sizeof(sentence),
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GALILEO, true));
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GALILEO, true));
|
||||
if (count > 0)
|
||||
{
|
||||
svUsedCount += count;
|
||||
|
@ -538,7 +538,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker = sentence;
|
||||
lengthRemaining = sizeof(sentence);
|
||||
|
||||
if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING)
|
||||
if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_BEARING)
|
||||
{
|
||||
float magTrack = location.gpsLocation.bearing;
|
||||
if (locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_MAG_DEV)
|
||||
|
@ -565,7 +565,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED)
|
||||
if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_SPEED)
|
||||
{
|
||||
float speedKnots = location.gpsLocation.speed * (3600.0/1852.0);
|
||||
float speedKmPerHour = location.gpsLocation.speed * 3.6;
|
||||
|
@ -585,7 +585,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG))
|
||||
if (!(location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG))
|
||||
length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix
|
||||
else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode)
|
||||
length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous
|
||||
|
@ -613,7 +613,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)
|
||||
if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)
|
||||
{
|
||||
double latitude = location.gpsLocation.latitude;
|
||||
double longitude = location.gpsLocation.longitude;
|
||||
|
@ -662,7 +662,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if (location.gpsLocation.flags & GPS_LOCATION_HAS_SPEED)
|
||||
if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_SPEED)
|
||||
{
|
||||
float speedKnots = location.gpsLocation.speed * (3600.0/1852.0);
|
||||
length = snprintf(pMarker, lengthRemaining, "%.1lf,", speedKnots);
|
||||
|
@ -680,7 +680,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if (location.gpsLocation.flags & GPS_LOCATION_HAS_BEARING)
|
||||
if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_BEARING)
|
||||
{
|
||||
length = snprintf(pMarker, lengthRemaining, "%.1lf,", location.gpsLocation.bearing);
|
||||
}
|
||||
|
@ -738,7 +738,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG))
|
||||
if (!(location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG))
|
||||
length = snprintf(pMarker, lengthRemaining, "%c", 'N'); // N means no fix
|
||||
else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode)
|
||||
length = snprintf(pMarker, lengthRemaining, "%c", 'A'); // A means autonomous
|
||||
|
@ -766,7 +766,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if (location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG)
|
||||
if (location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG)
|
||||
{
|
||||
double latitude = location.gpsLocation.latitude;
|
||||
double longitude = location.gpsLocation.longitude;
|
||||
|
@ -816,7 +816,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
lengthRemaining -= length;
|
||||
|
||||
char gpsQuality;
|
||||
if (!(location.gpsLocation.flags & GPS_LOCATION_HAS_LAT_LONG))
|
||||
if (!(location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_LAT_LONG))
|
||||
gpsQuality = '0'; // 0 means no fix
|
||||
else if (LOC_POSITION_MODE_STANDALONE == loc_eng_data_p->adapter->getPositionMode().mode)
|
||||
gpsQuality = '1'; // 1 means GPS fix
|
||||
|
@ -868,7 +868,7 @@ void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p,
|
|||
pMarker += length;
|
||||
lengthRemaining -= length;
|
||||
|
||||
if ((location.gpsLocation.flags & GPS_LOCATION_HAS_ALTITUDE) &&
|
||||
if ((location.gpsLocation.flags & LOC_GPS_LOCATION_HAS_ALTITUDE) &&
|
||||
(locationExtended.flags & GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL))
|
||||
{
|
||||
length = snprintf(pMarker, lengthRemaining, "%.1lf,M,,",
|
||||
|
@ -936,7 +936,7 @@ SIDE EFFECTS
|
|||
|
||||
===========================================================================*/
|
||||
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
||||
const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended)
|
||||
const LocGnssSvStatus &svStatus, const GpsLocationExtended &locationExtended)
|
||||
{
|
||||
ENTRY_LOG();
|
||||
|
||||
|
@ -955,29 +955,29 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
loc_eng_data_p->glo_used_mask = 0;
|
||||
loc_eng_data_p->gal_used_mask = 0;
|
||||
for(svNumber=1; svNumber <= svCount; svNumber++) {
|
||||
if (GNSS_CONSTELLATION_GPS == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
if (LOC_GNSS_CONSTELLATION_GPS == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
{
|
||||
// cache the used in fix mask, as it will be needed to send $GPGSA
|
||||
// during the position report
|
||||
if (GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & GNSS_SV_FLAGS_USED_IN_FIX))
|
||||
if (LOC_GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & LOC_GNSS_SV_FLAGS_USED_IN_FIX))
|
||||
{
|
||||
loc_eng_data_p->gps_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1));
|
||||
}
|
||||
}
|
||||
else if (GNSS_CONSTELLATION_GLONASS == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
else if (LOC_GNSS_CONSTELLATION_GLONASS == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
{
|
||||
// cache the used in fix mask, as it will be needed to send $GNGSA
|
||||
// during the position report
|
||||
if (GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & GNSS_SV_FLAGS_USED_IN_FIX))
|
||||
if (LOC_GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & LOC_GNSS_SV_FLAGS_USED_IN_FIX))
|
||||
{
|
||||
loc_eng_data_p->glo_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1));
|
||||
}
|
||||
}
|
||||
else if (GNSS_CONSTELLATION_GALILEO == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
else if (LOC_GNSS_CONSTELLATION_GALILEO == svStatus.gnss_sv_list[svNumber - 1].constellation)
|
||||
{
|
||||
// cache the used in fix mask, as it will be needed to send $GAGSA
|
||||
// during the position report
|
||||
if (GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & GNSS_SV_FLAGS_USED_IN_FIX))
|
||||
if (LOC_GNSS_SV_FLAGS_USED_IN_FIX == (svStatus.gnss_sv_list[svNumber - 1].flags & LOC_GNSS_SV_FLAGS_USED_IN_FIX))
|
||||
{
|
||||
loc_eng_data_p->gal_used_mask |= (1 << (svStatus.gnss_sv_list[svNumber - 1].svid - 1));
|
||||
}
|
||||
|
@ -990,21 +990,21 @@ void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p,
|
|||
// ------------------
|
||||
|
||||
loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence),
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GPS, false));
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GPS, false));
|
||||
|
||||
// ------------------
|
||||
// ------$GLGSV------
|
||||
// ------------------
|
||||
|
||||
loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence),
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GLONASS, false));
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GLONASS, false));
|
||||
|
||||
// ------------------
|
||||
// ------$GAGSV------
|
||||
// ------------------
|
||||
|
||||
loc_eng_nmea_generate_GSV(loc_eng_data_p, svStatus, sentence, sizeof(sentence),
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, GNSS_CONSTELLATION_GALILEO, false));
|
||||
loc_nmea_sv_meta_init(loc_eng_data_p, sv_meta, LOC_GNSS_CONSTELLATION_GALILEO, false));
|
||||
|
||||
|
||||
// For RPC, the DOP are sent during sv report, so cache them
|
||||
|
|
|
@ -30,14 +30,13 @@
|
|||
#ifndef LOC_ENG_NMEA_H
|
||||
#define LOC_ENG_NMEA_H
|
||||
|
||||
#include <hardware/gps.h>
|
||||
#include <gps_extended.h>
|
||||
|
||||
#define NMEA_SENTENCE_MAX_LENGTH 200
|
||||
|
||||
void loc_eng_nmea_send(char *pNmea, int length, loc_eng_data_s_type *loc_eng_data_p);
|
||||
int loc_eng_nmea_put_checksum(char *pNmea, int maxSize);
|
||||
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const GnssSvStatus &svStatus, const GpsLocationExtended &locationExtended);
|
||||
void loc_eng_nmea_generate_sv(loc_eng_data_s_type *loc_eng_data_p, const LocGnssSvStatus &svStatus, const GpsLocationExtended &locationExtended);
|
||||
void loc_eng_nmea_generate_pos(loc_eng_data_s_type *loc_eng_data_p, const UlpLocation &location, const GpsLocationExtended &locationExtended, unsigned char generate_nmea);
|
||||
|
||||
#endif // LOC_ENG_NMEA_H
|
||||
|
|
|
@ -30,13 +30,11 @@
|
|||
#ifndef LOC_ENG_XTRA_H
|
||||
#define LOC_ENG_XTRA_H
|
||||
|
||||
#include <hardware/gps.h>
|
||||
|
||||
// Module data
|
||||
typedef struct
|
||||
{
|
||||
// loc_eng_ioctl_cb_data_s_type ioctl_cb_data;
|
||||
gps_xtra_download_request download_request_cb;
|
||||
loc_gps_xtra_download_request download_request_cb;
|
||||
report_xtra_server report_xtra_server_cb;
|
||||
|
||||
// XTRA data buffer
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <hardware/gps.h>
|
||||
#include <cutils/properties.h>
|
||||
#include "loc_target.h"
|
||||
#include "loc_log.h"
|
||||
|
|
Loading…
Reference in a new issue