-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
I am trying to connect to my Arduino via BLE using this library. But for some reason the services array are always empty:
Here's my code
noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
//
// Once the BLE radio has been powered on, it is possible
// to begin scanning for services. Pass an empty array to
// scan for all services (uses more time and power).
//
console.log('scanning...');
noble.startScanning(['0000222000001000800000805f9b34fb'], false);
}
else {
noble.stopScanning();
}
})
noble.on('discover', function(peripheral) {
console.log(peripheral);
// we found a peripheral, stop scanning
noble.stopScanning();
console.log("scanning stopped")
peripheral.connect(err => {
peripheral.discoverServices(['0000222000001000800000805f9b34fb'], function(err, services) {
console.log({error: err, service: services});
});
})
});Metadata
Metadata
Assignees
Labels
No labels