Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_present( ) causes the stick to close #4

Open
sam2b opened this issue Apr 20, 2018 · 0 comments
Open

is_present( ) causes the stick to close #4

sam2b opened this issue Apr 20, 2018 · 0 comments

Comments

@sam2b
Copy link

sam2b commented Apr 20, 2018

See my bug filed here: https://github.com/Loghorn/ant-plus/issues

When I call is_present(), the stick seems to close... or otherwise put the object in a bad state such that write() fails and throws and exception.

if (!this.stick.is_present()) { .. }
I've verified open() returns true before calling is_present(), and then after calling is_present() I verified open() returns false. See ./src/ant.ts file.

Fix: In powermeter.js, please comment out the offending lines. Once removed, the program runs nicely.
PowerMeter.prototype.broadcast = function(power, cadence) {

PowerMeter.prototype.broadcast = function(power, cadence) {
// BUG do not call is_present() else the stick closes!
/*if (!this.stick.is_present()) {
console.log("Stick not present.");
return;
}*/
...
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant