Typedefs | |
typedef void(* | UALocationServiceStatusChangedHandler )(UALocationServiceStatusFlags flags, void *context) |
Callback type that is invoked when the location service status changes. More... | |
typedef struct UbuntuApplicationLocationServiceController | UALocationServiceController |
Opaque type encapsulating a controller the location service. More... | |
typedef struct UbuntuApplicationLocationHeadingUpdate | UALocationHeadingUpdate |
Opaque type encapsulating a heading update. More... | |
typedef struct UbuntuApplicationLocationPositionUpdate | UALocationPositionUpdate |
Opaque type encapsulating a location update. More... | |
typedef unsigned int | UALocationServiceRequirementsFlags |
Bitfield type for summarizing an application's requirements. More... | |
typedef struct UbuntuApplicationLocationServiceSession | UALocationServiceSession |
Opaque type encapsulating a session with the location service. More... | |
typedef void(* | UALocationServiceSessionPositionUpdatesHandler )(UALocationPositionUpdate *position, void *context) |
Callback type that is invoked for position updates. More... | |
typedef void(* | UALocationServiceSessionHeadingUpdatesHandler )(UALocationHeadingUpdate *heading, void *context) |
Callback type that is invoked for heading updates. More... | |
typedef void(* | UALocationServiceSessionVelocityUpdatesHandler )(UALocationVelocityUpdate *heading, void *context) |
Callback type that is invoked for velocity updates. More... | |
typedef struct UbuntuApplicationLocationVelocityUpdate | UALocationVelocityUpdate |
Opaque type encapsulating a velocity update. More... | |
Enumerations | |
enum | UbuntuApplicationLocationServiceStatus { UA_LOCATION_SERVICE_ENABLED = 1 << 0, UA_LOCATION_SERVICE_DISABLED = 1 << 1, UA_LOCATION_SERVICE_GPS_ENABLED = 1 << 2, UA_LOCATION_SERVICE_GPS_DISABLED = 1 << 3 } |
Location service status. More... | |
enum | UbuntuApplicationLocationServiceRequirement { UA_LOCATION_SERVICE_REQUIRE_ALTITUDE = 1 << 0, UA_LOCATION_SERVICE_REQUIRE_HEADING = 1 << 1, UA_LOCATION_SERVICE_REQUIRE_VELOCITY = 1 << 2 } |
Application-specific requirements. More... | |
Applications in Ubuntu do not access positioning hardware directly but instead rely on a system-wide location service to be provided with position, heading and velocity updates. An application that wants to receive position, heading or velocity updates needs to start a session with the location service and specify its requirements with the help UALocationServiceRequirementsFlags. After the session has been created, position, heading and velocity updates need to be started by the application for its session. The actual updates are delivered via callbacks. Please note that the location service caches updates as good as possible. That is, if an application is only interested in a single position fix, and a reasonable fix is already known to the service, the information is immediately delivered to the application when the respecitve updates are started.
typedef struct UbuntuApplicationLocationHeadingUpdate UALocationHeadingUpdate |
Opaque type encapsulating a heading update.
Definition at line 36 of file heading_update.h.
typedef struct UbuntuApplicationLocationPositionUpdate UALocationPositionUpdate |
Opaque type encapsulating a location update.
Definition at line 36 of file position_update.h.
typedef struct UbuntuApplicationLocationServiceController UALocationServiceController |
Opaque type encapsulating a controller the location service.
Definition at line 58 of file controller.h.
typedef unsigned int UALocationServiceRequirementsFlags |
typedef struct UbuntuApplicationLocationServiceSession UALocationServiceSession |
typedef void(* UALocationServiceSessionHeadingUpdatesHandler)(UALocationHeadingUpdate *heading, void *context) |
typedef void(* UALocationServiceSessionPositionUpdatesHandler)(UALocationPositionUpdate *position, void *context) |
typedef void(* UALocationServiceSessionVelocityUpdatesHandler)(UALocationVelocityUpdate *heading, void *context) |
typedef void(* UALocationServiceStatusChangedHandler)(UALocationServiceStatusFlags flags, void *context) |
Callback type that is invoked when the location service status changes.
Definition at line 50 of file controller.h.
typedef struct UbuntuApplicationLocationVelocityUpdate UALocationVelocityUpdate |
Opaque type encapsulating a velocity update.
Definition at line 36 of file velocity_update.h.
Location service status.
Definition at line 34 of file controller.h.
UBUNTU_DLL_PUBLIC double ua_location_heading_update_get_heading_in_degree | ( | UALocationHeadingUpdate * | update | ) |
Queries the new heading from the update.
[in] | update | The heading update instance to be queried. |
UBUNTU_DLL_PUBLIC uint64_t ua_location_heading_update_get_timestamp | ( | UALocationHeadingUpdate * | update | ) |
Queries the timestamp of the heading update.
[in] | update | The heading update instance to be queried. |
UBUNTU_DLL_PUBLIC void ua_location_heading_update_ref | ( | UALocationHeadingUpdate * | update | ) |
Increments the reference count of the heading update instance.
[in] | update | The heading update instance to increment the reference count for. |
UBUNTU_DLL_PUBLIC void ua_location_heading_update_unref | ( | UALocationHeadingUpdate * | update | ) |
Decrements the reference count of the heading update instance.
[in] | update | The heading update instance to decrement the reference count for. |
UBUNTU_DLL_PUBLIC double ua_location_position_update_get_altitude_in_meter | ( | UALocationPositionUpdate * | update | ) |
Queries the altitude contained in the position update.
[in] | update | The position update instance to be queried. |
UBUNTU_DLL_PUBLIC double ua_location_position_update_get_horizontal_accuracy_in_meter | ( | UALocationPositionUpdate * | update | ) |
Queries the horizontal accuracy contained in the position update.
[in] | update | The position update instance to be queried. |
UBUNTU_DLL_PUBLIC double ua_location_position_update_get_latitude_in_degree | ( | UALocationPositionUpdate * | update | ) |
Queries the latitude contained in the position update.
[in] | update | The position update instance to be queried. |
UBUNTU_DLL_PUBLIC double ua_location_position_update_get_longitude_in_degree | ( | UALocationPositionUpdate * | update | ) |
Queries the longitude contained in the position update.
[in] | update | The position update instance to be queried. |
UBUNTU_DLL_PUBLIC uint64_t ua_location_position_update_get_timestamp | ( | UALocationPositionUpdate * | update | ) |
Queries the timestamp of the position update.
[in] | update | The position update instance to be queried. |
UBUNTU_DLL_PUBLIC double ua_location_position_update_get_vertical_accuracy_in_meter | ( | UALocationPositionUpdate * | update | ) |
Queries the vertical accuracy contained in the position update.
[in] | update | The position update instance to be queried. |
UBUNTU_DLL_PUBLIC bool ua_location_position_update_has_altitude | ( | UALocationPositionUpdate * | update | ) |
Checks if the position update contains an altitude.
[in] | update | The position update instance to be queried. |
UBUNTU_DLL_PUBLIC bool ua_location_position_update_has_horizontal_accuracy | ( | UALocationPositionUpdate * | update | ) |
Checks if the position update contains a horizontal accuracy estimate.
[in] | update | The position update instance to be queried. |
UBUNTU_DLL_PUBLIC bool ua_location_position_update_has_vertical_accuracy | ( | UALocationPositionUpdate * | update | ) |
Checks if the position update contains a vertical accuracy estimate.
[in] | update | The position update instance to be queried. |
UBUNTU_DLL_PUBLIC void ua_location_position_update_ref | ( | UALocationPositionUpdate * | update | ) |
Increments the reference count of the position update instance.
[in] | update | The position update instance to increment the reference count for. |
UBUNTU_DLL_PUBLIC void ua_location_position_update_unref | ( | UALocationPositionUpdate * | update | ) |
Decrements the reference count of the position update instance.
[in] | update | The position update instance to decrement the reference count for. |
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_disable_gps | ( | UALocationServiceController * | controller | ) |
Disables all gps providers known to the location service.
[in] | controller | The controller instance. |
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_disable_service | ( | UALocationServiceController * | controller | ) |
Disables the location service completely.
[in] | controller | The controller instance. |
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_enable_gps | ( | UALocationServiceController * | controller | ) |
Enables all gps providers known to the location service.
[in] | controller | The controller instance. |
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_enable_service | ( | UALocationServiceController * | controller | ) |
Enables the location service.
[in] | controller | The controller instance. |
UBUNTU_DLL_PUBLIC UStatus ua_location_service_controller_query_status | ( | UALocationServiceController * | controller, |
UALocationServiceStatusFlags * | out_flags | ||
) |
Query the status of the location service.
[in] | controller | The controller instance. |
[out] | flags | Flags indicating the service status. |
UBUNTU_DLL_PUBLIC void ua_location_service_controller_ref | ( | UALocationServiceController * | controller | ) |
Increments the reference count of the controller instance.
[in] | controller | The controller instance to increment the reference count for. |
UBUNTU_DLL_PUBLIC void ua_location_service_controller_set_status_changed_handler | ( | UALocationServiceController * | controller, |
UALocationServiceStatusChangedHandler | handler, | ||
void * | context | ||
) |
Sets the status changed handler of the controller instance.
[in] | controller | The controller instance. |
[in] | handler | The status changed handler to invoke. |
[in] | context | The context pointer to pass in the status changed handler |
UBUNTU_DLL_PUBLIC void ua_location_service_controller_unref | ( | UALocationServiceController * | controller | ) |
Decrements the reference count of the controller instance.
[in] | controller | The controller instance to decrement the reference count for. |
UBUNTU_DLL_PUBLIC UALocationServiceController* ua_location_service_create_controller | ( | ) |
Creates a new controller for the location service.
UBUNTU_DLL_PUBLIC UALocationServiceSession* ua_location_service_create_session_for_high_accuracy | ( | UALocationServiceRequirementsFlags | flags | ) |
Creates a new session with the location service for high positional accuracy requirements.
[in] | Bitfield | describing the application's requirements. |
UBUNTU_DLL_PUBLIC UALocationServiceSession* ua_location_service_create_session_for_low_accuracy | ( | UALocationServiceRequirementsFlags | flags | ) |
Creates a new session with the location service for low positional accuracy requirements.
[in] | Bitfield | describing the application's requirements. |
UBUNTU_DLL_PUBLIC void ua_location_service_session_ref | ( | UALocationServiceSession * | session | ) |
Increments the reference count of the session instance.
[in] | session | The session instance to increment the reference count for. |
UBUNTU_DLL_PUBLIC void ua_location_service_session_set_heading_updates_handler | ( | UALocationServiceSession * | session, |
UALocationServiceSessionHeadingUpdatesHandler | handler, | ||
void * | context | ||
) |
Installs an app-specific heading update handler for the session.
[in] | session | The session instance to install the handler for. |
[in] | handler | The heading update handler. |
UBUNTU_DLL_PUBLIC void ua_location_service_session_set_position_updates_handler | ( | UALocationServiceSession * | session, |
UALocationServiceSessionPositionUpdatesHandler | handler, | ||
void * | context | ||
) |
Installs an app-specific position update handler for the session.
[in] | session | The session instance to install the handler for. |
[in] | handler | The position update handler. |
UBUNTU_DLL_PUBLIC void ua_location_service_session_set_velocity_updates_handler | ( | UALocationServiceSession * | session, |
UALocationServiceSessionVelocityUpdatesHandler | handler, | ||
void * | context | ||
) |
Installs an app-specific velocity update handler for the session.
[in] | session | The session instance to install the handler for. |
[in] | handler | The velocity update handler. |
UBUNTU_DLL_PUBLIC UStatus ua_location_service_session_start_heading_updates | ( | UALocationServiceSession * | session | ) |
Starts heading updates for the supplied session.
[in] | session | The session instance to start heading updates for. |
UBUNTU_DLL_PUBLIC UStatus ua_location_service_session_start_position_updates | ( | UALocationServiceSession * | session | ) |
Starts position updates for the supplied session.
[in] | session | The session instance to start position updates for. |
UBUNTU_DLL_PUBLIC UStatus ua_location_service_session_start_velocity_updates | ( | UALocationServiceSession * | session | ) |
Starts velocity updates for the supplied session.
[in] | session | The session instance to start velocity updates for. |
UBUNTU_DLL_PUBLIC void ua_location_service_session_stop_heading_updates | ( | UALocationServiceSession * | session | ) |
Stops heading updates for the supplied session.
[in] | session | The session instance to stop heading updates for. |
UBUNTU_DLL_PUBLIC void ua_location_service_session_stop_position_updates | ( | UALocationServiceSession * | session | ) |
Stops position updates for the supplied session.
[in] | session | The session instance to stop position updates for. |
UBUNTU_DLL_PUBLIC void ua_location_service_session_stop_velocity_updates | ( | UALocationServiceSession * | session | ) |
Stops velocity updates for the supplied session.
[in] | session | The session instance to stop velocity updates for. |
UBUNTU_DLL_PUBLIC void ua_location_service_session_unref | ( | UALocationServiceSession * | session | ) |
Decrements the reference count of the session instance.
[in] | session | The session instance to decrement the reference count for. |
UBUNTU_DLL_PUBLIC uint64_t ua_location_velocity_update_get_timestamp | ( | UALocationVelocityUpdate * | update | ) |
Queries the timestamp of the velocity update.
[in] | update | The velocity update instance to be queried. |
UBUNTU_DLL_PUBLIC double ua_location_velocity_update_get_velocity_in_meters_per_second | ( | UALocationVelocityUpdate * | update | ) |
Queries the velocity contained in the position update.
[in] | update | The velocity update instance to be queried. |
UBUNTU_DLL_PUBLIC void ua_location_velocity_update_ref | ( | UALocationVelocityUpdate * | update | ) |
Increments the reference count of the velocity update instance.
[in] | update | The velocity update instance to increment the reference count for. |
UBUNTU_DLL_PUBLIC void ua_location_velocity_update_unref | ( | UALocationVelocityUpdate * | update | ) |
Decrements the reference count of the velocity update instance.
[in] | update | The velocity update instance to decrement the reference count for. |