1b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel/* Copyright (c) 2017 The Linux Foundation. All rights reserved. 2b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * 3b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * Redistribution and use in source and binary forms, with or without 4b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * modification, are permitted provided that the following conditions are 5b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * met: 6b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * * Redistributions of source code must retain the above copyright 7b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * notice, this list of conditions and the following disclaimer. 8b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * * Redistributions in binary form must reproduce the above 9b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * copyright notice, this list of conditions and the following 10b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * disclaimer in the documentation and/or other materials provided 11b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * with the distribution. 12b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * * Neither the name of The Linux Foundation nor the names of its 13b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * contributors may be used to endorse or promote products derived 14b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * from this software without specific prior written permission. 15b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * 16b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel */ 28b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel 29b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel#ifndef LOCATION_INTERFACE_H 30b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel#define LOCATION_INTERFACE_H 31b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel 32b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel#include <LocationAPI.h> 33b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel 34b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudelstruct GnssInterface { 35b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel size_t size; 36b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*initialize)(void); 37b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*deinitialize)(void); 38b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); 39b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*removeClient)(LocationAPI* client); 40b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*requestCapabilities)(LocationAPI* client); 41b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel uint32_t (*startTracking)(LocationAPI* client, LocationOptions& options); 42b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, LocationOptions& options); 43b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*stopTracking)(LocationAPI* client, uint32_t id); 44b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*gnssNiResponse)(LocationAPI* client, uint32_t id, GnssNiResponse response); 45b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*setControlCallbacks)(LocationControlCallbacks& controlCallbacks); 46b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel uint32_t (*enable)(LocationTechnologyType techType); 47b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*disable)(uint32_t id); 48b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel uint32_t* (*gnssUpdateConfig)(GnssConfig config); 49b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel uint32_t (*gnssDeleteAidingData)(GnssAidingData& data); 50b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*injectLocation)(double latitude, double longitude, float accuracy); 51b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*injectTime)(int64_t time, int64_t timeReference, int32_t uncertainty); 52b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*agpsInit)(void* statusV4Cb); 53b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*agpsDataConnOpen)(short agpsType, const char* apnName, int apnLen, int ipType); 54b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*agpsDataConnClosed)(short agpsType); 55b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*agpsDataConnFailed)(short agpsType); 56d384ff095adb1231bf2c5a79e26d1abef8a1ff77Thierry Strudel void (*getDebugReport)(GnssDebugReport& report); 57b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel}; 58b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel 59b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudelstruct FlpInterface { 60b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel size_t size; 61b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*initialize)(void); 62b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*deinitialize)(void); 63b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); 64b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*removeClient)(LocationAPI* client); 65b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*requestCapabilities)(LocationAPI* client); 66b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel uint32_t (*startTracking)(LocationAPI* client, LocationOptions& options); 67b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*updateTrackingOptions)(LocationAPI* client, uint32_t id, LocationOptions& options); 68b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*stopTracking)(LocationAPI* client, uint32_t id); 69b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel uint32_t (*startBatching)(LocationAPI* client, LocationOptions&); 70b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*stopBatching)(LocationAPI* client, uint32_t id); 71b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*updateBatchingOptions)(LocationAPI* client, uint32_t id, LocationOptions&); 72b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*getBatchedLocations)(LocationAPI* client, uint32_t id, size_t count); 73b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*getPowerStateChanges)(void* powerStateCb); 74b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel}; 75b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel 76b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudelstruct GeofenceInterface { 77b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel size_t size; 78b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*initialize)(void); 79b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*deinitialize)(void); 80b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*addClient)(LocationAPI* client, const LocationCallbacks& callbacks); 81b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*removeClient)(LocationAPI* client); 82b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*requestCapabilities)(LocationAPI* client); 83b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel uint32_t* (*addGeofences)(LocationAPI* client, size_t count, GeofenceOption*, GeofenceInfo*); 84b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*removeGeofences)(LocationAPI* client, size_t count, uint32_t* ids); 85b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*modifyGeofences)(LocationAPI* client, size_t count, uint32_t* ids, 86b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel GeofenceOption* options); 87b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*pauseGeofences)(LocationAPI* client, size_t count, uint32_t* ids); 88b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel void (*resumeGeofences)(LocationAPI* client, size_t count, uint32_t* ids); 89b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel}; 90b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel 91b4dcb0e3da7f3f737289d237b53b6b5e904b5284Thierry Strudel#endif /* LOCATION_INTERFACE_H */ 92