-
I've tried a lot of things.
reboot,reset...
even hard reset!
nothing helps. It drives me a little crazy.the output of your code (that's how I checked it too)
1 BluetoothDevice: { "id": "e2:54:81:aa:af:05 random", "rssi": -41, "data": new Uint8Array([2, 1, 6, 13, 9, 80, 117, 99, 107, 46, 106, 115, 32, 97, 102, 48, 53]).buffer, "name": "Puck.js af05" } 4 BluetoothRemoteGATTServer: { "device": BluetoothDevice: { "id": "e2:54:81:aa:af:05 random", "rssi": -41, "data": new Uint8Array([2, 1, 6, 13, 9, 80, 117, 99, 107, 46, 106, 115, 32, 97, 102, 48, 53]).buffer, "name": "Puck.js af05", "gatt": ... }, "connected": true } Uncaught Error: Unhandled promise rejection: ERR 0x11 (BUSY)
-
Hello!
I am studying the interaction of two puck devices.js
I need to transfer data from one device to another.
I use tutorials from the Internet.
A strange error occurs at the getPrimaryService stage.My Code:
var gatt; NRF.requestDevice({ timeout: 5000, filters: [{ namePrefix: 'Puck.js 4bcd' }] }).then(function(device) { return device.gatt.connect(); }).then(function(g) { gatt = g; console.log("4"); return gatt.getPrimaryService("6e400001-b5a3-f393-e0a9-e50e24dcca9e"); }).then(function(service) { console.log("5"); return service.getCharacteristic("6e400002-b5a3-f393-e0a9-e50e24dcca9e"); }).then(function(characteristic) { console.log("6"); return characteristic.writeValue("LED3.set()\n"); }).then(function() { gatt.disconnect(); console.log("OK!"); });
When I call this code
return gatt.getPrimaryService("6e400001-b5a3-f393-e0a9-e50e24dcca9e");
An error appears:
Uncaught Error: Unhandled promise rejection: ERR 0x11 (BUSY)
Execution stops, information does not go to the second device.
I don't understand what the problem is, I couldn't find an answer on the Internet.
2v09.87