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

Merge back downstream fixes from abandonware #122

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
37 changes: 37 additions & 0 deletions .github/workflows/nodepackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Node.js package

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [
6,
8,
10,
12,
]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
run: |
sudo apt -qq update
sudo apt install -y libudev-dev
- name: Build
run: |
export PATH=./node_modules/.bin:${PATH}
npm install --build-from-source --node-gyp=$(which pangyp)
./node_modules/.bin/node-pre-gyp package
- name: Test
run: npm test
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ This library needs raw USB access to a Bluetooth 4.0 USB adapter, as it needs to
A [WinUSB](https://msdn.microsoft.com/en-ca/library/windows/hardware/ff540196(v=vs.85).aspx) driver is required, use [Zadig tool](http://zadig.akeo.ie) to replace the driver for your adapter.

__WARNING:__ This will make the adapter unavailable in Windows Bluetooth settings! To roll back to the original driver go to: ```Device Manager -> Open Device -> Update Driver```
Note:
- that one should select "Delete the driver software for this device" as per Zadig instructions if the generation of the system restoral point by Zadig fails if one wishes to use restore system restoral point as an option.

#### Compatible Bluetooth 4.0 USB Adapter's

Expand All @@ -31,6 +33,7 @@ __WARNING:__ This will make the adapter unavailable in Windows Bluetooth setting
| BCM920702 Bluetooth 4.0 | 0x0a5c | 0x21e8 |
| BCM20702A0 Bluetooth 4.0 | 0x19ff | 0x0239 |
| BCM20702A0 Bluetooth 4.0 | 0x0489 | 0xe07a |
| BCM20702A0 Bluetooth 4.0 | 0x413c | 0x8143 |
| CSR8510 A10 | 0x0a12 | 0x0001 |
| Asus BT-400 | 0x0b05 | 0x17cb |
| Intel Wireless Bluetooth 6235 | 0x8087 | 0x07da |
Expand Down
8 changes: 3 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ environment:
GYP_MSVS_VERSION: 2013

matrix:
- node_version: '4'
- node_version: '5'
- node_version: '6'
- node_version: '8'
- node_version: '10'
- node_version: '12'

install:
- ps: Install-Product node $env:node_version $env:platform
- ps: npm install -g node-gyp node-pre-gyp-github
# This fixes an issue with Node 4.x on x86. If it builds without this line
# needing to be set, we can remove it.
- ps: npm config -g set node-gyp "$(npm config -g get prefix)\node_modules\node-gyp\bin\node-gyp.js"

- ps: if ($env:appveyor_repo_tag -match "true" -and $env:appveyor_repo_tag_name -match '^v?[0-9]') { $publish_binary=1; }

build_script:
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ if (process.env.BLUETOOTH_HCI_SOCKET_FORCE_USB || platform === 'win32' || platfo
} else if (platform === 'linux' || platform === 'android') {
module.exports = require('./lib/native');
} else {
throw new Error('Unsupported platform');
module.exports = require('./lib/unsupported');
}
2 changes: 1 addition & 1 deletion lib/native.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var events = require('events');

var binary = require('node-pre-gyp');
var path = require('path');
var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));
var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json')));
var binding = require(binding_path);

var BluetoothHciSocket = binding.BluetoothHciSocket;
Expand Down
5 changes: 5 additions & 0 deletions lib/unsupported.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function UnsupportedPlatformBluetoothHciSocket() {
throw new Error('Unsupported platform');
}

module.exports = UnsupportedPlatformBluetoothHciSocket;
3 changes: 2 additions & 1 deletion lib/usb.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var VENDOR_DEVICE_LIST = [
{vid: 0x0CF3, pid: 0xE300 }, // Qualcomm Atheros QCA61x4
{vid: 0x0a5c, pid: 0x21e8 }, // Broadcom BCM20702A0
{vid: 0x19ff, pid: 0x0239 }, // Broadcom BCM20702A0
{vid: 0x413c, pid: 0x8143 }, // Broadcom BCM20702A0
{vid: 0x0a12, pid: 0x0001 }, // CSR
{vid: 0x0b05, pid: 0x17cb }, // ASUS BT400
{vid: 0x8087, pid: 0x07da }, // Intel 6235
Expand Down Expand Up @@ -114,7 +115,7 @@ BluetoothHciSocket.prototype.getDeviceList = function() {
"busNumber": dev.busNumber,
"deviceAddress": dev.deviceAddress,
}));
}
};

BluetoothHciSocket.prototype.bindControl = function() {
this._mode = 'control';
Expand Down
26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,28 @@
"win32"
],
"dependencies": {
"debug": "^2.2.0",
"nan": "^2.0.5",
"node-pre-gyp": "0.6.x"
"debug": "^4.1.0",
"nan": "^2.14.0",
"node-pre-gyp": "^0.13.0"
},
"optionalDependencies": {
"usb": "^1.1.0"
"usb": "^1.6.0"
},
"devDependencies": {
"jshint": "^2.8.0"
},
"scripts": {
"preinstall": "npm install node-pre-gyp",
"install": "node-pre-gyp install --fallback-to-build",
"test": "jshint lib/*.js"
"install": "node-pre-gyp install --fallback-to-build",
"test": "jshint lib/*.js && node test.js"
},
"binary": {
"module_name": "binding",
"module_path": "./lib/binding/",
"host": "https://github.com/sandeepmistry/node-bluetooth-hci-socket/releases/download/",
"package_name": "{module_name}-{version}-{node_abi}-{platform}-{arch}.tar.gz",
"remote_path": "{version}"
"module_name": "binding",
"module_path": "./lib/binding/",
"host": "https://github.com/sandeepmistry/node-bluetooth-hci-socket/releases/download/",
"package_name": "{module_name}-{version}-{node_abi}-{platform}-{arch}.tar.gz",
"remote_path": "{version}"
},
"jshintConfig": {
"esversion": 6
}
}
Loading