![]() |
![]() |
![]() |
Gypsy Reference Manual | ![]() |
---|---|---|---|---|
GypsyDevice; #define GYPSY_DEVICE_DBUS_SERVICE #define GYPSY_DEVICE_DBUS_INTERFACE enum GypsyDeviceFixStatus; GypsyDevice* gypsy_device_new (const char *object_path); gboolean gypsy_device_get_connection_status (GypsyDevice *device, GError **error); GypsyDeviceFixStatus gypsy_device_get_fix_status (GypsyDevice *device, GError **error); gboolean gypsy_device_start (GypsyDevice *device, GError **error); gboolean gypsy_device_stop (GypsyDevice *device, GError **error);
"connection-changed" : Run First / No Recursion "fix-status-changed" : Run First / No Recursion
GypsyDevice is used whenever the client program wishes to know about changes in the device's status. It has signals for connection status and fix status.
#define GYPSY_DEVICE_DBUS_SERVICE "org.freedesktop.Gypsy"
A define containing the address of the Device service
#define GYPSY_DEVICE_DBUS_INTERFACE "org.freedesktop.Gypsy.Device"
A define containing the name of the Device interface
typedef enum { GYPSY_DEVICE_FIX_STATUS_INVALID = 0, GYPSY_DEVICE_FIX_STATUS_NONE, GYPSY_DEVICE_FIX_STATUS_2D, GYPSY_DEVICE_FIX_STATUS_3D } GypsyDeviceFixStatus;
An enum representing the various fix states that a GPS device can be in.
GypsyDevice* gypsy_device_new (const char *object_path);
Creates a new GypsyDevice that points to object_path
object_path : |
Object path to the device |
Returns : | A pointer to a GypsyDevice |
gboolean gypsy_device_get_connection_status (GypsyDevice *device, GError **error);
Obtains the connection status of device
.
device : |
A GypsyDevice |
error : |
A pointer to a GError to return an error in. |
Returns : | TRUE if the device is connected, FALSE otherwise. |
GypsyDeviceFixStatus gypsy_device_get_fix_status (GypsyDevice *device, GError **error);
Obtains the current fix status of device
.
device : |
A GypsyDevice |
error : |
A pointer to a GError to return a error in. |
Returns : | A GypsyDeviceFixStatus |
gboolean gypsy_device_start (GypsyDevice *device, GError **error);
Starts the connection to the physical device pointed to by device
, and
listens for incoming messages.
device : |
A GypsyDevice |
error : |
A pointer to a GError to return the error in |
Returns : | TRUE on success, FALSE otherwise. |
gboolean gypsy_device_stop (GypsyDevice *device, GError **error);
Stops the physical device pointed to by device
.
device : |
A GypsyDevice |
error : |
A pointer to a GError to return the error in |
Returns : | TRUE on success, FALSE otherwise. |
void user_function (GypsyDevice *connected, gboolean arg1, gpointer user_data) : Run First / No Recursion
The ::connection-changed signal is emitted whenever the device connection changes.
connected : |
Whether or not the device is connected |
user_data : |
user data set when the signal handler was connected. |
void user_function (GypsyDevice *fix_status, gint arg1, gpointer user_data) : Run First / No Recursion
The ::fix-status-changed signal is emitted whenever the GPS device
reports that its fix status has changed. fix_status
is a
GypsyDeviceFixStatus
fix_status : |
The new fix status |
user_data : |
user data set when the signal handler was connected. |