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