I'm trying to print from a device from a PWA - the device is https://www.sunmi.com/en/v2-pro/ - I can connect to the device, but when I try to get the service, the promise gets stuck i.e. neither the "catch" nor the "finally" callbacks are called.
navigator.bluetooth.requestDevice({
acceptAllDevices: true,
optionalServices: ['00001101-0000-1000-8000-00805f9b34fb'],
})
.then((device) => {
console.log('> Found ' + device.name);
console.log('Connecting to GATT Server...');
return device.gatt.connect();
})
.then((server) => {
console.log('> Connected ' + server.connected);
console.log('getPrimaryService...');
return server.getPrimaryService('00001101-0000-1000-8000-00805f9b34fb');
})
.then((service) => {
console.log('getCharacteristic...');
return service.getCharacteristic('00001101-0000-1000-8000-00805f9b34fb');
})
.then((characteristic) => {
console.log('> Characteristic UUID: ' + characteristic.uuid);
})
.catch((error) => {
console.log('Argh! ' + error);
})
.finally(() => {
console.log('> Finally');
});
console.log('whatsup?');
https://share.getcloudapp.com/5zuLxBE4 - the logs until "getPrimaryService...". The device does not show any dialog or requests any interaction. So not sure why this would get stuck.
I've used the nRF connect app to get the uuid - https://share.getcloudapp.com/GGulYQYz
Not sure if I'm doing something wrong here, any help would be appreciated.