I've been looking into the recent Bluetooth web API and was wondering if it was possible to connect headphones/headsets with this service.
This is my current code, however it doesn't seem to filter for my device when requesting in the web.
const DEVICE_NAME = 'MY DEVICE NAME';
navigator.bluetooth.requestDevice({
filters: [{
name: [DEVICE_NAME],
}]
})
.then(device => {
console.log(`Connected to Device : ${DEVICE_NAME}`);
})
.catch(error => { console.log(error); });
I have also tried using the bluetooth UUID for my selected device but the same issue occurs. Is this because bluetooth wep-api doesnt support these types of devices or am I missing something in my code?
Any help would be much appreciated.
Aucun commentaire:
Enregistrer un commentaire