Android Hardware Abstraction Layer
Data Fields
FlpLocationInterface Struct Reference

#include <fused_location.h>

Data Fields

size_t size
 
int(* init )(FlpCallbacks *callbacks)
 
int(* get_batch_size )()
 
int(* start_batching )(int id, FlpBatchOptions *options)
 
int(* update_batching_options )(int id, FlpBatchOptions *new_options)
 
int(* stop_batching )(int id)
 
void(* cleanup )()
 
void(* get_batched_location )(int last_n_locations)
 
int(* inject_location )(FlpLocation *location)
 
const void *(* get_extension )(const char *name)
 

Detailed Description

Represents the standard FLP interface.

Definition at line 244 of file fused_location.h.

Field Documentation

void(* cleanup)()

Closes the interface. If any batch operations are in progress, they should be stopped.

Definition at line 319 of file fused_location.h.

int(* get_batch_size)()

Return the batch size (in number of FlpLocation objects) available in the hardware. Note, different HW implementations may have different sample sizes. This shall return number of samples defined in the format of FlpLocation. This will be used by the upper layer, to decide on the batching interval and whether the AP should be woken up or not.

Definition at line 264 of file fused_location.h.

void(* get_batched_location)(int last_n_locations)

Get the fused location that was batched. flp_location_callback is used to return the location. The location object is dropped from the buffer only when the buffer is full. Do not remove it from the buffer just because it has been returned using the callback. In other words, when there is no new location object, two calls to get_batched_location(1) should return the same location object. Parameters: last_n_locations - Number of locations to get. This can be one or many. If the last_n_locations is 1, you get the latest location known to the hardware.

Definition at line 333 of file fused_location.h.

const void*(* get_extension)(const char *name)

Get a pointer to extension information.

Definition at line 348 of file fused_location.h.

int(* init)(FlpCallbacks *callbacks)

Opens the interface and provides the callback routines to the implemenation of this interface.

Definition at line 254 of file fused_location.h.

int(* inject_location)(FlpLocation *location)

Injects current location from another location provider latitude and longitude are measured in degrees expected accuracy is measured in meters Parameters: location - The location object being injected. Return value: FLP_RESULT_SUCCESS or FLP_RESULT_ERROR.

Definition at line 343 of file fused_location.h.

size_t size

set to sizeof(FlpLocationInterface)

Definition at line 248 of file fused_location.h.

int(* start_batching)(int id, FlpBatchOptions *options)

Start batching locations. This API is primarily used when the AP is asleep and the device can batch locations in the hardware. flp_location_callback is used to return the locations. When the buffer is full and FLP_BATCH_WAKEUP_ON_FIFO_FULL is used, the AP is woken up. When the buffer is full and FLP_BATCH_WAKEUP_ON_FIFO_FULL is not set, the oldest location object is dropped. In this case the AP will not be woken up. The upper layer will use get_batched_location API to explicitly ask for the location. If FLP_BATCH_CALLBACK_ON_LOCATION_FIX is set, the implementation will call the flp_location_callback every single time there is a location fix. This overrides FLP_BATCH_WAKEUP_ON_FIFO_FULL flag setting. It's the responsibility of the upper layers (caller) to switch it off, if it knows that the AP might go to sleep. This is useful for nagivational applications when the system is in high power mode. Parameters: id - Id for the request. options - See FlpBatchOptions struct definition. Return value: FLP_RESULT_SUCCESS on success, FLP_RESULT_INSUFFICIENT_MEMORY, FLP_RESULT_ID_EXISTS, FLP_RESULT_ERROR on failure.

Definition at line 288 of file fused_location.h.

int(* stop_batching)(int id)

Stop batching. Parameters: id - Id for the request. Return Value: FLP_RESULT_SUCCESS on success, FLP_RESULT_ID_UNKNOWN or FLP_RESULT_ERROR on failure.

Definition at line 313 of file fused_location.h.

int(* update_batching_options)(int id, FlpBatchOptions *new_options)

Update FlpBatchOptions associated with a batching request. When a batching operation is in progress and a batching option such as FLP_BATCH_WAKEUP_ON_FIFO_FULL needs to be updated, this API will be used. For instance, this can happen when the AP is awake and the maps application is being used. Parameters: id - Id of an existing batch request. new_options - Updated FlpBatchOptions Return value: FLP_RESULT_SUCCESS on success, FLP_RESULT_ID_UNKNOWN, FLP_RESULT_ERROR on error.

Definition at line 303 of file fused_location.h.


The documentation for this struct was generated from the following file: