Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
updated node usb native from vscode-arduino repo (#194)
Browse files Browse the repository at this point in the history
Fixes CPX serial monitor so it works again
  • Loading branch information
andreamah authored Feb 10, 2020
1 parent 086250c commit 8d0438c
Show file tree
Hide file tree
Showing 33 changed files with 5,071 additions and 5,071 deletions.
50 changes: 25 additions & 25 deletions vendor/node-usb-native/.eslintrc
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
}
}
28 changes: 14 additions & 14 deletions vendor/node-usb-native/.gitignore
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/
4 changes: 2 additions & 2 deletions vendor/node-usb-native/.npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
build/
node_modules/
build/
8 changes: 4 additions & 4 deletions vendor/node-usb-native/README.md
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;
126 changes: 63 additions & 63 deletions vendor/node-usb-native/binding.gyp
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"
]
}
]
]
}
]
}
88 changes: 44 additions & 44 deletions vendor/node-usb-native/lib/bindings.js
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
};
Loading

0 comments on commit 8d0438c

Please sign in to comment.