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

setTimeout and serialport interaction #1754

Closed
cleoo opened this issue Dec 25, 2018 · 2 comments
Closed

setTimeout and serialport interaction #1754

cleoo opened this issue Dec 25, 2018 · 2 comments

Comments

@cleoo
Copy link

cleoo commented Dec 25, 2018

Hi,

I'm trying to use a timer to evaluate if the device i'm using is still responding, with a code like that:

[...]
serial.write(request);
dead_timer = setTimeout(() => { set device is dead }, 5000);

[...]
serial.on('data', response => {
clearTimeout(dead_timer);
[...]
})

But the code don't work anymore as expected. The timer freeze the data event during 5000ms, unless I "deref" the timer object. Can someone explain this behavior ?

Ps: I'm using Linux Arch, node 11.5.0, latest serial port.

@Holger-Will
Copy link
Contributor

See #1751

@reconbot
Copy link
Member

reconbot commented Jan 3, 2019

Same issue, I'm going to close this for #1751. We'll either pull the release or release an update.

@reconbot reconbot closed this as completed Jan 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants