winnus
Version:
Windows 8.1 and above BLE NUS support
47 lines (35 loc) • 1.51 kB
Markdown
Windows NUS BLE (winnus) gives access to the Nordic Semiconductor Bluetooth Low Energy UART Service for Node.js on Windows, using Windows BLE APIs (Windows 8.1 and above).
Created for [Espruino and Puck.js](http://www.espruino.com).
## Usage
```JavaScript
var winnus = require("winnus");
var device = winnus.getDevices()[0];
winnus.connect(device, function(data) {
console.log("Got data "+JSON.stringify(data));
});
winnus.write("Hello\r");
setTimeout(function() {
winnus.disconnect();
}, 1000);
```
Please start with:
- [Puck.js](http://www.espruino.com/Puck.js), a Nordic Semiconductor Bluetooth Low Energy device.
- [Visual C++ 2015 Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)
- [Python 2.7](https://www.python.org/downloads/):
- [git](https://git-scm.com/)
- [node](https://nodejs.org/en/)
Clone this repository, then use the simple node example as a start.
Sucess is indicated by finding an advertisement and getting data, for example:
```bash
winnus\examples\hellowinnusnode>node hellowinnus.js
[ { name: 'Puck.js 431b',
address: 'df:f5:a5:ec:43:1b',
path: '\\\\?\\bthledevice#{6e400001-b5a3-f393-e0a9-e50e24dcca9e}_dff5a5ec431b#8&17558516&0&000b#{6e400001-b5a3-f393-e0a9-e50e24dcca9e}' } ]
{ name: 'Puck.js 431b',
address: 'df:f5:a5:ec:43:1b',
path: '\\\\?\\bthledevice#{6e400001-b5a3-f393-e0a9-e50e24dcca9e}_dff5a5ec431b#8&17558516&0&000b#{6e400001-b5a3-f393-e0a9-e50e24dcca9e}' }
Connect
Got data "Hello\r\nUncaught Refe"
```