Socket
Socket
Sign inDemoInstall

noble

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

noble - npm Package Compare versions

Comparing version 1.8.0 to 1.8.1

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## Version 1.8.1
* easier install instructions for Windows ([@don](https://github.com/don))
* hci-socket binding: more descriptive error outputs ([@mbifulco](https://github.com/mbifulco))
* hci-socket binding: report non-connectable advertisements without scan response
* Corrected deprecated `read` event for characteristics no emitting for notifications
## Version 1.8.0

@@ -2,0 +9,0 @@

16

lib/characteristic.js

@@ -39,5 +39,15 @@ var debug = require('debug')('characteristic');

if (callback) {
this.once('read', function(data) {
callback(null, data);
});
var onRead = function(data, isNotificaton) {
// only call the callback if 'read' event and non-notification
// 'read' for non-notifications is only present for backwards compatbility
if (!isNotificaton) {
// remove the listener
this.removeListener('read', onRead);
// call the callback
callback(null, data);
}
}.bind(this);
this.on('read', onRead);
}

@@ -44,0 +54,0 @@

6

lib/hci-socket/bindings.js

@@ -217,4 +217,6 @@ var debug = require('debug')('bindings');

uuid = this._pendingConnectionUuid;
error = new Error(Hci.STATUS_MAPPER[status] || ('Unknown (' + status + ')'));
var statusMessage = Hci.STATUS_MAPPER[status] || 'HCI Error: Unknown';
var errorCode = ' (0x' + status.toString(16) + ')';
statusMessage = statusMessage + errorCode;
error = new Error(statusMessage);
}

@@ -221,0 +223,0 @@

@@ -234,4 +234,4 @@ var debug = require('debug')('gap');

// only report after a scan response event or more than one discovery without a scan response, so more data can be collected
if (type === 0x04 || (discoveryCount > 1 && !hasScanResponse) || process.env.NOBLE_REPORT_ALL_HCI_EVENTS) {
// only report after a scan response event or if non-connectable or more than one discovery without a scan response, so more data can be collected
if (type === 0x04 || !connectable || (discoveryCount > 1 && !hasScanResponse) || process.env.NOBLE_REPORT_ALL_HCI_EVENTS) {
this.emit('discover', status, address, addressType, connectable, advertisement, rssi);

@@ -238,0 +238,0 @@ }

@@ -277,5 +277,3 @@ var debug = require('debug')('noble');

if (!isNotification) {
characteristic.emit('read', data, isNotification); // for backwards compatbility
}
characteristic.emit('read', data, isNotification); // for backwards compatbility
} else {

@@ -282,0 +280,0 @@ this.emit('warning', 'unknown peripheral ' + peripheralUuid + ', ' + serviceUuid + ', ' + characteristicUuid + ' read!');

@@ -6,3 +6,3 @@ {

"description": "A Node.js BLE (Bluetooth Low Energy) central library.",
"version": "1.8.0",
"version": "1.8.1",
"repository": {

@@ -9,0 +9,0 @@ "type": "git",

@@ -65,10 +65,15 @@ # ![noble](assets/noble-logo.png)

* [node-gyp requirements for Windows](https://github.com/TooTallNate/node-gyp#installation)
* Python 2.7
* Visual Studio ([Express](https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx))
* [node-bluetooth-hci-socket prerequisites](https://github.com/sandeepmistry/node-bluetooth-hci-socket#windows)
[node-gyp requirements for Windows](https://github.com/TooTallNate/node-gyp#installation)
Install the required tools and configurations using Microsoft's [windows-build-tools](https://github.com/felixrieseberg/windows-build-tools) from an elevated PowerShell or cmd.exe (run as Administrator).
```cmd
npm install --global --production windows-build-tools
```
[node-bluetooth-hci-socket prerequisites](https://github.com/sandeepmistry/node-bluetooth-hci-socket#windows)
* Compatible Bluetooth 4.0 USB adapter
* [WinUSB](https://msdn.microsoft.com/en-ca/library/windows/hardware/ff540196(v=vs.85).aspx) driver setup for Bluetooth 4.0 USB adapter, using [Zadig tool](http://zadig.akeo.ie/)
See [@don](https://github.com/don)'s set up guide on [Bluetooth LE with Node.js and Noble on Windows](https://www.youtube.com/watch?v=mL9B8wuEdms).
See [@don](https://github.com/don)'s set up guide on [Bluetooth LE with Node.js and Noble on Windows](https://www.youtube.com/watch?v=mL9B8wuEdms&feature=youtu.be&t=1m46s)

@@ -75,0 +80,0 @@ ## Notes

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc