From 1bd4906a584be308689c8935957d2a91fe7bf80a Mon Sep 17 00:00:00 2001 From: Robert Chiras Date: Thu, 28 Apr 2016 17:32:38 +0300 Subject: [PATCH] Add support for Android OS Add android to supported OSes, so that bluetooth-hci-socket can be compiled for and used on Android too. Signed-off-by: Robert Chiras --- binding.gyp | 2 +- index.js | 2 +- package.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/binding.gyp b/binding.gyp index 3652876..eaaa819 100644 --- a/binding.gyp +++ b/binding.gyp @@ -3,7 +3,7 @@ { 'target_name': 'binding', 'conditions': [ - ['OS=="linux"', { + ['OS=="linux" or OS=="android"', { 'sources': [ 'src/BluetoothHciSocket.cpp' ] diff --git a/index.js b/index.js index 258bd12..d9262be 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ var platform = os.platform(); if (process.env.BLUETOOTH_HCI_SOCKET_FORCE_USB || platform === 'win32') { module.exports = require('./lib/usb.js'); -} else if (platform === 'linux') { +} else if (platform === 'linux' || platform === 'android') { module.exports = require('./lib/native'); } else { throw new Error('Unsupported platform'); diff --git a/package.json b/package.json index 3411cb5..14d0961 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "homepage": "https://github.com/sandeepmistry/node-bluetooth-hci-socket", "os": [ "linux", + "android", "win32" ], "dependencies": {