4 * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngae Kang <youngae.kang@samsung.com>, Minjune Kim <sena06.kim@samsung.com>
7 * Genie Kim <daejins.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_PLUGIN_PLUGIN_INTF_H_
23 #define _GPS_PLUGIN_PLUGIN_INTF_H_
25 #include <gps_plugin_data_types.h>
26 #include <gps_plugin_extra_data_types.h>
32 #define GPS_PLUGIN_PATH LIB_DIR"/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 asynchronous event type
41 GPS_EVENT_START_SESSION = 0x0000, /**< The session is started */
42 GPS_EVENT_STOP_SESSION, /**< The session is stopped */
43 GPS_EVENT_CHANGE_INTERVAL, /**< Change updating interval */
44 GPS_EVENT_REPORT_POSITION = 0x0100, /**< Bring up GPS position data */
45 GPS_EVENT_REPORT_SATELLITE, /**< Bring up GPS SV data */
46 GPS_EVENT_REPORT_NMEA, /**< Bring up GPS NMEA data */
47 GPS_EVENT_REPORT_BATCH, /**< Bring up GPS batch data */
48 GPS_EVENT_SET_OPTION = 0x0200, /**< The option is set */
49 GPS_EVENT_GET_REF_LOCATION = 0x0300, /**< Get the reference location for AGPS */
50 GPS_EVENT_GET_IMSI, /**< Get IMSI for identification */
51 GPS_EVENT_OPEN_DATA_CONNECTION = 0x0400, /**< Request opening data network connection */
52 GPS_EVENT_CLOSE_DATA_CONNECTION, /**< Request closing data network connection */
53 GPS_EVENT_DNS_LOOKUP_IND, /**< Request resolving host name */
54 GPS_EVENT_AGPS_VERIFICATION_INDI, /**< Verification indicator for AGPS is required */
55 GPS_EVENT_FACTORY_TEST = 0x0500, /**< Factory test is done */
56 GPS_EVENT_GEOFENCE_TRANSITION = 0x0600, /**< Geofence transition is occured */
57 GPS_EVENT_GEOFENCE_STATUS, /**< Report geofence serivce status */
58 GPS_EVENT_ADD_GEOFENCE, /**< Geofence is added(Start geofence) */
59 GPS_EVENT_DELETE_GEOFENCE, /**< Geofence is deleted(Stop geofence) */
60 GPS_EVENT_PAUSE_GEOFENCE, /**< Geofence is paused */
61 GPS_EVENT_RESUME_GEOFENCE, /**< Geofence is resumed */
62 GPS_EVENT_ERR_CAUSE = 0xFFFF /**< Some error is occurred */
66 * Start session response event data
70 } gps_start_session_ev_info_t;
73 * Response of stop session
77 } gps_stop_session_ev_info_t;
80 * Set option response event data
84 } gps_set_option_ev_info_t;
88 } gps_change_interval_ev_info_t;
91 * Position data from GPS
104 } gps_batch_ev_info_t;
107 * Satellite data from GPS
120 } gps_nmea_ev_info_t;
123 * This enumeration defines values for notify type for GPS verification message.
126 AGPS_NOTIFY_NO_VERIFY = 0x00,
127 AGPS_NOTIFY_ONLY = 0x01,
128 AGPS_NOTIFY_ALLOW_NORESPONSE = 0x02,
129 AGPS_NOTIFY_NOTALLOW_NORESPONSE = 0x03,
130 AGPS_NOTIFY_PRIVACY_NEEDED = 0x04,
131 AGPS_NOTIFY_PRIVACY_OVERRIDE = 0x05
135 * This enumeration defines values for requester type for GPS verification message
138 AGPS_REQ_LOGICAL_NAME = 0x00, /**< Specifies logical name. */
139 AGPS_REQ_EMAIL_ADDR = 0x01, /**< Specifies e-mail address */
140 AGPS_REQ_MSISDN = 0x02, /**< Specifies MSISDN number */
141 AGPS_REQ_URL = 0x03, /**< Specifies URL */
142 AGPS_REQ_SIPURL = 0x04, /**< Specifies SIPURL */
143 AGPS_REQ_MIN = 0x05, /**< Specifies MIN */
144 AGPS_REQ_MDN = 0x06, /**< Specifies MDN */
145 AGPS_REQ_UNKNOWN = 0x07 /**< Unknown request */
146 } agps_supl_format_t;
149 * This enumeration defines values for GPS encoding type for GPS verification message.
152 AGPS_ENCODE_ISO646IRV = 0x00,
153 AGPS_ENCODE_ISO8859 = 0x01,
154 AGPS_ENCODE_UTF8 = 0x02,
155 AGPS_ENCODE_UTF16 = 0x03,
156 AGPS_ENCODE_UCS2 = 0x04,
157 AGPS_ENCODE_GSMDEFAULT = 0x05,
158 AGPS_ENCODE_SHIFT_JIS = 0x06,
159 AGPS_ENCODE_JIS = 0x07,
160 AGPS_ENCODE_EUC = 0x08,
161 AGPS_ENCODE_GB2312 = 0x09,
162 AGPS_ENCODE_CNS11643 = 0x0A,
163 AGPS_ENCODE_KSC1001 = 0x0B,
164 AGPS_ENCODE_GERMAN = 0x0C,
165 AGPS_ENCODE_ENGLISH = 0x0D,
166 AGPS_ENCODE_ITALIAN = 0x0E,
167 AGPS_ENCODE_FRENCH = 0x0F,
168 AGPS_ENCODE_SPANISH = 0x10,
169 AGPS_ENCODE_DUTCH = 0x11,
170 AGPS_ENCODE_SWEDISH = 0x12,
171 AGPS_ENCODE_DANISH = 0x13,
172 AGPS_ENCODE_PORTUGUESE = 0x14,
173 AGPS_ENCODE_FINNISH = 0x15,
174 AGPS_ENCODE_NORWEGIAN = 0x16,
175 AGPS_ENCODE_GREEK = 0x17,
176 AGPS_ENCODE_TURKISH = 0x18,
177 AGPS_ENCODE_HUNGARIAN = 0x19,
178 AGPS_ENCODE_POLISH = 0x1A,
179 AGPS_ENCODE_LANGUAGE_UNSPEC = 0xFF
180 } agps_encoding_scheme_t;
183 * This enumeration defines values for GPS encoding type for GPS verification message.
186 AGPS_ID_ENCODE_ISO646IRV = 0x00,
187 AGPS_ID_ENCODE_EXN_PROTOCOL_MSG = 0x01,
188 AGPS_ID_ENCODE_ASCII = 0x02,
189 AGPS_ID_ENCODE_IA5 = 0x03,
190 AGPS_ID_ENCODE_UNICODE = 0x04,
191 AGPS_ID_ENCODE_SHIFT_JIS = 0x05,
192 AGPS_ID_ENCODE_KOREAN = 0x06,
193 AGPS_ID_ENCODE_LATIN_HEBREW = 0x07,
194 AGPS_ID_ENCODE_LATIN = 0x08,
195 AGPS_ID_ENCODE_GSM = 0x09
196 } agps_requester_id_encoding_t;
199 * This structure defines the values for GPS Verification message indication.
202 /** Specifies notification type refer enum tapi_gps_notify_type_t */
203 agps_notify_t notify_type;
205 /** Specifies encoding type refer enum tapi_gps_encoding_type_t */
206 agps_supl_format_t supl_format;
208 /** Specifies requester type */
209 agps_encoding_scheme_t datacoding_scheme;
211 agps_requester_id_encoding_t requester_id_encoding;
213 /** Specifies requester ID */
214 char requester_id[MAX_REQUESTER_ID_LEN];
216 /** Specifies client name */
217 char client_name[MAX_CLIENT_NAME_LEN];
219 /** Response timer */
221 } agps_verification_ev_info_t;
224 * Factory test result information
230 } gps_factory_test_ev_info_t;
233 * DNS query request information
237 char domain_name[MAX_SUPL_URL_LEN];
238 } gps_dns_query_ev_info_t;
241 * Geofecne transition information
244 time_t geofence_timestamp;
247 geofence_zone_state_t state;
248 } geofence_transition_ev_info_t;
251 * Geofecne status information
254 geofence_status_t status;
256 } geofence_status_ev_info_t;
259 * Geofecne event information
263 geofence_error_t error;
270 /** Callback related with Response */
271 gps_start_session_ev_info_t start_session_rsp;
272 gps_stop_session_ev_info_t stop_session_rsp;
273 gps_set_option_ev_info_t set_option_rsp;
274 gps_change_interval_ev_info_t change_interval_rsp;
276 /** Callback related with Indication */
277 gps_pos_ev_info_t pos_ind;
278 gps_sv_ev_info_t sv_ind;
279 gps_nmea_ev_info_t nmea_ind;
280 gps_batch_ev_info_t batch_ind;
281 agps_verification_ev_info_t agps_verification_ind;
283 gps_factory_test_ev_info_t factory_test_rsp;
284 gps_dns_query_ev_info_t dns_query_ind;
286 /** Callback related with Geofence. */
287 geofence_transition_ev_info_t geofence_transition_ind;
288 geofence_status_ev_info_t geofence_status_ind;
289 geofence_event_t geofence_event_rsp;
293 * Transport Error Cause
296 GPS_FAILURE_CAUSE_NORMAL = 0x00,
297 GPS_FAILURE_CAUSE_FACTORY_TEST,
298 GPS_FAILURE_CAUSE_DNS_QUERY
299 } gps_failure_reason_t;
305 gps_event_id_t event_id; /**< GPS asynchronous event id */
306 gps_event_data_t event_data; /**< GPS event information data */
311 * LBS server needs to register a callback function with GPS OEM to receive asynchronous events.
313 typedef int (*gps_event_cb)(gps_event_info_t *gps_event_info, void *user_data);
319 GPS_ACTION_SEND_PARAMS = 0x000,
320 GPS_ACTION_START_SESSION,
321 GPS_ACTION_STOP_SESSION,
322 GPS_ACTION_START_BATCH,
323 GPS_ACTION_STOP_BATCH,
324 GPS_ACTION_CHANGE_INTERVAL,
326 GPS_INDI_SUPL_VERIFICATION,
327 GPS_INDI_SUPL_DNSQUERY,
329 GPS_ACTION_START_FACTTEST,
330 GPS_ACTION_STOP_FACTTEST,
331 GPS_ACTION_REQUEST_SUPL_NI,
332 GPS_ACTION_DELETE_GPS_DATA,
334 GPS_ACTION_ADD_GEOFENCE,
335 GPS_ACTION_DELETE_GEOFENCE,
336 GPS_ACTION_PAUSE_GEOFENCE,
337 GPS_ACTION_RESUME_GEOFENCE,
341 * Cell information type
344 GPS_CELL_INFO_TYPE_aRFCNPresent = 0,
345 GPS_CELL_INFO_TYPE_bSICPresent,
346 GPS_CELL_INFO_TYPE_rxLevPresent,
347 GPS_CELL_INFO_TYPE_frequencyInfoPresent,
348 GPS_CELL_INFO_TYPE_cellMeasuredResultPresent,
350 GPS_CELL_INFO_TYPE_refMCC,
351 GPS_CELL_INFO_TYPE_refMNC,
352 GPS_CELL_INFO_TYPE_refLAC,
353 GPS_CELL_INFO_TYPE_refCI,
354 GPS_CELL_INFO_TYPE_refUC,
355 GPS_CELL_INFO_TYPE_aRFCN,
356 GPS_CELL_INFO_TYPE_bSIC,
357 GPS_CELL_INFO_TYPE_rxLev
361 * Mobile service type
364 SVCTYPE_NONE = 0, /**< Unknown network */
365 SVCTYPE_NOSVC, /**< Network in no service */
366 SVCTYPE_EMERGENCY, /**< Network emergency */
367 SVCTYPE_SEARCH, /**< Network search 1900 */
368 SVCTYPE_2G, /**< Network 2G */
369 SVCTYPE_2_5G, /**< Network 2.5G */
370 SVCTYPE_2_5G_EDGE, /**< Network EDGE */
371 SVCTYPE_3G, /**< Network UMTS */
372 SVCTYPE_HSDPA /**< Network HSDPA */
376 * SUPL network-initiated information
379 char *msg_body; /**< SUPL NI message body */
380 int msg_size; /**< SUPL NI message size */
381 int status; /**< Return code of Status */
382 } agps_supl_ni_info_t;
385 * Geofence action data type
388 geofence_data_t geofence;
389 geofence_zone_state_t last_state;
391 int notification_responsiveness_ms;
392 int unknown_timer_ms;
393 } geofence_action_data_t;
398 } gps_action_start_data_t;
402 } gps_action_change_interval_data_t;
405 * gps-plugin plugin interface
408 /** Initialize plugin module and register callback function for event delivery. */
409 int (*init)(gps_event_cb gps_event_cb, void *user_data);
411 /** Deinitialize plugin module */
412 int (*deinit)(gps_failure_reason_t *reason_code);
414 /** Request specific action to plugin module */
415 int (*request)(gps_action_t gps_action, void *gps_action_data, gps_failure_reason_t *reason_code);
416 } gps_plugin_interface;
418 const gps_plugin_interface *get_gps_plugin_interface();
423 #endif /* _GPS_PLUGIN_INTF_H_ */