| OLD | NEW |
| 1 <h1>Bluetooth</h1> | 1 <h1>Bluetooth</h1> |
| 2 | 2 |
| 3 <p> | 3 <p> |
| 4 This document describes how to use the <a href="bluetooth.html">Bluetooth</a>, | 4 This document describes how to use the <a href="bluetooth.html">Bluetooth</a>, |
| 5 <a href="bluetoothSocket.html">Bluetooth Socket</a> and | 5 <a href="bluetoothSocket.html">Bluetooth Socket</a> and |
| 6 <a href="bluetoothLowEnergy.html">Bluetooth Low Energy</a> APIs to | 6 <a href="bluetoothLowEnergy.html">Bluetooth Low Energy</a> APIs to |
| 7 communicate with Bluetooth and Bluetooth Low Energy devices. | 7 communicate with Bluetooth and Bluetooth Low Energy devices. |
| 8 </p> | 8 </p> |
| 9 | 9 |
| 10 <p> | 10 <p> |
| 11 For background information about Bluetooth, see the official | 11 For background information about Bluetooth, see the official |
| 12 <a href="http://www.bluetooth.org">Bluetooth specifications</a>. | 12 <a href="http://www.bluetooth.org">Bluetooth specifications</a>. |
| 13 </p> | 13 </p> |
| 14 | 14 |
| 15 <h2 id="manifest">Manifest requirements</h2> | 15 <h2 id="manifest">Manifest requirements</h2> |
| 16 | 16 |
| 17 <p> | 17 <p> |
| 18 For Chrome Apps that use Bluetooth, add the | 18 For Chrome Apps that use Bluetooth, add the |
| 19 <a href="manifest/bluetooth">bluetooth</a> entry to the manifest | 19 <a href="manifest/bluetooth">bluetooth</a> entry to the manifest |
| 20 and specify, if appropriate, the UUIDs of profiles, protocols or services | 20 and specify, if appropriate, the UUIDs of profiles, protocols or services |
| 21 you wish to implement. | 21 you wish to implement along with whether you wish to implement these with the |
| 22 For example: | 22 socket and/or Low Energy APIs. |
| 23 </p> |
| 24 |
| 25 <p> |
| 26 For example for a socket implementation: |
| 23 </p> | 27 </p> |
| 24 | 28 |
| 25 <pre data-filename="manifest.json"> | 29 <pre data-filename="manifest.json"> |
| 26 "bluetooth": { | 30 "bluetooth": { |
| 27 "uuids": [ "1105", "1106" ] | 31 "uuids": [ "1105", "1106" ], |
| 32 "socket": true |
| 33 } |
| 34 </pre> |
| 35 |
| 36 <p> |
| 37 And for a Low Energy implementation: |
| 38 </p> |
| 39 |
| 40 <pre data-filename="manifest.json"> |
| 41 "bluetooth": { |
| 42 "uuids": [ "180D", "1809", "180F" ], |
| 43 "low_energy": true |
| 28 } | 44 } |
| 29 </pre> | 45 </pre> |
| 30 | 46 |
| 31 <p> | 47 <p> |
| 32 To only access adapter state, discover nearby devices, and obtain basic | 48 To only access adapter state, discover nearby devices, and obtain basic |
| 33 information about devices, omit the <code>uuids</code> list. | 49 information about devices, only the entry itself is required: |
| 34 </p> | 50 </p> |
| 35 | 51 |
| 52 <pre data-filename="manifest.json"> |
| 53 "bluetooth": { } |
| 54 </pre> |
| 55 |
| 36 <h2 id="adapter_info">Adapter information</h2> | 56 <h2 id="adapter_info">Adapter information</h2> |
| 37 | 57 |
| 38 <h3 id="adapter_state">Obtaining adapter state</h3> | 58 <h3 id="adapter_state">Obtaining adapter state</h3> |
| 39 | 59 |
| 40 <p> | 60 <p> |
| 41 To obtain the state of the Bluetooth adapter, use the | 61 To obtain the state of the Bluetooth adapter, use the |
| 42 $(ref:bluetooth.getAdapterState) method: | 62 $(ref:bluetooth.getAdapterState) method: |
| 43 </p> | 63 </p> |
| 44 | 64 |
| 45 <pre> | 65 <pre> |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 <h3 id="stop-accepting">Stop accepting client connections</h3> | 514 <h3 id="stop-accepting">Stop accepting client connections</h3> |
| 495 | 515 |
| 496 <p> | 516 <p> |
| 497 To stop accepting client connections and unpublish the service use | 517 To stop accepting client connections and unpublish the service use |
| 498 $(ref:bluetoothSocket.disconnect). | 518 $(ref:bluetoothSocket.disconnect). |
| 499 </p> | 519 </p> |
| 500 | 520 |
| 501 <pre> | 521 <pre> |
| 502 chrome.bluetoothSocket.disconnect(serverSocketId); | 522 chrome.bluetoothSocket.disconnect(serverSocketId); |
| 503 </pre> | 523 </pre> |
| OLD | NEW |