Я пытаюсь распечатать все характеристики моего телефона RealME-1, используя веб-интерфейс Google Bluetooth.Код выглядит так:
navigator.bluetooth.requestDevice(options)
.then(device => {
log('> Name: ' + device.name);
log('> Id: ' + device.id);
log('> Connected: ' + device.gatt.connected);
log('>device '+device);
return device.gatt.connect();
})
.then(server => {
log('Getting Service...');
return server.getPrimaryService(serviceUuid);
})
.then(service => {
log('Getting Characteristic...');
return service.getCharacteristic(characteristicUuid);
})
.then(characteristic => {
log('> Characteristic UUID: ' + characteristic.uuid);
log('> Broadcast: ' + characteristic.properties.broadcast);
log('> Read: ' + characteristic.properties.read);
log('> Write w/o response: ' +
characteristic.properties.writeWithoutResponse);
log('> Write: ' + characteristic.properties.write);
log('> Notify: ' + characteristic.properties.notify);
log('> Indicate: ' + characteristic.properties.indicate);
log('> Signed Write: ' +
characteristic.properties.authenticatedSignedWrites);
log('> Queued Write: ' + characteristic.properties.reliableWrite);
log('> Writable Auxiliaries: ' +
characteristic.properties.writableAuxiliaries);
})
.catch(error => {
log('Argh! ' + error);
});
Однако при тестировании он застревает в device.gatt.connect ().Любые иды, где я пропускаю?
Спасибо