-
public interface CyclingSpeedAndCadenceCallback
-
-
Method Summary
Modifier and Type Method Description floatgetWheelCircumference()This method should return the wheel circumference in millimeters.See http://www.bikecalc.com/wheel_size_math for values. abstract voidonDistanceChanged(@NonNull() BluetoothDevice device, @FloatRange(from = 0) float totalDistance, @FloatRange(from = 0) float distance, @FloatRange(from = 0) float speed)Callback called when the traveled distance and speed has changed. abstract voidonCrankDataChanged(@NonNull() BluetoothDevice device, @FloatRange(from = 0) float crankCadence, float gearRatio)Callback called when the crank data (cadence or gear ratio) has changed. -
-
Method Detail
-
getWheelCircumference
float getWheelCircumference()
This method should return the wheel circumference in millimeters.See http://www.bikecalc.com/wheel_size_math for values.
-
onDistanceChanged
abstract void onDistanceChanged(@NonNull() BluetoothDevice device, @FloatRange(from = 0) float totalDistance, @FloatRange(from = 0) float distance, @FloatRange(from = 0) float speed)
Callback called when the traveled distance and speed has changed.The distance and speed calculations are based on the wheel circumference obtainedwith getWheelCircumference. Make sure it returns the correct value.
- Parameters:
device- the target device.totalDistance- the total distance traveled since the measuring device was reset, in meters.distance- the distance traveled since the phone connected to the CSC device, in meters.speed- current speed, in meters per second.
-
onCrankDataChanged
abstract void onCrankDataChanged(@NonNull() BluetoothDevice device, @FloatRange(from = 0) float crankCadence, float gearRatio)
Callback called when the crank data (cadence or gear ratio) has changed.
- Parameters:
device- the target device.crankCadence- new crank cadence, in revolutions per minute.gearRatio- new gear ratio.
-
-
-
-