ant-plus icon indicating copy to clipboard operation
ant-plus copied to clipboard

Event is not emitted for SpeedSensor

Open fusionstream opened this issue 4 years ago • 4 comments

The event speedData is not emitted when using SpeedSensor but is emitted when using SpeedScanner.

Device is "verified" as attached via the attached event when using SpeedSensor

fusionstream avatar Mar 30 '20 12:03 fusionstream

That's odd because they are both calling the same function to process the data. Can you send me some code that shows the problem? Thank you

Loghorn avatar Apr 05 '20 17:04 Loghorn

Yea I looked through it as well and figured I might have missed something else so I opened this issue. But I guess not. Weird. Some code:

var Ant = require('ant-plus');
var stick = new Ant.GarminStick3;

var speedysense = new Ant.SpeedSensor(stick);
var hrsense = new Ant.HeartRateSensor(stick);

hrsense.on('hbData', (e) => {
    console.dir(e);
});
speedysense.on('speedData', (speed) => {
   console.dir(speed); //nothing happens
});
speedysense.on('attached', (data) => {
    console.log("Attached!", data);
});
stick.on('startup', function () {
    hrsense.attach(1, 11905);
    speedysense.attach(2, 33135);
});

fusionstream avatar Apr 09 '20 05:04 fusionstream

Initially I thought it was a channel issue as I was playing around with channels but the attached event dispelled that for me although this is my first time using Ant+. Am using a Wahoo Ant+ stick which I understand is just a branded garmin.

fusionstream avatar Apr 09 '20 05:04 fusionstream

Probably related to this issue https://github.com/Loghorn/ant-plus/issues/31

Alabate avatar Jun 13 '20 21:06 Alabate