src.bluetooth_sig.gatt.characteristics.location_and_speed

Location and Speed characteristic implementation.

Classes

Name

Description

ElevationSource

Elevation source enumeration.

HeadingSource

Heading source enumeration.

LocationAndSpeedCharacteristic

Location and Speed characteristic.

LocationAndSpeedData

Parsed data from Location and Speed characteristic.

LocationAndSpeedFlags

Location and Speed flags as per Bluetooth SIG specification.

SpeedAndDistanceFormat

Speed and distance format enumeration.

Module Contents

class src.bluetooth_sig.gatt.characteristics.location_and_speed.ElevationSource

Bases: enum.IntEnum

Elevation source enumeration.

BAROMETRIC_AIR_PRESSURE = 1
DATABASE_SERVICE = 2
OTHER = 3
POSITIONING_SYSTEM = 0
class src.bluetooth_sig.gatt.characteristics.location_and_speed.HeadingSource

Bases: enum.IntEnum

Heading source enumeration.

HEADING_BASED_ON_MAGNETIC_COMPASS = 1
HEADING_BASED_ON_MOVEMENT = 0
class src.bluetooth_sig.gatt.characteristics.location_and_speed.LocationAndSpeedCharacteristic

Bases: src.bluetooth_sig.gatt.characteristics.base.BaseCharacteristic[LocationAndSpeedData]

Location and Speed characteristic.

Used to represent data related to a location and speed sensor. Note that it is possible for this characteristic to exceed the default LE ATT_MTU size.

ELEVATION_SOURCE_MASK = 6144
ELEVATION_SOURCE_SHIFT = 11
HEADING_SOURCE_MASK = 8192
HEADING_SOURCE_SHIFT = 13
POSITION_STATUS_MASK = 768
POSITION_STATUS_SHIFT = 8
SPEED_DISTANCE_FORMAT_MASK = 1024
SPEED_DISTANCE_FORMAT_SHIFT = 10
allow_variable_length: bool = True
max_length = 28
min_length = 2
class src.bluetooth_sig.gatt.characteristics.location_and_speed.LocationAndSpeedData

Bases: msgspec.Struct

Parsed data from Location and Speed characteristic.

elevation: float | None = None
elevation_source: ElevationSource | None = None
flags: LocationAndSpeedFlags
heading: float | None = None
heading_source: HeadingSource | None = None
instantaneous_speed: float | None = None
latitude: float | None = None
longitude: float | None = None
position_status: src.bluetooth_sig.types.location.PositionStatus | None = None
rolling_time: int | None = None
speed_and_distance_format: SpeedAndDistanceFormat | None = None
total_distance: float | None = None
utc_time: datetime.datetime | None = None
class src.bluetooth_sig.gatt.characteristics.location_and_speed.LocationAndSpeedFlags

Bases: enum.IntFlag

Location and Speed flags as per Bluetooth SIG specification.

ELEVATION_PRESENT = 8
HEADING_PRESENT = 16
INSTANTANEOUS_SPEED_PRESENT = 1
LOCATION_PRESENT = 4
ROLLING_TIME_PRESENT = 32
TOTAL_DISTANCE_PRESENT = 2
UTC_TIME_PRESENT = 64
class src.bluetooth_sig.gatt.characteristics.location_and_speed.SpeedAndDistanceFormat

Bases: enum.IntEnum

Speed and distance format enumeration.

FORMAT_2D = 0
FORMAT_3D = 1