diff options
author | Saurabh Srivastava <ssrivast@codeaurora.org> | 2018-05-20 19:29:46 +0530 |
---|---|---|
committer | Saurabh Srivastava <ssrivast@codeaurora.org> | 2018-06-03 12:15:34 +0530 |
commit | eaf7e54b54a31c571560bf5fe869bb235a2aacaf (patch) | |
tree | 2f4bf20ac4196ba2439b38f80c7de31b1ce5467f /location/LocationDataTypes.h | |
parent | a93b10c6770079c9f23ca3484b56fa0136b25464 (diff) | |
download | gps-eaf7e54b54a31c571560bf5fe869bb235a2aacaf.tar.gz |
FR 45651 - GNSS SV/Constellation Control
Adding support for configuring GNSS SVs
and constellations to be used.
Change-Id: I47d5cd9d08ac9aaf633be2fe3b1bd152a2f4293b
CRs-Fixed: 2184871
Diffstat (limited to 'location/LocationDataTypes.h')
-rw-r--r-- | location/LocationDataTypes.h | 74 |
1 files changed, 71 insertions, 3 deletions
diff --git a/location/LocationDataTypes.h b/location/LocationDataTypes.h index 00cca18..5d1c809 100644 --- a/location/LocationDataTypes.h +++ b/location/LocationDataTypes.h @@ -270,6 +270,7 @@ typedef enum { GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT = (1<<7), GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT = (1<<8), GNSS_CONFIG_FLAGS_SUPL_MODE_BIT = (1<<9), + GNSS_CONFIG_FLAGS_BLACKLISTED_SV_IDS_BIT = (1<<10), } GnssConfigFlagsBits; typedef enum { @@ -740,12 +741,22 @@ typedef struct { GnssSvOptionsMask gnssSvOptionsMask; // Bitwise OR of GnssSvOptionsBits } GnssSv; -typedef struct { +struct GnssConfigSetAssistanceServer { size_t size; // set to sizeof(GnssConfigSetAssistanceServer) GnssAssistanceType type; // SUPL or C2K const char* hostName; // null terminated string uint32_t port; // port of server -} GnssConfigSetAssistanceServer; + + inline bool equals(const GnssConfigSetAssistanceServer& config) { + if (config.type == type && config.port == port && + ((NULL == config.hostName && NULL == hostName) || + (NULL != config.hostName && NULL != hostName && + 0 == strcmp(config.hostName, hostName)))) { + return true; + } + return false; + } +}; typedef struct { size_t size; // set to sizeof(GnssMeasurementsData) @@ -805,7 +816,40 @@ typedef struct { GnssMeasurementsClock clock; // clock } GnssMeasurementsNotification; +typedef uint32_t GnssSvId; + +struct GnssSvIdSource{ + size_t size; // set to sizeof(GnssSvIdSource) + GnssSvType constellation; // constellation for the sv to blacklist + GnssSvId svId; // sv id to blacklist +}; +inline bool operator ==(GnssSvIdSource const& left, GnssSvIdSource const& right) { + return left.size == right.size && + left.constellation == right.constellation && left.svId == right.svId; +} + +#define GNSS_SV_CONFIG_ALL_BITS_ENABLED_MASK ((uint64_t)0xFFFFFFFFFFFFFFFF) typedef struct { + size_t size; // set to sizeof(GnssSvIdConfig) + + // GLONASS - SV 65 maps to bit 0 +#define GNSS_SV_CONFIG_GLO_INITIAL_SV_ID 65 + uint64_t gloBlacklistSvMask; + + // BEIDOU - SV 201 maps to bit 0 +#define GNSS_SV_CONFIG_BDS_INITIAL_SV_ID 201 + uint64_t bdsBlacklistSvMask; + + // QZSS - SV 193 maps to bit 0 +#define GNSS_SV_CONFIG_QZSS_INITIAL_SV_ID 193 + uint64_t qzssBlacklistSvMask; + + // GAL - SV 301 maps to bit 0 +#define GNSS_SV_CONFIG_GAL_INITIAL_SV_ID 301 + uint64_t galBlacklistSvMask; +} GnssSvIdConfig; + +struct GnssConfig{ size_t size; // set to sizeof(GnssConfig) GnssConfigFlagsMask flags; // bitwise OR of GnssConfigFlagsBits to mark which params are valid GnssConfigGpsLock gpsLock; @@ -818,7 +862,26 @@ typedef struct { GnssConfigEmergencyPdnForEmergencySupl emergencyPdnForEmergencySupl; GnssConfigSuplEmergencyServices suplEmergencyServices; GnssConfigSuplModeMask suplModeMask; //bitwise OR of GnssConfigSuplModeBits -} GnssConfig; + std::vector<GnssSvIdSource> blacklistedSvIds; + + inline bool equals(const GnssConfig& config) { + if (flags == config.flags && + gpsLock == config.gpsLock && + suplVersion == config.suplVersion && + assistanceServer.equals(config.assistanceServer) && + lppProfile == config.lppProfile && + lppeControlPlaneMask == config.lppeControlPlaneMask && + lppeUserPlaneMask == config.lppeUserPlaneMask && + aGlonassPositionProtocolMask == config.aGlonassPositionProtocolMask && + emergencyPdnForEmergencySupl == config.emergencyPdnForEmergencySupl && + suplEmergencyServices == config.suplEmergencyServices && + suplModeMask == config.suplModeMask && + blacklistedSvIds == config.blacklistedSvIds) { + return true; + } + return false; + } +}; typedef struct { size_t size; // set to sizeof @@ -947,6 +1010,11 @@ typedef std::function<void( GnssMeasurementsNotification gnssMeasurementsNotification )> gnssMeasurementsCallback; +/* Provides the current GNSS configuration to the client */ +typedef std::function<void( + GnssConfig& config +)> gnssConfigCallback; + typedef struct { size_t size; // set to sizeof(LocationCallbacks) capabilitiesCallback capabilitiesCb; // mandatory |