ant-plus-next / StrideSpeedDistanceSensor
Represents a Stride-Based Speed and Distance Monitor (SDM) sensor. This class extends the AntPlusSensor class to provide specific functionality for handling SDM sensor data.
AntPlusSensornew StrideSpeedDistanceSensor(
stick):StrideSpeedDistanceSensor
Constructs an instance of the AntPlusSensor class.
The USB driver instance used for communication with the ANT+ stick.
AntPlusSensor.constructor
readonlystaticdeviceType:number=124
The device type code for Stride-Based Speed and Distance Monitor (SDM) sensors.
sensors/strideSpeedDistance/strideSpeedDistanceSensor.ts:22
attach(
channel,deviceId):Promise<void>
Attaches the sensor to a specified ANT+ channel and initializes its state.
number
The ANT+ channel number used for communication with the sensor.
number
The unique identifier of the sensor device.
Promise<void>
const sensor = new StrideSpeedDistanceSensor();
sensor.attach(1, 12345); // Attaches to channel 1 with device ID 12345
sensors/strideSpeedDistance/strideSpeedDistanceSensor.ts:36
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.
AntPlusSensor.detach