Merge "Use QMI_LOC_SET_NMEA_TYPES to set the NMEA sentences required." into location.lnx.1.0-dev.1.0

This commit is contained in:
Linux Build Service Account 2016-04-29 14:38:14 -07:00 committed by Gerrit - the friendly Code Review server
commit 83144d0f32
5 changed files with 77 additions and 6 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@ -445,6 +445,10 @@ enum loc_api_adapter_err LocApiBase::
setSUPLVersion(uint32_t version)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
setNMEATypes (uint32_t typesMask)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
enum loc_api_adapter_err LocApiBase::
setLPPConfig(uint32_t profile)
DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@ -171,6 +171,8 @@ public:
informNiResponse(GpsUserResponseType userResponse, const void* passThroughData);
virtual enum loc_api_adapter_err
setSUPLVersion(uint32_t version);
virtual enum loc_api_adapter_err
setNMEATypes (uint32_t typesMask);
virtual enum loc_api_adapter_err
setLPPConfig(uint32_t profile);
virtual enum loc_api_adapter_err

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-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
@ -346,6 +346,34 @@ typedef uint32_t LocPosTechMask;
#define LOC_POS_TECH_MASK_AFLT ((LocPosTechMask)0x00000040)
#define LOC_POS_TECH_MASK_HYBRID ((LocPosTechMask)0x00000080)
// Nmea sentence types mask
typedef uint32_t NmeaSentenceTypesMask;
#define LOC_NMEA_MASK_GGA_V02 ((NmeaSentenceTypesMask)0x00000001) /**< Enable GGA type */
#define LOC_NMEA_MASK_RMC_V02 ((NmeaSentenceTypesMask)0x00000002) /**< Enable RMC type */
#define LOC_NMEA_MASK_GSV_V02 ((NmeaSentenceTypesMask)0x00000004) /**< Enable GSV type */
#define LOC_NMEA_MASK_GSA_V02 ((NmeaSentenceTypesMask)0x00000008) /**< Enable GSA type */
#define LOC_NMEA_MASK_VTG_V02 ((NmeaSentenceTypesMask)0x00000010) /**< Enable VTG type */
#define LOC_NMEA_MASK_PQXFI_V02 ((NmeaSentenceTypesMask)0x00000020) /**< Enable PQXFI type */
#define LOC_NMEA_MASK_PSTIS_V02 ((NmeaSentenceTypesMask)0x00000040) /**< Enable PSTIS type */
#define LOC_NMEA_MASK_GLGSV_V02 ((NmeaSentenceTypesMask)0x00000080) /**< Enable GLGSV type */
#define LOC_NMEA_MASK_GNGSA_V02 ((NmeaSentenceTypesMask)0x00000100) /**< Enable GNGSA type */
#define LOC_NMEA_MASK_GNGNS_V02 ((NmeaSentenceTypesMask)0x00000200) /**< Enable GNGNS type */
#define LOC_NMEA_MASK_GARMC_V02 ((NmeaSentenceTypesMask)0x00000400) /**< Enable GARMC type */
#define LOC_NMEA_MASK_GAGSV_V02 ((NmeaSentenceTypesMask)0x00000800) /**< Enable GAGSV type */
#define LOC_NMEA_MASK_GAGSA_V02 ((NmeaSentenceTypesMask)0x00001000) /**< Enable GAGSA type */
#define LOC_NMEA_MASK_GAVTG_V02 ((NmeaSentenceTypesMask)0x00002000) /**< Enable GAVTG type */
#define LOC_NMEA_MASK_GAGGA_V02 ((NmeaSentenceTypesMask)0x00004000) /**< Enable GAGGA type */
#define LOC_NMEA_MASK_PQGSA_V02 ((NmeaSentenceTypesMask)0x00008000) /**< Enable PQGSA type */
#define LOC_NMEA_MASK_PQGSV_V02 ((NmeaSentenceTypesMask)0x00010000) /**< Enable PQGSV type */
#define LOC_NMEA_ALL_SUPPORTED_MASK (LOC_NMEA_MASK_GGA_V02 | LOC_NMEA_MASK_RMC_V02 | \
LOC_NMEA_MASK_GSV_V02 | LOC_NMEA_MASK_GSA_V02 | LOC_NMEA_MASK_VTG_V02 | \
LOC_NMEA_MASK_PQXFI_V02 | LOC_NMEA_MASK_PSTIS_V02 | LOC_NMEA_MASK_GLGSV_V02 | \
LOC_NMEA_MASK_GNGSA_V02 | LOC_NMEA_MASK_GNGNS_V02 | LOC_NMEA_MASK_GARMC_V02 | \
LOC_NMEA_MASK_GAGSV_V02 | LOC_NMEA_MASK_GAGSA_V02 | LOC_NMEA_MASK_GAVTG_V02 | \
LOC_NMEA_MASK_GAGGA_V02 | LOC_NMEA_MASK_PQGSA_V02 | LOC_NMEA_MASK_PQGSV_V02 )
typedef enum {
LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0,
LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM,

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
@ -185,6 +185,11 @@ public:
{
return mLocApi->setSUPLVersion(version);
}
inline enum loc_api_adapter_err
setNMEATypes (uint32_t typesMask)
{
return mLocApi->setNMEATypes(typesMask);
}
inline enum loc_api_adapter_err
setLPPConfig(uint32_t profile)
{

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2009-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2009-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
@ -497,6 +497,31 @@ struct LocEngSuplMode : public LocMsg {
}
};
// case LOC_ENG_MSG_SET_NMEA_TYPE:
struct LocEngSetNmeaTypes : public LocMsg {
LocEngAdapter* mAdapter;
uint32_t nmeaTypesMask;
inline LocEngSetNmeaTypes(LocEngAdapter* adapter,
uint32_t typesMask) :
LocMsg(), mAdapter(adapter), nmeaTypesMask(typesMask)
{
locallog();
}
inline virtual void proc() const {
// set the nmea types
mAdapter->setNMEATypes(nmeaTypesMask);
}
inline void locallog() const
{
LOC_LOGV("LocEngSetNmeaTypes %u\n",nmeaTypesMask);
}
inline virtual void log() const
{
locallog();
}
};
// case LOC_ENG_MSG_LPP_CONFIG:
struct LocEngLppConfig : public LocMsg {
LocEngAdapter* mAdapter;
@ -1749,7 +1774,7 @@ int loc_eng_init(loc_eng_data_s_type &loc_eng_data, LocCallbacks* callbacks,
event = event ^ LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT; // unregister for modem NMEA report
loc_eng_data.generateNmea = true;
}
else
else if (gps_conf.NMEA_PROVIDER == NMEA_PROVIDER_MP)
{
loc_eng_data.generateNmea = false;
}
@ -1779,6 +1804,13 @@ static int loc_eng_reinit(loc_eng_data_s_type &loc_eng_data)
sap_conf.SENSOR_PROVIDER));
adapter->sendMsg(new LocEngAGlonassProtocol(adapter, gps_conf.A_GLONASS_POS_PROTOCOL_SELECT));
if (!loc_eng_data.generateNmea)
{
NmeaSentenceTypesMask typesMask = LOC_NMEA_ALL_SUPPORTED_MASK;
LOC_LOGD("loc_eng_init setting nmea types, mask = %u\n",typesMask);
adapter->sendMsg(new LocEngSetNmeaTypes(adapter,typesMask));
}
/* Make sure at least one of the sensor property is specified by the user in the gps.conf file. */
if( sap_conf.GYRO_BIAS_RANDOM_WALK_VALID ||
sap_conf.ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID ||