1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="GypsySatellite">
<refmeta>
<refentrytitle role="top_of_page" id="GypsySatellite.top_of_page">GypsySatellite</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GYPSY Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GypsySatellite</refname>
<refpurpose>Object for obtaining satellite information</refpurpose>
</refnamediv>
<refsynopsisdiv id="GypsySatellite.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<synopsis>
<link linkend="GypsySatellite-struct">GypsySatellite</link>;
#define <link linkend="GYPSY-SATELLITE-DBUS-INTERFACE--CAPS">GYPSY_SATELLITE_DBUS_INTERFACE</link>
#define <link linkend="GYPSY-SATELLITE-DBUS-SERVICE--CAPS">GYPSY_SATELLITE_DBUS_SERVICE</link>
<link linkend="GypsySatelliteDetails">GypsySatelliteDetails</link>;
<link linkend="GypsySatellite">GypsySatellite</link> * <link linkend="gypsy-satellite-new">gypsy_satellite_new</link> (const <link linkend="char">char</link> *object_path);
<link linkend="GPtrArray">GPtrArray</link> * <link linkend="gypsy-satellite-get-satellites">gypsy_satellite_get_satellites</link> (<link linkend="GypsySatellite">GypsySatellite</link> *satellite,
<link linkend="GError">GError</link> **error);
<link linkend="void">void</link> <link linkend="gypsy-satellite-free-satellite-array">gypsy_satellite_free_satellite_array</link>
(<link linkend="GPtrArray">GPtrArray</link> *satellites);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GypsySatellite.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
<link linkend="GObject">GObject</link>
+----GypsySatellite
</synopsis>
</refsect1>
<refsect1 id="GypsySatellite.properties" role="properties">
<title role="properties.title">Properties</title>
<synopsis>
"<link linkend="GypsySatellite--object-path">object-path</link>" <link linkend="gchar">gchar</link>* : Write / Construct Only
</synopsis>
</refsect1>
<refsect1 id="GypsySatellite.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
"<link linkend="GypsySatellite-satellites-changed">satellites-changed</link>" : Run Last
</synopsis>
</refsect1>
<refsect1 id="GypsySatellite.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GypsySatellite"><type>GypsySatellite</type></link> is used whenever the client program wishes to know about
changes in the satellite details. The satellite details contain the satellite
ID number (the PRN), the elevation, the azimuth, the signal-to-noise ratio
(SNR) and whether or not the satellite was used to calculate the fix.
</para>
<para>
A <link linkend="GypsySatellite"><type>GypsySatellite</type></link> object is created using <link linkend="gypsy-satellite-new"><function>gypsy_satellite_new()</function></link> using the
D-Bus path of the GPS device. This path is returned from the
<link linkend="gypsy-control-create"><function>gypsy_control_create()</function></link> function. The client can then find out about the
visible satellites with <link linkend="gypsy-satellite-get-satellites"><function>gypsy_satellite_get_satellites()</function></link> which returns a
GPtrArray containing the <link linkend="GypsySatelliteDetails"><type>GypsySatelliteDetails</type></link> for each visible satellite.
Once the client is finished with this GPtrArray
<link linkend="gypsy-satellite-free-satellite-array"><function>gypsy_satellite_free_satellite_array()</function></link> should be used to free the data.
</para>
<para>
As the satellite information changes <link linkend="GypsySatellite"><type>GypsySatellite</type></link> will emit the
satellite-changed signal. This signal contains the satellite details in
a GPtrArray. In this case the satellite array does not need to be freed
with <link linkend="gypsy-satellite-free-satellite-array"><function>gypsy_satellite_free_satellite_array()</function></link>.
</para>
<para>
Although gypsy-daemon only emits signals whenever the associated data has
changed, satellite data is constantly changing, so so the satellite-changed
signal will be emitted at a rate of once every second.
</para>
<para>
<informalexample>
<programlisting>
GypsySatellite *satellite;
GError *error = NULL;
. . .
/ * path comes from the gypsy_control_create() function * /
satellite = gypsy_satellite_new (path);
g_signal_connect (satellite, "satellite-changed", G_CALLBACK (satellite_changed), NULL);
. . .
static void satellite_changed (GypsySatellite *satellite,
GPtrArray *satellites,
gpointer userdata)
{
int i;
for (i = 0; i < satellites->len; i++) {
GypsySatelliteDetails *details = satellites->pdata[i];
g_print ("Satellite %d: %s", details->satellite_id, details->in_use ? "In use" : "Not in use");
}
}
</programlisting>
</informalexample></para>
<para>
</para>
</refsect1>
<refsect1 id="GypsySatellite.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GypsySatellite-struct" role="struct">
<title>GypsySatellite</title>
<indexterm zone="GypsySatellite-struct"><primary sortas="GypsySatellite">GypsySatellite</primary></indexterm><programlisting>typedef struct _GypsySatellite GypsySatellite;</programlisting>
<para>
There are no public fields in <link linkend="GypsySatellite"><type>GypsySatellite</type></link>.</para>
<para>
</para></refsect2>
<refsect2 id="GYPSY-SATELLITE-DBUS-INTERFACE--CAPS" role="macro">
<title>GYPSY_SATELLITE_DBUS_INTERFACE</title>
<indexterm zone="GYPSY-SATELLITE-DBUS-INTERFACE--CAPS"><primary sortas="GYPSY_SATELLITE_DBUS_INTERFACE">GYPSY_SATELLITE_DBUS_INTERFACE</primary></indexterm><programlisting>#define GYPSY_SATELLITE_DBUS_INTERFACE "org.freedesktop.Gypsy.Satellite"
</programlisting>
<para>
A define containing the name of the Satellite interface</para>
<para>
</para></refsect2>
<refsect2 id="GYPSY-SATELLITE-DBUS-SERVICE--CAPS" role="macro">
<title>GYPSY_SATELLITE_DBUS_SERVICE</title>
<indexterm zone="GYPSY-SATELLITE-DBUS-SERVICE--CAPS"><primary sortas="GYPSY_SATELLITE_DBUS_SERVICE">GYPSY_SATELLITE_DBUS_SERVICE</primary></indexterm><programlisting>#define GYPSY_SATELLITE_DBUS_SERVICE "org.freedesktop.Gypsy"
</programlisting>
<para>
A define containing the address of the Satellite service.</para>
<para>
</para></refsect2>
<refsect2 id="GypsySatelliteDetails" role="struct">
<title>GypsySatelliteDetails</title>
<indexterm zone="GypsySatelliteDetails"><primary sortas="GypsySatelliteDetails">GypsySatelliteDetails</primary></indexterm><programlisting>typedef struct {
int satellite_id;
gboolean in_use;
guint elevation;
guint azimuth;
guint snr;
} GypsySatelliteDetails;
</programlisting>
<para>
A structure defining a satellite</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="int">int</link> <structfield>satellite_id</structfield>;</term>
<listitem><simpara> The satellite PRN id
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gboolean">gboolean</link> <structfield>in_use</structfield>;</term>
<listitem><simpara> Whether this satellite was used in calculating the fix
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="guint">guint</link> <structfield>elevation</structfield>;</term>
<listitem><simpara> The satellite elevation
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="guint">guint</link> <structfield>azimuth</structfield>;</term>
<listitem><simpara> The satellite azimuth
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="guint">guint</link> <structfield>snr</structfield>;</term>
<listitem><simpara> The signal to noise ratio
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gypsy-satellite-new" role="function">
<title>gypsy_satellite_new ()</title>
<indexterm zone="gypsy-satellite-new"><primary sortas="gypsy_satellite_new">gypsy_satellite_new</primary></indexterm><programlisting><link linkend="GypsySatellite">GypsySatellite</link> * gypsy_satellite_new (const <link linkend="char">char</link> *object_path);</programlisting>
<para>
Creates a new <link linkend="GypsySatellite"><type>GypsySatellite</type></link> object that listens for satellite changes
from the GPS found at <parameter>object_path</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object_path</parameter> :</term>
<listitem><simpara> Object path to the GPS device
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> A <link linkend="GypsySatellite"><type>GypsySatellite</type></link> object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gypsy-satellite-get-satellites" role="function">
<title>gypsy_satellite_get_satellites ()</title>
<indexterm zone="gypsy-satellite-get-satellites"><primary sortas="gypsy_satellite_get_satellites">gypsy_satellite_get_satellites</primary></indexterm><programlisting><link linkend="GPtrArray">GPtrArray</link> * gypsy_satellite_get_satellites (<link linkend="GypsySatellite">GypsySatellite</link> *satellite,
<link linkend="GError">GError</link> **error);</programlisting>
<para>
Retrieves the <link linkend="GypsySatelliteDetails"><type>GypsySatelliteDetails</type></link> about the satellites that the
GPS is able to see.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>satellite</parameter> :</term>
<listitem><simpara> A <link linkend="GypsySatellite"><type>GypsySatellite</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>error</parameter> :</term>
<listitem><simpara> A <link linkend="GError"><type>GError</type></link> for error return
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> A <link linkend="GPtrArray"><type>GPtrArray</type></link> of <link linkend="GypsySatelliteDetails"><type>GypsySatelliteDetails</type></link> or <link linkend="NULL--CAPS"><type>NULL</type></link> on error.
Should be freed using <link linkend="gypsy-satellite-free-satellite-array"><function>gypsy_satellite_free_satellite_array()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gypsy-satellite-free-satellite-array" role="function">
<title>gypsy_satellite_free_satellite_array ()</title>
<indexterm zone="gypsy-satellite-free-satellite-array"><primary sortas="gypsy_satellite_free_satellite_array">gypsy_satellite_free_satellite_array</primary></indexterm><programlisting><link linkend="void">void</link> gypsy_satellite_free_satellite_array
(<link linkend="GPtrArray">GPtrArray</link> *satellites);</programlisting>
<para>
Frees all resources used in the array.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>satellites</parameter> :</term>
<listitem><simpara> <link linkend="GPtrArray"><type>GPtrArray</type></link> containing <link linkend="GypsySatelliteDetails"><type>GypsySatelliteDetails</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
<refsect1 id="GypsySatellite.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GypsySatellite--object-path" role="property"><title>The <literal>"object-path"</literal> property</title>
<indexterm zone="GypsySatellite--object-path"><primary sortas="GypsySatellite:object-path">GypsySatellite:object-path</primary></indexterm><programlisting> "object-path" <link linkend="gchar">gchar</link>* : Write / Construct Only</programlisting>
<para>The DBus path to the object.</para><para>Default value: ""</para>
</refsect2>
</refsect1>
<refsect1 id="GypsySatellite.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GypsySatellite-satellites-changed" role="signal"><title>The <literal>"satellites-changed"</literal> signal</title>
<indexterm zone="GypsySatellite-satellites-changed"><primary sortas="GypsySatellite::satellites-changed">GypsySatellite::satellites-changed</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GypsySatellite">GypsySatellite</link> *satellites,
<link linkend="gpointer">gpointer</link> arg1,
<link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
<para>
The ::satellites-changed signal is emitted every time the GPS
reports a change in the satellite data.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>satellites</parameter> :</term>
<listitem><simpara> A <link linkend="GPtrArray"><type>GPtrArray</type></link> containing <link linkend="GypsySatelliteDetails"><type>GypsySatelliteDetails</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
</refentry>
|