Skip to content
Vehicle properties
Performance & motion

PERF_VEHICLE_SPEED

What it is

Speed of the vehicle

The value must be positive when the vehicle is moving forward and negative when the vehicle is moving backward. This value is independent of gear value (CURRENT_GEAR or GEAR_SELECTION), for example, if GEAR_SELECTION is GEAR_NEUTRAL, PERF_VEHICLE_SPEED is positive when the vehicle is moving forward, negative when moving backward, and zero when not moving.

How the ID is built

A property ID is a 32-bit value packing four fields. Reading 0x11600207 apart:

FieldMaskValueMeans
Group0xf00000000x10000000SYSTEM
Area0x0f0000000x01000000GLOBAL
Type0x00ff00000x00600000FLOAT
Ordinal0x0000ffff0x000002070x207

Reading it from an app

CarPropertyManager mgr = (CarPropertyManager)
        car.getCarManager(Car.PROPERTY_SERVICE);

mgr.registerCallback(callback,
        VehiclePropertyIds.PERF_VEHICLE_SPEED,
        CarPropertyManager.SENSOR_RATE_ONCHANGE);

This property is read-only — writes are rejected. It changes continuously, so subscribe at a sample rate rather than polling.