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
I am using Angular version 7 on windows 10 and @types/web-bluetooth package.
My App was working as expected. The data was being written to the device using writeValueWithoutResponse/writeValueWithResponse methods of web bluetooth API. Now it is not working and throwing an error. I have attached chrome logs as well as console logs. Please help.
PFB my code:
navigator.bluetooth
.requestDevice({
filters: [{ name: this.deviceName }],
optionalServices: [this.GATT_SERVICE], // required if filtering is by name
})
.then((device) => {
// Step 2: Connect to it
console.log("device:", device);
return device.gatt.connect();
})
.then((server) => {
// Step 3: Get the Service
console.log("server: ", server);
return server.getPrimaryService(this.GATT_SERVICE);
})
.then((service) => {
// Step 4: get the Characteristic
console.log("service: ", service);
return service.getCharacteristic(this.GATT_CHARACTERISTIC);
// return service.getCharacteristics();
})
.then((characteristic) => {
characteristic.writeValueWithResponse(this.data);
}).catch((err) => console.log(err)) chrome logs.txt
The text was updated successfully, but these errors were encountered:
I ran into something like this around the Windows 10 2004 update. It turned out that Windows changed how devices were queried and started using "find by type value request" instead of "read by type request" (or something like that). The BLE device didn't handle this new request properly which "Unknown" errors after a timeout.
I am using Angular version 7 on windows 10 and @types/web-bluetooth package.
My App was working as expected. The data was being written to the device using writeValueWithoutResponse/writeValueWithResponse methods of web bluetooth API. Now it is not working and throwing an error. I have attached chrome logs as well as console logs. Please help.
PFB my code:

navigator.bluetooth
.requestDevice({
filters: [{ name: this.deviceName }],
optionalServices: [this.GATT_SERVICE], // required if filtering is by name
})
.then((device) => {
// Step 2: Connect to it
console.log("device:", device);
return device.gatt.connect();
})
.then((server) => {
// Step 3: Get the Service
console.log("server: ", server);
return server.getPrimaryService(this.GATT_SERVICE);
})
.then((service) => {
// Step 4: get the Characteristic
console.log("service: ", service);
return service.getCharacteristic(this.GATT_CHARACTERISTIC);
// return service.getCharacteristics();
})
.then((characteristic) => {
characteristic.writeValueWithResponse(this.data);
}).catch((err) => console.log(err))
chrome logs.txt
The text was updated successfully, but these errors were encountered: