1ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
2ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *
3ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * Redistribution and use in source and binary forms, with or without
4ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * modification, are permitted provided that the following conditions are
5ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * met:
6ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *     * Redistributions of source code must retain the above copyright
7ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *       notice, this list of conditions and the following disclaimer.
8ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *     * Redistributions in binary form must reproduce the above
9ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *       copyright notice, this list of conditions and the following
10ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *       disclaimer in the documentation and/or other materials provided
11ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *       with the distribution.
12ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *     * Neither the name of The Linux Foundation, nor the names of its
13ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *       contributors may be used to endorse or promote products derived
14ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *       from this software without specific prior written permission.
15ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *
16ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo *
28ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo */
29ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
30ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#ifndef LOC_ENG_H
31ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#define LOC_ENG_H
32ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
33ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#ifdef __cplusplus
34ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoextern "C" {
35ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#endif /* __cplusplus */
36ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
37ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo// Uncomment to keep all LOG messages (LOGD, LOGI, LOGV, etc.)
38ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#define MAX_NUM_ATL_CONNECTIONS  2
39ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
40ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo// Define boolean type to be used by libgps on loc api module
41ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russotypedef unsigned char boolean;
42ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
43ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#ifndef TRUE
44ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#define TRUE 1
45ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#endif
46ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
47ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#ifndef FALSE
48ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#define FALSE 0
49ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#endif
50ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
51ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#include <loc.h>
52ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#include <loc_eng_xtra.h>
53ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#include <loc_eng_ni.h>
54ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#include <loc_eng_agps.h>
55ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#include <loc_cfg.h>
56ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#include <loc_log.h>
57ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#include <log_util.h>
58ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#include <loc_eng_agps.h>
59ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#include <LocEngAdapter.h>
60ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
61ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo// The data connection minimal open time
62ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#define DATA_OPEN_MIN_TIME        1  /* sec */
63ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
64ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo// The system sees GPS engine turns off after inactive for this period of time
65ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#define GPS_AUTO_OFF_TIME         2  /* secs */
66ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#define SUCCESS              TRUE
67ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#define FAILURE                 FALSE
68ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#define INVALID_ATL_CONNECTION_HANDLE -1
69ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
7045b9829dc0a97fc69798a72a6cf238c8c0db69c8Dante Russo#define MAX_XTRA_SERVER_URL_LENGTH 256
7145b9829dc0a97fc69798a72a6cf238c8c0db69c8Dante Russo
72ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoenum loc_nmea_provider_e_type {
73ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    NMEA_PROVIDER_AP = 0, // Application Processor Provider of NMEA
74ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    NMEA_PROVIDER_MP // Modem Processor Provider of NMEA
75ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo};
76ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
77ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoenum loc_mute_session_e_type {
78ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo   LOC_MUTE_SESS_NONE = 0,
79ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo   LOC_MUTE_SESS_WAIT,
80ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo   LOC_MUTE_SESS_IN_SESSION
81ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo};
82ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
83ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo// Module data
84ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russotypedef struct loc_eng_data_s
85ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo{
86ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    LocEngAdapter                  *adapter;
87ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    loc_location_cb_ext            location_cb;
88ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    gps_status_callback            status_cb;
89ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    loc_sv_status_cb_ext           sv_status_cb;
90ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    agps_status_extended           agps_status_cb;
91ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    gps_nmea_callback              nmea_cb;
92ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    gps_ni_notify_callback         ni_notify_cb;
93ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    gps_acquire_wakelock           acquire_wakelock_cb;
94ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    gps_release_wakelock           release_wakelock_cb;
95ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    gps_request_utc_time           request_utc_time_cb;
96ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    boolean                        intermediateFix;
97ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    AGpsStatusValue                agps_status;
98ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    loc_eng_xtra_data_s_type       xtra_module_data;
99ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    loc_eng_ni_data_s_type         loc_eng_ni_data;
100ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
101ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    // AGPS state machines
102ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    AgpsStateMachine*              agnss_nif;
103ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    AgpsStateMachine*              internet_nif;
104ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    AgpsStateMachine*              wifi_nif;
105ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    //State machine for Data Services
106ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    AgpsStateMachine*              ds_nif;
107ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
108ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    // GPS engine status
109ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    GpsStatusValue                 engine_status;
110ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    GpsStatusValue                 fix_session_status;
111ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
112ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    // Aiding data information to be deleted, aiding data can only be deleted when GPS engine is off
113ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    GpsAidingData                  aiding_data_for_deletion;
114ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
115ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    // For muting session broadcast
116ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    loc_mute_session_e_type        mute_session_state;
117ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
118ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    // For nmea generation
119ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    boolean generateNmea;
120ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    uint32_t sv_used_mask;
121ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    float hdop;
122ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    float pdop;
123ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    float vdop;
124ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
125ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    // Address buffers, for addressing setting before init
126ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    int    supl_host_set;
127ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    char   supl_host_buf[101];
128ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    int    supl_port_buf;
129ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    int    c2k_host_set;
130ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    char   c2k_host_buf[101];
131ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    int    c2k_port_buf;
132ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    int    mpc_host_set;
133ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    char   mpc_host_buf[101];
134ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    int    mpc_port_buf;
135ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
136ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    loc_ext_parser location_ext_parser;
137ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    loc_ext_parser sv_ext_parser;
138ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo} loc_eng_data_s_type;
139ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
140ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo/* GPS.conf support */
141ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russotypedef struct loc_gps_cfg_s
142ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo{
143ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  INTERMEDIATE_POS;
144ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  ACCURACY_THRES;
145ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  ENABLE_WIPER;
146ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SUPL_VER;
147ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  CAPABILITIES;
148ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  QUIPC_ENABLED;
149ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  LPP_PROFILE;
150ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    uint8_t        NMEA_PROVIDER;
151ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  A_GLONASS_POS_PROTOCOL_SELECT;
15245b9829dc0a97fc69798a72a6cf238c8c0db69c8Dante Russo    char           XTRA_SERVER_1[MAX_XTRA_SERVER_URL_LENGTH];
15345b9829dc0a97fc69798a72a6cf238c8c0db69c8Dante Russo    char           XTRA_SERVER_2[MAX_XTRA_SERVER_URL_LENGTH];
15445b9829dc0a97fc69798a72a6cf238c8c0db69c8Dante Russo    char           XTRA_SERVER_3[MAX_XTRA_SERVER_URL_LENGTH];
155ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo} loc_gps_cfg_s_type;
156ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
157ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russotypedef struct
158ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo{
159ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    uint8_t        GYRO_BIAS_RANDOM_WALK_VALID;
160ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    double         GYRO_BIAS_RANDOM_WALK;
161ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_ACCEL_BATCHES_PER_SEC;
162ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_ACCEL_SAMPLES_PER_BATCH;
163ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_GYRO_BATCHES_PER_SEC;
164ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_GYRO_SAMPLES_PER_BATCH;
165ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_ACCEL_BATCHES_PER_SEC_HIGH;
166ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_ACCEL_SAMPLES_PER_BATCH_HIGH;
167ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_GYRO_BATCHES_PER_SEC_HIGH;
168ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_GYRO_SAMPLES_PER_BATCH_HIGH;
169ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_CONTROL_MODE;
170ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_USAGE;
171ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    unsigned long  SENSOR_ALGORITHM_CONFIG_MASK;
172ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    uint8_t        ACCEL_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
173ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    double         ACCEL_RANDOM_WALK_SPECTRAL_DENSITY;
174ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    uint8_t        ANGLE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
175ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    double         ANGLE_RANDOM_WALK_SPECTRAL_DENSITY;
176ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    uint8_t        RATE_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
177ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    double         RATE_RANDOM_WALK_SPECTRAL_DENSITY;
178ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    uint8_t        VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY_VALID;
179ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo    double         VELOCITY_RANDOM_WALK_SPECTRAL_DENSITY;
180ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo} loc_sap_cfg_s_type;
181ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
182ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoextern loc_gps_cfg_s_type gps_conf;
183ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoextern loc_sap_cfg_s_type sap_conf;
184ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
185ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_init(loc_eng_data_s_type &loc_eng_data,
186ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                  LocCallbacks* callbacks,
187ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                  LOC_API_ADAPTER_EVENT_MASK_T event);
188ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_start(loc_eng_data_s_type &loc_eng_data);
189ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_stop(loc_eng_data_s_type &loc_eng_data);
190ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russovoid loc_eng_cleanup(loc_eng_data_s_type &loc_eng_data);
191ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_inject_time(loc_eng_data_s_type &loc_eng_data,
192ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                         GpsUtcTime time, int64_t timeReference,
193ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                         int uncertainty);
194ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data,
195ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                             double latitude, double longitude,
196ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                             float accuracy);
197ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russovoid loc_eng_delete_aiding_data(loc_eng_data_s_type &loc_eng_data,
198ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                                GpsAidingData f);
199ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_set_position_mode(loc_eng_data_s_type &loc_eng_data,
200ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                               LocPosMode &params);
201ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoconst void* loc_eng_get_extension(loc_eng_data_s_type &loc_eng_data,
202ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                                  const char* name);
203ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russovoid loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data,
204ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                       AGpsExtCallbacks* callbacks);
205ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_agps_open(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType,
206ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                      const char* apn, AGpsBearerType bearerType);
207ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_agps_closed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType);
208ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_agps_open_failed(loc_eng_data_s_type &loc_eng_data, AGpsExtType agpsType);
209ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
210ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint  loc_eng_set_server_proxy(loc_eng_data_s_type &loc_eng_data,
211ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                              LocServerType type, const char *hostname, int port);
212ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
213ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
214ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russovoid loc_eng_agps_ril_update_network_availability(loc_eng_data_s_type &loc_eng_data,
215ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                                                  int avaiable, const char* apn);
216ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
217ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
218ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russobool loc_eng_inject_raw_command(loc_eng_data_s_type &loc_eng_data,
219ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                                char* command, int length);
220ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
221ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
222ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russovoid loc_eng_mute_one_session(loc_eng_data_s_type &loc_eng_data);
223ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
224ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint loc_eng_xtra_init (loc_eng_data_s_type &loc_eng_data,
225ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                       GpsXtraExtCallbacks* callbacks);
226ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
227ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint loc_eng_xtra_inject_data(loc_eng_data_s_type &loc_eng_data,
228ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                             char* data, int length);
229ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
230ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint loc_eng_xtra_request_server(loc_eng_data_s_type &loc_eng_data);
231ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
232ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoextern void loc_eng_ni_init(loc_eng_data_s_type &loc_eng_data,
233ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                            GpsNiExtCallbacks *callbacks);
234ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoextern void loc_eng_ni_respond(loc_eng_data_s_type &loc_eng_data,
235ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                               int notif_id, GpsUserResponseType user_response);
236ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoextern void loc_eng_ni_request_handler(loc_eng_data_s_type &loc_eng_data,
237ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                                   const GpsNiNotification *notif,
238ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo                                   const void* passThrough);
239ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoextern void loc_eng_ni_reset_on_engine_restart(loc_eng_data_s_type &loc_eng_data);
240ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russoint loc_eng_read_config(void);
241ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
242ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#ifdef __cplusplus
243ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo}
244ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#endif /* __cplusplus */
245ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo
246ec6e5d3a2597d37d5b1d98911cb06218cdf19bf1Dante Russo#endif // LOC_ENG_H
247