Git init
[framework/api/location-manager.git] / include / locations.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. 
15 */
16
17 #ifndef __TIZEN_LOCATION_LOCATIONS_H__
18 #define __TIZEN_LOCATION_LOCATIONS_H__
19
20 #include <tizen_type.h>
21 #include <tizen_error.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @addtogroup CAPI_LOCATION_MANAGER_MODULE
29  * @{
30  */
31
32 /**
33  * @brief Enumerations of error code for Location manager.
34  */
35 typedef enum
36 {
37     LOCATIONS_ERROR_NONE = TIZEN_ERROR_NONE,                                        /**< Successful */
38     LOCATIONS_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,                    /**< Out of memory */
39     LOCATIONS_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,            /**< Invalid parameter */
40     LOCATIONS_ERROR_INCORRECT_METHOD = TIZEN_ERROR_LOCATION_CLASS | 0x01,         /**< Location manager contains incorrect method for a given call */
41     LOCATIONS_ERROR_NETWORK_FAILED = TIZEN_ERROR_LOCATION_CLASS | 0x02,           /**< Network unavailable */
42     LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE = TIZEN_ERROR_LOCATION_CLASS | 0x03,    /**< Service unavailable */
43     LOCATIONS_ERROR_GPS_SETTING_OFF = TIZEN_ERROR_LOCATION_CLASS | 0x04,    /**< GPS is not enabled  */
44 } location_error_e;
45
46
47
48 /**
49  * @brief Location method type.
50  */
51 typedef enum
52 {
53     LOCATIONS_METHOD_NONE=0,    /**< Undefined method. */
54     LOCATIONS_METHOD_HYBRID,    /**< This method selects the best method available at the moment. */
55     LOCATIONS_METHOD_GPS,       /**< This method uses Global Positioning System. */
56     LOCATIONS_METHOD_WPS,       /**< This method uses Wifi Positioning System. */
57     LOCATIONS_METHOD_SPS        /**< This method uses sensor. */
58 } location_method_e;
59
60 /**
61  * @brief Approximate accuracy level of given information.
62  */
63 typedef enum
64 {
65     LOCATIONS_ACCURACY_NONE=0,      /**< Invalid data. */
66     LOCATIONS_ACCURACY_COUNTRY,     /**< Country accuracy level. */
67     LOCATIONS_ACCURACY_REGION,      /**< Regional accuracy level. */
68     LOCATIONS_ACCURACY_LOCALITY,    /**< Local accuracy level. */
69     LOCATIONS_ACCURACY_POSTALCODE,  /**< Postal accuracy level. */
70     LOCATIONS_ACCURACY_STREET,      /**< Street accuracy level. */
71     LOCATIONS_ACCURACY_DETAILED,    /**< Detailed accuracy level. */
72 } location_accuracy_level_e;
73
74 /**
75  * @brief Enumerations of the state of the location service.
76  */
77 typedef enum
78 {
79     LOCATIONS_SERVICE_DISABLED, /**< Service is disabled */
80     LOCATIONS_SERVICE_ENABLED  /**< Service is enabled */
81 } location_service_state_e;
82
83 /**
84  * @brief Enumerations of the boundary state.
85  */
86 typedef enum
87 {
88     LOCATIONS_BOUNDARY_IN,  /**< Boundary In (Zone In) */
89     LOCATIONS_BOUNDARY_OUT  /**< Boundary Out (Zone Out) */
90 } location_boundary_state_e;
91
92 /**
93  * @brief The location manager handle.
94  */
95  typedef struct location_manager_s *location_manager_h;
96
97 /**
98  * @}
99  */
100 /*
101  * Location Manager
102 */
103 /**
104  * @addtogroup CAPI_LOCATION_MANAGER_MODULE
105  * @{
106  */
107 /**
108  * @brief Called every 1 second with updated position information.
109  * @param[in] latitude  The updated latitude [-90.0 ~ 90.0] (degrees)
110  * @param[in] longitude The updated longitude [-180.0 ~ 180.0] (degrees)
111  * @param[in] altitude  The updated altitude (meters)
112  * @param[in] timestamp  The timestamp (time when measurement took place)
113  * @param[in] user_data  The user data passed from the call registration function
114  * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_position_updated_cb()
115  * @see location_manager_start()
116  * @see location_manager_set_position_updated_cb()
117  */
118 typedef void(*location_position_updated_cb )(double latitude, double longitude, double altitude, time_t timestamp, void *user_data);
119
120 /**
121  * @brief Called every 1 second with updated velocity information.
122  * @param[in] speed  The updated speed (km/h)
123  * @param[in] direction The updated direction (in degrees from the north)
124  * @param[in] climb  The updated climb (km/h)
125  * @param[in] timestamp  The timestamp (time when measurement took place)
126  * @param[in] user_data  The user data passed from the callback registration function
127  * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_velocity_updated_cb()
128  * @see location_manager_start()
129  * @see location_manager_set_velocity_updated_cb()
130  */
131 typedef void(*location_velocity_updated_cb )(double speed, double direction, double climb, time_t timestamp, void *user_data);
132
133 /**
134  * @brief Called when the state of location service is changed from enabled to disabled or vice versa.
135  * @param[in] state The service state
136  * @param[in] user_data  The user data passed from the callback registration function
137  * @pre Either location_manager_start() or location_manager_stop() will invoke this callback if you register this callback using location_manager_set_service_state_changed_cb()
138  * @see location_manager_start()
139  * @see location_manager_stop()
140  * @see location_manager_set_service_state_changed_cb()
141  * @see #location_service_state_e
142  */
143 typedef void(*location_service_state_changed_cb )(location_service_state_e state, void *user_data);
144
145 /**
146  * @brief Called when the user defined zones are entered or exited.
147  * @param[in] state  The boundary state
148  * @param[in] latitude  The updated latitude [-90.0 ~ 90.0] (degrees)
149  * @param[in] longitude The updated longitude [-180.0 ~ 180.0] (degrees)
150  * @param[in] altitude  The updated altitude (meters)
151  * @param[in] timestamp  The timestamp (time when measurement took place)
152  * @param[in] user_data  The user data passed from the callback registration function
153  * @pre location_manager_start() will invoke this callback if you register this callback using location_manager_set_zone_changed_cb()
154  * @see #location_boundary_state_e
155  * @see location_manager_start()
156  * @see location_manager_set_zone_changed_cb()
157  */
158 typedef void(*location_zone_changed_cb )(location_boundary_state_e state, double latitude, double longitude, double altitude, time_t timestamp, void *user_data);
159
160 /**
161  * @brief Creates a new location manager.
162  * @remarks @a manager must be released location_manager_destroy() by you.
163  * @param[in] method The location method
164  * @param[out] manager  A location manager handle to be newly created on success
165  * @return 0 on success, otherwise a negative error value.
166  * @retval #LOCATIONS_ERROR_NONE Successful
167  * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY Out of memory
168  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
169  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
170  * @see location_manager_destroy()
171  */
172 int location_manager_create(location_method_e method, location_manager_h* manager);
173
174 /**
175  * @brief Releases the location manager.
176  * @param[in] manager The location manager handle
177  * @return 0 on success, otherwise a negative error value.
178  * @retval #LOCATIONS_ERROR_NONE Successful
179  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
180  * @see location_manager_create()
181 */
182 int location_manager_destroy(location_manager_h manager);
183
184 /**
185  * @brief Starts the location service. 
186  *
187  * @remarks There is no limit on number of location managers for which this function was called.
188  *
189  * Calling this function invokes a location service event. When the location service is enabled, the service state change callback 
190  * (set using #location_manager_set_service_state_changed_cb()) notifies the user with #LOCATIONS_SERVICE_ENABLED as 
191  * the first argument, and the service starts. \n
192
193  * Started service is a requirement for calling these functions:
194  *
195  * location_manager_get_position(), location_manager_get_velocity(), location_manager_get_accuracy(),
196  * #gps_status_get_nmea(), gps_status_get_satellite_count_in_view(), gps_status_foreach_satellites_in_view(), gps_status_get_active_satellite_count().
197  *
198  * Once you stop the service, using #location_manager_stop(), you can no longer call the functions listed above.
199  *
200  * Starting and stopping the service is in the scope of the given location manager only (if there's more than one manager,
201  * starting and stopping should be executed for each of them separately).
202  *
203  * @param[in]   manager The location manager handle
204  * @return 0 on success, otherwise a negative error value.
205  * @retval #LOCATIONS_ERROR_NONE Successful
206  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter
207  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
208  * @retval #LOCATIONS_ERROR_NETWORK_FAILED Network failed
209  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF GPS is not enabled
210  * @post It invokes location_position_updated_cb(), location_velocity_updated_cb(), location_zone_changed_cb(), and location_service_state_changed_cb().
211  * @see location_manager_stop()
212  * @see location_manager_get_position()
213  * @see location_manager_get_velocity()
214  * @see location_manager_get_accuracy()
215  * @see location_manager_set_service_state_changed_cb()
216  * @see location_manager_set_position_updated_cb()
217  * @see location_position_updated_cb()
218  * @see location_manager_set_velocity_updated_cb()
219  * @see location_velocity_updated_cb()
220  * @see location_manager_set_zone_changed_cb()
221  * @see location_zone_changed_cb()
222  */
223 int location_manager_start(location_manager_h manager);
224
225 /**
226  * @brief Stops the location service.
227  * @remarks This function initiates the process of stopping the service. When the process is finished, callback set using
228  * #location_manager_set_service_state_changed_cb() will be called, with #LOCATIONS_SERVICE_DISABLED as first argument.
229  * When that happens, the service is stopped and the user is notified.
230  *
231  * You can stop and start the location manager as needed.
232  *
233  * @param[in]   manager The location manager handle
234  * @return 0 on success, otherwise a negative error value.
235  * @retval #LOCATIONS_ERROR_NONE Successful
236  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter
237  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
238  * @retval #LOCATIONS_ERROR_NETWORK_FAILED Network failed
239  * @see location_manager_start()
240  * @see location_manager_set_service_state_changed_cb()
241  * @see location_service_state_changed_cb()
242  */
243 int location_manager_stop(location_manager_h manager);
244
245 /**
246  * @brief Sets a rectangular boundary for a given location manager.
247  * @param[in]   manager                 The location manager handle
248  * @param[in]   top_left_latitude       The latitude of area's top left corner [-90.0 ~ 90.0] (degrees)
249  * @param[in]   top_left_longitude      The longitude of area's top left corner [-180.0 ~ 180.0] (degrees)
250  * @param[in]   bottom_right_latitude   The latitude of area's bottom right corner [-90.0 ~ 90.0] (degrees)
251  * @param[in]   bottom_right_longitude  The longitude of area's bottom right corner [-180.0 ~ 180.0] (degrees)
252  * @return 0 on success, otherwise a negative error value.
253  * @retval #LOCATIONS_ERROR_NONE Successful
254  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter
255  * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY Out of memory
256  * @post It invokes location_manager_set_zone_changed_cb() when a boundary is entered or exited, if you set a callback with location_manager_set_zone_changed_cb().
257  * @see location_manager_set_boundary_circle()
258  * @see location_manager_set_zone_changed_cb()
259  * @see location_manager_is_boundary_contains_coordinate()
260  */
261 int location_manager_set_boundary_rect(location_manager_h manager, double top_left_latitude, double top_left_longitude, double bottom_right_latitude, double bottom_right_longitude);
262
263 /**
264  * @brief Sets a circular boundary for a given location manager.
265  * @param[in]   manager             The location manager handle
266  * @param[in]   center_latitude     The latitude of circle's center [-90.0 ~ 90.0] (degrees)
267  * @param[in]   center_longitude    The longitude of circle's center [-180.0 ~ 180.0] (degrees)
268  * @param[in]   radius              The radius of a circle (meters)
269  * @return 0 on success, otherwise a negative error value.
270  * @retval #LOCATIONS_ERROR_NONE Successful
271  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter
272  * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY Out of memory
273  * @post It invokes location_manager_set_zone_changed_cb() when a boundary is entered or exited, if you set a callback with location_manager_set_zone_changed_cb().
274  * @see location_manager_set_boundary_rect()
275  * @see location_manager_set_zone_changed_cb()
276  * @see location_manager_is_boundary_contains_coordinate()
277  */
278 int location_manager_set_boundary_circle(location_manager_h manager, double center_latitude, double center_longitude, double radius);
279
280 /**
281  * @brief Check if the boundary contains the specified latitude and longitude.
282  * @param[in]   manager  The location manager handle
283  * @param[in]   latitude    The latitude to test against boundary [-90.0 ~ 90.0] (degrees)
284  * @param[in]   longitude  The longitude to test against boundary [-180.0 ~ 180.0] (degrees)
285  * @param[out]   contained  The result indicating whether the boundary contains the specified coordinate (@c true = contained, @c false = not contained )
286  * @return 0 on success, otherwise a negative error value.
287  * @retval #LOCATIONS_ERROR_NONE Successful
288  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid parameter
289  * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY Out of memory
290  * @see location_manager_set_boundary_rect()
291  * @see location_manager_set_boundary_circle()
292  */
293 int location_manager_is_boundary_contains_coordinate(location_manager_h manager, double latitude, double longitude, bool *contained);
294
295 /**
296  * @brief Gets the given location manager's method.
297  *
298  * @param[in]   manager The location manager handle
299  * @param[out]  method  The location method
300  * @return 0 on success, otherwise a negative error value.
301  * @retval  #LOCATIONS_ERROR_NONE                Successful
302  * @retval  #LOCATIONS_ERROR_INVALID_PARAMETER   Invalid parameter
303  * @see location_manager_create()
304  */
305 int location_manager_get_method(location_manager_h manager, location_method_e *method);
306
307 /**
308  * @brief Gets the current position information.
309  * @details
310  * The result is current altitude, latitude, and longitude, with a measurement timestamp.
311  *
312  * If altitude is negative, only altitude and latitude are available (fix status is 2D).
313  * If altitude is positive, fix status is 3D and returned altitude value is the result of measurement.
314  *
315  * @param[in]   manager     The location manager handle
316  * @param[out]  altitude    The current altitude (meters)
317  * @param[out]  latitude    The current latitude [-90.0 ~ 90.0] (degrees)
318  * @param[out]  longitude   The current longitude [-180.0 ~ 180.0] (degrees)
319  * @param[out]  timestamp   The timestamp (time when measurement took place)
320  * @return 0 on success, otherwise a negative error value.
321  * @retval #LOCATIONS_ERROR_NONE Successful
322  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument
323  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
324  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF GPS is not enabled
325  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() 
326  */
327 int location_manager_get_position(location_manager_h manager, double *altitude, double *latitude, double *longitude, time_t *timestamp);
328
329 /**
330  * @brief Gets the current velocity information.
331  * @details
332  * The result is current climb, direction, and speed, with a measurement timestamp.
333  *
334  * @param[in]   manager     The location manager handle
335  * @param[out]  climb       The climb (km/h)
336  * @param[out]  direction   The direction, degrees from the north
337  * @param[out]  speed       The speed (km/h)
338  * @param[out]  timestamp   The timestamp (time when measurement took place)
339  * @return 0 on success, otherwise a negative error value.
340  * @retval #LOCATIONS_ERROR_NONE Successful
341  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument
342  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
343  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF GPS is not enabled
344  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() 
345  */
346 int location_manager_get_velocity(location_manager_h manager, int *climb, int *direction, int *speed, time_t *timestamp);
347
348 /**
349  * @brief Gets the current accuracy information.
350  * @param[in]   manager The location manager handle
351  * @param[out]  level The accuracy level
352  * @param[out]  horizontal The horizontal accuracy (meters)
353  * @param[out]  vertical The vertical accuracy (meters)
354  * @return 0 on success, otherwise a negative error value.
355  * @retval #LOCATIONS_ERROR_NONE Successful
356  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument
357  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
358  * @retval #LOCATIONS_ERROR_GPS_SETTING_OFF GPS is not enabled
359  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() 
360  */
361 int location_manager_get_accuracy(location_manager_h manager, location_accuracy_level_e *level, double *horizontal, double *vertical);
362
363 /**
364  * @brief Registers a callback function to be invoked every 1 second with updated position information.
365  *
366  * @param[in]   manager     The location manager handle
367  * @param[in]   callback    The callback function to register
368  * @param[in]   user_data   The user data to be passed to the callback function
369  * @return 0 on success, otherwise a negative error value.
370  * @retval  #LOCATIONS_ERROR_NONE               Successful
371  * @retval  #LOCATIONS_ERROR_INVALID_PARAMETER  Invalid parameter
372  * @post  location_position_updated_cb() will be invoked
373  * @see location_manager_unset_position_updated_cb()
374  * @see location_position_updated_cb()
375  */
376 int location_manager_set_position_updated_cb(location_manager_h manager, location_position_updated_cb callback, void *user_data);
377
378 /**
379  * @brief       Unregisters the callback function.
380  *
381  * @param[in]   manager The location manager handle
382  * @return  0 on success, otherwise a negative error value.
383  * @retval  #LOCATIONS_ERROR_NONE               Successful
384  * @retval  #LOCATIONS_ERROR_INVALID_PARAMETER  Invalid parameter
385  * @see location_manager_set_position_updated_cb()
386  */
387 int location_manager_unset_position_updated_cb(location_manager_h manager);
388
389 /**
390  * @brief Registers a callback function to be invoked every 1 second with updated velocity information.
391  *
392  * @param[in]   manager     The location manager handle
393  * @param[in]   callback    The callback function to register
394  * @param[in]   user_data   The user data to be passed to the callback function
395  * @return 0 on success, otherwise a negative error value.
396  * @retval  #LOCATIONS_ERROR_NONE               Successful
397  * @retval  #LOCATIONS_ERROR_INVALID_PARAMETER  Invalid parameter
398  * @post  location_velocity_updated_cb() will be invoked
399  * @see location_manager_unset_velocity_updated_cb()
400  * @see location_velocity_updated_cb()
401  */
402 int location_manager_set_velocity_updated_cb(location_manager_h manager, location_velocity_updated_cb callback, void *user_data);
403
404 /**
405  * @brief       Unregisters the callback function.
406  *
407  * @param[in]   manager The location manager handle
408  * @return  0 on success, otherwise a negative error value.
409  * @retval  #LOCATIONS_ERROR_NONE               Successful
410  * @retval  #LOCATIONS_ERROR_INVALID_PARAMETER  Invalid parameter
411  * @see location_manager_set_velocity_updated_cb()
412  */
413 int location_manager_unset_velocity_updated_cb(location_manager_h manager);
414
415 /**
416  * @brief Registers a callback function to be invoked when the  location service state is changed.
417  *
418  * @param[in]   manager     The location manager handle
419  * @param[in]   callback    The callback function to register
420  * @param[in]   user_data   The user data to be passed to the callback function
421  * @return  0 on success, otherwise a negative error value.
422  * @retval  #LOCATIONS_ERROR_NONE               Successful
423  * @retval  #LOCATIONS_ERROR_INVALID_PARAMETER  Invalid parameter
424  * @post  location_service_state_changed_cb() will be invoked
425  * @see location_manager_unset_service_state_changed_cb()
426  * @see location_service_state_changed_cb()
427  * @see location_manager_start()
428  * @see location_manager_stop()
429  * @see #location_service_state_e
430 */
431 int location_manager_set_service_state_changed_cb(location_manager_h manager, location_service_state_changed_cb callback, void *user_data);
432
433 /**
434  * @brief       Unregisters the callback function.
435  * @param[in]   manager The location manager handle
436  * @return  0 on success, otherwise a negative error value.
437  * @retval  #LOCATIONS_ERROR_NONE               Successful
438  * @retval  #LOCATIONS_ERROR_INVALID_PARAMETER  Invalid parameter
439  * @see location_manager_set_service_state_changed_cb()
440  */
441 int location_manager_unset_service_state_changed_cb(location_manager_h manager);
442
443 /**
444  * @brief Registers a callback function to be invoked when the previously set boundary area is entered or left.
445  *
446  * @param[in]   manager     The location manager handle
447  * @param[in]   callback    The callback function to register
448  * @param[in]   user_data   The user data to be passed to the callback function
449  * @return  0 on success, otherwise a negative error value.
450  * @retval  #LOCATIONS_ERROR_NONE               Successful
451  * @retval  #LOCATIONS_ERROR_INVALID_PARAMETER  Invalid parameter
452  * @pre Either location_manager_set_boundary_rect() or location_manager_set_boundary_circle() is called before.
453  * @post  location_zone_changed_cb() will be invoked
454  * @see location_manager_unset_zone_changed_cb()
455  * @see location_zone_changed_cb()
456  */
457 int location_manager_set_zone_changed_cb(location_manager_h manager, location_zone_changed_cb callback, void *user_data);
458
459 /**
460  * @brief       Unregisters the callback function.
461  * @param[in]   manager The location manager handle
462  * @return 0 on success, otherwise a negative error value.
463  * @retval  #LOCATIONS_ERROR_NONE       Successful
464  * @retval  #LOCATIONS_ERROR_INVALID_PARAMETER  Invalid parameter
465  * @see location_manager_set_zone_changed_cb()
466  */
467 int location_manager_unset_zone_changed_cb(location_manager_h manager);
468 /**
469  * @}
470  */
471
472 /*
473  * GPS Status & Satellites
474  */
475
476 /**
477  * @addtogroup CAPI_LOCATION_GPS_STATUS_MODULE
478  * @{
479  */
480
481 /**
482  * @brief  Called once for each satellite in range.
483  * @param[in] azimuth   The azimuth of the satellite (degrees)
484  * @param[in] elevation The elevation of the satellite (meters)
485  * @param[in] prn       The PRN of the satellite
486  * @param[in] snr       The SNR of the satellite [dB]
487  * @param[in] is_active The flag signaling if satellite is in use
488  * @param[in] user_data  The user data passed from the foreach function
489  * @return @c true to continue with the next iteration of the loop, \n @c false to break out of the loop
490  * @pre gps_status_foreach_satellites_in_view() will invoke this callback.
491  * @see gps_status_foreach_satellites_in_view()
492  */
493 typedef bool(*gps_status_get_satellites_cb)(unsigned int azimuth, unsigned int elevation, unsigned int prn, int snr, bool is_active, void *user_data);
494
495 /**
496  * @brief Gets the GPS NMEA data.
497  *
498  * @remarks
499  * This call is valid only for location managers with #LOCATIONS_METHOD_GPS method.\n
500  * @a nmea must be released with @c free() by you.
501  *
502  * @param[in]   manager The location manager handle
503  * @param[out]  nmea    The NMEA data
504  * @return 0 on success, otherwise a negative error value.
505  * @retval #LOCATIONS_ERROR_NONE Successful
506  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument
507  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
508  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
509  * @retval #LOCATIONS_ERROR_OUT_OF_MEMORY Out of memory
510  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() 
511  * @see location_manager_start()
512  */
513 int gps_status_get_nmea(location_manager_h manager, char **nmea);
514
515 /**
516  * @brief Gets the number of satellites in view.
517  *
518  * @remarks
519  * This call is valid only for location managers with #LOCATIONS_METHOD_GPS method.
520  *
521  * @param[in]   manager The location manager handle
522  * @param[out]  count   The number of satellites in view
523  * @return 0 on success, otherwise a negative error value.
524  * @retval #LOCATIONS_ERROR_NONE Successful
525  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument
526  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
527  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
528  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() 
529  * @see   gps_status_foreach_satellites_in_view()
530  */
531 int  gps_status_get_satellite_count_in_view(location_manager_h manager, int *count);
532
533 /**
534  * @brief Invokes the callback function for each satellite.
535  *
536  * @remarks
537  * This function is valid only for location managers with the #LOCATIONS_METHOD_GPS method.
538  *
539  * @param[in]   manager     The location manager handle
540  * @param[in]   callback    The iteration callback function
541  * @param[in]   user_data   The user data to be passed to the callback function
542  * @return 0 on success, otherwise a negative error value.
543  * @retval #LOCATIONS_ERROR_NONE Successful
544  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument
545  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
546  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
547  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() 
548  * @post  It invokes gps_status_get_satellites_cb().
549  * @see   gps_status_get_satellite_count_in_view()
550  * @see   gps_status_get_satellites_cb()
551  */
552 int  gps_status_foreach_satellites_in_view (location_manager_h manager, gps_status_get_satellites_cb callback, void *user_data);
553
554 /**
555  * @brief Gets the number of satellites available to be used.
556  *
557  * @remarks
558  * This call is valid only for location managers with #LOCATIONS_METHOD_GPS method.
559  *
560  * @param[in]   manager The location manager handle
561  * @param[out]  count   The number of active satellites
562  * @return 0 on success, otherwise a negative error value.
563  * @retval #LOCATIONS_ERROR_NONE Successful
564  * @retval #LOCATIONS_ERROR_INVALID_PARAMETER Invalid argument
565  * @retval #LOCATIONS_ERROR_INCORRECT_METHOD Incorrect method
566  * @retval #LOCATIONS_ERROR_SERVICE_NOT_AVAILABLE Service not available
567  * @pre The location service state must be #LOCATIONS_SERVICE_ENABLED with location_manager_start() 
568  * @see   gps_status_get_satellite_count_in_view()
569  */
570 int  gps_status_get_active_satellite_count(location_manager_h manager, int *count);
571 /**
572  * @}
573  */
574 #ifdef __cplusplus
575 }
576 #endif
577
578 #endif /* __TIZEN_LOCATION_LOCATIONS_H__ */