| liblocation Reference Manual | ||||
|---|---|---|---|---|
#define LOCATION_GPS_DEVICE_NAN enum LocationGPSDeviceStatus; enum LocationGPSDeviceMode; LocationGPSDeviceSatellite; gsm_cell_info; #define LOCATION_CELL_INFO_GSM_CELL_INFO_SET #define LOCATION_CELL_INFO_WCDMA_CELL_INFO_SET #define LOCATION_GPS_DEVICE_NONE_SET #define LOCATION_GPS_DEVICE_ALTITUDE_SET #define LOCATION_GPS_DEVICE_SPEED_SET #define LOCATION_GPS_DEVICE_TRACK_SET #define LOCATION_GPS_DEVICE_CLIMB_SET #define LOCATION_GPS_DEVICE_LATLONG_SET #define LOCATION_GPS_DEVICE_TIME_SET LocationGPSDeviceFix; LocationGPSDevicePrivate; LocationGPSDevice; void location_gps_device_reset_last_known (LocationGPSDevice *device); void location_gps_device_start (LocationGPSDevice *device); void location_gps_device_stop (LocationGPSDevice *device);
"changed" : Run First / No Recursion "connected" : Run First / No Recursion "disconnected" : Run First / No Recursion
LocationGPSDevice is a listener for location daemons (Gypsy, for example) that sends signals as the fix details are updated.
#define LOCATION_GPS_DEVICE_NAN (double) (0.0 / 0.0)
A define representing NAN.
typedef enum {
LOCATION_GPS_DEVICE_STATUS_NO_FIX,
LOCATION_GPS_DEVICE_STATUS_FIX,
LOCATION_GPS_DEVICE_STATUS_DGPS_FIX,
} LocationGPSDeviceStatus;
Enum representing the various states that a device can be in
typedef enum {
LOCATION_GPS_DEVICE_MODE_NOT_SEEN,
LOCATION_GPS_DEVICE_MODE_NO_FIX,
LOCATION_GPS_DEVICE_MODE_2D,
LOCATION_GPS_DEVICE_MODE_3D
} LocationGPSDeviceMode;
Enum representing the modes that a device can operate in
typedef struct {
int prn;
int elevation;
int azimuth;
int signal_strength;
gboolean in_use;
} LocationGPSDeviceSatellite;
Details about satellites
int prn; |
Satellite ID number |
int elevation; |
Elevation of the satellite |
int azimuth; |
Satellite azimuth |
int signal_strength; |
Signal/Noise ratio |
gboolean in_use; |
Whether the satellite is being used to calculate the fix |
typedef struct {
int flags;
struct
{
guint16 mcc;
guint16 mnc;
guint16 lac;
guint16 cell_id;
} gsm_cell_info;
#define LOCATION_CELL_INFO_GSM_CELL_INFO_SET 0x01
A define indicating that the gsm_cell_info field of LocationCellInfo is valid
#define LOCATION_CELL_INFO_WCDMA_CELL_INFO_SET 0x02
A define indicating that the wcdma_cell_info field of LocationCellInfo is valid
#define LOCATION_GPS_DEVICE_NONE_SET 0
A define indicating that none of the LocationGPSDeviceFix fields are valid
#define LOCATION_GPS_DEVICE_ALTITUDE_SET (1 << 0)
A define indicating that the altitude field of LocationGPSDeviceFix is valid
#define LOCATION_GPS_DEVICE_SPEED_SET (1 << 1)
A define indicating that the speed field of LocationGPSDeviceFix is valid
#define LOCATION_GPS_DEVICE_TRACK_SET (1 << 2)
A define indicating that the track field of LocationGPSDeviceFix is valid
#define LOCATION_GPS_DEVICE_CLIMB_SET (1 << 3)
A define indicating that the climb field of LocationGPSDeviceFix is valid
#define LOCATION_GPS_DEVICE_LATLONG_SET (1 << 4)
A define indicating that the latitude and longitude fields of LocationGPSDeviceFix are valid
#define LOCATION_GPS_DEVICE_TIME_SET (1 << 5)
A define indicating that the time field of LocationGPSDeviceFix is valid
typedef struct {
LocationGPSDeviceMode mode;
guint32 fields;
double time;
double ept;
double latitude;
double longitude;
double eph;
double altitude;
double epv;
double track;
double epd;
double speed;
double eps;
double climb;
double epc;
} LocationGPSDeviceFix;
The details of the fix
LocationGPSDeviceMode mode; |
The mode of the fix |
guint32 fields; |
A bitfield representing what fields contain valid data |
double time; |
The timestamp of the update |
double ept; |
Estimated time uncertainty |
double latitude; |
Fix latitude |
double longitude; |
Fix longitude |
double eph; |
Horizontal position uncertainty |
double altitude; |
Fix altitude (in metres) |
double epv; |
Vertical position uncertainty |
double track; |
The current direction of motion (in degrees between 0 and 359) |
double epd; |
Track uncertainty |
double speed; |
Current speed (in km/h) |
double eps; |
Speed uncertainty |
double climb; |
Current rate of climb (in m/s) |
double epc; |
Climb uncertainty |
typedef struct {
gboolean online;
LocationGPSDeviceStatus status;
LocationGPSDeviceFix *fix;
int satellites_in_view;
int satellites_in_use;
GPtrArray *satellites;
LocationCellInfo *cell_info;
} LocationGPSDevice;
If the GPS has not yet obtained a fix from the device, then fix will hold
the last known location
gboolean online; |
Whether there is a connection to positioning hardware |
LocationGPSDeviceStatus status; |
The status of the device |
LocationGPSDeviceFix *fix; |
The location fix |
int satellites_in_view; |
Number of satellites the GPS device can see |
int satellites_in_use; |
Number of satellites the GPS used in calculating fix
|
GPtrArray *satellites; |
Array containing LocationGPSDeviceSatellite |
LocationCellInfo *cell_info; |
Current cell info, see LocationCellInfo |
void location_gps_device_reset_last_known
(LocationGPSDevice *device);
Resets the last known location to unknown.
device : |
LocationGPSDevice to reset |
"changed" signalvoid user_function (LocationGPSDevice *device, gpointer user_data) : Run First / No Recursion
The ::changed signal is emitted each time a received location message changes the state of the fix
device : |
the device which has been changed |
user_data : |
user data set when the signal handler was connected. |
"connected" signalvoid user_function (LocationGPSDevice *device, gpointer user_data) : Run First / No Recursion
The ::connected signal is emitted when device manages to connect
to the location server
device : |
the device which has been connected |
user_data : |
user data set when the signal handler was connected. |
"disconnected" signalvoid user_function (LocationGPSDevice *device, gpointer user_data) : Run First / No Recursion
The ::disconnected signal is emitted when device is disconnected
from the location server
device : |
the device which has been disconnected |
user_data : |
user data set when the signal handler was connected. |