tizen beta release
[framework/location/libslp-location.git] / location / location-satellite.h
1 /*
2  * libslp-location
3  *
4  * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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>
8  *
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
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
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.
20  */
21
22 #ifndef __LOCATION_SATELLITE_H_
23 #define __LOCATION_SATELLITE_H_
24
25 #include <location/location-types.h>
26
27 /**
28  * @file location-satellite.h
29  * @brief This file contains the internal definitions and structures related to satellite information.
30  * @addtogroup LocationTypes
31  * @{
32  */
33
34 G_BEGIN_DECLS
35
36 /**
37  * @brief This represents one satellite information in view.
38  */
39 typedef struct {
40         guint prn;       ///< The PRNs(Pseudo-Random Noise code) of a satellite.
41         gboolean used;   ///< TRUE if currently used satellite.
42         guint elevation; ///< The elevation of a satellite.
43         guint azimuth;   ///< The degree from true north 000 to 359 of a satellite.
44         gint snr;        ///< The signal-to-noise ratio, dB of a satellite.
45 } LocationSatelliteDetail;
46
47 /**
48  * @brief This represents position information such as number of satellites in used or in view.
49  */
50 struct _LocationSatellite
51 {
52         guint timestamp;                           ///< Time stamp.
53         guint num_of_sat_inview;                   ///< The number of satellites in view.
54         guint num_of_sat_used;                     ///< The number of satellites in used.
55         LocationSatelliteDetail* sat_inview;       ///< The information of satellites in view .
56 };
57
58 GType location_satellite_get_type (void);
59 #define LOCATION_TYPE_SATELLITE (location_satellite_get_type ())
60
61 /**
62  * @brief   Create a new #LocationSatellite with given number of #LocationSatelliteDetail.
63  * @remarks None.
64  * @pre     #location_init should be called before.\n
65  * @post    None.
66  * @param [in]  num_of_sat_inview - number of #LocationSatelliteDetail.
67  * @return a new #LocationSatellite
68  * @retval NULL if error occured
69  */
70 LocationSatellite *location_satellite_new (int num_of_sat_inview);
71
72 /**
73  * @brief   Free a #LocationSatellite.
74  * @remarks None.
75  * @pre     #location_init should be called before.\n
76  * @post    None.
77  * @param [in] satellite - a #LocationSatellite.
78  * @return None.
79  */
80 void location_satellite_free (LocationSatellite *satellite);
81
82 /**
83  * @brief   Makes a copy of #LocationSatellite
84  * @remarks None.
85  * @pre     #location_init should be called before.\n
86  * @post    None.
87  * @param [in]  satellite - a #LocationSatellite
88  * @return a new #LocationSatellite
89  * @retval NULL if error occured
90  */
91 LocationSatellite *location_satellite_copy (const LocationSatellite *satellite);
92
93 /**
94  * @brief   Get elements of #LocationSatelliteDetail with given index in #LocationSatellite.
95  * @remarks None.
96  * @pre     #location_init should be called before.\n
97  * @post    None.
98  * @param [in]   satellite - a #LocationSatellite
99  * @param [in]   index - index of #LocationSatelliteDetail in #LocationSatellite
100  * @param [out]  prn - The PRNs(Pseudo-Random Noise code) of a #LocationSatellite
101  * @param [out]  used - TRUE if a #LocationSatellite in used.
102  * @param [out]  elevation - The elevation of a #LocationSatellite
103  * @param [out]  azimuth - The degree from true north 000 to 359 of a#LocationSatellite
104  * @param [out]  snr - The signal-to-noise ratio, dB of #LocationSatellite
105  * @return gboolean
106  * @retval\n
107  * TRUE - if success\n
108  * FALSE - if error occured\n
109  */
110 gboolean location_satellite_get_satellite_details (const LocationSatellite *satellite, guint index, guint *prn, gboolean *used, guint *elevation, guint *azimuth, gint *snr);
111
112 /**
113  * @brief   Set elements of #LocationSatelliteDetail with given index in #LocationSatellite.
114  * @remarks None.
115  * @pre     #location_init should be called before.\n
116  * @post    None.
117  * @param [in]  satellite - a #LocationSatellite
118  * @param [in]  index - index of #LocationSatelliteDetail in #LocationSatellite
119  * @param [in]  prn - The PRNs(Pseudo-Random Noise code) of a #LocationSatellite
120  * @param [in]  used - TRUE if a #LocationSatellite in used.
121  * @param [in]  elevation - The elevation of a #LocationSatellite
122  * @param [in]  azimuth - The degree from true north 000 to 359 of a#LocationSatellite
123  * @param [in]  snr - The signal-to-noise ratio, dB of #LocationSatellite
124  * @return gboolean
125  * @retval\n
126  * TRUE - if success\n
127  * FALSE - if error occured\n
128  */
129 gboolean location_satellite_set_satellite_details( LocationSatellite *satellite, guint index, guint prn,        gboolean used, guint elevation, guint azimuth, gint snr);
130
131 /**
132  * @}
133  */
134
135 G_END_DECLS
136
137 #endif