From 9533907bcc3c6d3e34016fc3dd8d45f553e9d160 Mon Sep 17 00:00:00 2001 From: Francois Beaufort Date: Wed, 7 Dec 2016 09:56:29 +0100 Subject: [PATCH] Add warning about acceptAllDevices --- web-bluetooth/automatic-reconnect-async-await.js | 2 +- web-bluetooth/automatic-reconnect.js | 2 +- web-bluetooth/device-information-characteristics-async-await.js | 2 +- web-bluetooth/device-information-characteristics.js | 2 +- .../discover-services-and-characteristics-async-await.js | 2 +- web-bluetooth/discover-services-and-characteristics.js | 2 +- web-bluetooth/gap-characteristics-async-await.js | 2 +- web-bluetooth/gap-characteristics.js | 2 +- web-bluetooth/read-characteristic-value-changed-async-await.js | 2 +- web-bluetooth/read-characteristic-value-changed.js | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web-bluetooth/automatic-reconnect-async-await.js b/web-bluetooth/automatic-reconnect-async-await.js index e3402074de..a5ab00a2e3 100644 --- a/web-bluetooth/automatic-reconnect-async-await.js +++ b/web-bluetooth/automatic-reconnect-async-await.js @@ -3,7 +3,7 @@ var bluetoothDevice; async function onButtonClick() { bluetoothDevice = null; try { - log('Requesting any Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); bluetoothDevice = await navigator.bluetooth.requestDevice({ acceptAllDevices: true}); bluetoothDevice.addEventListener('gattserverdisconnected', onDisconnected); diff --git a/web-bluetooth/automatic-reconnect.js b/web-bluetooth/automatic-reconnect.js index 9c254815d7..dffa276aca 100644 --- a/web-bluetooth/automatic-reconnect.js +++ b/web-bluetooth/automatic-reconnect.js @@ -2,7 +2,7 @@ var bluetoothDevice; function onButtonClick() { bluetoothDevice = null; - log('Requesting any Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); navigator.bluetooth.requestDevice({acceptAllDevices: true}) .then(device => { bluetoothDevice = device; diff --git a/web-bluetooth/device-information-characteristics-async-await.js b/web-bluetooth/device-information-characteristics-async-await.js index a28b7de5b4..d4401bc7a4 100644 --- a/web-bluetooth/device-information-characteristics-async-await.js +++ b/web-bluetooth/device-information-characteristics-async-await.js @@ -1,6 +1,6 @@ async function onButtonClick() { try { - log('Requesting any Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); const device = await navigator.bluetooth.requestDevice({ acceptAllDevices: true, optionalServices: ['device_information']}); diff --git a/web-bluetooth/device-information-characteristics.js b/web-bluetooth/device-information-characteristics.js index 53a7d01fe4..177eff2a03 100644 --- a/web-bluetooth/device-information-characteristics.js +++ b/web-bluetooth/device-information-characteristics.js @@ -1,5 +1,5 @@ function onButtonClick() { - log('Requesting any Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); navigator.bluetooth.requestDevice({ acceptAllDevices: true, optionalServices: ['device_information']}) .then(device => { diff --git a/web-bluetooth/discover-services-and-characteristics-async-await.js b/web-bluetooth/discover-services-and-characteristics-async-await.js index f8b517ca18..34c0343a6a 100644 --- a/web-bluetooth/discover-services-and-characteristics-async-await.js +++ b/web-bluetooth/discover-services-and-characteristics-async-await.js @@ -5,7 +5,7 @@ async function onButtonClick() { .filter(s => s && BluetoothUUID.getService); try { - log('Requesting any Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); const device = await navigator.bluetooth.requestDevice({ acceptAllDevices: true, optionalServices: optionalServices}); diff --git a/web-bluetooth/discover-services-and-characteristics.js b/web-bluetooth/discover-services-and-characteristics.js index 717554adc5..aaaf72fc5b 100644 --- a/web-bluetooth/discover-services-and-characteristics.js +++ b/web-bluetooth/discover-services-and-characteristics.js @@ -4,7 +4,7 @@ function onButtonClick() { .split(/, ?/).map(s => s.startsWith('0x') ? parseInt(s) : s) .filter(s => s && BluetoothUUID.getService); - log('Requesting any Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); navigator.bluetooth.requestDevice({ acceptAllDevices: true, optionalServices: optionalServices}) .then(device => { diff --git a/web-bluetooth/gap-characteristics-async-await.js b/web-bluetooth/gap-characteristics-async-await.js index 016a5639e3..78a6cc077c 100644 --- a/web-bluetooth/gap-characteristics-async-await.js +++ b/web-bluetooth/gap-characteristics-async-await.js @@ -1,6 +1,6 @@ async function onButtonClick() { try { - log('Requesting any Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); const device = await navigator.bluetooth.requestDevice({ acceptAllDevices: true, optionalServices: ['generic_access']}); diff --git a/web-bluetooth/gap-characteristics.js b/web-bluetooth/gap-characteristics.js index 42cf7e2046..64f94b45f6 100644 --- a/web-bluetooth/gap-characteristics.js +++ b/web-bluetooth/gap-characteristics.js @@ -1,5 +1,5 @@ function onButtonClick() { - log('Requesting any Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); navigator.bluetooth.requestDevice({ acceptAllDevices: true, optionalServices: ['generic_access']}) .then(device => { diff --git a/web-bluetooth/read-characteristic-value-changed-async-await.js b/web-bluetooth/read-characteristic-value-changed-async-await.js index 7fc4e6075e..fbd6c23ed3 100644 --- a/web-bluetooth/read-characteristic-value-changed-async-await.js +++ b/web-bluetooth/read-characteristic-value-changed-async-await.js @@ -16,7 +16,7 @@ async function onReadBatteryLevelButtonClick() { } async function requestDevice() { - log('Requesting Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); bluetoothDevice = await navigator.bluetooth.requestDevice({ acceptAllDevices: true, optionalServices: ['battery_service']}); bluetoothDevice.addEventListener('gattserverdisconnected', onDisconnected); diff --git a/web-bluetooth/read-characteristic-value-changed.js b/web-bluetooth/read-characteristic-value-changed.js index 6f41df87b2..39ee2f1a03 100644 --- a/web-bluetooth/read-characteristic-value-changed.js +++ b/web-bluetooth/read-characteristic-value-changed.js @@ -14,7 +14,7 @@ function onReadBatteryLevelButtonClick() { } function requestDevice() { - log('Requesting Bluetooth Device...'); + log('Requesting any Bluetooth Device... (NOT RECOMMENDED - USE FILTERS)'); return navigator.bluetooth.requestDevice({ acceptAllDevices: true, optionalServices: ['battery_service']}) .then(device => {