LocationAPI.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. /* Copyright (c) 2017-2021 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. #ifndef LOCATIONAPI_H
  29. #define LOCATIONAPI_H
  30. #include "ILocationAPI.h"
  31. class LocationAPI : public ILocationAPI
  32. {
  33. private:
  34. LocationAPI();
  35. ~LocationAPI();
  36. public:
  37. /* creates an instance to LocationAPI object.
  38. Will return NULL if mandatory parameters are invalid or if the maximum number
  39. of instances have been reached */
  40. static LocationAPI* createInstance(LocationCallbacks&);
  41. /* destroy/cleans up the instance, which should be called when LocationControlAPI object is
  42. no longer needed. LocationControlAPI* returned from createInstance will no longer valid
  43. after destroy is called.
  44. If the caller allocates the memory for LocationControlCallbacks used in
  45. LocationControlAPI::createInstance, then the caller must ensure that the memory still remains
  46. valid until destroyCompleteCb is invoked.
  47. */
  48. void destroy(locationApiDestroyCompleteCallback destroyCompleteCb=nullptr);
  49. void onRemoveClientCompleteCb (LocationAdapterTypeMask adapterType);
  50. /* updates/changes the callbacks that will be called.
  51. mandatory callbacks must be present for callbacks to be successfully updated
  52. no return value */
  53. virtual void updateCallbacks(LocationCallbacks&) override;
  54. /* ================================== TRACKING ================================== */
  55. /* startTracking starts a tracking session, which returns a session id that will be
  56. used by the other tracking APIs and also in the responseCallback to match command
  57. with response. locations are reported on the trackingCallback passed in createInstance
  58. periodically according to LocationOptions.
  59. responseCallback returns:
  60. LOCATION_ERROR_SUCCESS if session was successfully started
  61. LOCATION_ERROR_ALREADY_STARTED if a startTracking session is already in progress
  62. LOCATION_ERROR_CALLBACK_MISSING if no trackingCallback was passed in createInstance
  63. LOCATION_ERROR_INVALID_PARAMETER if TrackingOptions parameter is invalid */
  64. virtual uint32_t startTracking(TrackingOptions&) override;
  65. /* stopTracking stops a tracking session associated with id parameter.
  66. responseCallback returns:
  67. LOCATION_ERROR_SUCCESS if successful
  68. LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */
  69. virtual void stopTracking(uint32_t id) override;
  70. /* updateTrackingOptions changes the TrackingOptions of a tracking session associated with id
  71. responseCallback returns:
  72. LOCATION_ERROR_SUCCESS if successful
  73. LOCATION_ERROR_INVALID_PARAMETER if TrackingOptions parameters are invalid
  74. LOCATION_ERROR_ID_UNKNOWN if id is not associated with a tracking session */
  75. virtual void updateTrackingOptions(uint32_t id, TrackingOptions&) override;
  76. /* ================================== BATCHING ================================== */
  77. /* startBatching starts a batching session, which returns a session id that will be
  78. used by the other batching APIs and also in the responseCallback to match command
  79. with response. locations are reported on the batchingCallback passed in createInstance
  80. periodically according to LocationOptions. A batching session starts tracking on
  81. the low power processor and delivers them in batches by the batchingCallback when
  82. the batch is full or when getBatchedLocations is called. This allows for the processor
  83. that calls this API to sleep when the low power processor can batch locations in the
  84. backgroup and wake up the processor calling the API only when the batch is full, thus
  85. saving power
  86. responseCallback returns:
  87. LOCATION_ERROR_SUCCESS if session was successful
  88. LOCATION_ERROR_ALREADY_STARTED if a startBatching session is already in progress
  89. LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback was passed in createInstance
  90. LOCATION_ERROR_INVALID_PARAMETER if a parameter is invalid
  91. LOCATION_ERROR_NOT_SUPPORTED if batching is not supported */
  92. virtual uint32_t startBatching(BatchingOptions&) override;
  93. /* stopBatching stops a batching session associated with id parameter.
  94. responseCallback returns:
  95. LOCATION_ERROR_SUCCESS if successful
  96. LOCATION_ERROR_ID_UNKNOWN if id is not associated with batching session */
  97. virtual void stopBatching(uint32_t id) override;
  98. /* updateBatchingOptions changes the BatchingOptions of a batching session associated with id
  99. responseCallback returns:
  100. LOCATION_ERROR_SUCCESS if successful
  101. LOCATION_ERROR_INVALID_PARAMETER if BatchingOptions parameters are invalid
  102. LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */
  103. virtual void updateBatchingOptions(uint32_t id, BatchingOptions&) override;
  104. /* getBatchedLocations gets a number of locations that are currently stored/batched
  105. on the low power processor, delivered by the batchingCallback passed in createInstance.
  106. Location are then deleted from the batch stored on the low power processor.
  107. responseCallback returns:
  108. LOCATION_ERROR_SUCCESS if successful, will be followed by batchingCallback call
  109. LOCATION_ERROR_CALLBACK_MISSING if no batchingCallback was passed in createInstance
  110. LOCATION_ERROR_ID_UNKNOWN if id is not associated with a batching session */
  111. virtual void getBatchedLocations(uint32_t id, size_t count) override;
  112. /* ================================== GEOFENCE ================================== */
  113. /* addGeofences adds any number of geofences and returns an array of geofence ids that
  114. will be used by the other geofence APIs and also in the collectiveResponseCallback to
  115. match command with response. The geofenceBreachCallback will deliver the status of each
  116. geofence according to the GeofenceOption for each. The geofence id array returned will
  117. be valid until the collectiveResponseCallback is called and has returned.
  118. collectiveResponseCallback returns:
  119. LOCATION_ERROR_SUCCESS if session was successful
  120. LOCATION_ERROR_CALLBACK_MISSING if no geofenceBreachCallback
  121. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  122. LOCATION_ERROR_NOT_SUPPORTED if geofence is not supported */
  123. virtual uint32_t* addGeofences(size_t count, GeofenceOption*, GeofenceInfo*) override;
  124. /* removeGeofences removes any number of geofences. Caller should delete ids array after
  125. removeGeofences returneds.
  126. collectiveResponseCallback returns:
  127. LOCATION_ERROR_SUCCESS if successful
  128. LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */
  129. virtual void removeGeofences(size_t count, uint32_t* ids) override;
  130. /* modifyGeofences modifies any number of geofences. Caller should delete ids array after
  131. modifyGeofences returns.
  132. collectiveResponseCallback returns:
  133. LOCATION_ERROR_SUCCESS if successful
  134. LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session
  135. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid */
  136. virtual void modifyGeofences(size_t count, uint32_t* ids, GeofenceOption* options) override;
  137. /* pauseGeofences pauses any number of geofences, which is similar to removeGeofences,
  138. only that they can be resumed at any time. Caller should delete ids array after
  139. pauseGeofences returns.
  140. collectiveResponseCallback returns:
  141. LOCATION_ERROR_SUCCESS if successful
  142. LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */
  143. virtual void pauseGeofences(size_t count, uint32_t* ids) override;
  144. /* resumeGeofences resumes any number of geofences that are currently paused. Caller should
  145. delete ids array after resumeGeofences returns.
  146. collectiveResponseCallback returns:
  147. LOCATION_ERROR_SUCCESS if successful
  148. LOCATION_ERROR_ID_UNKNOWN if id is not associated with a geofence session */
  149. virtual void resumeGeofences(size_t count, uint32_t* ids) override;
  150. /* ================================== GNSS ====================================== */
  151. /* gnssNiResponse is called in response to a gnssNiCallback.
  152. responseCallback returns:
  153. LOCATION_ERROR_SUCCESS if session was successful
  154. LOCATION_ERROR_INVALID_PARAMETER if any parameters in GnssNiResponse are invalid
  155. LOCATION_ERROR_ID_UNKNOWN if id does not match a gnssNiCallback */
  156. virtual void gnssNiResponse(uint32_t id, GnssNiResponse response) override;
  157. /* ================================== NETWORK PROVIDER =========================== */
  158. /* enableNetworkProvider enables Network Provider */
  159. virtual void enableNetworkProvider();
  160. /* disableNetworkProvider disables Network Provider */
  161. virtual void disableNetworkProvider();
  162. /* startNetworkLocation starts tracking session for
  163. network location request */
  164. virtual void startNetworkLocation(trackingCallback* callback);
  165. /* stopNetworkLocation stops the ongoing tracking session for
  166. network location request */
  167. virtual void stopNetworkLocation(trackingCallback* callback);
  168. };
  169. typedef struct {
  170. size_t size; // set to sizeof(LocationControlCallbacks)
  171. responseCallback responseCb; // mandatory
  172. collectiveResponseCallback collectiveResponseCb; // mandatory
  173. gnssConfigCallback gnssConfigCb; // optional
  174. } LocationControlCallbacks;
  175. class LocationControlAPI : public ILocationControlAPI
  176. {
  177. private:
  178. LocationControlAPI();
  179. ~LocationControlAPI();
  180. public:
  181. /* creates an instance to LocationControlAPI object.
  182. Will return NULL if mandatory parameters are invalid or if the maximum number
  183. of instances have been reached. Only once instance allowed */
  184. static LocationControlAPI* createInstance(LocationControlCallbacks&);
  185. static LocationControlAPI* getInstance();
  186. /* destroy/cleans up the instance, which should be called when LocationControlAPI object is
  187. no longer needed. LocationControlAPI* returned from createInstance will no longer valid
  188. after destroy is called */
  189. void destroy();
  190. /* enable will enable specific location technology to be used for calculation locations and
  191. will effectively start a control session if call is successful, which returns a session id
  192. that will be returned in responseCallback to match command with response. The session id is
  193. also needed to call the disable command.
  194. This effect is global for all clients of LocationAPI
  195. responseCallback returns:
  196. LOCATION_ERROR_SUCCESS if successful
  197. LOCATION_ERROR_ALREADY_STARTED if an enable was already called for this techType
  198. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  199. LOCATION_ERROR_GENERAL_FAILURE if failure for any other reason */
  200. uint32_t enable(LocationTechnologyType techType);
  201. /* disable will disable specific location technology to be used for calculation locations and
  202. effectively ends the control session if call is successful.
  203. id parameter is the session id that was returned in enable responseCallback for techType.
  204. The session id is no longer valid after disable's responseCallback returns success.
  205. This effect is global for all clients of LocationAPI
  206. responseCallback returns:
  207. LOCATION_ERROR_SUCCESS if successful
  208. LOCATION_ERROR_ID_UNKNOWN if id was not returned from responseCallback from enable
  209. LOCATION_ERROR_GENERAL_FAILURE if failure for any other reason */
  210. void disable(uint32_t id);
  211. /* gnssUpdateConfig updates the gnss specific configuration, which returns a session id array
  212. with an id for each of the bits set in GnssConfig.flags, order from low bits to high bits.
  213. The response for each config that is set will be returned in collectiveResponseCallback.
  214. The session id array returned will be valid until the collectiveResponseCallback is called
  215. and has returned. This effect is global for all clients of LocationAPI
  216. collectiveResponseCallback returns:
  217. LOCATION_ERROR_SUCCESS if session was successful
  218. LOCATION_ERROR_INVALID_PARAMETER if any other parameters are invalid
  219. LOCATION_ERROR_GENERAL_FAILURE if failure for any other reason
  220. PLEASE NOTE: It is caller's resposibility to FREE the memory of the return value.
  221. The memory must be freed by delete [].*/
  222. virtual uint32_t* gnssUpdateConfig(const GnssConfig& config) override;
  223. /* gnssGetConfig fetches the current constellation and SV configuration
  224. on the GNSS engine.
  225. Returns a session id array with an id for each of the bits set in
  226. the mask parameter, order from low bits to high bits.
  227. Response is sent via the registered gnssConfigCallback.
  228. This effect is global for all clients of LocationAPI
  229. collectiveResponseCallback returns:
  230. LOCATION_ERROR_SUCCESS if session was successful
  231. LOCATION_ERROR_INVALID_PARAMETER if any parameter is invalid
  232. LOCATION_ERROR_CALLBACK_MISSING If no gnssConfigCallback
  233. was passed in createInstance
  234. LOCATION_ERROR_NOT_SUPPORTED If read of requested configuration
  235. is not supported
  236. PLEASE NOTE: It is caller's resposibility to FREE the memory of the return value.
  237. The memory must be freed by delete [].*/
  238. uint32_t* gnssGetConfig(GnssConfigFlagsMask mask);
  239. /* delete specific gnss aiding data for testing, which returns a session id
  240. that will be returned in responseCallback to match command with response.
  241. Only allowed in userdebug builds. This effect is global for all clients of LocationAPI
  242. responseCallback returns:
  243. LOCATION_ERROR_SUCCESS if successful
  244. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  245. LOCATION_ERROR_NOT_SUPPORTED if build is not userdebug */
  246. virtual uint32_t gnssDeleteAidingData(GnssAidingData& data) override;
  247. /** @brief
  248. Configure the constellation and SVs to be used by the GNSS engine on
  249. modem.
  250. @param
  251. constellationEnablementConfig: configuration to enable/disable SV
  252. constellation to be used by SPE engine. When size in
  253. constellationEnablementConfig is set to 0, this indicates to reset SV
  254. constellation configuration to modem NV default.
  255. blacklistSvConfig: configuration to blacklist or unblacklist SVs
  256. used by SPE engine
  257. @return
  258. A session id that will be returned in responseCallback to
  259. match command with response. This effect is global for all
  260. clients of LocationAPI responseCallback returns:
  261. LOCATION_ERROR_SUCCESS if successful
  262. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  263. */
  264. virtual uint32_t configConstellations(
  265. const GnssSvTypeConfig& constellationEnablementConfig,
  266. const GnssSvIdConfig& blacklistSvConfig) override;
  267. /** @brief
  268. Configure the secondary band of constellations to be used by
  269. the GNSS engine on modem.
  270. @param
  271. secondaryBandConfig: configuration the secondary band usage
  272. for SPE engine
  273. @return
  274. A session id that will be returned in responseCallback to
  275. match command with response. This effect is global for all
  276. clients of LocationAPI responseCallback returns:
  277. LOCATION_ERROR_SUCCESS if successful
  278. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  279. */
  280. virtual uint32_t configConstellationSecondaryBand(
  281. const GnssSvTypeConfig& secondaryBandConfig) override;
  282. /** @brief
  283. Enable or disable the constrained time uncertainty feature.
  284. @param
  285. enable: true to enable the constrained time uncertainty
  286. feature and false to disable the constrainted time
  287. uncertainty feature.
  288. @param
  289. tuncThreshold: this specifies the time uncertainty threshold
  290. that gps engine need to maintain, in units of milli-seconds.
  291. Default is 0.0 meaning that modem default value of time
  292. uncertainty threshold will be used. This parameter is
  293. ignored when requesting to disable this feature.
  294. @param
  295. energyBudget: this specifies the power budget that gps
  296. engine is allowed to spend to maintain the time uncertainty.
  297. Default is 0 meaning that GPS engine is not constained by
  298. power budget and can spend as much power as needed. The
  299. parameter need to be specified in units of 0.1 milli watt
  300. second. This parameter is ignored requesting to disable this
  301. feature.
  302. @return
  303. A session id that will be returned in responseCallback to
  304. match command with response. This effect is global for all
  305. clients of LocationAPI responseCallback returns:
  306. LOCATION_ERROR_SUCCESS if successful
  307. LOCATION_ERROR_INVALID_PARAMETER if any parameters
  308. are invalid
  309. */
  310. virtual uint32_t configConstrainedTimeUncertainty(
  311. bool enable, float tuncThreshold = 0.0,
  312. uint32_t energyBudget = 0) override;
  313. /** @brief
  314. Enable or disable position assisted clock estimator feature.
  315. @param
  316. enable: true to enable position assisted clock estimator and
  317. false to disable the position assisted clock estimator
  318. feature.
  319. @return
  320. A session id that will be returned in responseCallback to
  321. match command with response. This effect is global for all
  322. clients of LocationAPI responseCallback returns:
  323. LOCATION_ERROR_SUCCESS if successful
  324. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  325. */
  326. virtual uint32_t configPositionAssistedClockEstimator(bool enable) override;
  327. /** @brief
  328. Sets the lever arm parameters for the vehicle.
  329. @param
  330. configInfo: lever arm configuration info regarding below two
  331. types of lever arm info:
  332. a: GNSS Antenna w.r.t the origin at the IMU e.g.: inertial
  333. measurement unit.
  334. b: lever arm parameters regarding the OPF (output frame)
  335. w.r.t the origin (at the GPS Antenna). Vehicle manufacturers
  336. prefer the position output to be tied to a specific point in
  337. the vehicle rather than where the antenna is placed
  338. (midpoint of the rear axle is typical).
  339. Caller can choose types of lever arm info to configure via the
  340. leverMarkTypeMask.
  341. @return
  342. A session id that will be returned in responseCallback to
  343. match command with response. This effect is global for all
  344. clients of LocationAPI responseCallback returns:
  345. LOCATION_ERROR_SUCCESS if successful
  346. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  347. */
  348. virtual uint32_t configLeverArm(const LeverArmConfigInfo& configInfo) override;
  349. /** @brief
  350. Configure the robust location setting.
  351. @param
  352. enable: true to enable robust location and false to disable
  353. robust location.
  354. @param
  355. enableForE911: true to enable robust location when device is
  356. on E911 session and false to disable on E911 session.
  357. This parameter is only valid if robust location is enabled.
  358. @return
  359. A session id that will be returned in responseCallback to
  360. match command with response. This effect is global for all
  361. clients of LocationAPI responseCallback returns:
  362. LOCATION_ERROR_SUCCESS if successful
  363. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  364. */
  365. virtual uint32_t configRobustLocation(bool enable, bool enableForE911) override;
  366. /** @brief
  367. Config the minimal GPS week used by modem GNSS engine.
  368. @param
  369. minGpsWeek: minimal GPS week to be used by modem GNSS engine.
  370. @return
  371. A session id that will be returned in responseCallback to
  372. match command with response. This effect is global for all
  373. clients of LocationAPI responseCallback returns:
  374. LOCATION_ERROR_SUCCESS if successful
  375. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  376. */
  377. virtual uint32_t configMinGpsWeek(uint16_t minGpsWeek) override;
  378. /** @brief
  379. Configure the vehicle body-to-Sensor mount parameters and
  380. other parameters for dead reckoning position engine.
  381. @param
  382. dreConfig: vehicle body-to-Sensor mount angles and other
  383. parameters.
  384. @return
  385. A session id that will be returned in responseCallback to
  386. match command with response. This effect is global for all
  387. clients of LocationAPI responseCallback returns:
  388. LOCATION_ERROR_SUCCESS if successful
  389. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  390. */
  391. virtual uint32_t configDeadReckoningEngineParams(
  392. const DeadReckoningEngineConfig& dreConfig) override;
  393. /** @brief
  394. This API is used to instruct the specified engine to be in
  395. the pause/resume state. <br/>
  396. When the engine is placed in paused state, the engine will
  397. stop. If there is an on-going session, engine will no longer
  398. produce fixes. In the paused state, calling API to delete
  399. aiding data from the paused engine may not have effect.
  400. Request to delete Aiding data shall be issued after
  401. engine resume. <br/>
  402. Currently, only DRE engine will support pause/resume
  403. request. responseCb() will return not supported when request
  404. is made to pause/resume none-DRE engine. <br/>
  405. Request to pause/resume DRE engine can be made with or
  406. without an on-going session. With QDR engine, on resume, GNSS
  407. position & heading re-acquisition is needed for DR engine to
  408. engage. If DR engine is already in the requested state, the
  409. request will be no-op. <br/>
  410. @param
  411. engType: the engine that is instructed to change its run
  412. state. <br/>
  413. engState: the new engine run state that the engine is
  414. instructed to be in. <br/>
  415. @return
  416. A session id that will be returned in responseCallback to
  417. match command with response. This effect is global for all
  418. clients of LocationAPI responseCallback returns:
  419. LOCATION_ERROR_SUCCESS if successful
  420. LOCATION_ERROR_INVALID_PARAMETER if any parameters are invalid
  421. */
  422. virtual uint32_t configEngineRunState(PositioningEngineMask engType,
  423. LocEngineRunState engState) override;
  424. /** @brief
  425. Set the EULA opt-in status from system user. This is used as consent to
  426. use network-based positioning.
  427. @param
  428. userConsnt: user agrees to use GTP service or not.
  429. @return
  430. A session id that will be returned in responseCallback to
  431. match command with response.
  432. */
  433. virtual uint32_t setOptInStatus(bool userConsent);
  434. /** @brief
  435. This API is used to config the NMEA sentence types.
  436. Without prior calling this API, all NMEA sentences supported
  437. in the system, as defined in NmeaTypesMask, will get
  438. generated and delivered to all the location clients that
  439. register to receive NMEA sentences.
  440. The NMEA sentence types are per-device setting and calling
  441. this API will impact all the location api clients that
  442. register to receive NMEA sentences. This API call is not
  443. incremental and the new NMEA sentence types will completely
  444. overwrite the previous call.
  445. If one or more unspecified bits are set in the NMEA mask,
  446. those bits will be ignored, but the rest of the
  447. configuration will get applied.
  448. Please note that the configured NMEA sentence types are not
  449. persistent.
  450. @param
  451. enabledNmeaTypes: specify the set of NMEA sentences the
  452. device will generate and deliver to the location api clients
  453. that register to receive NMEA sentences. <br/>
  454. @return
  455. A session id that will be returned in responseCallback to
  456. match command with response.
  457. */
  458. virtual uint32_t configOutputNmeaTypes(
  459. GnssNmeaTypesMask enabledNmeaTypes) override;
  460. /** @brief
  461. This API is used to send platform power events to GNSS adapters in order
  462. to handle GNSS sessions as per platform power event.
  463. @param
  464. powerState: Current vehicle/platform power state.
  465. @return
  466. No return value.
  467. */
  468. virtual void powerStateEvent(PowerStateType powerState) override;
  469. };
  470. #endif /* LOCATIONAPI_H */