ant-plus-next / MuscleOxygenSensor
Represents a Muscle Oxygen sensor. This class extends the AntPlusSensor class to handle specific data related to muscle oxygen measurements.
AntPlusSensornew MuscleOxygenSensor(
stick):MuscleOxygenSensor
Constructs an instance of the AntPlusSensor class.
The USB driver instance used for communication with the ANT+ stick.
AntPlusSensor.constructor
readonlystaticdeviceType:number=0x1f
The device type code for Muscle Oxygen sensors.
sensors/muscleOxygen/muscleOxygenSensor.ts:24
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 MuscleOxygenSensor();
sensor.attach(1, 12345); // Attaches to channel 1 with device ID 12345
sensors/muscleOxygen/muscleOxygenSensor.ts:45
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
setLap(
cbk?):Promise<void>
Sets a lap marker on the sensor.
Optional callback function to handle the send response.
Promise<void>
sensor.setLap(callbackFunction);
sensors/muscleOxygen/muscleOxygenSensor.ts:139
setUTCTime(
cbk?):Promise<void>
Sets the UTC time on the sensor.
Optional callback function to handle the send response.
Promise<void>
sensor.setUTCTime(callbackFunction);
sensors/muscleOxygen/muscleOxygenSensor.ts:97
startSession(
cbk?):Promise<void>
Starts a new session on the sensor.
Optional callback function to handle the send response.
Promise<void>
sensor.startSession(callbackFunction);
sensors/muscleOxygen/muscleOxygenSensor.ts:111
stopSession(
cbk?):Promise<void>
Stops the current session on the sensor.
Optional callback function to handle the send response.
Promise<void>
sensor.stopSession(callbackFunction);