org.freedesktop.GeoClue2.Client: Geoclue Reference Manual

## org.freedesktop.GeoClue2.Client org.freedesktop.GeoClue2.Client — The Application-specific client API |

## Methods

    Start ();
    Stop  ();

## Signals

    LocationUpdated (o old,
                     o new);

## Properties

    Location                readable   o
    DistanceThreshold       readwrite  u
    TimeThreshold           readwrite  u
    DesktopId               readwrite  s
    RequestedAccuracyLevel  readwrite  u
    Active                  readable   b

## Description

This is the interface you use to retrieve location information and receive location update signals from GeoClue service. You get the client object to use this interface on from org.freedesktop.GeoClue2.Manager.GetClient() method.

## Method Details

### The Start() method

    Start ();

Start receiving events about the current location. Applications should hook-up to "LocationUpdated" signal before calling this method.

### The Stop() method

    Stop ();

Stop receiving events about the current location.

## Signal Details

### The "LocationUpdated" signal

    LocationUpdated (o old,
                     o new);

The signal is emitted every time the location changes. The client should set the DistanceThreshold property to control how often this signal is emitted.

`o `old``: | old location as path to a #org.freedesktop.GeoClue2.Location object
`o `new``: | new location as path to a #org.freedesktop.GeoClue2.Location object

## Property Details

### The "Location" property

    Location  readable   o

Current location as path to a org.freedesktop.GeoClue2.Location object. Please note that this property will be set to "/" (D-Bus equivalent of null) initially, until Geoclue finds user's location. You want to delay reading this property until your callback to "LocationUpdated" signal is called for the first time after starting the client.

### The "DistanceThreshold" property

    DistanceThreshold  readwrite  u

Contains the current distance threshold in meters. This value is used by the service when it gets new location info. If the distance moved is below the threshold, it won't emit the LocationUpdated signal. The default value is 0. When DistanceThreshold is zero, it always emits the signal.

### The "TimeThreshold" property

    TimeThreshold  readwrite  u

Contains the current time threshold in seconds. This value is used by the service when it gets new location info. If the time since the last update is below the threshold, it won't emit the LocationUpdated signal. The default value is 0. When TimeThreshold is zero, it always emits the signal.

### The "DesktopId" property

    DesktopId  readwrite  s

The desktop file id (the basename of the desktop file). This property must be set by applications for authorization to work.

### The "RequestedAccuracyLevel" property

    RequestedAccuracyLevel  readwrite  u

The level of accuracy requested by client, as GClueAccuracyLevel.

Please keep in mind that the actual accuracy of location information is dependent on available hardware on your machine, external resources and/or how much accuracy user agrees to be confortable with.

### The "Active" property

    Active  readable   b

If client is active, i-e started successfully using Start() and receiving location updates.

Please keep in mind that geoclue can at any time stop and start the client on user (agent) request. Applications that are interested in in these changes, should watch for changes in this property.