From: Abhimanyu Swami Date: Wed, 11 Dec 2024 06:39:13 +0000 (+0530) Subject: Added documentation for hal-location-interface-1.h X-Git-Tag: accepted/tizen/9.0/unified/20250424.162122~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca0edb5d9654cb87de9e3110795a671a2d3ca098;p=platform%2Fhal%2Fapi%2Flocation.git Added documentation for hal-location-interface-1.h Change-Id: Ia251396d2fea92e55b002c0556cd43b5a1862e66 (cherry picked from commit 7a5067e88ad6a1c56e0708aa1e4b1f0d703b1e27) --- diff --git a/include/hal-location-interface-1.h b/include/hal-location-interface-1.h index c77133f..6b36e42 100644 --- a/include/hal-location-interface-1.h +++ b/include/hal-location-interface-1.h @@ -27,658 +27,760 @@ extern "C" { #endif -#define MAX_REQUESTER_ID_LEN (128) -#define MAX_CLIENT_NAME_LEN (128) -#define MAX_SUPL_URL_LEN (128) +/** + * @addtogroup HALAPI_HAL_LOCATION_MODULE + * @{ + */ + +/** + * @brief Max length of requester ID + * @since HAL_MODULE_LOCATION 1.0 + */ +#define HAL_LOCATION_MAX_REQUESTER_ID_LEN (128) -/** Maximum number of satellite which is in used */ -#define MAX_GPS_NUM_SAT_USED (12) +/** + * @brief Max length of client name + * @since HAL_MODULE_LOCATION 1.0 + */ +#define HAL_LOCATION_MAX_CLIENT_NAME_LEN (128) -/** Maximum number of satellite which is in view */ -#define MAX_GPS_NUM_SAT_IN_VIEW (32) +/** + * @brief Max length of SUPL URL + * @since HAL_MODULE_LOCATION 1.0 + */ +#define HAL_LOCATION_MAX_SUPL_URL_LEN (128) /** - * This enumeration has error type. + * @brief Maximum number of satellite which is in used + * @since HAL_MODULE_LOCATION 1.0 + */ +#define HAL_LOCATION_MAX_GPS_NUM_SAT_USED (12) + +/** + * @brief Maximum number of satellite which is in view + * @since HAL_MODULE_LOCATION 1.0 + */ +#define HAL_LOCATION_MAX_GPS_NUM_SAT_IN_VIEW (32) + +/** + * @brief This enumeration has error type. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_GPS_ERR_NONE = 0, /**< Error None */ + HAL_LOCATION_GPS_ERR_TIMEOUT = -100, /**< pos_cb error GPS Timeout */ + HAL_LOCATION_GPS_ERR_OUT_OF_SERVICE = -101, /**< pos_cb error GPS out of service */ + HAL_LOCATION_GPS_ERR_COMMUNICATION = -200, /**< Plugin event callback error */ +} hal_location_gps_error_e; /** - * This enumeration has geofence service status. + * @brief This enumeration has geofence service status. + * @since HAL_MODULE_LOCATION 1.0 */ typedef enum { - GEOFENCE_STATUS_UNAVAILABLE = 0, - GEOFENCE_STATUS_AVAILABLE = 1, -} geofence_status_t; + HAL_LOCATION_GEOFENCE_STATUS_UNAVAILABLE = 0, /**< Geofence status is unavailable */ + HAL_LOCATION_GEOFENCE_STATUS_AVAILABLE = 1, /**< Geofence status is available */ +} hal_location_geofence_status_e; /** - * This enumeration has geofence service error type. + * @brief This enumeration has geofence service error type. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_GEOFENCE_ERR_NONE = 0, /**< No error */ + HAL_LOCATION_GEOFENCE_ERR_TOO_MANY_GEOFENCE = -100, /**< Too many geofences */ + HAL_LOCATION_GEOFENCE_ERR_ID_EXISTS = -101, /**< Geofence ID already exists */ + HAL_LOCATION_GEOFENCE_ERR_ID_UNKNOWN = -200, /**< Geofence ID does not exist */ + HAL_LOCATION_GEOFENCE_ERR_INVALID_TRANSITION = -300, /**< Invalid transition */ + HAL_LOCATION_GEOFENCE_ERR_UNKNOWN = -400, /**< Unknown error */ +} hal_location_geofence_error_e; /** - * This enumeration has XTRA request error type (wearable profile use only). + * @brief This enumeration has XTRA request error type (wearable profile use only). + * @since HAL_MODULE_LOCATION 1.0 */ typedef enum { - XTRA_REQUEST_ERR_NONE = 0, - XTRA_REQUEST_ERR_UNKNOWN = -100, -} xtra_request_error_t; + HAL_LOCATION_XTRA_REQUEST_ERR_NONE = 0, /**< No error */ + HAL_LOCATION_XTRA_REQUEST_ERR_UNKNOWN = -100, /**< Unknown error */ +} hal_location_xtra_request_error_e; /** - * This structure defines the GPS position data. + * @brief This structure defines the GPS position data. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + 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) */ +} hal_location_pos_data_s; /** - * This structure defines the GPS batch data. + * @brief This structure defines the GPS batch data. + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - int num_of_location; /**< Number of batch data */ - pos_data_t *data; -} batch_data_t; + int num_of_location; /**< Number of batch data */ + hal_location_pos_data_s *data; /**< Batch data */ +} hal_location_batch_data_s; /** - * This structure defines the satellite data. + * @brief This structure defines the satellite data. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + 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 */ +} hal_location_sv_info_s; /** - * This structure defines the GPS satellite in view data. + * @brief This structure defines the GPS satellite in view data. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + time_t timestamp; /**< Timestamp */ + unsigned char pos_valid; /**< TRUE, if position is valid */ + int num_of_sat; /**< Number of satellites in view */ + hal_location_sv_info_s sat[HAL_LOCATION_MAX_GPS_NUM_SAT_IN_VIEW]; /**< Satellite information */ +} hal_location_sv_data_s; /** - * This structure defines the NMEA data. + * @brief This structure defines the NMEA data. + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - time_t timestamp; /**< Timestamp */ - int len; /**< NMEA data length */ - char *data; /**< Raw NMEA data */ -} nmea_data_t; + time_t timestamp; /**< Timestamp */ + int len; /**< NMEA data length */ + char *data; /**< Raw NMEA data */ +} hal_location_nmea_data_s; /** - * This structure defines the geofence data. + * @brief This structure defines the geofence data. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + int geofence_id; /**< Geofence ID */ + double latitude; /**< Latitude data (in degree) */ + double longitude; /**< Longitude data (in degree) */ + int radius; /**< Radius data (in meters) */ +} hal_location_geofence_data_s; +/** + * @brief This structure defines the mobile information. + * @since HAL_MODULE_LOCATION 1.0 + */ 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; + char imsi[16]; /**< IMSI */ + int mcc; /**< MCC */ + int mnc; /**< MNC */ + int lac; /**< Location area code */ + int psc; /**< Primary Srambling code */ + int cid; /**< Cell id */ +} hal_location_mobile_info_s; /** - * This enumeration has GPS session type. + * @brief This enumeration has GPS session type. + * @since HAL_MODULE_LOCATION 1.0 */ typedef enum { - GPS_SESSION_SINGLE_FIX = 0, /**< Single fix starting */ - GPS_SESSION_TRACKING_MODE /**< Tracking mode starting */ -} gps_session_t; + HAL_LOCATION_GPS_SESSION_SINGLE_FIX = 0, /**< Single fix starting */ + HAL_LOCATION_GPS_SESSION_TRACKING_MODE /**< Tracking mode starting */ +} hal_location_gps_session_e; /** - * This enumeration has GPS operation mode. + * @brief This enumeration has GPS operation mode. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_GPS_OPERATION_STANDALONE = 0, /**< GPS standalone (no assistance) */ + HAL_LOCATION_GPS_OPERATION_MS_BASED, /**< MS-Based AGPS */ + HAL_LOCATION_GPS_OPERATION_MS_ASSISTED /**< MS-Assisted AGPS */ +} hal_location_gps_operation_e; /** - * This enumeration has GPS starting type. + * @brief This enumeration has GPS starting type. + * @since HAL_MODULE_LOCATION 1.0 */ typedef enum { - GPS_STARTING_HOT_ = 0, /**< Hot start */ - GPS_STARTING_COLD, /**< Cold start */ - GPS_STARTING_NONE /**< None */ -} gps_starting_t; + HAL_LOCATION_GPS_STARTING_HOT_ = 0, /**< Hot start */ + HAL_LOCATION_GPS_STARTING_COLD, /**< Cold start */ + HAL_LOCATION_GPS_STARTING_NONE /**< None */ +} hal_location_gps_starting_e; /** - * This enumeration has the SSL mode. + * @brief This enumeration has the SSL mode. + * @since HAL_MODULE_LOCATION 1.0 */ typedef enum { - AGPS_SSL_DISABLE = 0, /**< SSL disable */ - AGPS_SSL_ENABLE /**< SSL enable */ -} agps_ssl_mode_t; + HAL_LOCATION_AGPS_SSL_DISABLE = 0, /**< SSL disable */ + HAL_LOCATION_AGPS_SSL_ENABLE /**< SSL enable */ +} hal_location_agps_ssl_mode_e; /** - * This enumeration has the SSL certification type. + * @brief This enumeration has the SSL certification type. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_AGPS_CERT_VERISIGN = 0,/**< Specifies Verisign certificate. */ + HAL_LOCATION_AGPS_CERT_THAWTE, /**< Specifies Thawte certificate. */ + HAL_LOCATION_AGPS_CERT_CMCC, /**< Specifies CMCC certificate. */ + HAL_LOCATION_AGPS_CERT_SPIRENT_TEST,/**< Specifies Spirent Test certificate. */ + HAL_LOCATION_AGPS_CERT_THALES_TEST, /**< Specifies Thales Test certificate. */ + HAL_LOCATION_AGPS_CERT_CMCC_TEST, /**< Specifies CMCC Test certificate. */ + HAL_LOCATION_AGPS_CERT_BMC_TEST, /**< Specifies BMC Test certificate. */ + HAL_LOCATION_AGPS_CERT_GOOGLE /**< Specifies Google certificate. */ +} hal_location_agps_ssl_cert_type_e; /** - * This enumeration has the verification confirm type. + * @brief This enumeration has the verification confirm type. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_AGPS_VER_CNF_YES = 0x00, /**< Specifies Confirmation yes. */ + HAL_LOCATION_AGPS_VER_CNF_NO = 0x01, /**< Specifies Confirmation no. */ + HAL_LOCATION_AGPS_VER_CNF_NORESPONSE = 0x02 /**< Specifies Confirmation no response. */ +} hal_location_agps_verification_cnf_type_e; /** - * This enumeration has the zone in/out type. + * @brief This enumeration has the zone in/out type. + * @since HAL_MODULE_LOCATION 1.0 */ typedef enum { - GEOFENCE_ZONE_OUT = 0x00, - GEOFENCE_ZONE_IN = 0x01, - GEOFENCE_ZONE_UNCERTAIN = 0x02 -} geofence_zone_state_t; + HAL_LOCATION_GEOFENCE_ZONE_OUT = 0x00, /**< Geofence zone out */ + HAL_LOCATION_GEOFENCE_ZONE_IN = 0x01, /**< Geofence zone in */ + HAL_LOCATION_GEOFENCE_ZONE_UNCERTAIN = 0x02 /**< Geofence zone uncertain */ +} hal_location_geofence_zone_state_e; /** - * This structure is used to get the Extra Fix request parameters. + * @brief This structure is used to get the Extra Fix request parameters. + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - int accuracy; /**< accuracy */ - int tbf; /**< time between fixes */ - int num_fixes; /**< num fixes */ - unsigned char timeout; /**< session timeout */ -} gps_qos_param_t; + int accuracy; /**< accuracy */ + int tbf; /**< time between fixes */ + int num_fixes; /**< num fixes */ + unsigned char timeout; /**< session timeout */ +} hal_location_gps_qos_param_s; /** - * GPS asynchronous event type + * @brief GPS asynchronous event type + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_GPS_EVENT_START_SESSION = 0x0000, /**< The session is started */ + HAL_LOCATION_GPS_EVENT_STOP_SESSION, /**< The session is stopped */ + HAL_LOCATION_GPS_EVENT_CHANGE_INTERVAL, /**< Change updating interval */ + HAL_LOCATION_GPS_EVENT_REPORT_POSITION = 0x0100, /**< Bring up GPS position data */ + HAL_LOCATION_GPS_EVENT_REPORT_SATELLITE, /**< Bring up GPS SV data */ + HAL_LOCATION_GPS_EVENT_REPORT_NMEA, /**< Bring up GPS NMEA data */ + HAL_LOCATION_GPS_EVENT_REPORT_BATCH, /**< Bring up GPS batch data */ + HAL_LOCATION_GPS_EVENT_SET_OPTION = 0x0200, /**< The option is set */ + HAL_LOCATION_GPS_EVENT_GET_REF_LOCATION = 0x0300, /**< Get the reference location for AGPS */ + HAL_LOCATION_GPS_EVENT_GET_IMSI, /**< Get IMSI for identification */ + HAL_LOCATION_GPS_EVENT_GET_REF_TIME, /**< Get the reference time for AGPS */ + HAL_LOCATION_GPS_EVENT_OPEN_DATA_CONNECTION = 0x0400, /**< Request opening data network connection */ + HAL_LOCATION_GPS_EVENT_CLOSE_DATA_CONNECTION, /**< Request closing data network connection */ + HAL_LOCATION_GPS_EVENT_DNS_LOOKUP_IND, /**< Request resolving host name */ + HAL_LOCATION_GPS_EVENT_AGPS_VERIFICATION_INDI, /**< Verification indicator for AGPS is required */ + HAL_LOCATION_GPS_EVENT_FACTORY_TEST = 0x0500, /**< Factory test is done */ + HAL_LOCATION_GPS_EVENT_GEOFENCE_TRANSITION = 0x0600, /**< Geofence transition is occured */ + HAL_LOCATION_GPS_EVENT_GEOFENCE_STATUS, /**< Report geofence serivce status */ + HAL_LOCATION_GPS_EVENT_ADD_GEOFENCE, /**< Geofence is added(Start geofence) */ + HAL_LOCATION_GPS_EVENT_DELETE_GEOFENCE, /**< Geofence is deleted(Stop geofence) */ + HAL_LOCATION_GPS_EVENT_PAUSE_GEOFENCE, /**< Geofence is paused */ + HAL_LOCATION_GPS_EVENT_RESUME_GEOFENCE, /**< Geofence is resumed */ + HAL_LOCATION_GPS_EVENT_REQUEST_XTRA = 0x0700, /**< XTRA is requested. Used by Wearable profile only. */ + HAL_LOCATION_GPS_EVENT_ERR_CAUSE = 0xFFFF /**< Some error is occurred */ +} hal_location_gps_event_id_e; /** - * Start session response event data + * @brief Start session response event data + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - gps_error_t error; -} gps_start_session_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ +} hal_location_gps_start_session_ev_info_s; /** - * Response of stop session + * @brief Response of stop session + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - gps_error_t error; -} gps_stop_session_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ +} hal_location_gps_stop_session_ev_info_s; /** - * Set option response event data + * @brief Set option response event data + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - gps_error_t error; -} gps_set_option_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ +} hal_location_gps_set_option_ev_info_s; +/** + * @brief Change interval response event data + * @since HAL_MODULE_LOCATION 1.0 + */ typedef struct { - gps_error_t error; -} gps_change_interval_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ +} hal_location_gps_change_interval_ev_info_s; /** - * Position data from GPS + * @brief Position data from GPS + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - gps_error_t error; - pos_data_t pos; -} gps_pos_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ + hal_location_pos_data_s pos; /**< Position data */ +} hal_location_gps_pos_ev_info_s; /** - * Batch data from GPS + * @brief Batch data from GPS + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - gps_error_t error; - batch_data_t batch; -} gps_batch_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ + hal_location_batch_data_s batch; /**< Batch data */ +} hal_location_gps_batch_ev_info_s; /** - * Satellite data from GPS + * @brief Satellite data from GPS + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - gps_error_t error; - sv_data_t sv; -} gps_sv_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ + hal_location_sv_data_s sv; /**< Satellite data */ +} hal_location_gps_sv_ev_info_s; /** - * NMEA data from GPS + * @brief NMEA data from GPS + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - gps_error_t error; - nmea_data_t nmea; -} gps_nmea_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ + hal_location_nmea_data_s nmea; /**< NMEA data */ +} hal_location_gps_nmea_ev_info_s; /** - * This enumeration defines values for notify type for GPS verification message. + * @brief This enumeration defines values for notify type for GPS verification message. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_AGPS_NOTIFY_NO_VERIFY = 0x00, /**< No verification needed */ + HAL_LOCATION_AGPS_NOTIFY_ONLY = 0x01, /**< Notification only */ + HAL_LOCATION_AGPS_NOTIFY_ALLOW_NORESPONSE = 0x02, /**< Allow without response */ + HAL_LOCATION_AGPS_NOTIFY_NOTALLOW_NORESPONSE = 0x03, /**< Not allow without response */ + HAL_LOCATION_AGPS_NOTIFY_PRIVACY_NEEDED = 0x04, /**< Privacy needed */ + HAL_LOCATION_AGPS_NOTIFY_PRIVACY_OVERRIDE = 0x05 /**< Privacy override */ +} hal_location_agps_notify_e; /** - * This enumeration defines values for requester type for GPS verification message + * @brief This enumeration defines values for requester type for GPS verification message + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_AGPS_REQ_LOGICAL_NAME = 0x00, /**< Specifies logical name. */ + HAL_LOCATION_AGPS_REQ_EMAIL_ADDR = 0x01, /**< Specifies e-mail address */ + HAL_LOCATION_AGPS_REQ_MSISDN = 0x02, /**< Specifies MSISDN number */ + HAL_LOCATION_AGPS_REQ_URL = 0x03, /**< Specifies URL */ + HAL_LOCATION_AGPS_REQ_SIPURL = 0x04, /**< Specifies SIPURL */ + HAL_LOCATION_AGPS_REQ_MIN = 0x05, /**< Specifies MIN */ + HAL_LOCATION_AGPS_REQ_MDN = 0x06, /**< Specifies MDN */ + HAL_LOCATION_AGPS_REQ_UNKNOWN = 0x07 /**< Unknown request */ +} hal_location_agps_supl_format_e; /** - * This enumeration defines values for GPS encoding type for GPS verification message. + * @brief This enumeration defines values for GPS encoding type for GPS verification message. + * @since HAL_MODULE_LOCATION 1.0 */ 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. + HAL_LOCATION_AGPS_ENCODE_ISO646IRV = 0x00, /**< Specifies ISO646IRV encoding */ + HAL_LOCATION_AGPS_ENCODE_ISO8859 = 0x01, /**< Specifies ISO8859 encoding */ + HAL_LOCATION_AGPS_ENCODE_UTF8 = 0x02, /**< Specifies UTF8 encoding */ + HAL_LOCATION_AGPS_ENCODE_UTF16 = 0x03, /**< Specifies UTF16 encoding */ + HAL_LOCATION_AGPS_ENCODE_UCS2 = 0x04, /**< Specifies UCS2 encoding */ + HAL_LOCATION_AGPS_ENCODE_GSMDEFAULT = 0x05, /**< Specifies GSM default encoding */ + HAL_LOCATION_AGPS_ENCODE_SHIFT_JIS = 0x06, /**< Specifies Shift JIS encoding */ + HAL_LOCATION_AGPS_ENCODE_JIS = 0x07, /**< Specifies JIS encoding */ + HAL_LOCATION_AGPS_ENCODE_EUC = 0x08, /**< Specifies EUC encoding */ + HAL_LOCATION_AGPS_ENCODE_GB2312 = 0x09, /**< Specifies GB2312 encoding */ + HAL_LOCATION_AGPS_ENCODE_CNS11643 = 0x0A, /**< Specifies CNS11643 encoding */ + HAL_LOCATION_AGPS_ENCODE_KSC1001 = 0x0B, /**< Specifies KSC1001 encoding */ + HAL_LOCATION_AGPS_ENCODE_GERMAN = 0x0C, /**< Specifies German encoding */ + HAL_LOCATION_AGPS_ENCODE_ENGLISH = 0x0D, /**< Specifies English encoding */ + HAL_LOCATION_AGPS_ENCODE_ITALIAN = 0x0E, /**< Specifies Italian encoding */ + HAL_LOCATION_AGPS_ENCODE_FRENCH = 0x0F, /**< Specifies French encoding */ + HAL_LOCATION_AGPS_ENCODE_SPANISH = 0x10, /**< Specifies Spanish encoding */ + HAL_LOCATION_AGPS_ENCODE_DUTCH = 0x11, /**< Specifies Dutch encoding */ + HAL_LOCATION_AGPS_ENCODE_SWEDISH = 0x12, /**< Specifies Swedish encoding */ + HAL_LOCATION_AGPS_ENCODE_DANISH = 0x13, /**< Specifies Danish encoding */ + HAL_LOCATION_AGPS_ENCODE_PORTUGUESE = 0x14, /**< Specifies Portuguese encoding */ + HAL_LOCATION_AGPS_ENCODE_FINNISH = 0x15, /**< Specifies Finish encoding */ + HAL_LOCATION_AGPS_ENCODE_NORWEGIAN = 0x16, /**< Specifies Norwegian encoding */ + HAL_LOCATION_AGPS_ENCODE_GREEK = 0x17, /**< Specifies Greek encoding */ + HAL_LOCATION_AGPS_ENCODE_TURKISH = 0x18, /**< Specifies Turkish encoding */ + HAL_LOCATION_AGPS_ENCODE_HUNGARIAN = 0x19, /**< Specifies Hungarian encoding */ + HAL_LOCATION_AGPS_ENCODE_POLISH = 0x1A, /**< Specifies Polish encoding */ + HAL_LOCATION_AGPS_ENCODE_LANGUAGE_UNSPEC = 0xFF /**< Unspecified language */ +} hal_location_agps_encoding_scheme_e; + +/** + * @brief This enumeration defines values for GPS encoding type for GPS verification message. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_AGPS_ID_ENCODE_ISO646IRV = 0x00, /**< Specifies ISO646IRV encoding */ + HAL_LOCATION_AGPS_ID_ENCODE_EXN_PROTOCOL_MSG = 0x01, /**< Specifies EXN protocol message encoding */ + HAL_LOCATION_AGPS_ID_ENCODE_ASCII = 0x02, /**< Specifies ASCII encoding */ + HAL_LOCATION_AGPS_ID_ENCODE_IA5 = 0x03, /**< Specifies IA5 encoding */ + HAL_LOCATION_AGPS_ID_ENCODE_UNICODE = 0x04, /**< Specifies Unicode encoding */ + HAL_LOCATION_AGPS_ID_ENCODE_SHIFT_JIS = 0x05, /**< Specifies Shift JIS encoding */ + HAL_LOCATION_AGPS_ID_ENCODE_KOREAN = 0x06, /**< Specifies Korean encoding */ + HAL_LOCATION_AGPS_ID_ENCODE_LATIN_HEBREW = 0x07, /**< Specifies Latin Hebrew encoding */ + HAL_LOCATION_AGPS_ID_ENCODE_LATIN = 0x08, /**< Specifies Latin encoding */ + HAL_LOCATION_AGPS_ID_ENCODE_GSM = 0x09 /**< Specifies GSM encoding */ +} hal_location_agps_requester_id_encoding_e; /** - * This structure defines the values for GPS Verification message indication. + * @brief This structure defines the values for GPS Verification message indication. + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - /** Specifies notification type refer enum tapi_gps_notify_type_t */ - agps_notify_t notify_type; + /** Specifies notification type refer enum tapi_gps_notify_type_t */ + hal_location_agps_notify_e notify_type; - /** Specifies encoding type refer enum tapi_gps_encoding_type_t */ - agps_supl_format_t supl_format; + /** Specifies encoding type refer enum tapi_gps_encoding_type_t */ + hal_location_agps_supl_format_e supl_format; - /** Specifies requester type */ - agps_encoding_scheme_t datacoding_scheme; + /** Specifies requester type */ + hal_location_agps_encoding_scheme_e datacoding_scheme; - agps_requester_id_encoding_t requester_id_encoding; + hal_location_agps_requester_id_encoding_e requester_id_encoding; - /** Specifies requester ID */ - char requester_id[MAX_REQUESTER_ID_LEN]; + /** Specifies requester ID */ + char requester_id[HAL_LOCATION_MAX_REQUESTER_ID_LEN]; - /** Specifies client name */ - char client_name[MAX_CLIENT_NAME_LEN]; + /** Specifies client name */ + char client_name[HAL_LOCATION_MAX_CLIENT_NAME_LEN]; - /** Response timer */ - int resp_timer; -} agps_verification_ev_info_t; + /** Response timer */ + int resp_timer; +} hal_location_agps_verification_ev_info_s; /** - * Factory test result information + * @brief Factory test result information + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - gps_error_t error; - int prn; - double snr; -} gps_factory_test_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ + int prn; /**< Specifies Pseudo Random Noise value */ + double snr; /**< Specifies Signal to Noise Ratio value */ +} hal_location_gps_factory_test_ev_info_s; /** - * DNS query request information + * @brief DNS query request information + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - gps_error_t error; - char domain_name[MAX_SUPL_URL_LEN]; -} gps_dns_query_ev_info_t; + hal_location_gps_error_e error; /**< Error code */ + char domain_name[HAL_LOCATION_MAX_SUPL_URL_LEN]; /**< Domain name */ +} hal_location_gps_dns_query_ev_info_s; /** - * Geofecne transition information + * @brief Geofence transition information + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - time_t geofence_timestamp; - int geofence_id; - pos_data_t pos; - geofence_zone_state_t state; -} geofence_transition_ev_info_t; + time_t geofence_timestamp; /**< Timestamp */ + int geofence_id; /**< Geofence ID */ + hal_location_pos_data_s pos; /**< Position data */ + hal_location_geofence_zone_state_e state; /**< Geofence zone state */ +} hal_location_geofence_transition_ev_info_s; /** - * Geofecne status information + * @brief Geofecne status information + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - geofence_status_t status; - pos_data_t last_pos; -} geofence_status_ev_info_t; + hal_location_geofence_status_e status; /**< Geofence status */ + hal_location_pos_data_s last_pos; /**< Last position */ +} hal_location_geofence_status_ev_info_s; /** - * Geofecne event information + * @brief Geofence event information + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - int geofence_id; - geofence_error_t error; -} geofence_event_t; + int geofence_id; /**< Geofence ID */ + hal_location_geofence_error_e error; /**< Geofence error */ +} hal_location_geofence_event_s; /** - * Type of XTRA request. Used by Wearable profile only. + * @brief Type of XTRA request. Used by Wearable profile only. + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_XTRA_REQUEST_TYPE_NONE = 0x00, /* Default value */ + HAL_LOCATION_XTRA_REQUEST_TYPE_QCOM = 0x01, /* Request type QCOM */ + HAL_LOCATION_XTRA_REQUEST_TYPE_BRCM = 0x02, /* Request type BRCM */ + HAL_LOCATION_XTRA_REQEUST_TYPE_NUM, /* Request type NUM */ +} xtra_request_type_e; /** - * XTRA request information. Used by Wearable profile only. + * @brief XTRA request information. Used by Wearable profile only. + * @since HAL_MODULE_LOCATION 1.0 */ typedef struct { - xtra_request_type_t xtra_id; - xtra_request_error_t error; -} xtra_request_info_t; + xtra_request_type_e xtra_id; /**< XTRA request type */ + hal_location_xtra_request_error_e error; /**< Error code */ +} xtra_request_info_s; +/** + * @brief Reference data request information. + * @since HAL_MODULE_LOCATION 1.0 + */ typedef struct { - time_t timeout; -}ref_data_request_info_t; + time_t timeout; /**< Timeout */ +}ref_data_request_info_s; /** - * GPS event info + * @brief GPS event info + * @since HAL_MODULE_LOCATION 1.0 */ 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 Response */ + hal_location_gps_start_session_ev_info_s start_session_rsp; /**< Start session response */ + hal_location_gps_stop_session_ev_info_s stop_session_rsp; /**< Stop session response */ + hal_location_gps_set_option_ev_info_s set_option_rsp; /**< Set option response */ + hal_location_gps_change_interval_ev_info_s change_interval_rsp; /**< Change interval response */ - /** 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; + /** Callback related with Indication */ + hal_location_gps_pos_ev_info_s pos_ind; /**< Position indication */ + hal_location_gps_sv_ev_info_s sv_ind; /**< Satellite indication */ + hal_location_gps_nmea_ev_info_s nmea_ind; /**< NMEA indication */ + hal_location_gps_batch_ev_info_s batch_ind; /**< Batch indication */ + hal_location_agps_verification_ev_info_s agps_verification_ind; /**< Verification indication */ - gps_factory_test_ev_info_t factory_test_rsp; - gps_dns_query_ev_info_t dns_query_ind; + hal_location_gps_factory_test_ev_info_s factory_test_rsp; /**< Factory test response */ + hal_location_gps_dns_query_ev_info_s dns_query_ind; /**< DNS query indication */ - /** 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 Geofence. */ + hal_location_geofence_transition_ev_info_s geofence_transition_ind; /**< Geofence transition indication */ + hal_location_geofence_status_ev_info_s geofence_status_ind; /**< Geofence status indication */ + hal_location_geofence_event_s geofence_event_rsp; /**< Geofence event response */ - /** 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; + /** Callback related with XTRA. Used by Wearable profile only. */ + xtra_request_info_s xtra_request_ind; /**< XTRA request indication */ + ref_data_request_info_s ref_data_req_ind; /**< Reference data request indication */ +} gps_event_data_u; /** - * Transport Error Cause + * @brief Transport Error Cause + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_GPS_FAILURE_CAUSE_NORMAL = 0x00, /**< Normal cause */ + HAL_LOCATION_GPS_FAILURE_CAUSE_FACTORY_TEST, /**< Factory test cause */ + HAL_LOCATION_GPS_FAILURE_CAUSE_DNS_QUERY, /**< DNS query cause */ + HAL_LOCATION_GPS_FAILURE_CAUSE_LBS_SERVER_FINISH /**< LBS server finish cause */ +} gps_failure_reason_e; /** - * GPS Event Info + * @brief GPS Event Info + * @since HAL_MODULE_LOCATION 1.0 */ 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; + hal_location_gps_event_id_e event_id; /**< GPS asynchronous event id */ + gps_event_data_u event_data; /**< GPS event information data */ +} gps_event_info_s; /** - * Callback function - * LBS server needs to register a callback function with GPS OEM to receive asynchronous events. + * @brief Callback function + * @remarks LBS server needs to register a callback function with GPS OEM to receive asynchronous events. + * @since HAL_MODULE_LOCATION 1.0 */ -typedef int (*gps_event_cb)(gps_event_info_t *gps_event_info, void *user_data); +typedef int (*gps_event_cb)(gps_event_info_s *gps_event_info, void *user_data); /** - * GPS action type + * @brief GPS action type + * @since HAL_MODULE_LOCATION 1.0 */ typedef enum { - GPS_ACTION_SEND_PARAMS = 0x000, - GPS_ACTION_START_SESSION, - GPS_ACTION_STOP_SESSION, - GPS_ACTION_CHANGE_INTERVAL, + HAL_LOCATION_GPS_ACTION_SEND_PARAMS = 0x000, /**< Send parameter */ + HAL_LOCATION_GPS_ACTION_START_SESSION, /**< Start session */ + HAL_LOCATION_GPS_ACTION_STOP_SESSION, /**< Stop session */ + HAL_LOCATION_GPS_ACTION_CHANGE_INTERVAL, /**< Change interval */ - GPS_INDI_SUPL_VERIFICATION, - GPS_INDI_SUPL_DNSQUERY, + HAL_LOCATION_GPS_INDI_SUPL_VERIFICATION, /**< SUPL verification */ + HAL_LOCATION_GPS_INDI_SUPL_DNSQUERY, /**< DNS query */ - GPS_ACTION_START_FACTTEST, - GPS_ACTION_STOP_FACTTEST, - GPS_ACTION_REQUEST_SUPL_NI, - GPS_ACTION_REQUEST_SUPL_NI_NOMODEM, - GPS_ACTION_DELETE_GPS_DATA, + HAL_LOCATION_GPS_ACTION_START_FACTTEST, /**< Start Factory test */ + HAL_LOCATION_GPS_ACTION_STOP_FACTTEST, /**< Stop Factory test */ + HAL_LOCATION_GPS_ACTION_REQUEST_SUPL_NI, /**< Request SUPL NI */ + HAL_LOCATION_GPS_ACTION_REQUEST_SUPL_NI_NOMODEM, /**< Request SUPL NI in case of no modem */ + HAL_LOCATION_GPS_ACTION_DELETE_GPS_DATA, /**< Delete GPS data */ - GPS_ACTION_ADD_GEOFENCE, - GPS_ACTION_DELETE_GEOFENCE, - GPS_ACTION_PAUSE_GEOFENCE, - GPS_ACTION_RESUME_GEOFENCE, + HAL_LOCATION_GPS_ACTION_ADD_GEOFENCE, /**< Add geofence */ + HAL_LOCATION_GPS_ACTION_DELETE_GEOFENCE, /**< Delete geofence */ + HAL_LOCATION_GPS_ACTION_PAUSE_GEOFENCE, /**< Pause geofence */ + HAL_LOCATION_GPS_ACTION_RESUME_GEOFENCE, /**< 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. */ + HAL_LOCATION_GPS_ACTION_DOWNLOAD_XTRA, /* Used by Wearable profile only. */ /**< Download XTRA */ + HAL_LOCATION_GPS_ACTION_CONSUMER_CONNECTED, /* Used by Wearable profile only. */ /**< Consumer connected */ + HAL_LOCATION_GPS_ACTION_CONSUMER_DISCONNECTED, /* Used by Wearable profile only. */ /**< Consumer disconnected */ - GPS_ACTION_CHANGE_INTERVAL_SPORTMODE, + HAL_LOCATION_GPS_ACTION_CHANGE_INTERVAL_SPORTMODE, /**< Change interval for sport mode */ - GPS_ACTION_SET_REF_LOCATION, /* Used by Wearable profile only. */ - GPS_ACTION_SET_REF_TIME, /* Used by Wearable profile only. */ + HAL_LOCATION_GPS_ACTION_SET_REF_LOCATION, /* Used by Wearable profile only. */ /**< Set reference location */ + HAL_LOCATION_GPS_ACTION_SET_REF_TIME, /* Used by Wearable profile only. */ /**< Set reference time */ - GPS_ACTION_START_BATCH, - GPS_ACTION_STOP_BATCH, - GPS_ACTION_ADD_REDUCE_SET, - GPS_ACTION_REMOVE_REDUCE_SET -} gps_action_t; + HAL_LOCATION_GPS_ACTION_START_BATCH, /**< Start batch */ + HAL_LOCATION_GPS_ACTION_STOP_BATCH, /**< Stop batch */ + HAL_LOCATION_GPS_ACTION_ADD_REDUCE_SET, /**< Add reduce set */ + HAL_LOCATION_GPS_ACTION_REMOVE_REDUCE_SET /**< Remove reduce set */ +} hal_location_gps_action_e; /** - * Cell information type + * @brief Cell information type + * @since HAL_MODULE_LOCATION 1.0 */ 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 + HAL_LOCATION_GPS_CELL_INFO_TYPE_aRFCNPresent = 0, /**< aRFCN present */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_bSICPresent, /**< bSIC present */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_rxLevPresent, /**< rxLev present */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_frequencyInfoPresent, /**< frequencyInfo present */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_cellMeasuredResultPresent, /**< cellMeasuredResult present */ + + HAL_LOCATION_GPS_CELL_INFO_TYPE_refMCC, /**< refMCC */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_refMNC, /**< refMNC */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_refLAC, /**< refLAC */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_refCI, /**< refCI */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_refUC, /**< refUC */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_aRFCN, /**< aRFCN */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_bSIC, /**< bSIC */ + HAL_LOCATION_GPS_CELL_INFO_TYPE_rxLev /**< rxLev */ +} hal_location_agps_cell_info_e; + +/** + * @brief Mobile service type + * @since HAL_MODULE_LOCATION 1.0 */ 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; + HAL_LOCATION_SVCTYPE_NONE = 0, /**< Unknown network */ + HAL_LOCATION_SVCTYPE_NOSVC, /**< Network in no service */ + HAL_LOCATION_SVCTYPE_EMERGENCY, /**< Network emergency */ + HAL_LOCATION_SVCTYPE_SEARCH, /**< Network search 1900 */ + HAL_LOCATION_SVCTYPE_2G, /**< Network 2G */ + HAL_LOCATION_SVCTYPE_2_5G, /**< Network 2.5G */ + HAL_LOCATION_SVCTYPE_2_5G_EDGE, /**< Network EDGE */ + HAL_LOCATION_SVCTYPE_3G, /**< Network UMTS */ + HAL_LOCATION_SVCTYPE_HSDPA /**< Network HSDPA */ +} hal_location_agps_svc_type_e; /** - * SUPL network-initiated information + * @brief SUPL network-initiated information + * @since HAL_MODULE_LOCATION 1.0 */ 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; + char *msg_body; /**< SUPL NI message body */ + int msg_size; /**< SUPL NI message size */ + int status; /**< Return code of Status */ +} hal_location_agps_supl_ni_info_s; /** - * SUPL network-initiated information in case of no-modem + * @brief SUPL network-initiated information in case of no-modem + * @since HAL_MODULE_LOCATION 1.0 */ 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; + 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 */ +} hal_location_agps_supl_ni_nomodem_info_s; /** - * Geofence action data type + * @brief Geofence action data type + * @since HAL_MODULE_LOCATION 1.0 */ 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; + hal_location_geofence_data_s geofence; /**< Geofence data */ + hal_location_geofence_zone_state_e last_state; /**< Last state */ + int monitor_states; /**< Monitor states */ + int notification_responsiveness_ms; /**< Notification responsiveness in milliseconds */ + int unknown_timer_ms; /**< Unknown timer in milliseconds */ +} hal_location_geofence_action_data_s; +/** + * @brief GPS action start data + * @since HAL_MODULE_LOCATION 1.0 + */ typedef struct { - int interval; - int period; /**< Emulator */ - int session_status; /**< Emulator */ -} gps_action_start_data_t; + int interval; /**< Interval */ + int period; /**< Emulator */ + int session_status; /**< Emulator */ +} hal_location_gps_action_start_data_s; +/** + * @brief GPS action change interval data + * @since HAL_MODULE_LOCATION 1.0 + */ typedef struct { - int interval; -} gps_action_change_interval_data_t; + int interval; /**< Interval */ +} hal_location_gps_action_change_interval_data_s; -/* -* GPS_ACTION_SET_REF_LOCATION +/** +* @brief GPS action to set ref location +* @since HAL_MODULE_LOCATION 1.0 */ 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 + int result; /**< Result */ + int reason; /**< Reason */ + time_t timestamp; /**< Timestamp */ + double latitude; /**< Latitude data (in degree) */ + double longitude; /**< Longitude data (in degree) */ + double accuracy; /**< Horizontal position error(in meter) */ +} hal_location_gps_action_set_ref_location_s; -/* -* GPS_ACTION_SET_REF_TIME +/** +* @brief GPS action to set ref time +* @since HAL_MODULE_LOCATION 1.0 */ 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 + int result; /**< Result */ + int reason; /**< Reason */ + int method; /**< 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 */ +} hal_location_gps_action_set_ref_time_s; +/** +* @brief HAL Backend Location Functions +* @since HAL_MODULE_LOCATION 1.0 +*/ 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); + int (*init)(gps_event_cb gps_event_cb, void *user_data); /**< Initialize GPS */ + int (*deinit)(gps_failure_reason_e *reason_code); /**< Deinitialize GPS */ + int (*request)(hal_location_gps_action_e gps_action, void *gps_action_data, gps_failure_reason_e *reason_code); /**< Request GPS action */ } hal_backend_location_funcs; +/* +* @} +*/ + #ifdef __cplusplus } #endif -#endif /* __HAL_LOCATION_INTERFACE_1__ */ - +#endif /* __HAL_LOCATION_INTERFACE_1__ */ \ No newline at end of file diff --git a/include/hal-location.h b/include/hal-location.h index ec05c09..cc34c39 100644 --- a/include/hal-location.h +++ b/include/hal-location.h @@ -75,7 +75,7 @@ int hal_location_deinit(gps_failure_reason_t *reason_code); * @retval #-ENOSUP Invalid operation * @see hal_location_init() */ -int hal_location_request(gps_action_t gps_action, void *gps_action_data, gps_failure_reason_t *reason_code); +int hal_location_request(hal_location_gps_action_e gps_action, void *gps_action_data, gps_failure_reason_t *reason_code); #ifdef __cplusplus } diff --git a/src/hal-api-location.c b/src/hal-api-location.c index 7e3db11..c115f73 100644 --- a/src/hal-api-location.c +++ b/src/hal-api-location.c @@ -92,7 +92,7 @@ int hal_location_deinit(gps_failure_reason_t *reason_code) } EXPORT -int hal_location_request(gps_action_t gps_action, void *gps_action_data, gps_failure_reason_t *reason_code) +int hal_location_request(hal_location_gps_action_e gps_action, void *gps_action_data, gps_failure_reason_t *reason_code) { if (!g_hal_location_funcs) return -ENOTSUP;