Loghorn / ant-plus

A node module for ANT+
MIT License
141 stars 70 forks source link

Event is not emitted for SpeedSensor #27

Open fusionstream opened 4 years ago

fusionstream commented 4 years ago

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

Loghorn commented 4 years ago

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

fusionstream commented 4 years ago

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 commented 4 years ago

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.

Alabate commented 4 years ago

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