sandeepmistry / node-bleacon

A Node.js library for creating, discovering, and configuring iBeacons
MIT License
498 stars 88 forks source link

Feature request: Windows support #27

Closed blowsie closed 9 years ago

blowsie commented 9 years ago

Here is my output when tring to install on windows.

C:\Users\sblowes\Desktop\beacon>npm install bleacon
/
> bignum@0.9.3 install C:\Users\sblowes\Desktop\beacon\node_modules\bleacon\node
_modules\bignum
> node-gyp configure build

C:\Users\sblowes\Desktop\beacon\node_modules\bleacon\node_modules\bignum>if not
defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\np
m\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure build
 )  else (configure build )
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
  bignum.cc
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\Users\sblowes\Desktop\beacon\node_modules\bleacon\node_module
s\bignum\build\bignum.vcxproj]
..\bignum.cc(9): fatal error C1083: Cannot open include file: 'openssl/bn.h': N
o such file or directory [C:\Users\sblowes\Desktop\beacon\node_modules\bleacon\
node_modules\bignum\build\bignum.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail
ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_mo
dules\npm\node_modules\node-gyp\lib\build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074
:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\nod
e_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Users\sblowes\Desktop\beacon\node_modules\bleacon\node_modules\b
ignum
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (
x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bleacon"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code EBADPLATFORM

npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: bleno
@0.1.13
npm ERR! notsup Valid OS:    darwin,linux
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: ia32

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\sblowes\Desktop\beacon\npm-debug.log
sandeepmistry commented 9 years ago

@blowsie this feature request is non-trivial:

1) noble does not support Windows yet, see: https://github.com/sandeepmistry/noble/issues/84 2) As far as I can tell, there are no API's on Windows 8.1 for scanning for BLE devices programmatically. All scanning + pairing is done via a GUI.

blowsie commented 9 years ago

@sandeepmistry no problem, I'll let you decide what you want to do with the request. FYI: there is a .NET lib that has similar functionality.

https://github.com/huysentruitw/win-beacon

sandeepmistry commented 9 years ago

@blowsie thanks for sharing the link!

The new BluetoothLEAdvertisementWatcher class in Windows 10 looks promising: https://msdn.microsoft.com/en-us/library/windows.devices.bluetooth.advertisement.bluetoothleadvertisementwatcher.aspx?f=255&MSPPError=-2147217396

sandeepmistry commented 9 years ago

@blowsie I've published version 0.4.0 with Windows support.

noble and bleno now use a similar technique to win-beacon for Windows support, the WinUSB driver is needed.

See here for what you need: https://github.com/sandeepmistry/node-bleacon#prerequisites

blowsie commented 9 years ago

@sandeepmistry awesome! Thank you!