|  |  |  | Geoclue Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Signals | ||||
#define GEOCLUE_VELOCITY_INTERFACE_NAME GeoclueVelocity; void (*GeoclueVelocityCallback) (GeoclueVelocity *velocity,GeoclueVelocityFields fields,int timestamp,double speed,double direction,double climb,GError *error,gpointer userdata); GeoclueVelocityClass; GeoclueVelocityFields geoclue_velocity_get_velocity (GeoclueVelocity *velocity,int *timestamp,double *speed,double *direction,double *climb,GError **error); void geoclue_velocity_get_velocity_async (GeoclueVelocity *velocity,GeoclueVelocityCallback callback,gpointer userdata); GeoclueVelocity * geoclue_velocity_new (const char *service,const char *path);
GeoclueVelocity contains velocity-related methods and signals. It is part of the Geoclue public C client API which uses D-Bus to communicate with the actual provider.
After a GeoclueVelocity is created with 
geoclue_velocity_new(), the 
geoclue_velocity_get_velocity() method and the VelocityChanged-signal
can be used to obtain the current velocity.
#define GEOCLUE_VELOCITY_INTERFACE_NAME "org.freedesktop.Geoclue.Velocity"
void (*GeoclueVelocityCallback) (GeoclueVelocity *velocity,GeoclueVelocityFields fields,int timestamp,double speed,double direction,double climb,GError *error,gpointer userdata);
Callback function for geoclue_velocity_get_velocity_async().
| 
 | A GeoclueVelocity object | 
| 
 | A GeoclueVelocityFields bitfield representing the validity of the velocity values | 
| 
 | Time of velocity measurement (unix timestamp) | 
| 
 | Horizontal speed | 
| 
 | Horizontal direction (bearing) | 
| 
 | Vertical speed | 
| 
 | Error as GError (may be NULL) | 
| 
 | User data pointer set in geoclue_velocity_get_velocity_async() | 
typedef struct {
	GeoclueProviderClass provider_class;
	void (* velocity_changed) (GeoclueVelocity      *velocity,
				   GeoclueVelocityFields fields,
				   int                   timestamp,
				   double                speed,
				   double                direction,
				   double                climb);
} GeoclueVelocityClass;
GeoclueVelocityFields geoclue_velocity_get_velocity (GeoclueVelocity *velocity,int *timestamp,double *speed,double *direction,double *climb,GError **error);
Obtains the current velocity. timestamp will contain the time of 
the actual velocity measurement.
If the caller is not interested in some values, the pointers can be 
left NULL.
| 
 | A GeoclueVelocity object | 
| 
 | Pointer to returned time of velocity measurement (unix timestamp) or NULL | 
| 
 | Pointer to returned horizontal speed or NULL | 
| 
 | Pointer to returned horizontal direction (bearing) or NULL | 
| 
 | Pointer to returned vertical speed or NULL | 
| 
 | Pointer to returned GError or NULL | 
| Returns : | A GeoclueVelocityFields bitfield representing the validity of the velocity values. | 
void geoclue_velocity_get_velocity_async (GeoclueVelocity *velocity,GeoclueVelocityCallback callback,gpointer userdata);
Function returns (essentially) immediately and calls callback when current velocity
is available or when D-Bus timeouts.
| 
 | A GeoclueVelocity object | 
| 
 | A GeoclueVelocityCallback function that should be called when return values are available | 
| 
 | pointer for user specified data | 
GeoclueVelocity * geoclue_velocity_new (const char *service,const char *path);
Creates a GeoclueVelocity with given D-Bus service name and path.
| 
 | D-Bus service name | 
| 
 | D-Bus path name | 
| Returns : | Pointer to a new GeoclueVelocity | 
"velocity-changed" signalvoid                user_function                      (GeoclueVelocity *velocity,
                                                        gint             fields,
                                                        gint             timestamp,
                                                        gdouble          speed,
                                                        gdouble          direction,
                                                        gdouble          climb,
                                                        gpointer         user_data)      : No Recursion
The geoclue-changed signal is emitted each time the velocity changes.
Note that not all providers support signals.
| 
 | the GeoclueVelocity object emitting the signal | 
| 
 | A GeoclueVelocityFields bitfield representing the validity of the velocity values | 
| 
 | Time of velocity measurement (Unix timestamp) | 
| 
 | horizontal speed | 
| 
 | horizontal direction (bearing) | 
| 
 | vertical speed | 
| 
 | user data set when the signal handler was connected. |