Re: [web-bluetooth] Get device Id in Notifications and Filter devices by Id (#553)

Inside a `'characteristicvaluechanged'` event listener you can access the device ID through the `BluetoothRemoteGATTCharacteristic` object like this,

```js
characteristic.addEventListener('characteristicvaluechanged', (e) => {
  console.log(`Device ID: ${e.target.service.device.id}`);
});
```

It doesn't make sense to filter devices based on their ID because the ID is only assigned to a device once the page has access to it. #417 tracks allowing filtering based on MAC address.

-- 
GitHub Notification of comment by reillyeon
Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/553#issuecomment-877374890 using your GitHub account


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

Received on Friday, 9 July 2021 18:25:40 UTC