Git init
[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 degress 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 satelltes in used or in view.
49  */
50 struct _LocationSatellite
51 {
52         guint num_of_sat_inview;                   ///< The number of satellites in view.
53         guint num_of_sat_used;                     ///< The number of satellites in used.
54         LocationSatelliteDetail* sat_inview;       ///< The information of satellites in view .
55 };
56
57 GType location_satellite_get_type (void);
58 #define LOCATION_TYPE_SATELLITE (location_satellite_get_type ())
59
60 /**
61  * @brief   Create a new #LocationSatellite with given number of #LocationSatelliteDetail.
62  * @remarks None.
63  * @pre     #location_init should be called before.\n
64  * @post    None.
65  * @param [in]  num_of_sat_inview - number of #LocationSatelliteDetail.
66  * @return a new #LocationSatellite
67  * @retval NULL if error occured
68  */
69 LocationSatellite *location_satellite_new (int num_of_sat_inview);
70
71 /**
72  * @brief   Free a #LocationSatellite.
73  * @remarks None.
74  * @pre     #location_init should be called before.\n
75  * @post    None.
76  * @param [in] satellite - a #LocationSatellite.
77  * @return None.
78  */
79 void location_satellite_free (LocationSatellite *satellite);
80
81 /**
82  * @brief   Makes a copy of #LocationSatellite
83  * @remarks None.
84  * @pre     #location_init should be called before.\n
85  * @post    None.
86  * @param [in]  satellite - a #LocationSatellite
87  * @return a new #LocationSatellite
88  * @retval NULL if error occured
89  */
90 LocationSatellite *location_satellite_copy (const LocationSatellite *satellite);
91
92 /**
93  * @brief   Get elements of #LocationSatelliteDetail with given index in #LocationSatellite.
94  * @remarks None.
95  * @pre     #location_init should be called before.\n
96  * @post    None.
97  * @param [in]   satellite - a #LocationSatellite
98  * @param [in]   index - index of #LocationSatelliteDetail in #LocationSatellite
99  * @param [out]  prn - The PRNs(Pseudo-Random Noise code) of a #LocationSatellite
100  * @param [out]  used - TRUE if a #LocationSatellite in used.
101  * @param [out]  elevation - The elevation of a #LocationSatellite
102  * @param [out]  azimuth - The degress from true north 000 to 359 of a#LocationSatellite
103  * @param [out]  snr - The signal-to-noise ratio, dB of #LocationSatellite
104  * @return gboolean
105  * @retval\n
106  * TRUE - if success\n
107  * FALSE - if error occured\n
108  */
109 gboolean location_satellite_get_satellite_details (const LocationSatellite *satellite, guint index, guint *prn, gboolean *used, guint *elevation, guint *azimuth, gint *snr);
110
111 /**
112  * @brief   Set elements of #LocationSatelliteDetail with given index in #LocationSatellite.
113  * @remarks None.
114  * @pre     #location_init should be called before.\n
115  * @post    None.
116  * @param [in]  satellite - a #LocationSatellite
117  * @param [in]  index - index of #LocationSatelliteDetail in #LocationSatellite
118  * @param [in]  prn - The PRNs(Pseudo-Random Noise code) of a #LocationSatellite
119  * @param [in]  used - TRUE if a #LocationSatellite in used.
120  * @param [in]  elevation - The elevation of a #LocationSatellite
121  * @param [in]  azimuth - The degress from true north 000 to 359 of a#LocationSatellite
122  * @param [in]  snr - The signal-to-noise ratio, dB of #LocationSatellite
123  * @return gboolean
124  * @retval\n
125  * TRUE - if success\n
126  * FALSE - if error occured\n
127  */
128 gboolean location_satellite_set_satellite_details( LocationSatellite *satellite, guint index, guint prn,        gboolean used, guint elevation, guint azimuth, gint snr);
129
130 /**
131  * @}
132  */
133
134 G_END_DECLS
135
136 #endif