Open mahmoudelgawad opened 5 years ago
You can't get MAC address from the Web Bluetooth API yet. What I've seen on devices though is a BLE characteristic that contains the MAC address as a value.
您尚无法从Web Bluetooth API获取MAC地址。 我在设备上看到的是BLE特性,其中包含MAC地址作为值。
Hello, now 2020, can I get the MAC address ?
What about now?
now?
Ping
It is still not yet possible unless you're in control of the Bluetooth device, in which case, you can have a custom Bluetooth characteristic whose value is the MAC address.
Is this still an issue? I see that we get fed unique IDs for devices (https://developer.mozilla.org/en-US/docs/Web/API/BluetoothDevice) but still no MAC address.
This is probably the wrong place to be requesting it though. I imagine the request has to go into the Chromium issue tracker over here? https://bugs.chromium.org/p/chromium/issues/wizard
I imagine it may even be refused on security grounds. The fact we get unique IDs given to us which are not MAC addresses when the latter would be such an obvious thing to include implies it could be a deliberate decision. Further discussion over here seems to back this up: https://github.com/WebBluetoothCG/web-bluetooth/issues/583
Hello, now 2023, can I get the MAC address ?
@gischy Nope. It's a security decision, it seems. Annoyingly the "unique ID" you get for a device instead also changes every session, which means if you're trying to implement an app that can recognise devices the user has previously connected, they are specifically blocking you from doing that unless you can query the device directly for its identity. Again, a security feature I suspect, to stop websites fingerprinting users based on nearby BLE devices.
You CAN get the mac address if you're using Electron since instead of a popup window it will report the MAC with the device name in an event when scanning, and you can feed this back into your application once the user has selected one of the devices. I just bung it in the BluetoothRemoteGATTServer object and now I have a proper ID for the device I've connected to.
hello, now 2024, curently still not supported for get MAC Address from paired Bluetooth devices using google chrome API.
@DexterVu have you found any solution
Hi, I am trying using Google chrome API examble here-> "Web Bluetooth / Device Info Sample". but unfortunately the "BluetoothDevice" object contain only {id, name, gatt}. I need to get the MAC Address value as the following: