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.2.0 to 1.2.1

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## Version 1.2.1
* Use latest v0.4.1 bluetooth-hci-socket dependency (for kernel 4.1.x disconnect workaround)
* Add read + write LE host supported commands (for kernel 4.1.x disconnect workaround)
* Fix a potential exception when accessing a non existent element ([@Loghorn](https://github.com/Loghorn))
## Version 1.2.0

@@ -2,0 +8,0 @@

2

lib/hci-socket/gap.js

@@ -146,3 +146,3 @@ var debug = require('debug')('gap');

var connectable = (type === 0x04) ? this._discoveries[address].connectable : (type !== 0x03);
var connectable = (type === 0x04 && previouslyDiscovered) ? this._discoveries[address].connectable : (type !== 0x03);

@@ -149,0 +149,0 @@ this._discoveries[address] = {

@@ -31,2 +31,4 @@ var debug = require('debug')('hci');

var OCF_SET_EVENT_MASK = 0x0001;
var OCF_READ_LE_HOST_SUPPORTED = 0x006C;
var OCF_WRITE_LE_HOST_SUPPORTED = 0x006D;

@@ -50,2 +52,4 @@ var OGF_INFO_PARAM = 0x04;

var SET_EVENT_MASK_CMD = OCF_SET_EVENT_MASK | OGF_HOST_CTL << 10;
var READ_LE_HOST_SUPPORTED_CMD = OCF_READ_LE_HOST_SUPPORTED | OGF_HOST_CTL << 10;
var WRITE_LE_HOST_SUPPORTED_CMD = OCF_WRITE_LE_HOST_SUPPORTED | OGF_HOST_CTL << 10;

@@ -99,2 +103,4 @@ var READ_LOCAL_VERSION_CMD = OCF_READ_LOCAL_VERSION | (OGF_INFO_PARAM << 10);

this.readLocalVersion();
this.writeLeHostSupported();
this.readLeHostSupported();
this.readBdAddr();

@@ -189,2 +195,34 @@ } else {

Hci.prototype.readLeHostSupported = function() {
var cmd = new Buffer(4);
// header
cmd.writeUInt8(HCI_COMMAND_PKT, 0);
cmd.writeUInt16LE(READ_LE_HOST_SUPPORTED_CMD, 1);
// length
cmd.writeUInt8(0x00, 3);
debug('read LE host supported - writing: ' + cmd.toString('hex'));
this._socket.write(cmd);
};
Hci.prototype.writeLeHostSupported = function() {
var cmd = new Buffer(6);
// header
cmd.writeUInt8(HCI_COMMAND_PKT, 0);
cmd.writeUInt16LE(WRITE_LE_HOST_SUPPORTED_CMD, 1);
// length
cmd.writeUInt8(0x02, 3);
// data
cmd.writeUInt8(0x01, 4); // le
cmd.writeUInt8(0x00, 5); // simul
debug('write LE host supported - writing: ' + cmd.toString('hex'));
this._socket.write(cmd);
};
Hci.prototype.setScanParameters = function() {

@@ -438,3 +476,9 @@ var cmd = new Buffer(11);

Hci.prototype.processCmdCompleteEvent = function(cmd, status, result) {
if (cmd === READ_LOCAL_VERSION_CMD) {
if (cmd === READ_LE_HOST_SUPPORTED_CMD) {
var le = result.readUInt8(0);
var simul = result.readUInt8(1);
debug('\t\t\tle = ' + le);
debug('\t\t\tsimul = ' + simul);
} else if (cmd === READ_LOCAL_VERSION_CMD) {
var hciVer = result.readUInt8(0);

@@ -441,0 +485,0 @@ var hciRev = result.readUInt16LE(1);

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

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

@@ -35,3 +35,3 @@ "type": "git",

"optionalDependencies": {
"bluetooth-hci-socket": "~0.4.0",
"bluetooth-hci-socket": "~0.4.1",
"bplist-parser": "0.0.6",

@@ -38,0 +38,0 @@ "xpc-connection": "~0.1.4"

@@ -51,2 +51,12 @@ # noble

## Notes
### Maximum simulanteous connections
| Platform | |
| :------- | --- |
| OS X 10.11 (El Capitan) | 6 |
| Linux/Windows - Adapter dependent | |
| | 5 (CSR based adapter) |
## Install

@@ -53,0 +63,0 @@

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