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

Board disconnect event #77

Open
robtarr opened this issue Nov 29, 2016 · 3 comments
Open

Board disconnect event #77

robtarr opened this issue Nov 29, 2016 · 3 comments

Comments

@robtarr
Copy link

robtarr commented Nov 29, 2016

It would be great if there was some way to tell if the board has stopped responding. Be it due to failure, power, disconnect, etc. I don't need to know why, just that it's no longer connected. Similar to rwaldron/johnny-five#1037.

@rwaldron
Copy link
Owner

rwaldron commented Dec 1, 2016

I'm travelling right now—can you take a run at this? After this: https://github.com/rwaldron/particle-io/blob/master/lib/particle.js#L310-L317, I think you'd add:

state.socket.on("close", function() {
  particle.emit("disconnect");
});

...But that's a completely untested guess.

@robtarr
Copy link
Author

robtarr commented Dec 4, 2016

I'll take a look. Thanks for the direction.

@anwarhamr
Copy link

Any status on this? I've tried the .on('close',...) and I'm not getting a message when I pull the plug. Does the REPL option matter in the ctor? I'm setting repl: false.

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

3 participants