ant-plus-next / SpeedCadenceScanner
Represents a scanner for Speed and Cadence sensors. Extends the AntPlusScanner class to handle scanning and state updates for multiple Speed and Cadence sensors.
AntPlusScanner
new SpeedCadenceScanner(
stick
):SpeedCadenceScanner
Constructs an instance of the AntPlusScanner class.
The USB driver instance used for communication with the ANT+ stick.
AntPlusScanner.constructor
wheelCircumference:
number
=2.199
The wheel circumference in meters, used to calculate speed.
2.199
sensors/speedCadence/speedCadenceScanner.ts:28
detach():
Promise
<void
>
Detaches the sensor from its assigned channel and stops communication.
Promise
<void
>
Will throw an error if there is an issue detaching.
AntPlusScanner.detach
scan():
Promise
<void
>
Initiates a scan for ANT+ sensors by receiving broadcast messages.
Promise
<void
>
A promise that resolves when the scanning process is complete.
// Example usage:
const scanner = new AntPlusScanner();
scanner.scan();
AntPlusScanner.scan
setWheelCircumference(
wheelCircumference
):void
Sets the wheel circumference for speed calculation.
number
The wheel circumference in meters.
void
const scanner = new SpeedCadenceScanner();
scanner.setWheelCircumference(2.105); // Sets the wheel circumference to 2.105 meters