LocationGPSDControl

LocationGPSDControl — Object for controlling location services

Synopsis

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);

Object Hierarchy

  GObject
   +----LocationGPSDControl

Properties

  "maincontext-pointer"      gpointer              : Write
  "preferred-interval"       gint                  : Read / Write
  "preferred-method"         gint                  : Read / Write

Signals

  "error"                                          : Run First / No Recursion
  "error-verbose"                                  : Run First / No Recursion
  "gpsd-running"                                   : Run First / No Recursion
  "gpsd-stopped"                                   : Run First / No Recursion

Description

A wrapper object that starts and stops location services.

Details

LocationGPSDControlMethod

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.


LOCATION_METHOD_USER_SELECTED

#define LOCATION_METHOD_USER_SELECTED 0x0

The method is based on the current device settings. This is the default.


LOCATION_METHOD_CWP

#define LOCATION_METHOD_CWP 0x1

Use the Complimentary Wireless Position method.


LOCATION_METHOD_ACWP

#define LOCATION_METHOD_ACWP 0x2

Use the Assisted Complimentary Wireless Position method.


LOCATION_METHOD_GNSS

#define LOCATION_METHOD_GNSS 0x4

Use the Global Navigation Satellite System method.


LOCATION_METHOD_AGNSS

#define LOCATION_METHOD_AGNSS 0x8

Use the Assisted Global Navigation Satellite System method.


enum LocationGPSDControlInterval

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.

LOCATION_INTERVAL_DEFAULT Default value for the system.
LOCATION_INTERVAL_1S 1 second between subsequent fixes.
LOCATION_INTERVAL_2S 2 seconds between subsequent fixes.
LOCATION_INTERVAL_5S 5 seconds between subsequent fixes.
LOCATION_INTERVAL_10S 10 seconds between subsequent fixes.
LOCATION_INTERVAL_20S 20 seconds between subsequent fixes.
LOCATION_INTERVAL_30S 30 seconds between subsequent fixes.
LOCATION_INTERVAL_60S 60 seconds between subsequent fixes.
LOCATION_INTERVAL_120S 120 seconds between subsequent fixes.

enum LocationGPSDControlError

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.

LOCATION_ERROR_USER_REJECTED_DIALOG User rejected location enabling dialog.
LOCATION_ERROR_USER_REJECTED_SETTINGS User changed settings which disabled locationing.
LOCATION_ERROR_BT_GPS_NOT_AVAILABLE Problems using BT GPS.
LOCATION_ERROR_METHOD_NOT_ALLOWED_IN_OFFLINE_MODE Method unavailable in offline mode.
LOCATION_ERROR_SYSTEM System error, dbus, hildon, etc. Also when trying to use nw based methods in simless state.

LocationGPSDControlPrivate

typedef struct _LocationGPSDControlPrivate LocationGPSDControlPrivate;


LocationGPSDControl

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.


location_gpsd_control_get_default ()

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.

location_gpsd_control_start ()

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

location_gpsd_control_stop ()

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

location_gpsd_control_request_status ()

void                location_gpsd_control_request_status
                                                        (LocationGPSDControl *control);

Warning

location_gpsd_control_request_status is deprecated and should not be used in newly-written code.

control : The control context.

location_gpsd_control_get_allowed_methods ()

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

Property Details

The "maincontext-pointer" property

  "maincontext-pointer"      gpointer              : Write

Set the main context address.


The "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


The "preferred-method" property

  "preferred-method"         gint                  : Read / Write

The positioning method the application would like to use.

Allowed values: [0,15]

Default value: 0

Signal Details

The "error" signal

void                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.

The "error-verbose" signal

void                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.

The "gpsd-running" signal

void                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.

The "gpsd-stopped" signal

void                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.