Skip to content

Commit

Permalink
Add warning about acceptAllDevices
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois committed Dec 7, 2016
1 parent 4ebbcd1 commit 9533907
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion web-bluetooth/automatic-reconnect-async-await.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion web-bluetooth/automatic-reconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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']});

Expand Down
2 changes: 1 addition & 1 deletion web-bluetooth/device-information-characteristics.js
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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});

Expand Down
2 changes: 1 addition & 1 deletion web-bluetooth/discover-services-and-characteristics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
2 changes: 1 addition & 1 deletion web-bluetooth/gap-characteristics-async-await.js
Original file line number Diff line number Diff line change
@@ -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']});

Expand Down
2 changes: 1 addition & 1 deletion web-bluetooth/gap-characteristics.js
Original file line number Diff line number Diff line change
@@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion web-bluetooth/read-characteristic-value-changed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 9533907

Please sign in to comment.