--- /dev/null
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
--- /dev/null
+/*
+ * HAL (Hardware Abstract Layer) Location API
+ *
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __HAL_LOCATION_INTERFACE__
+#define __HAL_LOCATION_INTERFACE__
+
+#include <stdint.h>
+#include <time.h>
+#include <hal/hal-common-interface.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MAX_REQUESTER_ID_LEN (128)
+#define MAX_CLIENT_NAME_LEN (128)
+#define MAX_SUPL_URL_LEN (128)
+
+/** Maximum number of satellite which is in used */
+#define MAX_GPS_NUM_SAT_USED (12)
+
+/** Maximum number of satellite which is in view */
+#define MAX_GPS_NUM_SAT_IN_VIEW (32)
+
+/**
+ * This enumeration has error type.
+ */
+typedef enum {
+ GPS_ERR_NONE = 0, /**< Error None */
+ GPS_ERR_TIMEOUT = -100, /**< pos_cb error GPS Timeout */
+ GPS_ERR_OUT_OF_SERVICE = -101, /**< pos_cb error GPS out of service */
+ GPS_ERR_COMMUNICATION = -200, /**< Plugin event callback error */
+} gps_error_t;
+
+/**
+ * This enumeration has geofence service status.
+ */
+typedef enum {
+ GEOFENCE_STATUS_UNAVAILABLE = 0,
+ GEOFENCE_STATUS_AVAILABLE = 1,
+} geofence_status_t;
+
+/**
+ * This enumeration has geofence service error type.
+ */
+typedef enum {
+ GEOFENCE_ERR_NONE = 0,
+ GEOFENCE_ERR_TOO_MANY_GEOFENCE = -100,
+ GEOFENCE_ERR_ID_EXISTS = -101,
+ GEOFENCE_ERR_ID_UNKNOWN = -200,
+ GEOFENCE_ERR_INVALID_TRANSITION = -300,
+ GEOFENCE_ERR_UNKNOWN = -400,
+} geofence_error_t;
+
+/**
+ * This enumeration has XTRA request error type (wearable profile use only).
+ */
+typedef enum {
+ XTRA_REQUEST_ERR_NONE = 0,
+ XTRA_REQUEST_ERR_UNKNOWN = -100,
+} xtra_request_error_t;
+
+/**
+ * This structure defines the GPS position data.
+ */
+typedef struct {
+ time_t timestamp; /**< Timestamp */
+ double latitude; /**< Latitude data (in degree) */
+ double longitude; /**< Longitude data (in degree) */
+ double altitude; /**< Altitude data (in meter) */
+ double speed; /**< Speed (in m/s) */
+ double bearing; /**< Direction from true north(in degree) */
+ double hor_accuracy; /**< Horizontal position error(in meter) */
+ double ver_accuracy; /**< Vertical position error(in meter) */
+} pos_data_t;
+
+/**
+ * This structure defines the GPS batch data.
+ */
+typedef struct {
+ int num_of_location; /**< Number of batch data */
+ pos_data_t *data;
+} batch_data_t;
+
+/**
+ * This structure defines the satellite data.
+ */
+typedef struct {
+ int prn; /**< Pseudo Random Noise code of satellite */
+ int snr; /**< Signal to Noise Ratio */
+ int elevation; /**< Elevation */
+ int azimuth; /**< Degrees from true north */
+ int used; /**< Satellite was used for position fix */
+} sv_info_t;
+
+/**
+ * This structure defines the GPS satellite in view data.
+ */
+typedef struct {
+ time_t timestamp; /**< Timestamp */
+ unsigned char pos_valid; /**< TRUE, if position is valid */
+ int num_of_sat; /**< Number of satellites in view */
+ sv_info_t sat[MAX_GPS_NUM_SAT_IN_VIEW]; /**< Satellite information */
+} sv_data_t;
+
+/**
+ * This structure defines the NMEA data.
+ */
+typedef struct {
+ time_t timestamp; /**< Timestamp */
+ int len; /**< NMEA data length */
+ char *data; /**< Raw NMEA data */
+} nmea_data_t;
+
+/**
+ * This structure defines the geofence data.
+ */
+typedef struct {
+ int geofence_id; /**< Geofence ID */
+ double latitude; /**< Latitude data (in degree) */
+ double longitude; /**< Longitude data (in degree) */
+ int radius; /**< Radius data (in meters) */
+} geofence_data_t;
+
+typedef struct {
+ char imsi[16]; /**< IMSI */
+ int mcc; /**< MCC */
+ int mnc; /**< MNC */
+ int lac; /**< Location area code */
+ int psc; /**< Primary Srambling code */
+ int cid; /**< Cell id */
+} mobile_info_t;
+
+/**
+ * This enumeration has GPS session type.
+ */
+typedef enum {
+ GPS_SESSION_SINGLE_FIX = 0, /**< Single fix starting */
+ GPS_SESSION_TRACKING_MODE /**< Tracking mode starting */
+} gps_session_t;
+
+/**
+ * This enumeration has GPS operation mode.
+ */
+typedef enum {
+ GPS_OPERATION_STANDALONE = 0, /**< GPS standalone (no assistance) */
+ GPS_OPERATION_MS_BASED, /**< MS-Based AGPS */
+ GPS_OPERATION_MS_ASSISTED /**< MS-Assisted AGPS */
+} gps_operation_t;
+
+/**
+ * This enumeration has GPS starting type.
+ */
+typedef enum {
+ GPS_STARTING_HOT_ = 0, /**< Hot start */
+ GPS_STARTING_COLD, /**< Cold start */
+ GPS_STARTING_NONE /**< None */
+} gps_starting_t;
+
+/**
+ * This enumeration has the SSL mode.
+ */
+typedef enum {
+ AGPS_SSL_DISABLE = 0, /**< SSL disable */
+ AGPS_SSL_ENABLE /**< SSL enable */
+} agps_ssl_mode_t;
+
+/**
+ * This enumeration has the SSL certification type.
+ */
+typedef enum {
+ AGPS_CERT_VERISIGN = 0,
+ AGPS_CERT_THAWTE,
+ AGPS_CERT_CMCC,
+ AGPS_CERT_SPIRENT_TEST,
+ AGPS_CERT_THALES_TEST,
+ AGPS_CERT_CMCC_TEST,
+ AGPS_CERT_BMC_TEST,
+ AGPS_CERT_GOOGLE
+} agps_ssl_cert_type_t;
+
+/**
+ * This enumeration has the verification confirm type.
+ */
+typedef enum {
+ AGPS_VER_CNF_YES = 0x00, /**< Specifies Confirmation yes. */
+ AGPS_VER_CNF_NO = 0x01, /**< Specifies Confirmation no. */
+ AGPS_VER_CNF_NORESPONSE = 0x02 /**< Specifies Confirmation no response. */
+} agps_verification_cnf_type_t;
+
+/**
+ * This enumeration has the zone in/out type.
+ */
+typedef enum {
+ GEOFENCE_ZONE_OUT = 0x00,
+ GEOFENCE_ZONE_IN = 0x01,
+ GEOFENCE_ZONE_UNCERTAIN = 0x02
+} geofence_zone_state_t;
+
+/**
+ * This structure is used to get the Extra Fix request parameters.
+ */
+typedef struct {
+ int accuracy; /**< accuracy */
+ int tbf; /**< time between fixes */
+ int num_fixes; /**< num fixes */
+ unsigned char timeout; /**< session timeout */
+} gps_qos_param_t;
+
+/**
+ * GPS asynchronous event type
+ */
+typedef enum {
+ GPS_EVENT_START_SESSION = 0x0000, /**< The session is started */
+ GPS_EVENT_STOP_SESSION, /**< The session is stopped */
+ GPS_EVENT_CHANGE_INTERVAL, /**< Change updating interval */
+ GPS_EVENT_REPORT_POSITION = 0x0100, /**< Bring up GPS position data */
+ GPS_EVENT_REPORT_SATELLITE, /**< Bring up GPS SV data */
+ GPS_EVENT_REPORT_NMEA, /**< Bring up GPS NMEA data */
+ GPS_EVENT_REPORT_BATCH, /**< Bring up GPS batch data */
+ GPS_EVENT_SET_OPTION = 0x0200, /**< The option is set */
+ GPS_EVENT_GET_REF_LOCATION = 0x0300, /**< Get the reference location for AGPS */
+ GPS_EVENT_GET_IMSI, /**< Get IMSI for identification */
+ GPS_EVENT_GET_REF_TIME, /**< Get the reference time for AGPS */
+ GPS_EVENT_OPEN_DATA_CONNECTION = 0x0400, /**< Request opening data network connection */
+ GPS_EVENT_CLOSE_DATA_CONNECTION, /**< Request closing data network connection */
+ GPS_EVENT_DNS_LOOKUP_IND, /**< Request resolving host name */
+ GPS_EVENT_AGPS_VERIFICATION_INDI, /**< Verification indicator for AGPS is required */
+ GPS_EVENT_FACTORY_TEST = 0x0500, /**< Factory test is done */
+ GPS_EVENT_GEOFENCE_TRANSITION = 0x0600, /**< Geofence transition is occured */
+ GPS_EVENT_GEOFENCE_STATUS, /**< Report geofence serivce status */
+ GPS_EVENT_ADD_GEOFENCE, /**< Geofence is added(Start geofence) */
+ GPS_EVENT_DELETE_GEOFENCE, /**< Geofence is deleted(Stop geofence) */
+ GPS_EVENT_PAUSE_GEOFENCE, /**< Geofence is paused */
+ GPS_EVENT_RESUME_GEOFENCE, /**< Geofence is resumed */
+ GPS_EVENT_REQUEST_XTRA = 0x0700, /**< XTRA is requested. Used by Wearable profile only. */
+ GPS_EVENT_ERR_CAUSE = 0xFFFF /**< Some error is occurred */
+} gps_event_id_t;
+
+/**
+ * Start session response event data
+ */
+typedef struct {
+ gps_error_t error;
+} gps_start_session_ev_info_t;
+
+/**
+ * Response of stop session
+ */
+typedef struct {
+ gps_error_t error;
+} gps_stop_session_ev_info_t;
+
+/**
+ * Set option response event data
+ */
+typedef struct {
+ gps_error_t error;
+} gps_set_option_ev_info_t;
+
+typedef struct {
+ gps_error_t error;
+} gps_change_interval_ev_info_t;
+
+/**
+ * Position data from GPS
+ */
+typedef struct {
+ gps_error_t error;
+ pos_data_t pos;
+} gps_pos_ev_info_t;
+
+/**
+ * Batch data from GPS
+ */
+typedef struct {
+ gps_error_t error;
+ batch_data_t batch;
+} gps_batch_ev_info_t;
+
+/**
+ * Satellite data from GPS
+ */
+typedef struct {
+ gps_error_t error;
+ sv_data_t sv;
+} gps_sv_ev_info_t;
+
+/**
+ * NMEA data from GPS
+ */
+typedef struct {
+ gps_error_t error;
+ nmea_data_t nmea;
+} gps_nmea_ev_info_t;
+
+/**
+ * This enumeration defines values for notify type for GPS verification message.
+ */
+typedef enum {
+ AGPS_NOTIFY_NO_VERIFY = 0x00,
+ AGPS_NOTIFY_ONLY = 0x01,
+ AGPS_NOTIFY_ALLOW_NORESPONSE = 0x02,
+ AGPS_NOTIFY_NOTALLOW_NORESPONSE = 0x03,
+ AGPS_NOTIFY_PRIVACY_NEEDED = 0x04,
+ AGPS_NOTIFY_PRIVACY_OVERRIDE = 0x05
+} agps_notify_t;
+
+/**
+ * This enumeration defines values for requester type for GPS verification message
+ */
+typedef enum {
+ AGPS_REQ_LOGICAL_NAME = 0x00, /**< Specifies logical name. */
+ AGPS_REQ_EMAIL_ADDR = 0x01, /**< Specifies e-mail address */
+ AGPS_REQ_MSISDN = 0x02, /**< Specifies MSISDN number */
+ AGPS_REQ_URL = 0x03, /**< Specifies URL */
+ AGPS_REQ_SIPURL = 0x04, /**< Specifies SIPURL */
+ AGPS_REQ_MIN = 0x05, /**< Specifies MIN */
+ AGPS_REQ_MDN = 0x06, /**< Specifies MDN */
+ AGPS_REQ_UNKNOWN = 0x07 /**< Unknown request */
+} agps_supl_format_t;
+
+/**
+ * This enumeration defines values for GPS encoding type for GPS verification message.
+ */
+typedef enum {
+ AGPS_ENCODE_ISO646IRV = 0x00,
+ AGPS_ENCODE_ISO8859 = 0x01,
+ AGPS_ENCODE_UTF8 = 0x02,
+ AGPS_ENCODE_UTF16 = 0x03,
+ AGPS_ENCODE_UCS2 = 0x04,
+ AGPS_ENCODE_GSMDEFAULT = 0x05,
+ AGPS_ENCODE_SHIFT_JIS = 0x06,
+ AGPS_ENCODE_JIS = 0x07,
+ AGPS_ENCODE_EUC = 0x08,
+ AGPS_ENCODE_GB2312 = 0x09,
+ AGPS_ENCODE_CNS11643 = 0x0A,
+ AGPS_ENCODE_KSC1001 = 0x0B,
+ AGPS_ENCODE_GERMAN = 0x0C,
+ AGPS_ENCODE_ENGLISH = 0x0D,
+ AGPS_ENCODE_ITALIAN = 0x0E,
+ AGPS_ENCODE_FRENCH = 0x0F,
+ AGPS_ENCODE_SPANISH = 0x10,
+ AGPS_ENCODE_DUTCH = 0x11,
+ AGPS_ENCODE_SWEDISH = 0x12,
+ AGPS_ENCODE_DANISH = 0x13,
+ AGPS_ENCODE_PORTUGUESE = 0x14,
+ AGPS_ENCODE_FINNISH = 0x15,
+ AGPS_ENCODE_NORWEGIAN = 0x16,
+ AGPS_ENCODE_GREEK = 0x17,
+ AGPS_ENCODE_TURKISH = 0x18,
+ AGPS_ENCODE_HUNGARIAN = 0x19,
+ AGPS_ENCODE_POLISH = 0x1A,
+ AGPS_ENCODE_LANGUAGE_UNSPEC = 0xFF
+} agps_encoding_scheme_t;
+
+/**
+ * This enumeration defines values for GPS encoding type for GPS verification message.
+ */
+typedef enum {
+ AGPS_ID_ENCODE_ISO646IRV = 0x00,
+ AGPS_ID_ENCODE_EXN_PROTOCOL_MSG = 0x01,
+ AGPS_ID_ENCODE_ASCII = 0x02,
+ AGPS_ID_ENCODE_IA5 = 0x03,
+ AGPS_ID_ENCODE_UNICODE = 0x04,
+ AGPS_ID_ENCODE_SHIFT_JIS = 0x05,
+ AGPS_ID_ENCODE_KOREAN = 0x06,
+ AGPS_ID_ENCODE_LATIN_HEBREW = 0x07,
+ AGPS_ID_ENCODE_LATIN = 0x08,
+ AGPS_ID_ENCODE_GSM = 0x09
+} agps_requester_id_encoding_t;
+
+/**
+ * This structure defines the values for GPS Verification message indication.
+ */
+typedef struct {
+ /** Specifies notification type refer enum tapi_gps_notify_type_t */
+ agps_notify_t notify_type;
+
+ /** Specifies encoding type refer enum tapi_gps_encoding_type_t */
+ agps_supl_format_t supl_format;
+
+ /** Specifies requester type */
+ agps_encoding_scheme_t datacoding_scheme;
+
+ agps_requester_id_encoding_t requester_id_encoding;
+
+ /** Specifies requester ID */
+ char requester_id[MAX_REQUESTER_ID_LEN];
+
+ /** Specifies client name */
+ char client_name[MAX_CLIENT_NAME_LEN];
+
+ /** Response timer */
+ int resp_timer;
+} agps_verification_ev_info_t;
+
+/**
+ * Factory test result information
+ */
+typedef struct {
+ gps_error_t error;
+ int prn;
+ double snr;
+} gps_factory_test_ev_info_t;
+
+/**
+ * DNS query request information
+ */
+typedef struct {
+ gps_error_t error;
+ char domain_name[MAX_SUPL_URL_LEN];
+} gps_dns_query_ev_info_t;
+
+/**
+ * Geofecne transition information
+ */
+typedef struct {
+ time_t geofence_timestamp;
+ int geofence_id;
+ pos_data_t pos;
+ geofence_zone_state_t state;
+} geofence_transition_ev_info_t;
+
+/**
+ * Geofecne status information
+ */
+typedef struct {
+ geofence_status_t status;
+ pos_data_t last_pos;
+} geofence_status_ev_info_t;
+
+/**
+ * Geofecne event information
+ */
+typedef struct {
+ int geofence_id;
+ geofence_error_t error;
+} geofence_event_t;
+
+/**
+ * Type of XTRA request. Used by Wearable profile only.
+ */
+typedef enum {
+ XTRA_REQUEST_TYPE_NONE = 0x00,
+ XTRA_REQUEST_TYPE_QCOM = 0x01,
+ XTRA_REQUEST_TYPE_BRCM = 0x02,
+ XTRA_REQEUST_TYPE_NUM,
+} xtra_request_type_t;
+
+/**
+ * XTRA request information. Used by Wearable profile only.
+ */
+typedef struct {
+ xtra_request_type_t xtra_id;
+ xtra_request_error_t error;
+} xtra_request_info_t;
+
+typedef struct {
+ time_t timeout;
+}ref_data_request_info_t;
+
+/**
+ * GPS event info
+ */
+typedef union {
+ /** Callback related with Response */
+ gps_start_session_ev_info_t start_session_rsp;
+ gps_stop_session_ev_info_t stop_session_rsp;
+ gps_set_option_ev_info_t set_option_rsp;
+ gps_change_interval_ev_info_t change_interval_rsp;
+
+ /** Callback related with Indication */
+ gps_pos_ev_info_t pos_ind;
+ gps_sv_ev_info_t sv_ind;
+ gps_nmea_ev_info_t nmea_ind;
+ gps_batch_ev_info_t batch_ind;
+ agps_verification_ev_info_t agps_verification_ind;
+
+ gps_factory_test_ev_info_t factory_test_rsp;
+ gps_dns_query_ev_info_t dns_query_ind;
+
+ /** Callback related with Geofence. */
+ geofence_transition_ev_info_t geofence_transition_ind;
+ geofence_status_ev_info_t geofence_status_ind;
+ geofence_event_t geofence_event_rsp;
+
+ /** Callback related with XTRA. Used by Wearable profile only. */
+ xtra_request_info_t xtra_request_ind;
+ ref_data_request_info_t ref_data_req_ind;
+} gps_event_data_t;
+
+/**
+ * Transport Error Cause
+ */
+typedef enum {
+ GPS_FAILURE_CAUSE_NORMAL = 0x00,
+ GPS_FAILURE_CAUSE_FACTORY_TEST,
+ GPS_FAILURE_CAUSE_DNS_QUERY,
+ GPS_FAILURE_CAUSE_LBS_SERVER_FINISH
+} gps_failure_reason_t;
+
+/**
+ * GPS Event Info
+ */
+typedef struct {
+ gps_event_id_t event_id; /**< GPS asynchronous event id */
+ gps_event_data_t event_data; /**< GPS event information data */
+} gps_event_info_t;
+
+/**
+ * Callback function
+ * LBS server needs to register a callback function with GPS OEM to receive asynchronous events.
+ */
+typedef int (*gps_event_cb)(gps_event_info_t *gps_event_info, void *user_data);
+
+/**
+ * GPS action type
+ */
+typedef enum {
+ GPS_ACTION_SEND_PARAMS = 0x000,
+ GPS_ACTION_START_SESSION,
+ GPS_ACTION_STOP_SESSION,
+ GPS_ACTION_CHANGE_INTERVAL,
+
+ GPS_INDI_SUPL_VERIFICATION,
+ GPS_INDI_SUPL_DNSQUERY,
+
+ GPS_ACTION_START_FACTTEST,
+ GPS_ACTION_STOP_FACTTEST,
+ GPS_ACTION_REQUEST_SUPL_NI,
+ GPS_ACTION_REQUEST_SUPL_NI_NOMODEM,
+ GPS_ACTION_DELETE_GPS_DATA,
+
+ GPS_ACTION_ADD_GEOFENCE,
+ GPS_ACTION_DELETE_GEOFENCE,
+ GPS_ACTION_PAUSE_GEOFENCE,
+ GPS_ACTION_RESUME_GEOFENCE,
+
+ GPS_ACTION_DOWNLOAD_XTRA, /* Used by Wearable profile only. */
+ GPS_ACTION_CONSUMER_CONNECTED, /* Used by Wearable profile only. */
+ GPS_ACTION_CONSUMER_DISCONNECTED, /* Used by Wearable profile only. */
+
+ GPS_ACTION_CHANGE_INTERVAL_SPORTMODE,
+
+ GPS_ACTION_SET_REF_LOCATION, /* Used by Wearable profile only. */
+ GPS_ACTION_SET_REF_TIME, /* Used by Wearable profile only. */
+
+ GPS_ACTION_START_BATCH,
+ GPS_ACTION_STOP_BATCH,
+ GPS_ACTION_ADD_REDUCE_SET,
+ GPS_ACTION_REMOVE_REDUCE_SET
+} gps_action_t;
+
+/**
+ * Cell information type
+ */
+typedef enum {
+ GPS_CELL_INFO_TYPE_aRFCNPresent = 0,
+ GPS_CELL_INFO_TYPE_bSICPresent,
+ GPS_CELL_INFO_TYPE_rxLevPresent,
+ GPS_CELL_INFO_TYPE_frequencyInfoPresent,
+ GPS_CELL_INFO_TYPE_cellMeasuredResultPresent,
+
+ GPS_CELL_INFO_TYPE_refMCC,
+ GPS_CELL_INFO_TYPE_refMNC,
+ GPS_CELL_INFO_TYPE_refLAC,
+ GPS_CELL_INFO_TYPE_refCI,
+ GPS_CELL_INFO_TYPE_refUC,
+ GPS_CELL_INFO_TYPE_aRFCN,
+ GPS_CELL_INFO_TYPE_bSIC,
+ GPS_CELL_INFO_TYPE_rxLev
+} agps_cell_info_t;
+
+/**
+ * Mobile service type
+ */
+typedef enum {
+ SVCTYPE_NONE = 0, /**< Unknown network */
+ SVCTYPE_NOSVC, /**< Network in no service */
+ SVCTYPE_EMERGENCY, /**< Network emergency */
+ SVCTYPE_SEARCH, /**< Network search 1900 */
+ SVCTYPE_2G, /**< Network 2G */
+ SVCTYPE_2_5G, /**< Network 2.5G */
+ SVCTYPE_2_5G_EDGE, /**< Network EDGE */
+ SVCTYPE_3G, /**< Network UMTS */
+ SVCTYPE_HSDPA /**< Network HSDPA */
+} agps_svc_type_t;
+
+/**
+ * SUPL network-initiated information
+ */
+typedef struct {
+ char *msg_body; /**< SUPL NI message body */
+ int msg_size; /**< SUPL NI message size */
+ int status; /**< Return code of Status */
+} agps_supl_ni_info_t;
+
+/**
+ * SUPL network-initiated information in case of no-modem
+ */
+typedef struct {
+ char *msg_body; /**< SUPL NI message body */
+ int msg_size; /**< SUPL NI message size */
+ char imsi[16]; /**< IMSI */
+ int mcc; /**< MCC */
+ int mnc; /**< MNC */
+ int lac; /**< Location area code */
+ int psc; /**< Primary Srambling code */
+ int cid; /**< Cell id */
+ int status; /**< Return code of Status */
+} agps_supl_ni_nomodem_info_t;
+
+/**
+ * Geofence action data type
+ */
+typedef struct {
+ geofence_data_t geofence;
+ geofence_zone_state_t last_state;
+ int monitor_states;
+ int notification_responsiveness_ms;
+ int unknown_timer_ms;
+} geofence_action_data_t;
+
+typedef struct {
+ int interval;
+ int period; /**< Emulator */
+ int session_status; /**< Emulator */
+} gps_action_start_data_t;
+
+typedef struct {
+ int interval;
+} gps_action_change_interval_data_t;
+
+/*
+* GPS_ACTION_SET_REF_LOCATION
+*/
+typedef struct {
+ int result;
+ int reason;
+ time_t timestamp; /**< Timestamp */
+ double latitude; /**< Latitude data (in degree) */
+ double longitude; /**< Longitude data (in degree) */
+ double accuracy; /**< Horizontal position error(in meter) */
+} gps_action_set_ref_location_t; // Added 2016.06.30
+
+/*
+* GPS_ACTION_SET_REF_TIME
+*/
+typedef struct {
+ int result;
+ int reason;
+ int method;
+ int64_t ntp_timestamp; /**< Timestamp from NTP */
+ int64_t elapsed_systime; /**< Milliseconds since boot, including time spent in sleep */
+ int uncertainty; /**< Half of round trip time in milliseconds */
+} gps_action_set_ref_time_t; // Added 2016.06.30
+
+typedef struct _hal_backend_location_funcs {
+ int (*init)(gps_event_cb gps_event_cb, void *user_data);
+ int (*deinit)(gps_failure_reason_t *reason_code);
+ int (*request)(gps_action_t gps_action, void *gps_action_data, gps_failure_reason_t *reason_code);
+} hal_backend_location_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_LOCATION_INTERFACE__ */
+