Going by the Web Bluetooth Draft Community Group Report, 11 February 2019 https://webbluetoothcg.github.io/web-bluetooth/#example-filter-by-services
and
Web Bluetooth API https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API
The following code should return all connected bluetooth devices:
navigator.bluetooth.requestDevice({acceptAllDevices:true}).then(function(device) {
console.log('Name: ' + device.name);
}).catch(function(error) {
console.log("Something went wrong. " + error);
});
When I refresh my html page I see the display screen with, "http://localhost wants to pair" at the top and some devices I do not know are listed; however, other devices that clearly show up in the Windows 10 "Bluetooth & other devices" info box are not in the Web Bluetooth info box.
I am trying to create the simplest code sample possible. I am baffled as to why this does not work. Any assistance would be greatly appreciated. Thx!
And yes, Google Chrome is up to date Version 73.0.3683.86 (Official Build) (64-bit)
Aucun commentaire:
Enregistrer un commentaire