You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I'm trying to receive advertisement packets from a BLE device running the code provided below, but i get this error:
internal/buffer.js:75
throw new ERR_BUFFER_OUT_OF_BOUNDS();
^
RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
at boundsError (internal/buffer.js:75:11)
at Buffer.readUInt8 (internal/buffer.js:243:5)
at Hci.processCmdCompleteEvent (C:\Users\Dlorente\PFG\node_modules@abandonware\noble\lib\hci-socket\hci.js:564:27)
at Hci.onSocketData (C:\Users\Dlorente\PFG\node_modules@abandonware\noble\lib\hci-socket\hci.js:459:12)
at BluetoothHciSocket.emit (events.js:310:20)
at BluetoothHciSocket.onHciEventEndpointData (C:\Users\Dlorente\PFG\node_modules@abandonware\bluetooth-hci-socket\lib\usb.js:191:10)
at InEndpoint.emit (events.js:310:20)
at Transfer.transferDone (C:\Users\Dlorente\PFG\node_modules\usb\usb.js:441:9) {
code: 'ERR_BUFFER_OUT_OF_BOUNDS'
}
Hello
I discover that I have the exact same output error if I try to run advertisement-discovery.js which is the test script that ensures if everything is properly configured or not. Maybe that can helpful in order to find the issue.
Thank you
Hi again
As I was typing my last message I found the way to solve it. Basically it was a matter of chainging the driver with the Zadig tool. Now aparently all works fine.
Thank you
Hello I'm trying to receive advertisement packets from a BLE device running the code provided below, but i get this error:
internal/buffer.js:75
throw new ERR_BUFFER_OUT_OF_BOUNDS();
^
RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
at boundsError (internal/buffer.js:75:11)
at Buffer.readUInt8 (internal/buffer.js:243:5)
at Hci.processCmdCompleteEvent (C:\Users\Dlorente\PFG\node_modules@abandonware\noble\lib\hci-socket\hci.js:564:27)
at Hci.onSocketData (C:\Users\Dlorente\PFG\node_modules@abandonware\noble\lib\hci-socket\hci.js:459:12)
at BluetoothHciSocket.emit (events.js:310:20)
at BluetoothHciSocket.onHciEventEndpointData (C:\Users\Dlorente\PFG\node_modules@abandonware\bluetooth-hci-socket\lib\usb.js:191:10)
at InEndpoint.emit (events.js:310:20)
at Transfer.transferDone (C:\Users\Dlorente\PFG\node_modules\usb\usb.js:441:9) {
code: 'ERR_BUFFER_OUT_OF_BOUNDS'
}
Code I'm using:
const noble = require('@abandonware/noble');
const util = require('util');
const sleepy = util.promisify(setTimeout);
var macs = ['']; //here is where I specify the MacAddress of my BLE device
noble.on('stateChange', async function state(state, errStates){
try{
if(state == 'poweredOn'){
const devices = await noble.startScanningAsync([], true)
.then(function (){
console.log("Scan started...");
})
}
}catch(errStates){
console.log(errStates);
}
});
noble.on('discover', function(devices){
for (var i=0;i<=macs.length;i++){
if(
${devices.address}
== macs[i]){const adman = devices.advertisement;
console.log(
\t${JSON.stringify(adman)}
);}
}
});
I'm using:
Windows 10
node v12.16.3
npm 6.14.4
Thank you in advance
The text was updated successfully, but these errors were encountered: