[web-bluetooth] NotSupportedError: GATT Error unknown when writing to device using web bluetooth API (#532)

pix1289 has just created a new issue for https://github.com/WebBluetoothCG/web-bluetooth:

== NotSupportedError: GATT Error unknown when writing to device using web bluetooth API ==
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))
![console logs](https://user-images.githubusercontent.com/10397713/99501501-dbdb7c00-29a1-11eb-940d-877b7a680f97.PNG)
[chrome logs.txt](https://github.com/WebBluetoothCG/web-bluetooth/files/5558558/chrome.logs.txt)



Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/532 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 18 November 2020 07:58:12 UTC