![]() |
![]() |
![]() |
Gypsy Reference Manual | |
---|---|---|---|---|
Top | Description |
GypsyTime; #define GYPSY_TIME_DBUS_SERVICE #define GYPSY_TIME_DBUS_INTERFACE GypsyTime * gypsy_time_new (const char *object_path
); gboolean gypsy_time_get_time (GypsyTime *gps_time
,int *timestamp
,GError **error
);
GypsyTime is used whenever the client program wishes to know about GPS time changes. It can report the current GPS time, and has a signal to notify listeners of changes.
A GypsyTime object is created with gypsy_time_new()
using the
D-Bus path of the GPS device. This path is returned from the
gypsy_control_create()
function. The client can then find out about the
GPS time with gypsy_time_get_time()
.
As the GPS time information changes GypsyTime will emit the time-changed signal. This signal contains the GPS time of the most recent GPS update that it received.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
GypsyTime *gps_time; GError *error = NULL; . . . /* path comes from the gypsy_control_create() function */ gps_time = gypsy_time_new (path); g_signal_connect (gps_time, "time-changed", G_CALLBACK (time_changed), NULL); . . . static void position_changed (GypsyTime *gps_time, int timestamp, gpointer userdata) { g_print ("timestamp: %d\n", timestamp); } |
typedef struct { GObject parent_object; } GypsyTime;
There are no public fields in GypsyTime.
#define GYPSY_TIME_DBUS_SERVICE "org.freedesktop.Gypsy"
A define containing the address of the Time service
#define GYPSY_TIME_DBUS_INTERFACE "org.freedesktop.Gypsy.Time"
A define containing the name of the Time interface
GypsyTime * gypsy_time_new (const char *object_path
);
Creates a new GypsyTime object that listens for time changes
from the GPS found at object_path
.
|
Object path to the GPS device |
Returns : |
A GypsyTime object |