Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1001601 of Bluetooth

  • Revision slug: Web/API/Bluetooth
  • Revision title: Bluetooth
  • Revision id: 1001601
  • Created:
  • Creator: jpmedley
  • Is current revision? No
  • Comment Add tags.

Revision Content

{{ apiref("Web Bluetooth API") }} {{Non-standard_header()}}

The Bluetooth interface of the Web Bluetooth API returns a {{jsxref("Promise")}} to a {{domxref("BluetoothDevice")}} object with the specified options.

Interface

interface Bluetooth {
  Promise<BluetoothDevice> requestDevice(RequestDeviceOptions options);
};
Bluetooth implements EventTarget;
Bluetooth implements BluetoothDeviceEventHandlers;
Bluetooth implements CharacteristicEventHandlers;
Bluetooth implements ServiceEventHandlers;

Properties

None

Methods

{{domxref("Bluetooth.requestDevice()")}}
Returns a {{jsxref("Promise")}} to a {{domxref("BluetoothDevice")}} object with the specified options.

Specifications

Specification Status Comment
{{SpecName('Web Bluetooth', '#dom-bluetooth-requestdevice', 'requestDevice()')}} {{Spec2('Web Bluetooth')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatChrome (45.0)}} [1]        
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support {{CompatNo}} {{CompatNo}}           {{CompatChrome (48.0)}} [2]

[1] Behind a flag. Chrome OS only.

[2] Behind a flag. Requires Android 6 (Marshmallow).

Revision Source

<p>{{ apiref("Web Bluetooth API") }}&nbsp;{{Non-standard_header()}}</p>

<p>The <strong><code>Bluetooth</code></strong>&nbsp;interface of the <a href="/Web/API/Web_Bluetooth_API">Web Bluetooth API</a>&nbsp;returns a {{jsxref("Promise")}}&nbsp;to&nbsp;a {{domxref("BluetoothDevice")}}&nbsp;object with the specified options.</p>

<h2 id="Interface">Interface</h2>

<pre class="syntaxbox">
interface <dfn data-dfn-type="interface" data-export="" id="bluetooth">Bluetooth</dfn> {
  Promise&lt;BluetoothDevice&gt; requestDevice(RequestDeviceOptions <dfn data-dfn-for="Bluetooth/requestDevice(options)" data-dfn-type="argument" data-export="" id="dom-bluetooth-requestdevice-options-options">options</dfn>);
};
Bluetooth implements EventTarget;
Bluetooth implements BluetoothDeviceEventHandlers;
Bluetooth implements CharacteristicEventHandlers;
Bluetooth implements ServiceEventHandlers;</pre>

<h2 id="Properties">Properties</h2>

<dl>
 <dt>None</dt>
</dl>

<h2 id="Methods">Methods</h2>

<dl>
 <dt>{{domxref("Bluetooth.requestDevice()")}}</dt>
 <dd>Returns&nbsp;a {{jsxref("Promise")}}&nbsp;to&nbsp;a {{domxref("BluetoothDevice")}}&nbsp;object with the specified options.</dd>
</dl>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Web Bluetooth', '#dom-bluetooth-requestdevice', 'requestDevice()')}}</td>
   <td>{{Spec2('Web Bluetooth')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatChrome (45.0)}} [1]</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Android Webview</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>Firefox OS</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
   <th>Chrome for Android</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>&nbsp;</td>
   <td>{{CompatChrome (48.0)}} [2]</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] Behind a flag. Chrome OS only.</p>

<p>[2] Behind a flag. Requires&nbsp;Android 6 (Marshmallow).</p>
Revert to this revision