Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion BigRedButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ function BigRedButton(index)
util.inherits(BigRedButton, events.EventEmitter);

BigRedButton.prototype.askForStatus = function() {
this.hid.write(cmdStatus);
try {
this.hid.write(cmdStatus);
} catch(e) {
this.close();
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't show up in my cases before as it's a race condition to see if write or read gets called first. So this never happened but did later.

};

BigRedButton.prototype.interpretData = function(error, data) {
Expand Down Expand Up @@ -98,3 +102,7 @@ BigRedButton.prototype.isLidDown = function() {

exports.BigRedButton = BigRedButton;
exports.deviceCount = function () { return getAllDevices().length; }
exports.resetDevices = function () {
allDevices = null
getAllDevices();
}
28 changes: 28 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "BigRedButtonNodeHID",
"version": "1.0.0",
"description": "Big red button helper.",
"main": "BigRedButton.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@github.com:codepope/BigRedButtonNodeHID.git"
},
"keywords": [
"big",
"red",
"button",
"helper",
"io",
"usb",
"hid"
],
"author": "codepope",
"license": "MIT",
"bugs": {
"url": "https://github.com/codepope/BigRedButtonNodeHID/issues"
},
"homepage": "https://github.com/codepope/BigRedButtonNodeHID"
}