Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get MAC Address from paired Bluetooth devices using google chrome API #622

Open
mahmoudelgawad opened this issue Dec 16, 2018 · 11 comments

Comments

@mahmoudelgawad
Copy link

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:
image

@beaufortfrancois
Copy link
Member

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.

@YunMengs
Copy link

YunMengs commented Aug 20, 2020

您尚无法从Web Bluetooth API获取MAC地址。
我在设备上看到的是BLE特性,其中包含MAC地址作为值。

Hello, now 2020, can I get the MAC address ?

@rchavezj
Copy link

What about now?

@barron9
Copy link

barron9 commented Dec 26, 2020

now?

@Anticom
Copy link

Anticom commented Jun 12, 2022

Ping

@beaufortfrancois
Copy link
Member

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.

@NbrTDB
Copy link

NbrTDB commented Apr 13, 2023

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: WebBluetoothCG/web-bluetooth#583

@gischy
Copy link

gischy commented Jun 21, 2023

Hello, now 2023, can I get the MAC address ?

@NbrTDB
Copy link

NbrTDB commented Jun 21, 2023

@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.

@DexterVu
Copy link

hello, now 2024, curently still not supported for get MAC Address from paired Bluetooth devices using google chrome API.

@hemtheguy
Copy link

@DexterVu have you found any solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants