@stoprocent/bleno
Advanced tools
Comparing version
const { EventEmitter } = require('events'); | ||
const Smp = require('./smp'); | ||
const Mgmt = require('./mgmt'); | ||
@@ -11,3 +12,4 @@ class AclStream extends EventEmitter { | ||
this._smp = new Smp(this, localAddressType, localAddress, remoteAddressType, remoteAddress); | ||
const mgmt = new Mgmt(hci.BluetoothHciSocket); | ||
this._smp = new Smp(this, mgmt, localAddressType, localAddress, remoteAddressType, remoteAddress); | ||
} | ||
@@ -14,0 +16,0 @@ |
@@ -83,2 +83,4 @@ const debug = require('debug')('hci'); | ||
const BluetoothHciSocket = loadDriver(options.hciDriver || 'default'); | ||
this.BluetoothHciSocket = BluetoothHciSocket; | ||
this._socket = new BluetoothHciSocket(); | ||
@@ -85,0 +87,0 @@ |
const debug = require('debug')('mgmt'); | ||
const BluetoothHciSocket = require('@stoprocent/bluetooth-hci-socket'); | ||
const LTK_INFO_SIZE = 36; | ||
@@ -10,4 +8,4 @@ | ||
class Mgmt { | ||
constructor () { | ||
this._socket = new BluetoothHciSocket(); | ||
constructor (socketClass) { | ||
this._socket = new socketClass(); | ||
this._ltkInfos = []; | ||
@@ -14,0 +12,0 @@ |
const { EventEmitter } = require('events'); | ||
const crypto = require('./crypto'); | ||
const Mgmt = require('./mgmt'); | ||
@@ -18,7 +17,8 @@ const SMP_CID = 0x0006; | ||
class Smp extends EventEmitter { | ||
constructor (aclStream, localAddressType, localAddress, remoteAddressType, remoteAddress) { | ||
constructor (aclStream, mgmt, localAddressType, localAddress, remoteAddressType, remoteAddress) { | ||
super(); | ||
this._aclStream = aclStream; | ||
this._mgmt = new Mgmt(); | ||
this._mgmt = mgmt; | ||
@@ -25,0 +25,0 @@ this._iat = Buffer.from([(remoteAddressType === 'random') ? 0x01 : 0x00]); |
{ | ||
"name": "@stoprocent/bleno", | ||
"version": "0.11.2", | ||
"version": "0.11.3", | ||
"description": "A Node.js module for implementing BLE (Bluetooth Low Energy) peripherals", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
768708
0.01%5214
0.02%10
-16.67%