This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated node usb native from vscode-arduino repo (#194)
Fixes CPX serial monitor so it works again
- Loading branch information
Showing
33 changed files
with
5,071 additions
and
5,071 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
{ | ||
"extends": [ | ||
"standard" | ||
], | ||
"plugins": [ | ||
"require-path-exists" | ||
], | ||
"env": { | ||
"node": true, | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"arrow-parens": [2, "as-needed", {"requireForBlockBody": true }], | ||
"no-unused-vars": [2, { "vars": "all", "args": "after-used" }], | ||
"object-curly-spacing": [2, "always"], | ||
"prefer-arrow-callback": 2, | ||
"prefer-const": 2, | ||
"prefer-template": 2, | ||
"require-path-exists/exists": 2, | ||
"require-path-exists/notEmpty": 2, | ||
"require-path-exists/tooManyArguments": 2, | ||
"semi": [2, "always", {"omitLastInOneLineBlock": true}], | ||
"space-before-function-paren": [2, "never"], | ||
"standard/object-curly-even-spacing": 0 | ||
} | ||
{ | ||
"extends": [ | ||
"standard" | ||
], | ||
"plugins": [ | ||
"require-path-exists" | ||
], | ||
"env": { | ||
"node": true, | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"arrow-parens": [2, "as-needed", {"requireForBlockBody": true }], | ||
"no-unused-vars": [2, { "vars": "all", "args": "after-used" }], | ||
"object-curly-spacing": [2, "always"], | ||
"prefer-arrow-callback": 2, | ||
"prefer-const": 2, | ||
"prefer-template": 2, | ||
"require-path-exists/exists": 2, | ||
"require-path-exists/notEmpty": 2, | ||
"require-path-exists/tooManyArguments": 2, | ||
"semi": [2, "always", {"omitLastInOneLineBlock": true}], | ||
"space-before-function-paren": [2, "never"], | ||
"standard/object-curly-even-spacing": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
$ cat .gitignore | ||
|
||
# Can ignore specific files | ||
.settings.xml | ||
.monitor | ||
.DS_Store | ||
|
||
# Use wildcards as well | ||
*~ | ||
#*.swp | ||
|
||
# Can also ignore all directories and files in a directory. | ||
node_modules/ | ||
build/ | ||
$ cat .gitignore | ||
|
||
# Can ignore specific files | ||
.settings.xml | ||
.monitor | ||
.DS_Store | ||
|
||
# Use wildcards as well | ||
*~ | ||
#*.swp | ||
|
||
# Can also ignore all directories and files in a directory. | ||
node_modules/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
node_modules/ | ||
build/ | ||
node_modules/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
This is a natvie package contains two modules: detector and serialport, detector provides the functionality of detecting usb changes and serialport provides the functionality of listing serial ports, openning serial ports and sending/receiving message to/from serial ports. | ||
|
||
require("../../../vendor/node-usb-native").SerialPort; | ||
require("../../../vendor/node-usb-native").detector; | ||
This is a natvie package contains two modules: detector and serialport, detector provides the functionality of detecting usb changes and serialport provides the functionality of listing serial ports, openning serial ports and sending/receiving message to/from serial ports. | ||
|
||
require("../../../vendor/node-usb-native").SerialPort; | ||
require("../../../vendor/node-usb-native").detector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
{ | ||
"targets": [ | ||
{ | ||
"target_name": "usb-native", | ||
"sources": [ | ||
"src/detection.cpp", | ||
"src/detection.h", | ||
"src/deviceList.cpp", | ||
"src/combined.cpp", | ||
"src/serialport.cpp" | ||
], | ||
"include_dirs": [ | ||
"<!(node -e \"require('nan')\")" | ||
], | ||
"conditions": [ | ||
[ | ||
"OS=='win'", | ||
{ | ||
"sources": [ | ||
"src/detection_win.cpp", | ||
"src/serialport_win.cpp" | ||
], | ||
"msvs_settings": { | ||
"VCCLCompilerTool": { | ||
"ExceptionHandling": "2", | ||
"DisableSpecificWarnings": [ | ||
"4530", | ||
"4506" | ||
] | ||
} | ||
}, | ||
"include_dirs+": [] | ||
} | ||
], | ||
[ | ||
"OS=='mac'", | ||
{ | ||
"sources": [ | ||
"src/detection_mac.cpp", | ||
"src/serialport_unix.cpp", | ||
"src/serialport_poller.cpp" | ||
], | ||
"libraries": [ | ||
"-framework CoreFoundation -framework IOKit" | ||
] | ||
} | ||
], | ||
[ | ||
"OS=='linux'", | ||
{ | ||
"sources": [ | ||
"src/detection_linux.cpp", | ||
"src/serialport_unix.cpp", | ||
"src/serialport_poller.cpp" | ||
], | ||
"defines": [ | ||
"DISABLE_USB_DETECTOR" | ||
] | ||
} | ||
] | ||
] | ||
} | ||
] | ||
{ | ||
"targets": [ | ||
{ | ||
"target_name": "usb-native", | ||
"sources": [ | ||
"src/detection.cpp", | ||
"src/detection.h", | ||
"src/deviceList.cpp", | ||
"src/combined.cpp", | ||
"src/serialport.cpp" | ||
], | ||
"include_dirs": [ | ||
"<!(node -e \"require('nan')\")" | ||
], | ||
"conditions": [ | ||
[ | ||
"OS=='win'", | ||
{ | ||
"sources": [ | ||
"src/detection_win.cpp", | ||
"src/serialport_win.cpp" | ||
], | ||
"msvs_settings": { | ||
"VCCLCompilerTool": { | ||
"ExceptionHandling": "2", | ||
"DisableSpecificWarnings": [ | ||
"4530", | ||
"4506" | ||
] | ||
} | ||
}, | ||
"include_dirs+": [] | ||
} | ||
], | ||
[ | ||
"OS=='mac'", | ||
{ | ||
"sources": [ | ||
"src/detection_mac.cpp", | ||
"src/serialport_unix.cpp", | ||
"src/serialport_poller.cpp" | ||
], | ||
"libraries": [ | ||
"-framework CoreFoundation -framework IOKit" | ||
] | ||
} | ||
], | ||
[ | ||
"OS=='linux'", | ||
{ | ||
"sources": [ | ||
"src/detection_linux.cpp", | ||
"src/serialport_unix.cpp", | ||
"src/serialport_poller.cpp" | ||
], | ||
"defines": [ | ||
"DISABLE_USB_DETECTOR" | ||
] | ||
} | ||
] | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
'use strict'; | ||
const path = require('path'); | ||
const bindings = require('./native_loader').load(path.join(__dirname, 'native'), 'usb-native'); | ||
var listUnix = require('./list-unix'); | ||
|
||
var linux = process.platform !== 'win32' && process.platform !== 'darwin'; | ||
|
||
function listLinux(callback) { | ||
callback = callback || function(err) { | ||
if (err) { | ||
this.emit('error', err); | ||
} | ||
}.bind(this); | ||
return listUnix(callback); | ||
} | ||
|
||
var platformOptions = {}; | ||
if (process.platform !== 'win32') { | ||
platformOptions = { | ||
vmin: 1, | ||
vtime: 0 | ||
}; | ||
} | ||
|
||
module.exports = { | ||
// serialport bindings | ||
close: bindings.close, | ||
drain: bindings.drain, | ||
flush: bindings.flush, | ||
list: linux ? listLinux : bindings.list, | ||
open: bindings.open, | ||
SerialportPoller: bindings.SerialportPoller, | ||
set: bindings.set, | ||
update: bindings.update, | ||
write: bindings.write, | ||
platformOptions: platformOptions, | ||
|
||
// usb-detection bindings | ||
registerAdded: bindings.registerAdded, | ||
registerRemoved: bindings.registerRemoved, | ||
startMonitoring: bindings.startMonitoring, | ||
stopMonitoring: bindings.stopMonitoring, | ||
find: bindings.find | ||
}; | ||
'use strict'; | ||
const path = require('path'); | ||
const bindings = require('./native_loader').load(path.join(__dirname, 'native'), 'usb-native'); | ||
var listUnix = require('./list-unix'); | ||
|
||
var linux = process.platform !== 'win32' && process.platform !== 'darwin'; | ||
|
||
function listLinux(callback) { | ||
callback = callback || function(err) { | ||
if (err) { | ||
this.emit('error', err); | ||
} | ||
}.bind(this); | ||
return listUnix(callback); | ||
} | ||
|
||
var platformOptions = {}; | ||
if (process.platform !== 'win32') { | ||
platformOptions = { | ||
vmin: 1, | ||
vtime: 0 | ||
}; | ||
} | ||
|
||
module.exports = { | ||
// serialport bindings | ||
close: bindings.close, | ||
drain: bindings.drain, | ||
flush: bindings.flush, | ||
list: linux ? listLinux : bindings.list, | ||
open: bindings.open, | ||
SerialportPoller: bindings.SerialportPoller, | ||
set: bindings.set, | ||
update: bindings.update, | ||
write: bindings.write, | ||
platformOptions: platformOptions, | ||
|
||
// usb-detection bindings | ||
registerAdded: bindings.registerAdded, | ||
registerRemoved: bindings.registerRemoved, | ||
startMonitoring: bindings.startMonitoring, | ||
stopMonitoring: bindings.stopMonitoring, | ||
find: bindings.find | ||
}; |
Oops, something went wrong.