liblocation Reference Manual | ||||
---|---|---|---|---|
typedef LocationGPSDControlMethod; #define LOCATION_METHOD_USER_SELECTED #define LOCATION_METHOD_CWP #define LOCATION_METHOD_ACWP #define LOCATION_METHOD_GNSS #define LOCATION_METHOD_AGNSS enum LocationGPSDControlInterval; enum LocationGPSDControlError; LocationGPSDControlPrivate; LocationGPSDControl; LocationGPSDControl* location_gpsd_control_get_default (void); void location_gpsd_control_start (LocationGPSDControl *control); void location_gpsd_control_stop (LocationGPSDControl *control); void location_gpsd_control_request_status (LocationGPSDControl *control); gint location_gpsd_control_get_allowed_methods (LocationGPSDControl *control);
"maincontext-pointer" gpointer : Write "preferred-interval" gint : Read / Write "preferred-method" gint : Read / Write
"error" : Run First / No Recursion "error-verbose" : Run First / No Recursion "gpsd-running" : Run First / No Recursion "gpsd-stopped" : Run First / No Recursion
typedef gint LocationGPSDControlMethod;
One of LOCATION_METHOD_AGNSS, LOCATION_METHOD_GNSS, LOCATION_METHOD_ACWP, LOCATION_METHOD_CWP, and LOCATION_METHOD_USER_SELECTED.
Please note that these values are in sync with the ones understood by the lower layers.
#define LOCATION_METHOD_USER_SELECTED 0x0
The method is based on the current device settings. This is the default.
#define LOCATION_METHOD_ACWP 0x2
Use the Assisted Complimentary Wireless Position method.
#define LOCATION_METHOD_GNSS 0x4
Use the Global Navigation Satellite System method.
#define LOCATION_METHOD_AGNSS 0x8
Use the Assisted Global Navigation Satellite System method.
typedef enum { LOCATION_INTERVAL_DEFAULT = 0x0000, LOCATION_INTERVAL_1S = 0x000A, LOCATION_INTERVAL_2S = 0x0014, LOCATION_INTERVAL_5S = 0x0032, LOCATION_INTERVAL_10S = 0x0064, LOCATION_INTERVAL_20S = 0x00C8, LOCATION_INTERVAL_30S = 0x012C, LOCATION_INTERVAL_60S = 0x0258, LOCATION_INTERVAL_120S = 0x04B0, } LocationGPSDControlInterval;
Enum representing valid values for the intervals between fixes. Note that only these constants can be specified for the preferred interval value.
typedef enum { LOCATION_ERROR_USER_REJECTED_DIALOG, LOCATION_ERROR_USER_REJECTED_SETTINGS, LOCATION_ERROR_BT_GPS_NOT_AVAILABLE, LOCATION_ERROR_METHOD_NOT_ALLOWED_IN_OFFLINE_MODE, LOCATION_ERROR_SYSTEM, } LocationGPSDControlError;
Enum representing reason for error why locationing is not available.
typedef struct _LocationGPSDControl LocationGPSDControl;
The object that controls the daemon processes. An application
obtains an instance of this object by calling the
location_gpsd_control_get_default()
function.
LocationGPSDControl* location_gpsd_control_get_default (void);
This function is an alias for creating a new LocationGPSDControl object. This used to return a single instance of object, but not anymore as object properties cannot be shared between applications.
Returns : | A new LocationGPSDControl object. |
void location_gpsd_control_start (LocationGPSDControl *control);
Starts an active connection to Location server ie. the application informs that it wants to use the location service.
control : |
The control context |
void location_gpsd_control_stop (LocationGPSDControl *control);
Informs the location framework that the application is no longer interested about the current location. Location service is kept running as long as there is at least one application using it. Please note that LocationGPSDevice still sends data as long as the location framework is running.
control : |
The control context |
void location_gpsd_control_request_status (LocationGPSDControl *control);
location_gpsd_control_request_status
is deprecated and should not be used in newly-written code.
control : |
The control context. |
gint location_gpsd_control_get_allowed_methods (LocationGPSDControl *control);
This function reads current location settings and returns a bitmask of allowed location methods of type LocationGPSDControlMethod. Please note that you can also use methods, that are not currently allowed. Location Framework will in this case prompt user a dialog to enable necessary settings when location is started.
control : |
The control context. |
Returns : | A bitmask of allowed location methods of type LocationGPSDControlMethod. |
Since 0.100
"maincontext-pointer"
property"maincontext-pointer" gpointer : Write
Set the main context address.
"preferred-interval"
property"preferred-interval" gint : Read / Write
The interval between fixes the application prefers. The actual rate may be different.
Allowed values: >= -1
Default value: -1
"error"
signalvoid user_function (LocationGPSDControl *control, gpointer user_data) : Run First / No Recursion
The ::error signal is emitted when location is stopped or not started due to error.
control : |
the control object. |
user_data : |
user data set when the signal handler was connected. |
"error-verbose"
signalvoid user_function (LocationGPSDControl *control, gint error, gpointer user_data) : Run First / No Recursion
The ::error-verbose signal is a more verbose version of ::error signal, and is emitted when location is stopped or not started due to error.
control : |
the control object. |
error : |
the reason for error, which stopped location. see LocationGPSDControlError for possible errors. |
user_data : |
user data set when the signal handler was connected. |
"gpsd-running"
signalvoid user_function (LocationGPSDControl *control, gpointer user_data) : Run First / No Recursion
The ::gpsd-running signal is emitted when location has been succesfully started.
control : |
the control object. |
user_data : |
user data set when the signal handler was connected. |
"gpsd-stopped"
signalvoid user_function (LocationGPSDControl *control, gpointer user_data) : Run First / No Recursion
The ::gpsd-stopped signal is emitted when location is stopped.
control : |
the control object. |
user_data : |
user data set when the signal handler was connected. |