FlpLocationInterface Struct Reference

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)
void(*  flush_batched_locations )()

Detailed Description

Represents the standard FLP interface.

Definition at line 321 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 398 of file fused_location.h .

void(* flush_batched_locations)()

Retrieve all batched locations currently stored and clear the buffer. flp_location_callback MUST be called in response, even if there are no locations to flush (in which case num_locations should be 0). Subsequent calls to get_batched_location or flush_batched_locations should not return any of the locations returned in this call.

Definition at line 436 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 343 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 412 of file fused_location.h .

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

Get a pointer to extension information.

Definition at line 427 of file fused_location.h .

int(* init)( FlpCallbacks *callbacks)

Opens the interface and provides the callback routines to the implementation of this interface. Once called you should respond by calling the flp_capabilities_callback in FlpCallbacks to specify the capabilities that your implementation supports.

Definition at line 333 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 422 of file fused_location.h .

size_t size

set to sizeof(FlpLocationInterface)

Definition at line 325 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 367 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 392 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 382 of file fused_location.h .

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