4 * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngae Kang <youngae.kang@samsung.com>, Yunhan Kim <yhan.kim@samsung.com>,
7 * Genie Kim <daejins.kim@samsung.com>, Minjune Kim <sena06.kim@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
22 #ifndef _GPS_MANAGER_PLUGIN_INTF_H_
23 #define _GPS_MANAGER_PLUGIN_INTF_H_
25 #include <gps_manager_data_types.h>
26 #include <gps_manager_extra_data_types.h>
32 #define GPS_MANAGER_PLUGIN_PATH "/usr/lib/libSLP-lbs-plugin.so"
33 #define MAX_REQUESTER_ID_LEN (128)
34 #define MAX_CLIENT_NAME_LEN (128)
35 #define MAX_SUPL_URL_LEN (128)
38 * GPS setting parameters
41 gps_session_t session_type; /**< Session type */
42 gps_operation_t operation_mode; /**< Operation mode */
43 gps_starting_t starting_type; /**< Starting type */
44 int num_fixes; /**< Total number of fixes to be done */
45 int time_bn_fixes; /**< Time between fix */
46 char supl_url[MAX_SUPL_URL_LEN];/**< SUPL URL */
47 int supl_port; /**< SUPL port number */
48 agps_ssl_mode_t ssl_mode; /**< SSL mode */
49 agps_ssl_cert_type_t cert_type; /**< SSL certification type */
53 * GPS asynchronous event type
56 GPS_EVENT_START_SESSION = 0x0000,/**< The session is started */
57 GPS_EVENT_STOP_SESSION, /**< The session is stopped */
58 GPS_EVENT_REPORT_POSITION = 0x0100,/**< Bring up GPS position data */
59 GPS_EVENT_REPORT_SATELLITE, /**< Bring up GPS SV data */
60 GPS_EVENT_REPORT_NMEA, /**< Bring up GPS NMEA data */
61 GPS_EVENT_SET_OPTION = 0x0200,/**< The option is set */
62 GPS_EVENT_GET_REF_LOCATION = 0x0300,/**< Get the reference location for AGPS */
63 GPS_EVENT_GET_IMSI, /**< Get IMSI for identification */
64 GPS_EVENT_OPEN_DATA_CONNECTION = 0x0400,/**< Request opening data network connection */
65 GPS_EVENT_CLOSE_DATA_CONNECTION, /**< Request closing data network connection */
66 GPS_EVENT_DNS_LOOKUP_IND, /**< Request resolving host name */
67 GPS_EVENT_AGPS_VERIFICATION_INDI, /**< Verification indicator for AGPS is required */
68 GPS_EVENT_FACTORY_TEST = 0x0500,/**< Factory test is done */
69 GPS_EVENT_ERR_CAUSE = 0xFFFF /**< Some error is occurred */
73 * Start session response event data
77 } gps_start_session_ev_info_t;
80 * Response of stop session
84 } gps_stop_session_ev_info_t;
87 * Set option response event data
91 } gps_set_option_ev_info_t;
95 * Position data from GPS
103 * Satellite data from GPS
116 } gps_nmea_ev_info_t;
119 * This enumeration defines values for notify type for GPS verification message.
122 AGPS_NOTIFY_NO_VERIFY = 0x00,
123 AGPS_NOTIFY_ONLY = 0x01,
124 AGPS_NOTIFY_ALLOW_NORESPONSE = 0x02,
125 AGPS_NOTIFY_NOTALLOW_NORESPONSE = 0x03,
126 AGPS_NOTIFY_PRIVACY_NEEDED = 0x04,
127 AGPS_NOTIFY_PRIVACY_OVERRIDE = 0x05
131 * This enumeration defines values for requester type for GPS verification message
134 AGPS_REQ_LOGICAL_NAME = 0x00, /**< Specifies logical name. */
135 AGPS_REQ_EMAIL_ADDR = 0x01, /**< Specifies e-mail address */
136 AGPS_REQ_MSISDN = 0x02, /**< Specifies MSISDN number */
137 AGPS_REQ_URL = 0x03, /**< Specifies URL */
138 AGPS_REQ_SIPURL = 0x04, /**< Specifies SIPURL */
139 AGPS_REQ_MIN = 0x05, /**< Specifies MIN */
140 AGPS_REQ_MDN = 0x06, /**< Specifies MDN */
141 AGPS_REQ_UNKNOWN = 0x07 /**< Unknown request */
142 } agps_supl_format_t;
145 * This enumeration defines values for GPS encoding type for GPS verification message.
148 AGPS_ENCODE_ISO646IRV = 0x00,
149 AGPS_ENCODE_ISO8859 = 0x01,
150 AGPS_ENCODE_UTF8 = 0x02,
151 AGPS_ENCODE_UTF16 = 0x03,
152 AGPS_ENCODE_UCS2 = 0x04,
153 AGPS_ENCODE_GSMDEFAULT = 0x05,
154 AGPS_ENCODE_SHIFT_JIS = 0x06,
155 AGPS_ENCODE_JIS = 0x07,
156 AGPS_ENCODE_EUC = 0x08,
157 AGPS_ENCODE_GB2312 = 0x09,
158 AGPS_ENCODE_CNS11643 = 0x0A,
159 AGPS_ENCODE_KSC1001 = 0x0B,
160 AGPS_ENCODE_GERMAN = 0x0C,
161 AGPS_ENCODE_ENGLISH = 0x0D,
162 AGPS_ENCODE_ITALIAN = 0x0E,
163 AGPS_ENCODE_FRENCH = 0x0F,
164 AGPS_ENCODE_SPANISH = 0x10,
165 AGPS_ENCODE_DUTCH = 0x11,
166 AGPS_ENCODE_SWEDISH = 0x12,
167 AGPS_ENCODE_DANISH = 0x13,
168 AGPS_ENCODE_PORTUGUESE = 0x14,
169 AGPS_ENCODE_FINNISH = 0x15,
170 AGPS_ENCODE_NORWEGIAN = 0x16,
171 AGPS_ENCODE_GREEK = 0x17,
172 AGPS_ENCODE_TURKISH = 0x18,
173 AGPS_ENCODE_HUNGARIAN = 0x19,
174 AGPS_ENCODE_POLISH = 0x1A,
175 AGPS_ENCODE_LANGUAGE_UNSPEC = 0xFF
176 } agps_encoding_scheme_t;
179 * This enumeration defines values for GPS encoding type for GPS verification message.
182 AGPS_ID_ENCODE_ISO646IRV = 0x00,
183 AGPS_ID_ENCODE_EXN_PROTOCOL_MSG = 0x01,
184 AGPS_ID_ENCODE_ASCII = 0x02,
185 AGPS_ID_ENCODE_IA5 = 0x03,
186 AGPS_ID_ENCODE_UNICODE = 0x04,
187 AGPS_ID_ENCODE_SHIFT_JIS = 0x05,
188 AGPS_ID_ENCODE_KOREAN = 0x06,
189 AGPS_ID_ENCODE_LATIN_HEBREW = 0x07,
190 AGPS_ID_ENCODE_LATIN = 0x08,
191 AGPS_ID_ENCODE_GSM = 0x09
192 } agps_requester_id_encoding_t;
195 * This structure defines the values for GPS Verification message indication.
198 /** Specifies notification type refer enum tapi_gps_notify_type_t */
199 agps_notify_t notify_type;
201 /** Specifies encoding type refer enum tapi_gps_encoding_type_t */
202 agps_supl_format_t supl_format;
204 /** Specifies requester type */
205 agps_encoding_scheme_t datacoding_scheme;
207 agps_requester_id_encoding_t requester_id_encoding;
209 /** Specifies requester ID */
210 char requester_id[MAX_REQUESTER_ID_LEN];
212 /** Specifies client name */
213 char client_name[MAX_CLIENT_NAME_LEN];
215 /** Response timer */
217 } agps_verification_ev_info_t;
220 * Factory test result information
226 } gps_factory_test_ev_info_t;
229 * DNS query request information
233 char domain_name[MAX_SUPL_URL_LEN];
234 } gps_dns_query_ev_info_t;
240 /** Callback related with Response */
241 gps_start_session_ev_info_t start_session_rsp;
242 gps_stop_session_ev_info_t stop_session_rsp;
243 gps_set_option_ev_info_t set_option_rsp;
245 /** Callback Related with Indication */
246 gps_pos_ev_info_t pos_ind;
247 gps_sv_ev_info_t sv_ind;
248 gps_nmea_ev_info_t nmea_ind;
249 agps_verification_ev_info_t agps_verification_ind;
251 gps_factory_test_ev_info_t factory_test_rsp;
252 gps_dns_query_ev_info_t dns_query_ind;
256 * Transport Error Cause
259 GPS_FAILURE_CAUSE_NORMAL = 0x00,
260 GPS_FAILURE_CAUSE_FACTORY_TEST,
261 GPS_FAILURE_CAUSE_DNS_QUERY
262 } gps_failure_reason_t;
268 gps_event_id_t event_id; /**< GPS asynchronous event id */
269 gps_event_data_t event_data; /**< GPS event information data */
274 * LBS server needs to register a callback function with GPS OEM to receive asynchronous events.
276 typedef int (*gps_event_cb) (gps_event_info_t *gps_event_info);
282 GPS_ACTION_SEND_PARAMS = 0x000,
283 GPS_ACTION_START_SESSION,
284 GPS_ACTION_STOP_SESSION,
286 GPS_INDI_SUPL_VERIFICATION,
287 GPS_INDI_SUPL_DNSQUERY,
289 GPS_ACTION_START_FACTTEST,
290 GPS_ACTION_STOP_FACTTEST,
291 GPS_ACTION_REQUEST_SUPL_NI
295 * Cell information type
298 GPS_CELL_INFO_TYPE_aRFCNPresent = 0,
299 GPS_CELL_INFO_TYPE_bSICPresent,
300 GPS_CELL_INFO_TYPE_rxLevPresent,
301 GPS_CELL_INFO_TYPE_frequencyInfoPresent,
302 GPS_CELL_INFO_TYPE_cellMeasuredResultPresent,
304 GPS_CELL_INFO_TYPE_refMCC,
305 GPS_CELL_INFO_TYPE_refMNC,
306 GPS_CELL_INFO_TYPE_refLAC,
307 GPS_CELL_INFO_TYPE_refCI,
308 GPS_CELL_INFO_TYPE_refUC,
309 GPS_CELL_INFO_TYPE_aRFCN,
310 GPS_CELL_INFO_TYPE_bSIC,
311 GPS_CELL_INFO_TYPE_rxLev
315 * Mobile service type
318 SVCTYPE_NONE = 0, /**< Unknown network */
319 SVCTYPE_NOSVC, /**< Network in no service */
320 SVCTYPE_EMERGENCY, /**< Network emergency */
321 SVCTYPE_SEARCH, /**< Network search 1900 */
322 SVCTYPE_2G, /**< Network 2G */
323 SVCTYPE_2_5G, /**< Network 2.5G */
324 SVCTYPE_2_5G_EDGE, /**< Network EDGE */
325 SVCTYPE_3G, /**< Network UMTS */
326 SVCTYPE_HSDPA /**< Network HSDPA */
330 * SUPL network-initiated information
333 char *msg_body; /**< SUPL NI message body */
334 int msg_size; /**< SUPL NI message size */
335 int status; /**< Return code of Status */
336 } agps_supl_ni_info_t;
339 * gps-manager plugin interface
342 /** Initialize plugin module and register callback function for event delivery. */
343 int (*init) (gps_event_cb gps_event_cb, gps_server_param_t * gps_params);
345 /** Deinitialize plugin module */
346 int (*deinit) (gps_failure_reason_t *reason_code);
348 /** Request specific action to plugin module */
349 int (*request) (gps_action_t gps_action, void *data,
350 gps_failure_reason_t *reason_code);
351 } gps_plugin_interface;
353 const gps_plugin_interface *get_gps_plugin_interface();
358 #endif /* _GPS_MANAGER_PLUGIN_INTF_H_ */