Skip to content

Commit 68a7ccd

Browse files
committed
Merge pull request #4 from blainesch/feature/workups
Feature/workups - Bring in for cleanup
2 parents d3761a7 + bf89ca3 commit 68a7ccd

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

BigRedButton.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ function BigRedButton(index)
5555
util.inherits(BigRedButton, events.EventEmitter);
5656

5757
BigRedButton.prototype.askForStatus = function() {
58-
this.hid.write(cmdStatus);
58+
try {
59+
this.hid.write(cmdStatus);
60+
} catch(e) {
61+
this.close();
62+
}
5963
};
6064

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

99103
exports.BigRedButton = BigRedButton;
100104
exports.deviceCount = function () { return getAllDevices().length; }
105+
exports.resetDevices = function () {
106+
allDevices = null
107+
getAllDevices();
108+
}

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "BigRedButtonNodeHID",
3+
"version": "1.0.0",
4+
"description": "Big red button helper.",
5+
"main": "BigRedButton.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "[email protected]:codepope/BigRedButtonNodeHID.git"
12+
},
13+
"keywords": [
14+
"big",
15+
"red",
16+
"button",
17+
"helper",
18+
"io",
19+
"usb",
20+
"hid"
21+
],
22+
"author": "codepope",
23+
"license": "MIT",
24+
"bugs": {
25+
"url": "https://github.com/codepope/BigRedButtonNodeHID/issues"
26+
},
27+
"homepage": "https://github.com/codepope/BigRedButtonNodeHID"
28+
}

0 commit comments

Comments
 (0)