libretro.drivers.location.driver

Protocol definition for geolocation drivers.

See also

libretro.api.location

The matching ctypes types and callback definitions.

Classes

LocationDriver

Protocol for drivers that supply geographic position updates to a core.

Position

A geographic position reported by a LocationDriver.

class LocationDriver[source]

Bases: Protocol

Protocol for drivers that supply geographic position updates to a core.

See also

libretro.api.location

The matching ctypes types and callback definitions.

abstractmethod start()[source]

Begin reporting geographic position updates to the core.

Called by the core through retro_location_callback.start.

Return type:

bool

Returns:

True if the location service started successfully.

See also

retro_location_start_t

The C function pointer type whose signature this method implements.

abstractmethod stop()[source]

Stop reporting geographic position updates to the core.

Called by the core through retro_location_callback.stop.

See also

retro_location_stop_t

The C function pointer type whose signature this method implements.

Return type:

None

abstractmethod get_position()[source]

Return the most recently observed geographic position.

Return type:

Position | None

Returns:

The latest Position, or None if no fix is available yet.

See also

retro_location_get_position_t

The C function pointer type whose signature this method implements.

abstractmethod set_interval(interval, distance)[source]

Configure how frequently the driver should produce position updates.

Parameters:
  • interval (int) – Minimum time between updates in milliseconds.

  • distance (int) – Minimum distance between updates in meters.

See also

retro_location_set_interval_t

The C function pointer type whose signature this method implements.

Return type:

None

abstract property initialized

Callback the driver invokes after it finishes initializing.

Registered by the core through retro_location_callback.initialized; None if the core has not registered one.

Parameters:

value – The callback to invoke after initialization, or None to clear it.

See also

retro_location_lifetime_status_t

The C function pointer type that this attribute holds.

__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)
abstract property deinitialized

Callback the driver invokes immediately before it deinitializes.

Registered by the core through retro_location_callback.deinitialized; None if the core has not registered one.

Parameters:

value – The callback to invoke before deinitialization, or None to clear it.

See also

retro_location_lifetime_status_t

The C function pointer type that this attribute holds.

class Position[source]

Bases: object

A geographic position reported by a LocationDriver.

latitude
longitude
horizontal_accuracy
vertical_accuracy
__init__(latitude, longitude, horizontal_accuracy, vertical_accuracy)
classmethod __new__(*args, **kwargs)