1f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. 2f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * 3f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * Redistribution and use in source and binary forms, with or without 4f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * modification, are permitted provided that the following conditions are 5f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * met: 6f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * * Redistributions of source code must retain the above copyright 7f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * notice, this list of conditions and the following disclaimer. 8f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * * Redistributions in binary form must reproduce the above 9f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * copyright notice, this list of conditions and the following 10f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * disclaimer in the documentation and/or other materials provided 11f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * with the distribution. 12f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * * Neither the name of Code Aurora Forum, Inc. nor the names of its 13f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * contributors may be used to endorse or promote products derived 14f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * from this software without specific prior written permission. 15f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * 16f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani * 28f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani */ 29f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#ifndef LOC_API_ADAPTER_H 30f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_H 31f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 32f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#include <ctype.h> 33f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#include <hardware/gps.h> 34f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#include <loc.h> 35f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#include <log_util.h> 36f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 37f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define MIN_POSSIBLE_FIX_INTERVAL 1000 /* msec */ 38f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 39f77c85bb51137f5ba854184e5e9194197027438aAjay Dudanienum loc_api_adapter_err { 40f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_SUCCESS = 0, 41f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_GENERAL_FAILURE = 1, 42f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_UNSUPPORTED = 2, 43f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_INVALID_HANDLE = 4, 44f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_INVALID_PARAMETER = 5, 45f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_ENGINE_BUSY = 6, 46f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_PHONE_OFFLINE = 7, 47f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_TIMEOUT = 8, 48f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_SERVICE_NOT_PRESENT = 9, 49f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 50f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_ENGINE_DOWN = 100, 51f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_FAILURE, 52f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_ERR_UNKNOWN 53f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani}; 54f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 55f77c85bb51137f5ba854184e5e9194197027438aAjay Dudanienum loc_api_adapter_event_index { 56f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_REPORT_POSITION = 0, // Position report comes in loc_parsed_position_s_type 57f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_REPORT_SATELLITE, // Satellite in view report 58f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_REPORT_NMEA_1HZ, // NMEA report at 1HZ rate 59f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_REPORT_NMEA_POSITION, // NMEA report at position report rate 60f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_REQUEST_NI_NOTIFY_VERIFY, // NI notification/verification request 61f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_REQUEST_ASSISTANCE_DATA, // Assistance data, eg: time, predicted orbits request 62f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_REQUEST_LOCATION_SERVER, // Request for location server 63f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_REPORT_IOCTL, // Callback report for loc_ioctl 64f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_REPORT_STATUS, // Misc status report: eg, engine state 65f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 66f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_EVENT_MAX 67f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani}; 68f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 69f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_BIT_PARSED_POSITION_REPORT (1<<LOC_API_ADAPTER_REPORT_POSITION) 70f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_BIT_SATELLITE_REPORT (1<<LOC_API_ADAPTER_REPORT_SATELLITE) 71f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_BIT_NMEA_1HZ_REPORT (1<<LOC_API_ADAPTER_REPORT_NMEA_1HZ) 72f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_BIT_NMEA_POSITION_REPORT (1<<LOC_API_ADAPTER_REPORT_NMEA_POSITION) 73f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_BIT_NI_NOTIFY_VERIFY_REQUEST (1<<LOC_API_ADAPTER_REQUEST_NI_NOTIFY_VERIFY) 74f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_BIT_ASSISTANCE_DATA_REQUEST (1<<LOC_API_ADAPTER_REQUEST_ASSISTANCE_DATA) 75f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST (1<<LOC_API_ADAPTER_REQUEST_LOCATION_SERVER) 76f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_BIT_IOCTL_REPORT (1<<LOC_API_ADAPTER_REPORT_IOCTL) 77f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#define LOC_API_ADAPTER_BIT_STATUS_REPORT (1<<LOC_API_ADAPTER_REPORT_STATUS) 78f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 79f77c85bb51137f5ba854184e5e9194197027438aAjay Dudanitypedef unsigned int LOC_API_ADAPTER_EVENT_MASK_T; 80f77c85bb51137f5ba854184e5e9194197027438aAjay Dudanitypedef void (*loc_msg_sender)(void* loc_eng_data_p, void* msgp); 81f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 82f77c85bb51137f5ba854184e5e9194197027438aAjay Dudanistruct LocEng { 83f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void* owner; 84f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_EVENT_MASK_T eventMask; 85f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani const gps_acquire_wakelock acquireWakelock; 86f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani const gps_release_wakelock releaseWakeLock; 87f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani const loc_msg_sender sendMsge; 88f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani const loc_ext_parser extPosInfo; 89f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani const loc_ext_parser extSvInfo; 90f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 91f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LocEng(void* caller, 92f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LOC_API_ADAPTER_EVENT_MASK_T emask, 93f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani gps_acquire_wakelock acqwl, 94f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani gps_release_wakelock relwl, 95f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani loc_msg_sender msgSender, 96f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani loc_ext_parser posParser, 97f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani loc_ext_parser svParser); 98f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani}; 99f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 100f77c85bb51137f5ba854184e5e9194197027438aAjay Dudaniclass LocApiAdapter { 101f77c85bb51137f5ba854184e5e9194197027438aAjay Dudaniprotected: 102f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani const LocEng locEngHandle; 103f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 104f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LocApiAdapter(LocEng &locEng); 105f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 106f77c85bb51137f5ba854184e5e9194197027438aAjay Dudanipublic: 107f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani //LocApiAdapter(int q, reportCb_t[LOC_API_ADAPTER_EVENT_MAX] callbackTable); 108f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani virtual ~LocApiAdapter(); 109f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 110197fe088f73d03b66dcf4d02e1f454ff89f70fa7Ajay Dudani static LocApiAdapter* getLocApiAdapter(LocEng &locEng); 111197fe088f73d03b66dcf4d02e1f454ff89f70fa7Ajay Dudani 112f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani static int hexcode(char *hexstring, int string_size, 113f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani const char *data, int data_size); 114f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani static int decodeAddress(char *addr_string, int string_size, 115f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani const char *data, int data_size); 116f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 117f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void reportPosition(GpsLocation &location, 118f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void* locationExt, 119f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani enum loc_sess_status status); 120f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void reportSv(GpsSvStatus &svStatus, void* svExt); 121f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void reportStatus(GpsStatusValue status); 122f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void reportNmea(const char* nmea, int length); 123f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void reportAgpsStatus(AGpsStatus &agpsStatus); 124f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void requestXtraData(); 125f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void requestTime(); 126f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void requestLocation(); 127f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void requestATL(int connHandle, AGpsType agps_type); 128f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void releaseATL(int connHandle); 129f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void requestNiNotify(GpsNiNotification ¬ify, const void* data); 130f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void handleEngineDownEvent(); 131f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani void handleEngineUpEvent(); 132f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 133f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani // All below functions are to be defined by adapter specific modules: 134f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani // RPC, QMI, etc. The default implementation is empty. 135f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 136f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani reinit() 137f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 138f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 139f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani startFix() 140f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 141f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 142f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani stopFix() 143f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 144f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 145f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani deleteAidingData(GpsAidingData f) 146f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 147f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 148f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani enableData(int enable) 149f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 150f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 151f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setAPN(char* apn, int len) 152f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 153f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 154f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani injectPosition(double latitude, double longitude, float accuracy) 155f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 156f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 157f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setTime(GpsUtcTime time, int64_t timeReference, int uncertainty) 158f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 159f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 160f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setXtraData(char* data, int length) 161f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 162f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#ifdef QCOM_FEATURE_IPV6 163f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 164f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani atlOpenStatus(int handle, int is_succ, char* apn, AGpsBearerType bear, AGpsType agpsType) 165f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 166f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#else 167f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 168f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani atlOpenStatus(int handle, int is_succ, char* apn, AGpsType agpsType) 169f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 170f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#endif 171f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 172f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani atlCloseStatus(int handle, int is_succ) 173f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 174f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 175f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setPositionMode(LocPositionMode mode, GpsPositionRecurrence recurrence, 176f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani uint32_t min_interval, uint32_t preferred_accuracy, 177f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani uint32_t preferred_time) 178f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 179f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 180f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setServer(const char* url, int len) 181f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 182f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 183f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setServer(unsigned int ip, int port, 184f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani LocServerType type) 185f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 186f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 187f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani informNiResponse(GpsUserResponseType userResponse, const void* passThroughData) 188f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 189f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 190f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setSUPLVersion(uint32_t version) 191f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 192f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 193f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setSensorControlConfig(int sensorUsage) 194f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 195f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 196f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setSensorProperties(float gyroBiasVarianceRandomWalk) 197f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 198f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani inline virtual enum loc_api_adapter_err 199f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani setSensorPerfControlConfig(int controlMode, int accelSamplesPerBatch, int accelBatchesPerSec, 200f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani int gyroSamplesPerBatch, int gyroBatchesPerSec) 201f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani {LOC_LOGW("%s: default implementation invoked", __func__); return LOC_API_ADAPTER_ERR_SUCCESS;} 202f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani}; 203f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 204197fe088f73d03b66dcf4d02e1f454ff89f70fa7Ajay Dudaniextern "C" LocApiAdapter* getLocApiAdapter(LocEng &locEng); 205f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 206197fe088f73d03b66dcf4d02e1f454ff89f70fa7Ajay Dudanitypedef LocApiAdapter* (getLocApiAdapter_t)(LocEng&); 207f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani 208f77c85bb51137f5ba854184e5e9194197027438aAjay Dudani#endif //LOC_API_RPC_ADAPTER_H 209