• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
2  *
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are
5  * met:
6  *     * Redistributions of source code must retain the above copyright
7  *       notice, this list of conditions and the following disclaimer.
8  *     * Redistributions in binary form must reproduce the above
9  *       copyright notice, this list of conditions and the following
10  *       disclaimer in the documentation and/or other materials provided
11  *       with the distribution.
12  *     * Neither the name of The Linux Foundation nor the names of its
13  *       contributors may be used to endorse or promote products derived
14  *       from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef GPS_EXTENDED_C_H
30 #define GPS_EXTENDED_C_H
31 
32 #include <ctype.h>
33 #include <stdbool.h>
34 #include <stdlib.h>
35 #include <string.h>
36 #include <loc_gps.h>
37 #include <LocationAPI.h>
38 #include <time.h>
39 
40 /**
41  * @file
42  * @brief C++ declarations for GPS types
43  */
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif /* __cplusplus */
48 
49 /** Location has valid source information. */
50 #define LOCATION_HAS_SOURCE_INFO   0x0020
51 /** LocGpsLocation has valid "is indoor?" flag */
52 #define LOC_GPS_LOCATION_HAS_IS_INDOOR   0x0040
53 /** LocGpsLocation has valid floor number */
54 #define LOC_GPS_LOCATION_HAS_FLOOR_NUMBER   0x0080
55 /** LocGpsLocation has valid map URL*/
56 #define LOC_GPS_LOCATION_HAS_MAP_URL   0x0100
57 /** LocGpsLocation has valid map index */
58 #define LOC_GPS_LOCATION_HAS_MAP_INDEX   0x0200
59 
60 /** Sizes for indoor fields */
61 #define GPS_LOCATION_MAP_URL_SIZE 400
62 #define GPS_LOCATION_MAP_INDEX_SIZE 16
63 
64 /** Position source is ULP */
65 #define ULP_LOCATION_IS_FROM_HYBRID   0x0001
66 /** Position source is GNSS only */
67 #define ULP_LOCATION_IS_FROM_GNSS     0x0002
68 /** Position source is ZPP only */
69 #define ULP_LOCATION_IS_FROM_ZPP      0x0004
70 /** Position is from a Geofence Breach Event */
71 #define ULP_LOCATION_IS_FROM_GEOFENCE 0X0008
72 /** Position is from Hardware FLP */
73 #define ULP_LOCATION_IS_FROM_HW_FLP   0x0010
74 /** Position is from NLP */
75 #define ULP_LOCATION_IS_FROM_NLP      0x0020
76 /** Position is from PIP */
77 #define ULP_LOCATION_IS_FROM_PIP      0x0040
78 /** Position is from external DR solution*/
79 #define ULP_LOCATION_IS_FROM_EXT_DR   0X0080
80 /** Raw GNSS position fixes */
81 #define ULP_LOCATION_IS_FROM_GNSS_RAW   0X0100
82 
83 typedef uint32_t LocSvInfoSource;
84 /** SVinfo source is GNSS/DR */
85 #define ULP_SVINFO_IS_FROM_GNSS       ((LocSvInfoSource)0x0001)
86 /** Raw SVinfo from GNSS */
87 #define ULP_SVINFO_IS_FROM_DR         ((LocSvInfoSource)0x0002)
88 
89 #define ULP_MIN_INTERVAL_INVALID 0xffffffff
90 #define ULP_MAX_NMEA_STRING_SIZE 201
91 
92 /*Emergency SUPL*/
93 #define LOC_GPS_NI_TYPE_EMERGENCY_SUPL    4
94 
95 #define LOC_AGPS_CERTIFICATE_MAX_LENGTH 2000
96 #define LOC_AGPS_CERTIFICATE_MAX_SLOTS 10
97 
98 /* TBM Threshold for tracking in background power mode : in millis */
99 #define TRACKING_TBM_THRESHOLD_MILLIS 480000
100 
101 typedef uint32_t LocPosTechMask;
102 #define LOC_POS_TECH_MASK_DEFAULT ((LocPosTechMask)0x00000000)
103 #define LOC_POS_TECH_MASK_SATELLITE ((LocPosTechMask)0x00000001)
104 #define LOC_POS_TECH_MASK_CELLID ((LocPosTechMask)0x00000002)
105 #define LOC_POS_TECH_MASK_WIFI ((LocPosTechMask)0x00000004)
106 #define LOC_POS_TECH_MASK_SENSORS ((LocPosTechMask)0x00000008)
107 #define LOC_POS_TECH_MASK_REFERENCE_LOCATION ((LocPosTechMask)0x00000010)
108 #define LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION ((LocPosTechMask)0x00000020)
109 #define LOC_POS_TECH_MASK_AFLT ((LocPosTechMask)0x00000040)
110 #define LOC_POS_TECH_MASK_HYBRID ((LocPosTechMask)0x00000080)
111 
112 enum loc_registration_mask_status {
113     LOC_REGISTRATION_MASK_ENABLED,
114     LOC_REGISTRATION_MASK_DISABLED,
115     LOC_REGISTRATION_MASK_SET
116 };
117 
118 typedef enum {
119     LOC_SUPPORTED_FEATURE_ODCPI_2_V02 = 0, /**<  Support ODCPI version 2 feature  */
120     LOC_SUPPORTED_FEATURE_WIFI_AP_DATA_INJECT_2_V02 = 1, /**<  Support Wifi AP data inject version 2 feature  */
121     LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02 = 2, /**< Support debug NMEA feature */
122     LOC_SUPPORTED_FEATURE_GNSS_ONLY_POSITION_REPORT_V02 = 3, /**< Support the GNSS only position report feature */
123     LOC_SUPPORTED_FEATURE_FDCL_V02 = 4, /**< Support the FDCL feature */
124     LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02 = 5, /**<  Support the GNSS constellation enablement feature  */
125     LOC_SUPPORTED_FEATURE_AGPM_V02 = 6, /**<  Support the advanced GNSS power management feature  */
126     LOC_SUPPORTED_FEATURE_PASSIVE_LISTENER_V02 = 7, /**<  Support the passive listener feature  */
127 } loc_supported_feature_enum;
128 
129 typedef struct {
130     /** set to sizeof(UlpLocation) */
131     size_t          size;
132     LocGpsLocation     gpsLocation;
133     /* Provider indicator for HYBRID or GPS */
134     uint16_t        position_source;
135     LocPosTechMask  tech_mask;
136 } UlpLocation;
137 
138 typedef struct {
139     /** set to sizeof(UlpNmea) */
140     size_t          size;
141     char            nmea_str[ULP_MAX_NMEA_STRING_SIZE];
142     unsigned int    len;
143 } UlpNmea;
144 
145 
146 /** AGPS type */
147 typedef int8_t AGpsExtType;
148 #define LOC_AGPS_TYPE_INVALID       -1
149 #define LOC_AGPS_TYPE_ANY           0
150 #define LOC_AGPS_TYPE_SUPL          1
151 #define LOC_AGPS_TYPE_C2K           2
152 #define LOC_AGPS_TYPE_WWAN_ANY      3
153 #define LOC_AGPS_TYPE_WIFI          4
154 #define LOC_AGPS_TYPE_SUPL_ES       5
155 
156 /** SSID length */
157 #define SSID_BUF_SIZE (32+1)
158 
159 typedef int16_t AGpsBearerType;
160 #define AGPS_APN_BEARER_INVALID     0
161 #define AGPS_APN_BEARER_IPV4        1
162 #define AGPS_APN_BEARER_IPV6        2
163 #define AGPS_APN_BEARER_IPV4V6      3
164 
165 typedef uint64_t LocApnTypeMask;
166 #define LOC_APN_TYPE_MASK_DEFAULT   ((LocApnTypeMask)0x0000000000000001ull) /**<  Denotes APN type for Default/Internet traffic  */
167 #define LOC_APN_TYPE_MASK_IMS       ((LocApnTypeMask)0x0000000000000002ull) /**<  Denotes  APN type for IP Multimedia Subsystem  */
168 #define LOC_APN_TYPE_MASK_MMS       ((LocApnTypeMask)0x0000000000000004ull) /**<  Denotes APN type for Multimedia Messaging Service  */
169 #define LOC_APN_TYPE_MASK_DUN       ((LocApnTypeMask)0x0000000000000008ull) /**<  Denotes APN type for Dial Up Network  */
170 #define LOC_APN_TYPE_MASK_SUPL      ((LocApnTypeMask)0x0000000000000010ull) /**<  Denotes APN type for Secure User Plane Location  */
171 #define LOC_APN_TYPE_MASK_HIPRI     ((LocApnTypeMask)0x0000000000000020ull) /**<  Denotes APN type for High Priority Mobile Data  */
172 #define LOC_APN_TYPE_MASK_FOTA      ((LocApnTypeMask)0x0000000000000040ull) /**<  Denotes APN type for over the air administration  */
173 #define LOC_APN_TYPE_MASK_CBS       ((LocApnTypeMask)0x0000000000000080ull) /**<  Denotes APN type for Carrier Branded Services  */
174 #define LOC_APN_TYPE_MASK_IA        ((LocApnTypeMask)0x0000000000000100ull) /**<  Denotes APN type for Initial Attach  */
175 #define LOC_APN_TYPE_MASK_EMERGENCY ((LocApnTypeMask)0x0000000000000200ull) /**<  Denotes APN type for emergency  */
176 
177 typedef enum {
178     AGPS_CB_PRIORITY_LOW  = 1,
179     AGPS_CB_PRIORITY_MED  = 2,
180     AGPS_CB_PRIORITY_HIGH = 3
181 } AgpsCbPriority;
182 
183 typedef struct {
184     void* statusV4Cb;
185     AgpsCbPriority cbPriority;
186 } AgpsCbInfo;
187 
188 /** GPS extended callback structure. */
189 typedef struct {
190     /** set to sizeof(LocGpsCallbacks) */
191     size_t      size;
192     loc_gps_set_capabilities set_capabilities_cb;
193     loc_gps_acquire_wakelock acquire_wakelock_cb;
194     loc_gps_release_wakelock release_wakelock_cb;
195     loc_gps_create_thread create_thread_cb;
196     loc_gps_request_utc_time request_utc_time_cb;
197 } GpsExtCallbacks;
198 
199 /** Callback to report the xtra server url to the client.
200  *  The client should use this url when downloading xtra unless overwritten
201  *  in the gps.conf file
202  */
203 typedef void (* report_xtra_server)(const char*, const char*, const char*);
204 
205 /** Callback structure for the XTRA interface. */
206 typedef struct {
207     loc_gps_xtra_download_request download_request_cb;
208     loc_gps_create_thread create_thread_cb;
209     report_xtra_server report_xtra_server_cb;
210 } GpsXtraExtCallbacks;
211 
212 /** Represents the status of AGPS. */
213 typedef struct {
214     /** set to sizeof(AGpsExtStatus) */
215     size_t          size;
216 
217     AGpsExtType type;
218     LocAGpsStatusValue status;
219     uint32_t        ipv4_addr;
220     struct sockaddr_storage addr;
221     char            ssid[SSID_BUF_SIZE];
222     char            password[SSID_BUF_SIZE];
223 } AGpsExtStatus;
224 
225 /** Callback with AGPS status information.
226  *  Can only be called from a thread created by create_thread_cb.
227  */
228 typedef void (* agps_status_extended)(AGpsExtStatus* status);
229 
230 /** Callback structure for the AGPS interface. */
231 typedef struct {
232     agps_status_extended status_cb;
233     loc_gps_create_thread create_thread_cb;
234 } AGpsExtCallbacks;
235 
236 
237 typedef void (*loc_ni_notify_callback)(LocGpsNiNotification *notification, bool esEnalbed);
238 /** GPS NI callback structure. */
239 typedef struct
240 {
241     /**
242      * Sends the notification request from HAL to GPSLocationProvider.
243      */
244     loc_ni_notify_callback notify_cb;
245 } GpsNiExtCallbacks;
246 
247 typedef enum loc_server_type {
248     LOC_AGPS_CDMA_PDE_SERVER,
249     LOC_AGPS_CUSTOM_PDE_SERVER,
250     LOC_AGPS_MPC_SERVER,
251     LOC_AGPS_SUPL_SERVER
252 } LocServerType;
253 
254 typedef enum loc_position_mode_type {
255     LOC_POSITION_MODE_INVALID = -1,
256     LOC_POSITION_MODE_STANDALONE = 0,
257     LOC_POSITION_MODE_MS_BASED,
258     LOC_POSITION_MODE_MS_ASSISTED,
259     LOC_POSITION_MODE_RESERVED_1,
260     LOC_POSITION_MODE_RESERVED_2,
261     LOC_POSITION_MODE_RESERVED_3,
262     LOC_POSITION_MODE_RESERVED_4,
263     LOC_POSITION_MODE_RESERVED_5
264 
265 } LocPositionMode;
266 
267 /**
268  * @brief Minimum allowed value for fix interval.
269  *
270  * This value is a sanity limit in GPS framework. The hardware has own internal
271  * limits that may not match this value
272  *
273  * @sa GPS_DEFAULT_FIX_INTERVAL_MS
274  */
275 
276 #define GPS_MIN_POSSIBLE_FIX_INTERVAL_MS 100
277 /**
278  * @brief Default value for fix interval.
279  *
280  * This value is used by default whenever appropriate.
281  *
282  * @sa GPS_MIN_POSSIBLE_FIX_INTERVAL_MS
283  */
284 #define GPS_DEFAULT_FIX_INTERVAL_MS      1000
285 
286 /** Flags to indicate which values are valid in a GpsLocationExtended. */
287 typedef uint32_t GpsLocationExtendedFlags;
288 /** GpsLocationExtended has valid pdop, hdop, vdop. */
289 #define GPS_LOCATION_EXTENDED_HAS_DOP 0x0001
290 /** GpsLocationExtended has valid altitude mean sea level. */
291 #define GPS_LOCATION_EXTENDED_HAS_ALTITUDE_MEAN_SEA_LEVEL 0x0002
292 /** UlpLocation has valid magnetic deviation. */
293 #define GPS_LOCATION_EXTENDED_HAS_MAG_DEV 0x0004
294 /** UlpLocation has valid mode indicator. */
295 #define GPS_LOCATION_EXTENDED_HAS_MODE_IND 0x0008
296 /** GpsLocationExtended has valid vertical uncertainty */
297 #define GPS_LOCATION_EXTENDED_HAS_VERT_UNC 0x0010
298 /** GpsLocationExtended has valid speed uncertainty */
299 #define GPS_LOCATION_EXTENDED_HAS_SPEED_UNC 0x0020
300 /** GpsLocationExtended has valid heading uncertainty */
301 #define GPS_LOCATION_EXTENDED_HAS_BEARING_UNC 0x0040
302 /** GpsLocationExtended has valid horizontal reliability */
303 #define GPS_LOCATION_EXTENDED_HAS_HOR_RELIABILITY 0x0080
304 /** GpsLocationExtended has valid vertical reliability */
305 #define GPS_LOCATION_EXTENDED_HAS_VERT_RELIABILITY 0x0100
306 /** GpsLocationExtended has valid Horizontal Elliptical Uncertainty (Semi-Major Axis) */
307 #define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_MAJOR 0x0200
308 /** GpsLocationExtended has valid Horizontal Elliptical Uncertainty (Semi-Minor Axis) */
309 #define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_MINOR 0x0400
310 /** GpsLocationExtended has valid Elliptical Horizontal Uncertainty Azimuth */
311 #define GPS_LOCATION_EXTENDED_HAS_HOR_ELIP_UNC_AZIMUTH 0x0800
312 /** GpsLocationExtended has valid gnss sv used in position data */
313 #define GPS_LOCATION_EXTENDED_HAS_GNSS_SV_USED_DATA 0x1000
314 /** GpsLocationExtended has valid navSolutionMask */
315 #define GPS_LOCATION_EXTENDED_HAS_NAV_SOLUTION_MASK 0x2000
316 /** GpsLocationExtended has valid LocPosTechMask */
317 #define GPS_LOCATION_EXTENDED_HAS_POS_TECH_MASK   0x4000
318 /** GpsLocationExtended has valid LocSvInfoSource */
319 #define GPS_LOCATION_EXTENDED_HAS_SV_SOURCE_INFO   0x8000
320 /** GpsLocationExtended has valid position dynamics data */
321 #define GPS_LOCATION_EXTENDED_HAS_POS_DYNAMICS_DATA   0x10000
322 /** GpsLocationExtended has GPS Time */
323 #define GPS_LOCATION_EXTENDED_HAS_GPS_TIME   0x20000
324 /** GpsLocationExtended has Extended Dilution of Precision */
325 #define GPS_LOCATION_EXTENDED_HAS_EXT_DOP   0x40000
326 
327 typedef uint32_t LocNavSolutionMask;
328 /* Bitmask to specify whether SBAS ionospheric correction is used  */
329 #define LOC_NAV_MASK_SBAS_CORRECTION_IONO ((LocNavSolutionMask)0x0001)
330 /* Bitmask to specify whether SBAS fast correction is used  */
331 #define LOC_NAV_MASK_SBAS_CORRECTION_FAST ((LocNavSolutionMask)0x0002)
332 /**<  Bitmask to specify whether SBAS long-tem correction is used  */
333 #define LOC_NAV_MASK_SBAS_CORRECTION_LONG ((LocNavSolutionMask)0x0004)
334 /**<  Bitmask to specify whether SBAS integrity information is used  */
335 #define LOC_NAV_MASK_SBAS_INTEGRITY ((LocNavSolutionMask)0x0008)
336 
337 typedef uint32_t LocPosDataMask;
338 /* Bitmask to specify whether Navigation data has Forward Acceleration  */
339 #define LOC_NAV_DATA_HAS_LONG_ACCEL ((LocPosDataMask)0x0001)
340 /* Bitmask to specify whether Navigation data has Sideward Acceleration */
341 #define LOC_NAV_DATA_HAS_LAT_ACCEL ((LocPosDataMask)0x0002)
342 /* Bitmask to specify whether Navigation data has Vertical Acceleration */
343 #define LOC_NAV_DATA_HAS_VERT_ACCEL ((LocPosDataMask)0x0004)
344 /* Bitmask to specify whether Navigation data has Heading Rate */
345 #define LOC_NAV_DATA_HAS_YAW_RATE ((LocPosDataMask)0x0008)
346 /* Bitmask to specify whether Navigation data has Body pitch */
347 #define LOC_NAV_DATA_HAS_PITCH ((LocPosDataMask)0x0010)
348 
349 /** GPS PRN Range */
350 #define GPS_SV_PRN_MIN      1
351 #define GPS_SV_PRN_MAX      32
352 #define GLO_SV_PRN_MIN      65
353 #define GLO_SV_PRN_MAX      96
354 #define QZSS_SV_PRN_MIN     193
355 #define QZSS_SV_PRN_MAX     197
356 #define BDS_SV_PRN_MIN      201
357 #define BDS_SV_PRN_MAX      235
358 #define GAL_SV_PRN_MIN      301
359 #define GAL_SV_PRN_MAX      336
360 
361 typedef uint32_t LocPosTechMask;
362 #define LOC_POS_TECH_MASK_DEFAULT ((LocPosTechMask)0x00000000)
363 #define LOC_POS_TECH_MASK_SATELLITE ((LocPosTechMask)0x00000001)
364 #define LOC_POS_TECH_MASK_CELLID ((LocPosTechMask)0x00000002)
365 #define LOC_POS_TECH_MASK_WIFI ((LocPosTechMask)0x00000004)
366 #define LOC_POS_TECH_MASK_SENSORS ((LocPosTechMask)0x00000008)
367 #define LOC_POS_TECH_MASK_REFERENCE_LOCATION ((LocPosTechMask)0x00000010)
368 #define LOC_POS_TECH_MASK_INJECTED_COARSE_POSITION ((LocPosTechMask)0x00000020)
369 #define LOC_POS_TECH_MASK_AFLT ((LocPosTechMask)0x00000040)
370 #define LOC_POS_TECH_MASK_HYBRID ((LocPosTechMask)0x00000080)
371 
372 typedef enum {
373     LOC_RELIABILITY_NOT_SET = 0,
374     LOC_RELIABILITY_VERY_LOW = 1,
375     LOC_RELIABILITY_LOW = 2,
376     LOC_RELIABILITY_MEDIUM = 3,
377     LOC_RELIABILITY_HIGH = 4
378 }LocReliability;
379 
380 typedef struct {
381     struct timespec apTimeStamp;
382     /*boottime received from pps-ktimer*/
383     float apTimeStampUncertaintyMs;
384     /* timestamp uncertainty in milli seconds */
385 }Gnss_ApTimeStampStructType;
386 
387 typedef struct {
388     uint64_t gps_sv_used_ids_mask;
389     uint64_t glo_sv_used_ids_mask;
390     uint64_t gal_sv_used_ids_mask;
391     uint64_t bds_sv_used_ids_mask;
392     uint64_t qzss_sv_used_ids_mask;
393 } GnssSvUsedInPosition;
394 
395 /* Body Frame parameters */
396 typedef struct {
397     /** Contains Body frame LocPosDataMask bits. */
398    uint32_t        bodyFrameDatamask;
399    /* Forward Acceleration in body frame (m/s2)*/
400    float           longAccel;
401    /* Sideward Acceleration in body frame (m/s2)*/
402    float           latAccel;
403    /* Vertical Acceleration in body frame (m/s2)*/
404    float           vertAccel;
405    /* Heading Rate (Radians/second) */
406    float           yawRate;
407    /* Body pitch (Radians) */
408    float           pitch;
409 }LocPositionDynamics;
410 
411 typedef struct {
412 
413   /**  Position dilution of precision.
414        Range: 1 (highest accuracy) to 50 (lowest accuracy) */
415   float PDOP;
416 
417   /**  Horizontal dilution of precision.
418        Range: 1 (highest accuracy) to 50 (lowest accuracy) */
419   float HDOP;
420 
421   /**  Vertical dilution of precision.
422        Range: 1 (highest accuracy) to 50 (lowest accuracy) */
423   float VDOP;
424 
425   /**  geometric  dilution of precision.
426        Range: 1 (highest accuracy) to 50 (lowest accuracy) */
427   float GDOP;
428 
429   /**  time dilution of precision.
430        Range: 1 (highest accuracy) to 50 (lowest accuracy) */
431   float TDOP;
432 }LocExtDOP;
433 
434 /* GPS Time structure */
435 typedef struct {
436 
437   /**<   Current GPS week as calculated from midnight, Jan. 6, 1980. \n
438        - Units: Weeks */
439   uint16_t gpsWeek;
440 
441   /**<   Amount of time into the current GPS week. \n
442        - Units: Milliseconds */
443   uint32_t gpsTimeOfWeekMs;
444 }GPSTimeStruct;
445 
446 /** Represents gps location extended. */
447 typedef struct {
448     /** set to sizeof(GpsLocationExtended) */
449     size_t          size;
450     /** Contains GpsLocationExtendedFlags bits. */
451     uint32_t        flags;
452     /** Contains the Altitude wrt mean sea level */
453     float           altitudeMeanSeaLevel;
454     /** Contains Position Dilusion of Precision. */
455     float           pdop;
456     /** Contains Horizontal Dilusion of Precision. */
457     float           hdop;
458     /** Contains Vertical Dilusion of Precision. */
459     float           vdop;
460     /** Contains Magnetic Deviation. */
461     float           magneticDeviation;
462     /** vertical uncertainty in meters */
463     float           vert_unc;
464     /** speed uncertainty in m/s */
465     float           speed_unc;
466     /** heading uncertainty in degrees (0 to 359.999) */
467     float           bearing_unc;
468     /** horizontal reliability. */
469     LocReliability  horizontal_reliability;
470     /** vertical reliability. */
471     LocReliability  vertical_reliability;
472     /*  Horizontal Elliptical Uncertainty (Semi-Major Axis) */
473     float           horUncEllipseSemiMajor;
474     /*  Horizontal Elliptical Uncertainty (Semi-Minor Axis) */
475     float           horUncEllipseSemiMinor;
476     /*    Elliptical Horizontal Uncertainty Azimuth */
477     float           horUncEllipseOrientAzimuth;
478 
479     Gnss_ApTimeStampStructType               timeStamp;
480     /** Gnss sv used in position data */
481     GnssSvUsedInPosition gnss_sv_used_ids;
482     /** Nav solution mask to indicate sbas corrections */
483     LocNavSolutionMask  navSolutionMask;
484     /** Position technology used in computing this fix */
485     LocPosTechMask tech_mask;
486     /** SV Info source used in computing this fix */
487     LocSvInfoSource sv_source;
488     /** Body Frame Dynamics: 4wayAcceleration and pitch set with validity */
489     LocPositionDynamics bodyFrameData;
490     /** GPS Time */
491     GPSTimeStruct gpsTime;
492     /** Dilution of precision associated with this position*/
493     LocExtDOP extDOP;
494 } GpsLocationExtended;
495 
496 enum loc_sess_status {
497     LOC_SESS_SUCCESS,
498     LOC_SESS_INTERMEDIATE,
499     LOC_SESS_FAILURE
500 };
501 
502 // Nmea sentence types mask
503 typedef uint32_t NmeaSentenceTypesMask;
504 #define LOC_NMEA_MASK_GGA_V02   ((NmeaSentenceTypesMask)0x00000001) /**<  Enable GGA type  */
505 #define LOC_NMEA_MASK_RMC_V02   ((NmeaSentenceTypesMask)0x00000002) /**<  Enable RMC type  */
506 #define LOC_NMEA_MASK_GSV_V02   ((NmeaSentenceTypesMask)0x00000004) /**<  Enable GSV type  */
507 #define LOC_NMEA_MASK_GSA_V02   ((NmeaSentenceTypesMask)0x00000008) /**<  Enable GSA type  */
508 #define LOC_NMEA_MASK_VTG_V02   ((NmeaSentenceTypesMask)0x00000010) /**<  Enable VTG type  */
509 #define LOC_NMEA_MASK_PQXFI_V02 ((NmeaSentenceTypesMask)0x00000020) /**<  Enable PQXFI type  */
510 #define LOC_NMEA_MASK_PSTIS_V02 ((NmeaSentenceTypesMask)0x00000040) /**<  Enable PSTIS type  */
511 #define LOC_NMEA_MASK_GLGSV_V02 ((NmeaSentenceTypesMask)0x00000080) /**<  Enable GLGSV type  */
512 #define LOC_NMEA_MASK_GNGSA_V02 ((NmeaSentenceTypesMask)0x00000100) /**<  Enable GNGSA type  */
513 #define LOC_NMEA_MASK_GNGNS_V02 ((NmeaSentenceTypesMask)0x00000200) /**<  Enable GNGNS type  */
514 #define LOC_NMEA_MASK_GARMC_V02 ((NmeaSentenceTypesMask)0x00000400) /**<  Enable GARMC type  */
515 #define LOC_NMEA_MASK_GAGSV_V02 ((NmeaSentenceTypesMask)0x00000800) /**<  Enable GAGSV type  */
516 #define LOC_NMEA_MASK_GAGSA_V02 ((NmeaSentenceTypesMask)0x00001000) /**<  Enable GAGSA type  */
517 #define LOC_NMEA_MASK_GAVTG_V02 ((NmeaSentenceTypesMask)0x00002000) /**<  Enable GAVTG type  */
518 #define LOC_NMEA_MASK_GAGGA_V02 ((NmeaSentenceTypesMask)0x00004000) /**<  Enable GAGGA type  */
519 #define LOC_NMEA_MASK_PQGSA_V02 ((NmeaSentenceTypesMask)0x00008000) /**<  Enable PQGSA type  */
520 #define LOC_NMEA_MASK_PQGSV_V02 ((NmeaSentenceTypesMask)0x00010000) /**<  Enable PQGSV type  */
521 #define LOC_NMEA_MASK_DEBUG_V02 ((NmeaSentenceTypesMask)0x00020000) /**<  Enable DEBUG type  */
522 
523 // all bitmasks of general supported NMEA sentenses - debug is not part of this
524 #define LOC_NMEA_ALL_GENERAL_SUPPORTED_MASK  (LOC_NMEA_MASK_GGA_V02 | LOC_NMEA_MASK_RMC_V02 | \
525               LOC_NMEA_MASK_GSV_V02 | LOC_NMEA_MASK_GSA_V02 | LOC_NMEA_MASK_VTG_V02 | \
526         LOC_NMEA_MASK_PQXFI_V02 | LOC_NMEA_MASK_PSTIS_V02 | LOC_NMEA_MASK_GLGSV_V02 | \
527         LOC_NMEA_MASK_GNGSA_V02 | LOC_NMEA_MASK_GNGNS_V02 | LOC_NMEA_MASK_GARMC_V02 | \
528         LOC_NMEA_MASK_GAGSV_V02 | LOC_NMEA_MASK_GAGSA_V02 | LOC_NMEA_MASK_GAVTG_V02 | \
529         LOC_NMEA_MASK_GAGGA_V02 | LOC_NMEA_MASK_PQGSA_V02 | LOC_NMEA_MASK_PQGSV_V02)
530 
531 typedef enum {
532   LOC_ENG_IF_REQUEST_SENDER_ID_QUIPC = 0,
533   LOC_ENG_IF_REQUEST_SENDER_ID_MSAPM,
534   LOC_ENG_IF_REQUEST_SENDER_ID_MSAPU,
535   LOC_ENG_IF_REQUEST_SENDER_ID_GPSONE_DAEMON,
536   LOC_ENG_IF_REQUEST_SENDER_ID_MODEM,
537   LOC_ENG_IF_REQUEST_SENDER_ID_UNKNOWN
538 } loc_if_req_sender_id_e_type;
539 
540 
541 #define smaller_of(a, b) (((a) > (b)) ? (b) : (a))
542 #define MAX_APN_LEN 100
543 
544 // This will be overridden by the individual adapters
545 // if necessary.
546 #define DEFAULT_IMPL(rtv)                                     \
547 {                                                             \
548     LOC_LOGD("%s: default implementation invoked", __func__); \
549     return rtv;                                               \
550 }
551 
552 enum loc_api_adapter_err {
553     LOC_API_ADAPTER_ERR_SUCCESS             = 0,
554     LOC_API_ADAPTER_ERR_GENERAL_FAILURE     = 1,
555     LOC_API_ADAPTER_ERR_UNSUPPORTED         = 2,
556     LOC_API_ADAPTER_ERR_INVALID_HANDLE      = 4,
557     LOC_API_ADAPTER_ERR_INVALID_PARAMETER   = 5,
558     LOC_API_ADAPTER_ERR_ENGINE_BUSY         = 6,
559     LOC_API_ADAPTER_ERR_PHONE_OFFLINE       = 7,
560     LOC_API_ADAPTER_ERR_TIMEOUT             = 8,
561     LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT = 9,
562     LOC_API_ADAPTER_ERR_INTERNAL            = 10,
563 
564     /* equating engine down to phone offline, as they are the same errror */
565     LOC_API_ADAPTER_ERR_ENGINE_DOWN         = LOC_API_ADAPTER_ERR_PHONE_OFFLINE,
566     LOC_API_ADAPTER_ERR_FAILURE             = 101,
567     LOC_API_ADAPTER_ERR_UNKNOWN
568 };
569 
570 enum loc_api_adapter_event_index {
571     LOC_API_ADAPTER_REPORT_POSITION = 0,               // Position report comes in loc_parsed_position_s_type
572     LOC_API_ADAPTER_REPORT_SATELLITE,                  // Satellite in view report
573     LOC_API_ADAPTER_REPORT_NMEA_1HZ,                   // NMEA report at 1HZ rate
574     LOC_API_ADAPTER_REPORT_NMEA_POSITION,              // NMEA report at position report rate
575     LOC_API_ADAPTER_REQUEST_NI_NOTIFY_VERIFY,          // NI notification/verification request
576     LOC_API_ADAPTER_REQUEST_ASSISTANCE_DATA,           // Assistance data, eg: time, predicted orbits request
577     LOC_API_ADAPTER_REQUEST_LOCATION_SERVER,           // Request for location server
578     LOC_API_ADAPTER_REPORT_IOCTL,                      // Callback report for loc_ioctl
579     LOC_API_ADAPTER_REPORT_STATUS,                     // Misc status report: eg, engine state
580     LOC_API_ADAPTER_REQUEST_WIFI,                      //
581     LOC_API_ADAPTER_SENSOR_STATUS,                     //
582     LOC_API_ADAPTER_REQUEST_TIME_SYNC,                 //
583     LOC_API_ADAPTER_REPORT_SPI,                        //
584     LOC_API_ADAPTER_REPORT_NI_GEOFENCE,                //
585     LOC_API_ADAPTER_GEOFENCE_GEN_ALERT,                //
586     LOC_API_ADAPTER_REPORT_GENFENCE_BREACH,            //
587     LOC_API_ADAPTER_PEDOMETER_CTRL,                    //
588     LOC_API_ADAPTER_MOTION_CTRL,                       //
589     LOC_API_ADAPTER_REQUEST_WIFI_AP_DATA,              // Wifi ap data
590     LOC_API_ADAPTER_BATCH_FULL,                        // Batching on full
591     LOC_API_ADAPTER_BATCHED_POSITION_REPORT,           // Batching on fix
592     LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_REPORT,    //
593     LOC_API_ADAPTER_GNSS_MEASUREMENT_REPORT,          //GNSS Measurement Report
594     LOC_API_ADAPTER_GNSS_SV_POLYNOMIAL_REPORT,        //GNSS SV Polynomial Report
595     LOC_API_ADAPTER_GDT_UPLOAD_BEGIN_REQ,              // GDT upload start request
596     LOC_API_ADAPTER_GDT_UPLOAD_END_REQ,                // GDT upload end request
597     LOC_API_ADAPTER_GNSS_MEASUREMENT,                  // GNSS Measurement report
598     LOC_API_ADAPTER_REQUEST_TIMEZONE,                  // Timezone injection request
599     LOC_API_ADAPTER_REPORT_GENFENCE_DWELL_REPORT,      // Geofence dwell report
600     LOC_API_ADAPTER_REQUEST_SRN_DATA,                  // request srn data from AP
601     LOC_API_ADAPTER_REQUEST_POSITION_INJECTION,        // Position injection request
602     LOC_API_ADAPTER_BATCH_STATUS,                      // batch status
603     LOC_API_ADAPTER_FDCL_SERVICE_REQ,                  // FDCL service request
604     LOC_API_ADAPTER_EVENT_MAX
605 };
606 
607 #define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT           (1<<LOC_API_ADAPTER_REPORT_POSITION)
608 #define LOC_API_ADAPTER_BIT_SATELLITE_REPORT                 (1<<LOC_API_ADAPTER_REPORT_SATELLITE)
609 #define LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT                  (1<<LOC_API_ADAPTER_REPORT_NMEA_1HZ)
610 #define LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT             (1<<LOC_API_ADAPTER_REPORT_NMEA_POSITION)
611 #define LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST         (1<<LOC_API_ADAPTER_REQUEST_NI_NOTIFY_VERIFY)
612 #define LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST          (1<<LOC_API_ADAPTER_REQUEST_ASSISTANCE_DATA)
613 #define LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST          (1<<LOC_API_ADAPTER_REQUEST_LOCATION_SERVER)
614 #define LOC_API_ADAPTER_BIT_IOCTL_REPORT                     (1<<LOC_API_ADAPTER_REPORT_IOCTL)
615 #define LOC_API_ADAPTER_BIT_STATUS_REPORT                    (1<<LOC_API_ADAPTER_REPORT_STATUS)
616 #define LOC_API_ADAPTER_BIT_REQUEST_WIFI                     (1<<LOC_API_ADAPTER_REQUEST_WIFI)
617 #define LOC_API_ADAPTER_BIT_SENSOR_STATUS                    (1<<LOC_API_ADAPTER_SENSOR_STATUS)
618 #define LOC_API_ADAPTER_BIT_REQUEST_TIME_SYNC                (1<<LOC_API_ADAPTER_REQUEST_TIME_SYNC)
619 #define LOC_API_ADAPTER_BIT_REPORT_SPI                       (1<<LOC_API_ADAPTER_REPORT_SPI)
620 #define LOC_API_ADAPTER_BIT_REPORT_NI_GEOFENCE               (1<<LOC_API_ADAPTER_REPORT_NI_GEOFENCE)
621 #define LOC_API_ADAPTER_BIT_GEOFENCE_GEN_ALERT               (1<<LOC_API_ADAPTER_GEOFENCE_GEN_ALERT)
622 #define LOC_API_ADAPTER_BIT_REPORT_GENFENCE_BREACH           (1<<LOC_API_ADAPTER_REPORT_GENFENCE_BREACH)
623 #define LOC_API_ADAPTER_BIT_BATCHED_GENFENCE_BREACH_REPORT   (1<<LOC_API_ADAPTER_BATCHED_GENFENCE_BREACH_REPORT)
624 #define LOC_API_ADAPTER_BIT_PEDOMETER_CTRL                   (1<<LOC_API_ADAPTER_PEDOMETER_CTRL)
625 #define LOC_API_ADAPTER_BIT_MOTION_CTRL                      (1<<LOC_API_ADAPTER_MOTION_CTRL)
626 #define LOC_API_ADAPTER_BIT_REQUEST_WIFI_AP_DATA             (1<<LOC_API_ADAPTER_REQUEST_WIFI_AP_DATA)
627 #define LOC_API_ADAPTER_BIT_BATCH_FULL                       (1<<LOC_API_ADAPTER_BATCH_FULL)
628 #define LOC_API_ADAPTER_BIT_BATCHED_POSITION_REPORT          (1<<LOC_API_ADAPTER_BATCHED_POSITION_REPORT)
629 #define LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT_REPORT          (1<<LOC_API_ADAPTER_GNSS_MEASUREMENT_REPORT)
630 #define LOC_API_ADAPTER_BIT_GNSS_SV_POLYNOMIAL_REPORT        (1<<LOC_API_ADAPTER_GNSS_SV_POLYNOMIAL_REPORT)
631 #define LOC_API_ADAPTER_BIT_GDT_UPLOAD_BEGIN_REQ             (1<<LOC_API_ADAPTER_GDT_UPLOAD_BEGIN_REQ)
632 #define LOC_API_ADAPTER_BIT_GDT_UPLOAD_END_REQ               (1<<LOC_API_ADAPTER_GDT_UPLOAD_END_REQ)
633 #define LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT                 (1<<LOC_API_ADAPTER_GNSS_MEASUREMENT)
634 #define LOC_API_ADAPTER_BIT_REQUEST_TIMEZONE                 (1<<LOC_API_ADAPTER_REQUEST_TIMEZONE)
635 #define LOC_API_ADAPTER_BIT_REPORT_GENFENCE_DWELL            (1<<LOC_API_ADAPTER_REPORT_GENFENCE_DWELL_REPORT)
636 #define LOC_API_ADAPTER_BIT_REQUEST_SRN_DATA                 (1<<LOC_API_ADAPTER_REQUEST_SRN_DATA)
637 #define LOC_API_ADAPTER_BIT_POSITION_INJECTION_REQUEST       (1<<LOC_API_ADAPTER_REQUEST_POSITION_INJECTION)
638 #define LOC_API_ADAPTER_BIT_BATCH_STATUS                     (1<<LOC_API_ADAPTER_BATCH_STATUS)
639 #define LOC_API_ADAPTER_BIT_FDCL_SERVICE_REQ                 (1ULL<<LOC_API_ADAPTER_FDCL_SERVICE_REQ)
640 
641 
642 typedef uint64_t LOC_API_ADAPTER_EVENT_MASK_T;
643 
644 typedef enum loc_api_adapter_msg_to_check_supported {
645     LOC_API_ADAPTER_MESSAGE_LOCATION_BATCHING,               // Batching 1.0
646     LOC_API_ADAPTER_MESSAGE_BATCHED_GENFENCE_BREACH,         // Geofence Batched Breach
647     LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING,          // DBT 2.0
648     LOC_API_ADAPTER_MESSAGE_ADAPTIVE_LOCATION_BATCHING,      // Batching 1.5
649     LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING, // Batching 2.0
650     LOC_API_ADAPTER_MESSAGE_UPDATE_TBF_ON_THE_FLY,           // Updating Tracking TBF On The Fly
651     LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING,           // Outdoor Trip Batching
652 
653     LOC_API_ADAPTER_MESSAGE_MAX
654 } LocCheckingMessagesID;
655 
656 typedef int IzatDevId_t;
657 
658 typedef uint32_t LOC_GPS_LOCK_MASK;
659 #define isGpsLockNone(lock) ((lock) == 0)
660 #define isGpsLockMO(lock) ((lock) & ((LOC_GPS_LOCK_MASK)1))
661 #define isGpsLockMT(lock) ((lock) & ((LOC_GPS_LOCK_MASK)2))
662 #define isGpsLockAll(lock) (((lock) & ((LOC_GPS_LOCK_MASK)3)) == 3)
663 
664 /*++ ***********************************************
665 **  Satellite Measurement and Satellite Polynomial
666 **  Structure definitions
667 **  ***********************************************
668 --*/
669 #define GNSS_SV_POLY_VELOCITY_COEF_MAX_SIZE         12
670 #define GNSS_SV_POLY_XYZ_0_TH_ORDER_COEFF_MAX_SIZE  3
671 #define GNSS_SV_POLY_XYZ_N_TH_ORDER_COEFF_MAX_SIZE  9
672 #define GNSS_SV_POLY_SV_CLKBIAS_COEFF_MAX_SIZE      4
673 #define GNSS_LOC_SV_MEAS_LIST_MAX_SIZE              16
674 
675 enum ulp_gnss_sv_measurement_valid_flags{
676 
677     ULP_GNSS_SV_MEAS_GPS_TIME = 0,
678     ULP_GNSS_SV_MEAS_PSUEDO_RANGE,
679     ULP_GNSS_SV_MEAS_MS_IN_WEEK,
680     ULP_GNSS_SV_MEAS_SUB_MSEC,
681     ULP_GNSS_SV_MEAS_CARRIER_PHASE,
682     ULP_GNSS_SV_MEAS_DOPPLER_SHIFT,
683     ULP_GNSS_SV_MEAS_CNO,
684     ULP_GNSS_SV_MEAS_LOSS_OF_LOCK,
685 
686     ULP_GNSS_SV_MEAS_MAX_VALID_FLAGS
687 };
688 
689 #define ULP_GNSS_SV_MEAS_BIT_GPS_TIME        (1<<ULP_GNSS_SV_MEAS_GPS_TIME)
690 #define ULP_GNSS_SV_MEAS_BIT_PSUEDO_RANGE    (1<<ULP_GNSS_SV_MEAS_PSUEDO_RANGE)
691 #define ULP_GNSS_SV_MEAS_BIT_MS_IN_WEEK      (1<<ULP_GNSS_SV_MEAS_MS_IN_WEEK)
692 #define ULP_GNSS_SV_MEAS_BIT_SUB_MSEC        (1<<ULP_GNSS_SV_MEAS_SUB_MSEC)
693 #define ULP_GNSS_SV_MEAS_BIT_CARRIER_PHASE   (1<<ULP_GNSS_SV_MEAS_CARRIER_PHASE)
694 #define ULP_GNSS_SV_MEAS_BIT_DOPPLER_SHIFT   (1<<ULP_GNSS_SV_MEAS_DOPPLER_SHIFT)
695 #define ULP_GNSS_SV_MEAS_BIT_CNO             (1<<ULP_GNSS_SV_MEAS_CNO)
696 #define ULP_GNSS_SV_MEAS_BIT_LOSS_OF_LOCK    (1<<ULP_GNSS_SV_MEAS_LOSS_OF_LOCK)
697 
698 enum ulp_gnss_sv_poly_valid_flags{
699 
700     ULP_GNSS_SV_POLY_GLO_FREQ = 0,
701     ULP_GNSS_SV_POLY_T0,
702     ULP_GNSS_SV_POLY_IODE,
703     ULP_GNSS_SV_POLY_FLAG,
704     ULP_GNSS_SV_POLY_POLYCOEFF_XYZ0,
705     ULP_GNSS_SV_POLY_POLYCOEFF_XYZN,
706     ULP_GNSS_SV_POLY_POLYCOEFF_OTHER,
707     ULP_GNSS_SV_POLY_SV_POSUNC,
708     ULP_GNSS_SV_POLY_IONODELAY,
709     ULP_GNSS_SV_POLY_IONODOT,
710     ULP_GNSS_SV_POLY_SBAS_IONODELAY,
711     ULP_GNSS_SV_POLY_SBAS_IONODOT,
712     ULP_GNSS_SV_POLY_TROPODELAY,
713     ULP_GNSS_SV_POLY_ELEVATION,
714     ULP_GNSS_SV_POLY_ELEVATIONDOT,
715     ULP_GNSS_SV_POLY_ELEVATIONUNC,
716     ULP_GNSS_SV_POLY_VELO_COEFF,
717     ULP_GNSS_SV_POLY_ENHANCED_IOD,
718 
719     ULP_GNSS_SV_POLY_VALID_FLAGS
720 
721 };
722 
723 #define ULP_GNSS_SV_POLY_BIT_GLO_FREQ               (1<<ULP_GNSS_SV_POLY_GLO_FREQ)
724 #define ULP_GNSS_SV_POLY_BIT_T0                     (1<<ULP_GNSS_SV_POLY_T0)
725 #define ULP_GNSS_SV_POLY_BIT_IODE                   (1<<ULP_GNSS_SV_POLY_IODE)
726 #define ULP_GNSS_SV_POLY_BIT_FLAG                   (1<<ULP_GNSS_SV_POLY_FLAG)
727 #define ULP_GNSS_SV_POLY_BIT_POLYCOEFF_XYZ0         (1<<ULP_GNSS_SV_POLY_POLYCOEFF_XYZ0)
728 #define ULP_GNSS_SV_POLY_BIT_POLYCOEFF_XYZN         (1<<ULP_GNSS_SV_POLY_POLYCOEFF_XYZN)
729 #define ULP_GNSS_SV_POLY_BIT_POLYCOEFF_OTHER        (1<<ULP_GNSS_SV_POLY_POLYCOEFF_OTHER)
730 #define ULP_GNSS_SV_POLY_BIT_SV_POSUNC              (1<<ULP_GNSS_SV_POLY_SV_POSUNC)
731 #define ULP_GNSS_SV_POLY_BIT_IONODELAY              (1<<ULP_GNSS_SV_POLY_IONODELAY)
732 #define ULP_GNSS_SV_POLY_BIT_IONODOT                (1<<ULP_GNSS_SV_POLY_IONODOT)
733 #define ULP_GNSS_SV_POLY_BIT_SBAS_IONODELAY         (1<<ULP_GNSS_SV_POLY_SBAS_IONODELAY)
734 #define ULP_GNSS_SV_POLY_BIT_SBAS_IONODOT           (1<<ULP_GNSS_SV_POLY_SBAS_IONODOT)
735 #define ULP_GNSS_SV_POLY_BIT_TROPODELAY             (1<<ULP_GNSS_SV_POLY_TROPODELAY)
736 #define ULP_GNSS_SV_POLY_BIT_ELEVATION              (1<<ULP_GNSS_SV_POLY_ELEVATION)
737 #define ULP_GNSS_SV_POLY_BIT_ELEVATIONDOT           (1<<ULP_GNSS_SV_POLY_ELEVATIONDOT)
738 #define ULP_GNSS_SV_POLY_BIT_ELEVATIONUNC           (1<<ULP_GNSS_SV_POLY_ELEVATIONUNC)
739 #define ULP_GNSS_SV_POLY_BIT_VELO_COEFF             (1<<ULP_GNSS_SV_POLY_VELO_COEFF)
740 #define ULP_GNSS_SV_POLY_BIT_ENHANCED_IOD           (1<<ULP_GNSS_SV_POLY_ENHANCED_IOD)
741 
742 typedef enum
743 {
744     GNSS_LOC_FREQ_SOURCE_INVALID = 0,
745     /**< Source of the frequency is invalid */
746     GNSS_LOC_FREQ_SOURCE_EXTERNAL = 1,
747     /**< Source of the frequency is from external injection */
748     GNSS_LOC_FREQ_SOURCE_PE_CLK_REPORT = 2,
749     /**< Source of the frequency is from Navigation engine */
750     GNSS_LOC_FREQ_SOURCE_UNKNOWN = 3
751     /**< Source of the frequency is unknown */
752 } Gnss_LocSourceofFreqEnumType;
753 
754 typedef struct
755 {
756     size_t                          size;
757     float                           clockDrift;
758     /**< Receiver clock Drift \n
759          - Units: meter per sec \n
760     */
761     float                           clockDriftUnc;
762     /**< Receiver clock Drift uncertainty \n
763          - Units: meter per sec \n
764     */
765     Gnss_LocSourceofFreqEnumType    sourceOfFreq;
766 }Gnss_LocRcvrClockFrequencyInfoStructType;
767 
768 typedef struct
769 {
770     size_t      size;
771     uint8_t     leapSec;
772     /**< GPS time leap second delta to UTC time  \n
773          - Units: sec \n
774        */
775     uint8_t     leapSecUnc;
776     /**< Uncertainty for GPS leap second \n
777          - Units: sec \n
778        */
779 }Gnss_LeapSecondInfoStructType;
780 
781 typedef enum
782 {
783    GNSS_LOC_SYS_TIME_BIAS_VALID                = 0x01,
784    /**< System time bias valid */
785    GNSS_LOC_SYS_TIME_BIAS_UNC_VALID            = 0x02,
786    /**< System time bias uncertainty valid */
787 }Gnss_LocInterSystemBiasValidMaskType;
788 
789 typedef struct
790 {
791     size_t          size;
792     uint32_t        validMask;
793     /* Validity mask as per Gnss_LocInterSystemBiasValidMaskType */
794 
795     float           timeBias;
796     /**< System-1 to System-2 Time Bias  \n
797         - Units: msec \n
798     */
799     float           timeBiasUnc;
800     /**< System-1 to System-2 Time Bias uncertainty  \n
801         - Units: msec \n
802     */
803 }Gnss_InterSystemBiasStructType;
804 
805 
806 typedef struct
807 {
808     size_t          size;
809     uint16_t        systemWeek;
810     /**< System week number for GPS, BDS and GAL satellite systems. \n
811          Set to 65535 when invalid or not available. \n
812          Not valid for GLONASS system. \n
813        */
814 
815     uint32_t        systemMsec;
816     /**< System time msec. Time of Week for GPS, BDS, GAL and
817          Time of Day for GLONASS.
818          - Units: msec \n
819       */
820     float           systemClkTimeBias;
821     /**< System clock time bias \n
822          - Units: msec \n
823          System time = systemMsec - systemClkTimeBias \n
824       */
825     float           systemClkTimeUncMs;
826     /**< Single sided maximum time bias uncertainty \n
827                                                     - Units: msec \n
828       */
829 }Gnss_LocSystemTimeStructType;
830 
831 typedef struct {
832 
833   size_t        size;
834   uint8_t       gloFourYear;
835   /**<   GLONASS four year number from 1996. Refer to GLONASS ICD.\n
836         Applicable only for GLONASS and shall be ignored for other constellations. \n
837         If unknown shall be set to 255
838         */
839 
840   uint16_t      gloDays;
841   /**<   GLONASS day number in four years. Refer to GLONASS ICD.
842         Applicable only for GLONASS and shall be ignored for other constellations. \n
843         If unknown shall be set to 65535
844         */
845 
846   uint32_t      gloMsec;
847   /**<   GLONASS time of day in msec. Refer to GLONASS ICD.
848             - Units: msec \n
849         */
850 
851   float         gloClkTimeBias;
852   /**<   System clock time bias (sub-millisecond) \n
853             - Units: msec \n
854         System time = systemMsec - systemClkTimeBias \n
855     */
856 
857   float         gloClkTimeUncMs;
858   /**<   Single sided maximum time bias uncertainty \n
859                 - Units: msec \n
860         */
861 }Gnss_LocGloTimeStructType;  /* Type */
862 
863 typedef struct {
864 
865   size_t    size;
866   uint32_t  refFCount;
867   /**<   Receiver frame counter value at reference tick */
868 
869   uint8_t   systemRtc_valid;
870   /**<   Validity indicator for System RTC */
871 
872   uint64_t  systemRtcMs;
873   /**<   Platform system RTC value \n
874         - Units: msec \n
875         */
876 
877   uint32_t  sourceOfTime;
878   /**<   Source of time information */
879 
880 }Gnss_LocGnssTimeExtStructType;
881 
882 
883 
884 typedef enum
885 {
886     GNSS_LOC_MEAS_STATUS_NULL                    = 0x00000000,
887     /**< No information state */
888     GNSS_LOC_MEAS_STATUS_SM_VALID                = 0x00000001,
889     /**< Code phase is known */
890     GNSS_LOC_MEAS_STATUS_SB_VALID                = 0x00000002,
891     /**< Sub-bit time is known */
892     GNSS_LOC_MEAS_STATUS_MS_VALID                = 0x00000004,
893     /**< Satellite time is known */
894     GNSS_LOC_MEAS_STATUS_BE_CONFIRM              = 0x00000008,
895     /**< Bit edge is confirmed from signal   */
896     GNSS_LOC_MEAS_STATUS_VELOCITY_VALID          = 0x00000010,
897     /**< Satellite Doppler measured */
898     GNSS_LOC_MEAS_STATUS_VELOCITY_FINE           = 0x00000020,
899     /**< TRUE: Fine Doppler measured, FALSE: Coarse Doppler measured */
900     GNSS_LOC_MEAS_STATUS_FROM_RNG_DIFF           = 0x00000200,
901     /**< Range update from Satellite differences */
902     GNSS_LOC_MEAS_STATUS_FROM_VE_DIFF            = 0x00000400,
903     /**< Doppler update from Satellite differences */
904     GNSS_LOC_MEAS_STATUS_DONT_USE_X              = 0x00000800,
905     /**< Don't use measurement if bit is set */
906     GNSS_LOC_MEAS_STATUS_DONT_USE_M              = 0x000001000,
907     /**< Don't use measurement if bit is set */
908     GNSS_LOC_MEAS_STATUS_DONT_USE_D              = 0x000002000,
909     /**< Don't use measurement if bit is set */
910     GNSS_LOC_MEAS_STATUS_DONT_USE_S              = 0x000004000,
911     /**< Don't use measurement if bit is set */
912     GNSS_LOC_MEAS_STATUS_DONT_USE_P              = 0x000008000
913     /**< Don't use measurement if bit is set */
914 }Gnss_LocSvMeasStatusMaskType;
915 
916 typedef struct
917 {
918     size_t              size;
919     uint32_t            svMs;
920     /**<  Satellite time milisecond.\n
921           For GPS, BDS, GAL range of 0 thru (604800000-1) \n
922           For GLONASS range of 0 thru (86400000-1) \n
923           Valid when PD_LOC_MEAS_STATUS_MS_VALID bit is set in measurement status \n
924           Note: All SV times in the current measurement block are alredy propagated to common reference time epoch. \n
925             - Units: msec \n
926        */
927     float               svSubMs;
928     /**<Satellite time sub-millisecond. \n
929         Total SV Time = svMs + svSubMs \n
930         - Units: msec \n
931        */
932     float               svTimeUncMs;
933     /**<  Satellite Time uncertainty \n
934           - Units: msec \n
935        */
936     float               dopplerShift;
937     /**< Satellite Doppler \n
938             - Units: meter per sec \n
939        */
940     float               dopplerShiftUnc;
941     /**< Satellite Doppler uncertainty\n
942             - Units: meter per sec \n
943        */
944 }Gnss_LocSVTimeSpeedStructType;
945 
946 typedef enum
947 {
948   GNSS_SV_STATE_IDLE = 0,
949   GNSS_SV_STATE_SEARCH = 1,
950   GNSS_SV_STATE_SEARCH_VERIFY = 2,
951   GNSS_SV_STATE_BIT_EDGE = 3,
952   GNSS_SV_STATE_VERIFY_TRACK = 4,
953   GNSS_SV_STATE_TRACK = 5,
954   GNSS_SV_STATE_RESTART = 6,
955   GNSS_SV_STATE_DPO_TRACK = 7
956 } Gnss_LocSVStateEnumType;
957 
958 typedef enum
959 {
960   GNSS_LOC_SVINFO_MASK_HAS_EPHEMERIS   = 0x01,
961   /**< Ephemeris is available for this SV */
962   GNSS_LOC_SVINFO_MASK_HAS_ALMANAC     = 0x02
963   /**< Almanac is available for this SV */
964 }Gnss_LocSvInfoMaskT;
965 
966 typedef enum
967 {
968   GNSS_LOC_SV_SRCH_STATUS_IDLE      = 1,
969     /**< SV is not being actively processed */
970   GNSS_LOC_SV_SRCH_STATUS_SEARCH    = 2,
971     /**< The system is searching for this SV */
972   GNSS_LOC_SV_SRCH_STATUS_TRACK     = 3
973     /**< SV is being tracked */
974 }Gnss_LocSvSearchStatusEnumT;
975 
976 
977 typedef struct
978 {
979     size_t                          size;
980     uint16_t                        gnssSvId;
981     /**< GNSS SV ID.
982          \begin{itemize1}
983          \item Range:  \begin{itemize1}
984            \item For GPS:      1 to 32
985            \item For GLONASS:  1 to 32
986            \item For SBAS:     120 to 151
987            \item For BDS:      201 to 237
988          \end{itemize1} \end{itemize1}
989         The GPS and GLONASS SVs can be disambiguated using the system field.
990     */
991     uint8_t                         gloFrequency;
992     /**< GLONASS frequency number + 7 \n
993          Valid only for GLONASS System \n
994          Shall be ignored for all other systems \n
995           - Range: 1 to 14 \n
996     */
997     Gnss_LocSvSearchStatusEnumT     svStatus;
998     /**< Satellite search state \n
999         @ENUM()
1000     */
1001     bool                         healthStatus_valid;
1002     /**< SV Health Status validity flag\n
1003         - 0: Not valid \n
1004         - 1: Valid \n
1005     */
1006     uint8_t                         healthStatus;
1007     /**< Health status.
1008          \begin{itemize1}
1009          \item    Range: 0 to 1; 0 = unhealthy, \n 1 = healthy, 2 = unknown
1010          \vspace{-0.18in} \end{itemize1}
1011     */
1012     Gnss_LocSvInfoMaskT             svInfoMask;
1013     /**< Indicates whether almanac and ephemeris information is available. \n
1014         @MASK()
1015     */
1016     uint64_t                        measurementStatus;
1017     /**< Bitmask indicating SV measurement status.
1018         Valid bitmasks: \n
1019         If any MSB bit in 0xFFC0000000000000 DONT_USE is set, the measurement
1020         must not be used by the client.
1021         @MASK()
1022     */
1023     uint16_t                        CNo;
1024     /**< Carrier to Noise ratio  \n
1025         - Units: 0.1 dBHz \n
1026     */
1027     uint16_t                          gloRfLoss;
1028     /**< GLONASS Rf loss reference to Antenna. \n
1029          - Units: dB, Scale: 0.1 \n
1030     */
1031     bool                         lossOfLock;
1032     /**< Loss of signal lock indicator  \n
1033          - 0: Signal in continuous track \n
1034          - 1: Signal not in track \n
1035     */
1036     int16_t                         measLatency;
1037     /**< Age of the measurement. Positive value means measurement precedes ref time. \n
1038          - Units: msec \n
1039     */
1040     Gnss_LocSVTimeSpeedStructType   svTimeSpeed;
1041     /**< Unfiltered SV Time and Speed information
1042     */
1043     float                           dopplerAccel;
1044     /**< Satellite Doppler Accelertion\n
1045          - Units: Hz/s \n
1046     */
1047     bool                         multipathEstValid;
1048     /**< Multipath estimate validity flag\n
1049         - 0: Multipath estimate not valid \n
1050         - 1: Multipath estimate valid \n
1051     */
1052     float                           multipathEstimate;
1053     /**< Estimate of multipath in measurement\n
1054          - Units: Meters \n
1055     */
1056     bool                         fineSpeedValid;
1057     /**< Fine speed validity flag\n
1058          - 0: Fine speed not valid \n
1059          - 1: Fine speed valid \n
1060     */
1061     float                           fineSpeed;
1062     /**< Carrier phase derived speed \n
1063          - Units: m/s \n
1064     */
1065     bool                         fineSpeedUncValid;
1066     /**< Fine speed uncertainty validity flag\n
1067          - 0: Fine speed uncertainty not valid \n
1068          - 1: Fine speed uncertainty valid \n
1069     */
1070     float                           fineSpeedUnc;
1071     /**< Carrier phase derived speed \n
1072         - Units: m/s \n
1073     */
1074     bool                         carrierPhaseValid;
1075     /**< Carrier Phase measurement validity flag\n
1076          - 0: Carrier Phase not valid \n
1077          - 1: Carrier Phase valid \n
1078     */
1079     double                          carrierPhase;
1080     /**< Carrier phase measurement [L1 cycles] \n
1081     */
1082     bool                         cycleSlipCountValid;
1083      /**< Cycle slup count validity flag\n
1084          - 0: Not valid \n
1085          - 1: Valid \n
1086     */
1087     uint8_t                         cycleSlipCount;
1088     /**< Increments when a CSlip is detected */
1089 
1090     bool                         svDirectionValid;
1091     /**< Validity flag for SV direction */
1092 
1093     float                           svAzimuth;
1094     /**< Satellite Azimuth
1095         - Units: radians \n
1096     */
1097     float                           svElevation;
1098     /**< Satellite Elevation
1099         - Units: radians \n
1100     */
1101 } Gnss_SVMeasurementStructType;
1102 
1103 /**< Maximum number of satellites in measurement block for given system. */
1104 
1105 typedef struct
1106 {
1107     size_t                          size;
1108     Gnss_LocSvSystemEnumType        system;
1109     /**< Specifies the Satellite System Type
1110     */
1111     bool                            isSystemTimeValid;
1112     /**< Indicates whether System Time is Valid:\n
1113          - 0x01 (TRUE) --  System Time is valid \n
1114          - 0x00 (FALSE) -- System Time is not valid
1115     */
1116     Gnss_LocSystemTimeStructType    systemTime;
1117     /**< System Time Information \n
1118     */
1119     bool                            isGloTime_valid;
1120     Gnss_LocGloTimeStructType       gloTime;
1121 
1122     bool                            isSystemTimeExt_valid;
1123     Gnss_LocGnssTimeExtStructType   systemTimeExt;
1124 
1125     uint8_t                         numSvs;
1126     /* Number of SVs in this report block */
1127 
1128     Gnss_SVMeasurementStructType    svMeasurement[GNSS_LOC_SV_MEAS_LIST_MAX_SIZE];
1129     /**< Satellite measurement Information \n
1130     */
1131 } Gnss_ClockMeasurementStructType;
1132 
1133 
1134 typedef struct
1135 {
1136     size_t                                      size;
1137     uint8_t                                     seqNum;
1138     /**< Current message Number */
1139     uint8_t                                     maxMessageNum;
1140     /**< Maximum number of message that will be sent for present time epoch. */
1141 
1142     bool                                     leapSecValid;
1143     Gnss_LeapSecondInfoStructType               leapSec;
1144 
1145     Gnss_InterSystemBiasStructType              gpsGloInterSystemBias;
1146 
1147     Gnss_InterSystemBiasStructType              gpsBdsInterSystemBias;
1148 
1149     Gnss_InterSystemBiasStructType              gpsGalInterSystemBias;
1150 
1151     Gnss_InterSystemBiasStructType              bdsGloInterSystemBias;
1152 
1153     Gnss_InterSystemBiasStructType              galGloInterSystemBias;
1154 
1155     Gnss_InterSystemBiasStructType              galBdsInterSystemBias;
1156 
1157     bool                                     clockFreqValid;
1158     Gnss_LocRcvrClockFrequencyInfoStructType    clockFreq;   /* Freq */
1159     bool                                     gnssMeasValid;
1160     Gnss_ClockMeasurementStructType             gnssMeas;
1161     Gnss_ApTimeStampStructType               timeStamp;
1162 
1163 } GnssSvMeasurementSet;
1164 
1165 typedef enum
1166 {
1167    GNSS_SV_POLY_COEFF_VALID             = 0x01,
1168    /**< SV position in orbit coefficients are valid */
1169    GNSS_SV_POLY_IONO_VALID              = 0x02,
1170    /**< Iono estimates are valid */
1171 
1172    GNSS_SV_POLY_TROPO_VALID             = 0x04,
1173    /**< Tropo estimates are valid */
1174 
1175    GNSS_SV_POLY_ELEV_VALID              = 0x08,
1176    /**< Elevation, rate, uncertainty are valid */
1177 
1178    GNSS_SV_POLY_SRC_ALM_CORR            = 0x10,
1179    /**< Polynomials based on XTRA */
1180 
1181    GNSS_SV_POLY_SBAS_IONO_VALID         = 0x20,
1182    /**< SBAS IONO and rate are valid */
1183 
1184    GNSS_SV_POLY_GLO_STR4                = 0x40
1185    /**< GLONASS String 4 has been received */
1186 }Gnss_SvPolyStatusMaskType;
1187 
1188 
1189 typedef struct
1190 {
1191     size_t      size;
1192     uint16_t     gnssSvId;
1193     /* GPS: 1-32, GLO: 65-96, 0: Invalid,
1194        SBAS: 120-151, BDS:201-237,GAL:301 to 336
1195        All others are reserved
1196     */
1197     int8_t      freqNum;
1198     /* Freq index, only valid if u_SysInd is GLO */
1199 
1200     uint8_t     svPolyFlags;
1201     /* Indicate the validity of the elements
1202     as per Gnss_SvPolyStatusMaskType
1203     */
1204 
1205     uint32_t    is_valid;
1206 
1207     uint16_t     iode;
1208     /* Ephemeris reference time
1209        GPS:Issue of Data Ephemeris used [unitless].
1210        GLO: Tb 7-bit, refer to ICD02
1211     */
1212     double      T0;
1213     /* Reference time for polynominal calculations
1214        GPS: Secs in week.
1215        GLO: Full secs since Jan/01/96
1216     */
1217     double      polyCoeffXYZ0[GNSS_SV_POLY_XYZ_0_TH_ORDER_COEFF_MAX_SIZE];
1218     /* C0X, C0Y, C0Z */
1219     double      polyCoefXYZN[GNSS_SV_POLY_XYZ_N_TH_ORDER_COEFF_MAX_SIZE];
1220     /* C1X, C2X ... C2Z, C3Z */
1221     float       polyCoefOther[GNSS_SV_POLY_SV_CLKBIAS_COEFF_MAX_SIZE];
1222     /* C0T, C1T, C2T, C3T */
1223     float       svPosUnc;       /* SV position uncertainty [m]. */
1224     float       ionoDelay;    /* Ionospheric delay at d_T0 [m]. */
1225     float       ionoDot;      /* Iono delay rate [m/s].  */
1226     float       sbasIonoDelay;/* SBAS Ionospheric delay at d_T0 [m]. */
1227     float       sbasIonoDot;  /* SBAS Iono delay rate [m/s].  */
1228     float       tropoDelay;   /* Tropospheric delay [m]. */
1229     float       elevation;    /* Elevation [rad] at d_T0 */
1230     float       elevationDot;      /* Elevation rate [rad/s] */
1231     float       elevationUnc;      /* SV elevation [rad] uncertainty */
1232     double      velCoef[GNSS_SV_POLY_VELOCITY_COEF_MAX_SIZE];
1233     /* Coefficients of velocity poly */
1234     uint32_t    enhancedIOD;    /*  Enhanced Reference Time */
1235 } GnssSvPolynomial;
1236 
1237 /* Various Short Range Node Technology type*/
1238 typedef enum {
1239     SRN_AP_DATA_TECH_TYPE_NONE,
1240     SRN_AP_DATA_TECH_TYPE_BT,
1241     SRN_AP_DATA_TECH_TYPE_BTLE,
1242     SRN_AP_DATA_TECH_TYPE_NFC,
1243     SRN_AP_DATA_TECH_TYPE_MOBILE_CODE,
1244     SRN_AP_DATA_TECH_TYPE_OTHER
1245 } Gnss_SrnTech;
1246 
1247 /* Mac Address type requested by modem */
1248 typedef enum {
1249     SRN_AP_DATA_PUBLIC_MAC_ADDR_TYPE_INVALID, /* No valid mac address type send */
1250     SRN_AP_DATA_PUBLIC_MAC_ADDR_TYPE_PUBLIC, /* SRN AP MAC Address type PUBLIC  */
1251     SRN_AP_DATA_PUBLIC_MAC_ADDR_TYPE_PRIVATE, /* SRN AP MAC Address type PRIVATE  */
1252     SRN_AP_DATA_PUBLIC_MAC_ADDR_TYPE_OTHER, /* SRN AP MAC Address type OTHER  */
1253 }Gnss_Srn_MacAddr_Type;
1254 
1255 typedef struct
1256 {
1257     size_t                 size;
1258     Gnss_SrnTech           srnTechType; /* SRN Technology type in request */
1259     bool                   srnRequest; /* scan - start(true) or stop(false) */
1260     bool                   e911Mode; /* If in E911 emergency */
1261     Gnss_Srn_MacAddr_Type  macAddrType; /* SRN AP MAC Address type */
1262 } GnssSrnDataReq;
1263 
1264 /* Mask indicating enabled or disabled constellations */
1265 typedef uint64_t GnssSvTypesMask;
1266 typedef enum {
1267     GNSS_SV_TYPES_MASK_GLO_BIT  = (1<<0),
1268     GNSS_SV_TYPES_MASK_BDS_BIT  = (1<<1),
1269     GNSS_SV_TYPES_MASK_QZSS_BIT = (1<<2),
1270     GNSS_SV_TYPES_MASK_GAL_BIT  = (1<<3),
1271 } GnssSvTypesMaskBits;
1272 
1273 /* This SV Type config is injected directly to GNSS Adapter
1274  * bypassing Location API */
1275 typedef struct {
1276     size_t size; // set to sizeof(GnssSvTypeConfig)
1277     // Enabled Constellations
1278     GnssSvTypesMask enabledSvTypesMask;
1279     // Disabled Constellations
1280     GnssSvTypesMask blacklistedSvTypesMask;
1281 } GnssSvTypeConfig;
1282 
1283 /* Provides the current GNSS SV Type configuration to the client.
1284  * This is fetched via direct call to GNSS Adapter bypassing
1285  * Location API */
1286 typedef std::function<void(
1287     const GnssSvTypeConfig& config
1288 )> GnssSvTypeConfigCallback;
1289 
1290 /*
1291  * Represents the status of AGNSS augmented to support IPv4.
1292  */
1293 struct AGnssExtStatusIpV4 {
1294     AGpsExtType type;
1295     LocAGpsStatusValue status;
1296     /*
1297      * 32-bit IPv4 address.
1298      */
1299     uint32_t ipV4Addr;
1300 };
1301 
1302 /*
1303  * Represents the status of AGNSS augmented to support IPv6.
1304  */
1305 struct AGnssExtStatusIpV6 {
1306     AGpsExtType type;
1307     LocAGpsStatusValue status;
1308     /*
1309      * 128-bit IPv6 address.
1310      */
1311     uint8_t ipV6Addr[16];
1312 };
1313 
1314 /* ODCPI Request Info */
1315 enum OdcpiRequestType {
1316     ODCPI_REQUEST_TYPE_START,
1317     ODCPI_REQUEST_TYPE_STOP
1318 };
1319 struct OdcpiRequestInfo {
1320     size_t size;
1321     OdcpiRequestType type;
1322     uint32_t tbfMillis;
1323     bool isEmergencyMode;
1324 };
1325 /* Callback to send ODCPI request to framework */
1326 typedef std::function<void(const OdcpiRequestInfo& request)> OdcpiRequestCallback;
1327 
1328 /*
1329  * Callback with AGNSS(IpV4) status information.
1330  *
1331  * @param status Will be of type AGnssExtStatusIpV4.
1332  */
1333 typedef void (*AgnssStatusIpV4Cb)(AGnssExtStatusIpV4 status);
1334 
1335 /*
1336  * Callback with AGNSS(IpV6) status information.
1337  *
1338  * @param status Will be of type AGnssExtStatusIpV6.
1339  */
1340 typedef void (*AgnssStatusIpV6Cb)(AGnssExtStatusIpV6 status);
1341 
1342 /* Constructs for interaction with loc_net_iface library */
1343 typedef void (*LocAgpsOpenResultCb)(bool isSuccess, AGpsExtType agpsType, const char* apn,
1344         AGpsBearerType bearerType, void* userDataPtr);
1345 
1346 typedef void (*LocAgpsCloseResultCb)(bool isSuccess, AGpsExtType agpsType, void* userDataPtr);
1347 
1348 /* Shared resources of LocIpc */
1349 #define LOC_IPC_HAL "/dev/socket/location/socket_hal"
1350 #define LOC_IPC_XTRA "/dev/socket/location/xtra/socket_xtra"
1351 
1352 #ifdef __cplusplus
1353 }
1354 #endif /* __cplusplus */
1355 
1356 #endif /* GPS_EXTENDED_C_H */
1357