<li>
Sets visibility </li>
<li>
-Discovers nearby Bluetooth devices (Device discovery) </li>
+Discovers nearby Bluetooth devices (Device discovery, including Bluetooth LE devices) </li>
<li>
Gets bonded devices information </li>
<li>
Connects to a service on a remote device and exchanges data </li>
<li>
Registers a service (RFCOMM) on a local device, which can be consumed by remote devices to exchange data </li>
+ <li>
+Advertise for remote devices (including Bluetooth LE devices) </li>
+ <li>
+Act as a GATT client (Generic Attribute Profile client) </li>
</ul>
<p>
For more information on the Bluetooth features, see <a href="../../../../../org.tizen.guides/html/web/tizen/communication/bluetooth_w.htm">Bluetooth Guide</a>.
</li>
<li>1.5. <a href="#BluetoothHealthChannelType">BluetoothHealthChannelType</a>
</li>
+<li>1.6. <a href="#BluetoothLESolicitationUUID">BluetoothLESolicitationUUID</a>
+</li>
+<li>1.7. <a href="#BluetoothAdvertisePacketType">BluetoothAdvertisePacketType</a>
+</li>
+<li>1.8. <a href="#BluetoothAdvertisingState">BluetoothAdvertisingState</a>
+</li>
+<li>1.9. <a href="#BluetoothAdvertisingMode">BluetoothAdvertisingMode</a>
+</li>
</ul>
</li>
<li>2. <a href="#interfaces-section">Interfaces</a><ul class="toc">
<li>2.1. <a href="#BluetoothManagerObject">BluetoothManagerObject</a>
</li>
-<li>2.2. <a href="#BluetoothManager">BluetoothManager</a>
+<li>2.2. <a href="#BluetoothLEServiceData">BluetoothLEServiceData</a>
+</li>
+<li>2.3. <a href="#BluetoothLEManufacturerData">BluetoothLEManufacturerData</a>
+</li>
+<li>2.4. <a href="#BluetoothLEAdvertiseDataInit">BluetoothLEAdvertiseDataInit</a>
+</li>
+<li>2.5. <a href="#BluetoothLEAdvertiseData">BluetoothLEAdvertiseData</a>
+</li>
+<li>2.6. <a href="#BluetoothManager">BluetoothManager</a>
+</li>
+<li>2.7. <a href="#BluetoothAdapter">BluetoothAdapter</a>
+</li>
+<li>2.8. <a href="#BluetoothLEAdapter">BluetoothLEAdapter</a>
+</li>
+<li>2.9. <a href="#BluetoothGATTService">BluetoothGATTService</a>
+</li>
+<li>2.10. <a href="#BluetoothGATTCharacteristic">BluetoothGATTCharacteristic</a>
+</li>
+<li>2.11. <a href="#BluetoothGATTDescriptor">BluetoothGATTDescriptor</a>
+</li>
+<li>2.12. <a href="#BluetoothLEScanCallback">BluetoothLEScanCallback</a>
</li>
-<li>2.3. <a href="#BluetoothAdapter">BluetoothAdapter</a>
+<li>2.13. <a href="#BluetoothLEAdvertiseCallback">BluetoothLEAdvertiseCallback</a>
</li>
-<li>2.4. <a href="#BluetoothDevice">BluetoothDevice</a>
+<li>2.14. <a href="#BluetoothLEConnectChangeCallback">BluetoothLEConnectChangeCallback</a>
</li>
-<li>2.5. <a href="#BluetoothSocket">BluetoothSocket</a>
+<li>2.15. <a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a>
</li>
-<li>2.6. <a href="#BluetoothClass">BluetoothClass</a>
+<li>2.16. <a href="#BluetoothDevice">BluetoothDevice</a>
</li>
-<li>2.7. <a href="#BluetoothClassDeviceMajor">BluetoothClassDeviceMajor</a>
+<li>2.17. <a href="#BluetoothLEDevice">BluetoothLEDevice</a>
</li>
-<li>2.8. <a href="#BluetoothClassDeviceMinor">BluetoothClassDeviceMinor</a>
+<li>2.18. <a href="#BluetoothSocket">BluetoothSocket</a>
</li>
-<li>2.9. <a href="#BluetoothClassDeviceService">BluetoothClassDeviceService</a>
+<li>2.19. <a href="#BluetoothClass">BluetoothClass</a>
</li>
-<li>2.10. <a href="#BluetoothServiceHandler">BluetoothServiceHandler</a>
+<li>2.20. <a href="#BluetoothClassDeviceMajor">BluetoothClassDeviceMajor</a>
</li>
-<li>2.11. <a href="#BluetoothProfileHandler">BluetoothProfileHandler</a>
+<li>2.21. <a href="#BluetoothClassDeviceMinor">BluetoothClassDeviceMinor</a>
</li>
-<li>2.12. <a href="#BluetoothHealthProfileHandler">BluetoothHealthProfileHandler</a>
+<li>2.22. <a href="#BluetoothClassDeviceService">BluetoothClassDeviceService</a>
</li>
-<li>2.13. <a href="#BluetoothHealthApplication">BluetoothHealthApplication</a>
+<li>2.23. <a href="#BluetoothServiceHandler">BluetoothServiceHandler</a>
</li>
-<li>2.14. <a href="#BluetoothHealthChannel">BluetoothHealthChannel</a>
+<li>2.24. <a href="#BluetoothProfileHandler">BluetoothProfileHandler</a>
</li>
-<li>2.15. <a href="#BluetoothAdapterChangeCallback">BluetoothAdapterChangeCallback</a>
+<li>2.25. <a href="#BluetoothHealthProfileHandler">BluetoothHealthProfileHandler</a>
</li>
-<li>2.16. <a href="#BluetoothDeviceSuccessCallback">BluetoothDeviceSuccessCallback</a>
+<li>2.26. <a href="#BluetoothHealthApplication">BluetoothHealthApplication</a>
</li>
-<li>2.17. <a href="#BluetoothDeviceArraySuccessCallback">BluetoothDeviceArraySuccessCallback</a>
+<li>2.27. <a href="#BluetoothHealthChannel">BluetoothHealthChannel</a>
</li>
-<li>2.18. <a href="#BluetoothDiscoverDevicesSuccessCallback">BluetoothDiscoverDevicesSuccessCallback</a>
+<li>2.28. <a href="#BluetoothAdapterChangeCallback">BluetoothAdapterChangeCallback</a>
</li>
-<li>2.19. <a href="#BluetoothSocketSuccessCallback">BluetoothSocketSuccessCallback</a>
+<li>2.29. <a href="#BluetoothDeviceSuccessCallback">BluetoothDeviceSuccessCallback</a>
</li>
-<li>2.20. <a href="#BluetoothServiceSuccessCallback">BluetoothServiceSuccessCallback</a>
+<li>2.30. <a href="#BluetoothDeviceArraySuccessCallback">BluetoothDeviceArraySuccessCallback</a>
</li>
-<li>2.21. <a href="#BluetoothHealthApplicationSuccessCallback">BluetoothHealthApplicationSuccessCallback</a>
+<li>2.31. <a href="#BluetoothDiscoverDevicesSuccessCallback">BluetoothDiscoverDevicesSuccessCallback</a>
</li>
-<li>2.22. <a href="#BluetoothHealthChannelSuccessCallback">BluetoothHealthChannelSuccessCallback</a>
+<li>2.32. <a href="#BluetoothSocketSuccessCallback">BluetoothSocketSuccessCallback</a>
</li>
-<li>2.23. <a href="#BluetoothHealthChannelChangeCallback">BluetoothHealthChannelChangeCallback</a>
+<li>2.33. <a href="#BluetoothServiceSuccessCallback">BluetoothServiceSuccessCallback</a>
+</li>
+<li>2.34. <a href="#BluetoothHealthApplicationSuccessCallback">BluetoothHealthApplicationSuccessCallback</a>
+</li>
+<li>2.35. <a href="#BluetoothHealthChannelSuccessCallback">BluetoothHealthChannelSuccessCallback</a>
+</li>
+<li>2.36. <a href="#BluetoothHealthChannelChangeCallback">BluetoothHealthChannelChangeCallback</a>
</li>
</ul>
</li>
<td></td>
</tr>
<tr>
+<td><a href="#BluetoothLEServiceData">BluetoothLEServiceData</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#BluetoothLEManufacturerData">BluetoothLEManufacturerData</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#BluetoothLEAdvertiseDataInit">BluetoothLEAdvertiseDataInit</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#BluetoothLEAdvertiseData">BluetoothLEAdvertiseData</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#BluetoothManager">BluetoothManager</a></td>
<td>
-<a href="#BluetoothAdapter">BluetoothAdapter</a> <a href="#BluetoothManager::getDefaultAdapter">getDefaultAdapter</a> ()</td>
+<a href="#BluetoothAdapter">BluetoothAdapter</a> <a href="#BluetoothManager::getDefaultAdapter">getDefaultAdapter</a> ()<br>
+ <a href="#BluetoothLEAdapter">BluetoothLEAdapter</a> <a href="#BluetoothManager::getLEAdapter">getLEAdapter</a> ()</td>
</tr>
<tr>
<td><a href="#BluetoothAdapter">BluetoothAdapter</a></td>
<a href="#BluetoothProfileHandler">BluetoothProfileHandler</a> <a href="#BluetoothAdapter::getBluetoothProfileHandler">getBluetoothProfileHandler</a> (<a href="#BluetoothProfileType">BluetoothProfileType</a> profileType)</td>
</tr>
<tr>
+<td><a href="#BluetoothLEAdapter">BluetoothLEAdapter</a></td>
+<td>void <a href="#BluetoothLEAdapter::startScan">startScan</a> (<a href="#BluetoothLEScanCallback">BluetoothLEScanCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)<br>
+ void <a href="#BluetoothLEAdapter::stopScan">stopScan</a> ()<br>
+ void <a href="#BluetoothLEAdapter::startAdvertise">startAdvertise</a> (<a href="#BluetoothLEAdvertiseData">BluetoothLEAdvertiseData</a> advertiseData, <a href="#BluetoothAdvertisePacketType">BluetoothAdvertisePacketType</a> packetType, <a href="#BluetoothLEAdvertiseCallback">BluetoothLEAdvertiseCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional <a href="#BluetoothAdvertisingMode">BluetoothAdvertisingMode</a>? mode, optional boolean? connectable)<br>
+ void <a href="#BluetoothLEAdapter::stopAdvertise">stopAdvertise</a> ()</td>
+</tr>
+<tr>
+<td><a href="#BluetoothGATTService">BluetoothGATTService</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#BluetoothGATTCharacteristic">BluetoothGATTCharacteristic</a></td>
+<td>void <a href="#BluetoothGATTCharacteristic::readValue">readValue</a> (<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)<br>
+ void <a href="#BluetoothGATTCharacteristic::writeValue">writeValue</a> (byte[] value, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)<br>
+ long <a href="#BluetoothGATTCharacteristic::addValueChangeListener">addValueChangeListener</a> (<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> callback)<br>
+ void <a href="#BluetoothGATTCharacteristic::removeValueChangeListener">removeValueChangeListener</a> (long watchID)</td>
+</tr>
+<tr>
+<td><a href="#BluetoothGATTDescriptor">BluetoothGATTDescriptor</a></td>
+<td>void <a href="#BluetoothGATTDescriptor::readValue">readValue</a> (<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)<br>
+ void <a href="#BluetoothGATTDescriptor::writeValue">writeValue</a> (byte[] value, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</td>
+</tr>
+<tr>
+<td><a href="#BluetoothLEScanCallback">BluetoothLEScanCallback</a></td>
+<td>void <a href="#BluetoothLEScanCallback::onstarted">onstarted</a> ()<br>
+ void <a href="#BluetoothLEScanCallback::ondevicefound">ondevicefound</a> (<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device)<br>
+ void <a href="#BluetoothLEScanCallback::onfinished">onfinished</a> (<a href="#BluetoothLEDevice">BluetoothLEDevice</a>[] foundDevices)</td>
+</tr>
+<tr>
+<td><a href="#BluetoothLEAdvertiseCallback">BluetoothLEAdvertiseCallback</a></td>
+<td>void <a href="#BluetoothLEAdvertiseCallback::onstate">onstate</a> (<a href="#BluetoothAdvertisingState">BluetoothAdvertisingState</a> state)</td>
+</tr>
+<tr>
+<td><a href="#BluetoothLEConnectChangeCallback">BluetoothLEConnectChangeCallback</a></td>
+<td>void <a href="#BluetoothLEConnectChangeCallback::onconnected">onconnected</a> (<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device)<br>
+ void <a href="#BluetoothLEConnectChangeCallback::ondisconnected">ondisconnected</a> (<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device)</td>
+</tr>
+<tr>
+<td><a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a></td>
+<td>void <a href="#ReadValueSuccessCallback::onread">onread</a> (byte[] value)</td>
+</tr>
+<tr>
<td><a href="#BluetoothDevice">BluetoothDevice</a></td>
<td>void <a href="#BluetoothDevice::connectToServiceByUUID">connectToServiceByUUID</a> (<a href="#BluetoothUUID">BluetoothUUID</a> uuid, <a href="#BluetoothSocketSuccessCallback">BluetoothSocketSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</td>
</tr>
<tr>
+<td><a href="#BluetoothLEDevice">BluetoothLEDevice</a></td>
+<td>void <a href="#BluetoothLEDevice::connect">connect</a> (optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)<br>
+ void <a href="#BluetoothLEDevice::disconnect">disconnect</a> (optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)<br>
+ <a href="#BluetoothGATTService">BluetoothGATTService</a> <a href="#BluetoothLEDevice::getService">getService</a> (<a href="#BluetoothUUID">BluetoothUUID</a> uuid)<br>
+ long <a href="#BluetoothLEDevice::addConnectStateChangeListener">addConnectStateChangeListener</a> (<a href="#BluetoothLEConnectChangeCallback">BluetoothLEConnectChangeCallback</a> listener)<br>
+ void <a href="#BluetoothLEDevice::removeConnectStateChangeListener">removeConnectStateChangeListener</a> (long watchID)</td>
+</tr>
+<tr>
<td><a href="#BluetoothSocket">BluetoothSocket</a></td>
<td>unsigned long <a href="#BluetoothSocket::writeData">writeData</a> (byte[] data)<br>
byte[] <a href="#BluetoothSocket::readData">readData</a> ()<br>
2.2
</p>
</div>
+<div class="typedef" id="BluetoothLESolicitationUUID">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLESolicitationUUID"></a><h3>1.6. BluetoothLESolicitationUUID</h3>
+<div class="brief">
+ The service solicitation UUID of the Bluetooth LE device.
+ </div>
+<pre class="webidl prettyprint"> typedef DOMString BluetoothLESolicitationUUID;</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</div>
+<div class="enum" id="BluetoothAdvertisePacketType">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothAdvertisePacketType"></a><h3>1.7. BluetoothAdvertisePacketType</h3>
+<div class="brief">
+ The Bluetooth LE packet type
+ </div>
+<pre class="webidl prettyprint"> enum BluetoothAdvertisePacketType { "ADVERTISE", "SCAN_RESPONSE" };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <ul>
+ <li>
+ADVERTISE - the advertising packet </li>
+ <li>
+SCAN_RESPONSE- the scan response packet </li>
+ </ul>
+ </div>
+</div>
+<div class="enum" id="BluetoothAdvertisingState">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothAdvertisingState"></a><h3>1.8. BluetoothAdvertisingState</h3>
+<div class="brief">
+ The Bluetooth advertising state
+ </div>
+<pre class="webidl prettyprint"> enum BluetoothAdvertisingState { "STARTED", "STOPPED" };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <ul>
+ <li>
+STARTED - advertising has started </li>
+ <li>
+STOPPED - advertising has stopped </li>
+ </ul>
+ </div>
+</div>
+<div class="enum" id="BluetoothAdvertisingMode">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothAdvertisingMode"></a><h3>1.9. BluetoothAdvertisingMode</h3>
+<div class="brief">
+ The Bluetooth advertising mode
+ </div>
+<pre class="webidl prettyprint"> enum BluetoothAdvertisingMode { "BALANCED", "LOW_LATENCY", "LOW_ENERGY" };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <ul>
+ <li>
+BALANCED- Balanced advertising mode </li>
+ <li>
+LOW_LATENCY- Low latency advertising mode </li>
+ <li>
+LOW_ENERGY - Low energy advertising mode </li>
+ </ul>
+ </div>
+</div>
</div>
<div class="interfaces" id="interfaces-section">
<h2>2. Interfaces</h2>
</p>
</div>
</div>
+<div class="interface" id="BluetoothLEServiceData">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEServiceData"></a><h3>2.2. BluetoothLEServiceData</h3>
+<div class="brief">
+ The BluetoothLEServiceData interface is a service specific data container of Bluetooth LE device.
+ </div>
+<pre class="webidl prettyprint"> interface BluetoothLEServiceData {
+ attribute <a href="#BluetoothUUID">BluetoothUUID</a> serviceuuid;
+ attribute DOMString data;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="BluetoothLEServiceData::serviceuuid">
+<span class="attrName"><span class="type">BluetoothUUID </span><span class="name">serviceuuid</span></span><div class="brief">
+ The 16 bit UUID of service data
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothLEServiceData::data">
+<span class="attrName"><span class="type">DOMString </span><span class="name">data</span></span><div class="brief">
+ The service data of the Bluetooth LE device
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+</ul>
+</div>
+</div>
+<div class="interface" id="BluetoothLEManufacturerData">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEManufacturerData"></a><h3>2.3. BluetoothLEManufacturerData</h3>
+<div class="brief">
+ The BluetoothLEManufacturerData interface is a manufacturer specific data container for an advertise or scan response data.
+ </div>
+<pre class="webidl prettyprint"> interface BluetoothLEManufacturerData {
+ attribute DOMString id;
+ attribute DOMString data;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="BluetoothLEManufacturerData::id">
+<span class="attrName"><span class="type">DOMString </span><span class="name">id</span></span><div class="brief">
+ The manufacturer assigned ID.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothLEManufacturerData::data">
+<span class="attrName"><span class="type">DOMString </span><span class="name">data</span></span><div class="brief">
+ The manufacturer data content.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+</ul>
+</div>
+</div>
+<div class="dictionary" id="BluetoothLEAdvertiseDataInit">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEAdvertiseDataInit"></a><h3>2.4. BluetoothLEAdvertiseDataInit</h3>
+<div class="brief">
+ Provides a dictionary for specifying advertise or scan response data.
+ </div>
+<pre class="webidl prettyprint"> dictionary BluetoothLEAdvertiseDataInit {
+ boolean? includeName;
+ <a href="#BluetoothUUID">BluetoothUUID</a>[]? serviceuuids;
+ <a href="#BluetoothLESolicitationUUID">BluetoothLESolicitationUUID</a>[]? solicitationuuids;
+ unsigned long? appearance;
+ boolean? includeTxPowerLevel;
+ <a href="#BluetoothLEServiceData">BluetoothLEServiceData</a>[]? serviceData;
+ <a href="#BluetoothLEManufacturerData">BluetoothLEManufacturerData</a>? manufacturerData;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+This dictionary is used as an input parameter of the BluetoothLEAdvertiseData construtor.
+ </p>
+ </div>
+</div>
+<div class="interface" id="BluetoothLEAdvertiseData">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEAdvertiseData"></a><h3>2.5. BluetoothLEAdvertiseData</h3>
+<div class="brief">
+ The BluetoothLEAdvertiseData interface is an advertise or scan response data container for Bluetooth advertising.
+ </div>
+<pre class="webidl prettyprint"> [Constructor(optional <a href="#BluetoothLEAdvertiseDataInit">BluetoothLEAdvertiseDataInit</a>? init)]
+ interface BluetoothLEAdvertiseData {
+ attribute boolean? includeName;
+ attribute <a href="#BluetoothUUID">BluetoothUUID</a>[]? serviceuuids;
+ attribute <a href="#BluetoothLESolicitationUUID">BluetoothLESolicitationUUID</a>[]? solicitationuuids;
+ attribute unsigned long? appearance;
+ attribute boolean? includeTxPowerLevel;
+ attribute <a href="#BluetoothLEServiceData">BluetoothLEServiceData</a>[]? serviceData;
+ attribute <a href="#BluetoothLEManufacturerData">BluetoothLEManufacturerData</a>? manufacturerData;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The BluetoothLEAdvertiseData container for Bluetooth LE advertising.
+This represents the data to be advertised as well as the scan response data for active scans.
+ </p>
+ </div>
+<div class="constructors">
+<h4 id="BluetoothLEAdvertiseData::constructor">Constructors</h4>
+<dl><pre class="webidl prettyprint">BluetoothLEAdvertiseData(optional <a href="#BluetoothLEAdvertiseDataInit">BluetoothLEAdvertiseDataInit</a>? init);</pre></dl>
+</div>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="BluetoothLEAdvertiseData::includeName">
+<span class="attrName"><span class="type">boolean </span><span class="name">includeName</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The flag indicating whether the device name should be included in advertise or scan response data.
+By default, this attribute is set to null. If attribute is set to null, The default value is set to a false.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothLEAdvertiseData::serviceuuids">
+<span class="attrName"><span class="type">BluetoothUUID[]
+ </span><span class="name">serviceuuids</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The service UUID for advertise or scan response data.
+By default, this attribute is set to null.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothLEAdvertiseData::solicitationuuids">
+<span class="attrName"><span class="type">BluetoothLESolicitationUUID[]
+ </span><span class="name">solicitationuuids</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The service solicitation UUID for advertise or scan response data.
+By default, this attribute is set to null.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothLEAdvertiseData::appearance">
+<span class="attrName"><span class="type">unsigned long </span><span class="name">appearance</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The external appearance of this device for advertise or scan response data.
+By default, this attribute is set to null.
+ </div>
+<div class="description">
+ <p>
+See the <a href="https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.gap.appearance.xml">list of appearance codes</a> for sample values.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothLEAdvertiseData::includeTxPowerLevel">
+<span class="attrName"><span class="type">boolean </span><span class="name">includeTxPowerLevel</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The transmission power level should be included in advertise or scan response data.
+By default, this attribute is set to null.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothLEAdvertiseData::serviceData">
+<span class="attrName"><span class="type">BluetoothLEServiceData[]
+ </span><span class="name">serviceData</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The service data for advertise or scan response data.
+By default, this attribute is set to null.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothLEAdvertiseData::manufacturerData">
+<span class="attrName"><span class="type">BluetoothLEManufacturerData </span><span class="name">manufacturerData</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The manufacturer specific data for advertise or scan response data.
+By default, this attribute is set to null.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+</ul>
+</div>
+</div>
<div class="interface" id="BluetoothManager">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothManager"></a><h3>2.2. BluetoothManager</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothManager"></a><h3>2.6. BluetoothManager</h3>
<div class="brief">
The BluetoothManager interface provides access to the <em>BluetoothAdapter</em> object.
</div>
readonly attribute <a href="#BluetoothClassDeviceMinor">BluetoothClassDeviceMinor</a> deviceMinor;
readonly attribute <a href="#BluetoothClassDeviceService">BluetoothClassDeviceService</a> deviceService;
<a href="#BluetoothAdapter">BluetoothAdapter</a> getDefaultAdapter() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#BluetoothLEAdapter">BluetoothLEAdapter</a> getLEAdapter() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};</pre>
<p><span class="version">
Since: </span>
</pre>
</div>
</dd>
+<dt class="method" id="BluetoothManager::getLEAdapter">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothManager::getLEAdapter"></a><code><b><span class="methodName">getLEAdapter</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets the default Low Energy Bluetooth adapter.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#BluetoothLEAdapter">BluetoothLEAdapter</a> getLEAdapter();
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<p><span class="remark"> Remark : </span>
+ To check if this method is supported or not, use <a href="systeminfo.html#SystemInfo::getCapability">tizen.systeminfo.getCapability</a>("http://tizen.org/feature/network.bluetooth.le").
+ </p>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ BluetoothLEAdapter The local <em>BluetoothLEAdapter </em>object.
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type NotSupportedError, if the feature is not supported.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, if any other error occurs.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> try {
+ var adapter = tizen.bluetooth.getLEAdapter();
+ } catch (err) {
+ console.log(err.name +": " + err.message);
+ }
+ </pre>
+</div>
+</dd>
</dl>
</div>
</div>
<div class="interface" id="BluetoothAdapter">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothAdapter"></a><h3>2.3. BluetoothAdapter</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothAdapter"></a><h3>2.7. BluetoothAdapter</h3>
<div class="brief">
The BluetoothAdapter interface provides access to control the device's Bluetooth adapter.
</div>
Sets the local device visibility by sending a request to a Bluetooth hardware to change the device visible state to <em>mode</em>.
</div>
<div class="deprecated"><p><font color="red"><i><b>Deprecated.</b>
- It is deprecated since Tizen 2.3 and will be removed in Tizen 3.0. Instead, let the user change the Bluetooth visibility through the Settings application. See the <a href="../../../../../org.tizen.tutorials/html/web/tizen/communication/bluetooth_tutorial_w.htm">Bluetooth</a> Tutorial.
+It is deprecated since Tizen 2.3 and will be removed in Tizen 3.0. Instead, let the user change theBluetooth visibility through the Settings application. See the <a href="../../../../../org.tizen.tutorials/html/web/tizen/communication/bluetooth_tutorial_w.htm">Bluetooth</a> Tutorial.
</i></font></p></div>
<div class="synopsis"><pre class="signature prettyprint">void setVisible(boolean mode, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional unsigned short? timeout);
</pre></div>
<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onBondingSuccess(device) {
console.log("Device Name:" + device.name);
console.log("Device Address:" + device.address);
- console.log("Device Service UUIDs:" + device.uuids.join("\n"));
+ console.log("Device Service UUIDs:" + device.uuids.join("<br>"));
}
function onError(e) {
</dl>
</div>
</div>
-<div class="interface" id="BluetoothDevice">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDevice"></a><h3>2.4. BluetoothDevice</h3>
+<div class="interface" id="BluetoothLEAdapter">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEAdapter"></a><h3>2.8. BluetoothLEAdapter</h3>
<div class="brief">
- The BluetoothDevice interface represents a remote Bluetooth device.
+ The BluetoothLEAdapter interface provides access to control the device's Bluetooth Low Energy adapter.
</div>
-<pre class="webidl prettyprint"> [NoInterfaceObject] interface BluetoothDevice {
- readonly attribute DOMString name;
- readonly attribute <a href="#BluetoothAddress">BluetoothAddress</a> address;
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface BluetoothLEAdapter {
+ void startScan(<a href="#BluetoothLEScanCallback">BluetoothLEScanCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void stopScan() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void startAdvertise(<a href="#BluetoothLEAdvertiseData">BluetoothLEAdvertiseData</a> advertiseData, <a href="#BluetoothAdvertisePacketType">BluetoothAdvertisePacketType</a> packetType, <a href="#BluetoothLEAdvertiseCallback">BluetoothLEAdvertiseCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional <a href="#BluetoothAdvertisingMode">BluetoothAdvertisingMode</a>? mode, optional boolean? connectable) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void stopAdvertise() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+This interface offers methods to control local Bluetooth Low Energy behavior, such as:
+ </p>
+ <ul>
+ <li>
+Scanning for remote devices </li>
+ <li>
+Listening for changes in Bluetooth Low Energy state </li>
+ </ul>
+ </div>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="BluetoothLEAdapter::startScan">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEAdapter::startScan"></a><code><b><span class="methodName">startScan</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Starts scanning for Low Energy advertisement.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void startScan(<a href="#BluetoothLEScanCallback">BluetoothLEScanCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The scanning process can be canceled anytime, by calling the <em>stopScan() </em> method in the <em>BluetoothLEAdapter</em> interface.
+ </p>
+ <p>
+The <em>ErrorCallback</em> will be launched in the following situations:
+ </p>
+ <ul>
+ <li>
+ ServiceNotAvailableError - If a Bluetooth device is turned off </li>
+ <li>
+ UnknownError - If any other error occurs. </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ called when advertisement is found.
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The method to invoke when an error occurs.
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input attribute is not compatible with the expected type for this attribute.
+ </p></li>
+<li class="list"><p>
+ with error type InvalidStateError, if device is currently in progress of scanning
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ console.log("[Found device] address: " + device.address);
+ },
+ onfinished: function(devices) {
+ console.log("Found devices: " + devices.length);
+ }
+ });
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothLEAdapter::stopScan">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEAdapter::stopScan"></a><code><b><span class="methodName">stopScan</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Stops scanning for Low Energy advertisement.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void stopScan();
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, if any other error occurs
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ adapter.stopScan();
+ }
+ },
+ onfinished: function(devices) {
+ console.log("Found devices: " + devices.length);
+ }
+ });
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothLEAdapter::startAdvertise">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEAdapter::startAdvertise"></a><code><b><span class="methodName">startAdvertise</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Starts advertising for Low Energy Devices.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void startAdvertise(<a href="#BluetoothLEAdvertiseData">BluetoothLEAdvertiseData</a> advertiseData, <a href="#BluetoothAdvertisePacketType">BluetoothAdvertisePacketType</a> packetType, <a href="#BluetoothLEAdvertiseCallback">BluetoothLEAdvertiseCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional <a href="#BluetoothAdvertisingMode">BluetoothAdvertisingMode</a>? mode, optional boolean? connectable);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+A advertising process can be canceled anytime, by calling <em>stopAdvertise() </em>on the <em>BluetoothLEAdapter</em>.
+ </p>
+ <p>
+The <em>ErrorCallback</em> will be launched in the following situations:
+ </p>
+ <ul>
+ <li>
+ ServiceNotAvailableError - If a Bluetooth device is turned off </li>
+ <li>
+ UnknownError - If any other error occurs </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">advertiseData</span>:
+ BluetoothLEAdvertiseData object to be added
+ </li>
+ <li class="param">
+<span class="name">packetType</span>:
+ The bluetooth LE packet type
+ </li>
+ <li class="param">
+<span class="name">successCallback</span>:
+ called when edvertisement is found.
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The method to invoke when an error occurs.
+ </li>
+ <li class="param">
+<span class="name">mode</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The power and latency mode of advertising. The default mode is "BALANCED".
+ </li>
+ <li class="param">
+<span class="name">connectable</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The connectable status. It's true if the advertisement will be connectable. The default value of the parameter is <var>true</var>.
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input attribute is not compatible with the expected type for this attribute.
+ </p></li>
+<li class="list"><p>
+ with error type QuotaPatameterError, if any input attribute is not compatible with the maximum data size for this attribute.
+ </p></li>
+<li class="list"><p>
+ with error type InvalidStateError, if device is currently in progress of advertising
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ var battery_svc_uuid_16 = "180f"; // the service UUID, 16-bit UUID or 128-bit UUID is supported. (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB)
+ var heart_rate_svc_uuid_16 = "180d"; // the service solicitation UUID, 16-bit UUID or 128-bit UUID is supported. (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB)
+ var advertiseOptions = {
+ includeName: true, // Whether the device name should be included
+ includeTxPowerLevel: true, // Whether the transmission power level should be included
+ appearance: 192, // The external appearance of device, 192 - Generic Watch
+ serviceuuids: [battery_svc_uuid_16],
+ solicitationuuids: [heart_rate_svc_uuid_16]
+ };
+
+ var advertiseData = new tizen.BluetoothLEAdvertiseData(advertiseOptions);
+ var connectable = true;
+
+ adapter.startAdvertise(advertiseData, "ADVERTISE", function() {
+ onstate: function(state) {
+ console.log("Advertiser state: " + state);
+ }
+ }, "LOW_LATENCY", connectable);
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothLEAdapter::stopAdvertise">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEAdapter::stopAdvertise"></a><code><b><span class="methodName">stopAdvertise</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Stops advertising for Low Energy Devices.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void stopAdvertise();
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, if any other error occurs
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ var battery_svc_uuid_16 = "180f"; // the service UUID, 16-bit UUID or 128-bit UUID is supported. (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB)
+ var heart_rate_svc_uuid_16 = "180d"; // the service solicitation UUID, 16-bit UUID or 128-bit UUID is supported. (e.g. 180F, 0000180F-0000-1000-8000-00805F9B34FB)
+ var advertiseOptions = {
+ includeName: true, // Whether the device name should be included
+ includeTxPowerLevel: true, // Whether the transmission power level should be included
+ appearance: 192, // The external appearance of device, 192 - Generic Watch
+ serviceuuids: [battery_svc_uuid_16],
+ solicitationuuids: [heart_rate_svc_uuid_16]
+ };
+
+ var advertiseData = new tizen.BluetoothLEAdvertiseData(advertiseOptions);
+
+ adapter.startAdvertise(advertiseData, "ADVERTISE", function() {
+ onstate: function(state) {
+ console.log("Advertiser state: " + state);
+ }
+ });
+ adapter.stopAdvertise();
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="interface" id="BluetoothGATTService">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothGATTService"></a><h3>2.9. BluetoothGATTService</h3>
+<div class="brief">
+ Bluetooth Low Energy Service. The service can be retrieved with BluetoothLEDevice.getService().
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface BluetoothGATTService {
+ readonly attribute <a href="#BluetoothUUID">BluetoothUUID</a> uuid;
+ readonly attribute <a href="#BluetoothGATTService">BluetoothGATTService</a>[] services;
+ readonly attribute <a href="#BluetoothGATTCharacteristic">BluetoothGATTCharacteristic</a>[] characteristics;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onError(e) {
+ console.log("Error occured: " + e.message);
+ }
+
+ function onDeviceFound(device) {
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ try {
+ var service = device.getService(device.uuids[0]);
+ console.log("Service got");
+ } catch(e) {
+ console.log("Failed to retrieve service: " + e.message);
+ }
+ }
+ }
+
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ ondevicefound: onDeviceFound
+ }, onError);
+ </pre>
+</div>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="BluetoothGATTService::uuid">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">BluetoothUUID </span><span class="name">uuid</span></span><div class="brief">
+ UUID of the service.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTService::services">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">BluetoothGATTService[]
+ </span><span class="name">services</span></span><div class="brief">
+ A list of services included in this service.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTService::characteristics">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">BluetoothGATTCharacteristic[]
+ </span><span class="name">characteristics</span></span><div class="brief">
+ A list of characteristics in this service.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+</ul>
+</div>
+</div>
+<div class="interface" id="BluetoothGATTCharacteristic">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothGATTCharacteristic"></a><h3>2.10. BluetoothGATTCharacteristic</h3>
+<div class="brief">
+ A characteristic provided by Bluetooth Low Energy service.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface BluetoothGATTCharacteristic {
+ readonly attribute <a href="#BluetoothGATTDescriptor">BluetoothGATTDescriptor</a>[] descriptors;
+ readonly attribute boolean isBroadcast;
+ readonly attribute boolean hasExtendedProperties;
+ readonly attribute boolean isNotify;
+ readonly attribute boolean isIndication;
+ readonly attribute boolean isReadable;
+ readonly attribute boolean isSignedWrite;
+ readonly attribute boolean isWritable;
+ readonly attribute boolean isWriteNoResponse;
+ void readValue(<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void writeValue(byte[] value, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ long addValueChangeListener(<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> callback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void removeValueChangeListener(long watchID);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="BluetoothGATTCharacteristic::descriptors">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">BluetoothGATTDescriptor[]
+ </span><span class="name">descriptors</span></span><div class="brief">
+ A list of descriptors in this characteristic.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTCharacteristic::isBroadcast">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isBroadcast</span></span><div class="brief">
+ Indicates if the characteristic is broadcastable.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTCharacteristic::hasExtendedProperties">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">hasExtendedProperties</span></span><div class="brief">
+ Indicates if the characteristic has extended properties.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTCharacteristic::isNotify">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isNotify</span></span><div class="brief">
+ Indicates if the characteristic supports notification.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTCharacteristic::isIndication">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isIndication</span></span><div class="brief">
+ Indicates if the characteristic supports indication.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTCharacteristic::isReadable">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isReadable</span></span><div class="brief">
+ Indicates if the characteristic is readable.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTCharacteristic::isSignedWrite">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isSignedWrite</span></span><div class="brief">
+ Indicates if the characteristic supports write with the signature.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTCharacteristic::isWritable">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isWritable</span></span><div class="brief">
+ Indicates if the characteristic is writable.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+<li class="attribute" id="BluetoothGATTCharacteristic::isWriteNoResponse">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isWriteNoResponse</span></span><div class="brief">
+ Indicates if the characteristic supports writing without response.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</li>
+</ul>
+</div>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="BluetoothGATTCharacteristic::readValue">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothGATTCharacteristic::readValue"></a><code><b><span class="methodName">readValue</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Reads the characteristic value from the remote device. Updates characteristic value attribute.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void readValue(<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The ErrorCallback is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ UnknownError - If any other error occurs </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ Callback function that is called when the characteristic value is read successfully
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called in case of failure
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type InvalidStateError, if device is currently not connected
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onerror(e) {
+ console.log("Failed to connect to device: " + e.message);
+ }
+
+ function proccessDevice(device) {
+ function onConnected() {
+ var service = device.getService("5BCE9431-6C75-32AB-AFE0-2EC108A30860");
+ if (service.characteristics.length > 0) {
+ var characteristic = service.characteristics[0];
+ characteristic.readValue(function onread(val) {
+ console.log("Value read: " + val);
+ device.disconnect();
+ });
+ }
+ }
+ device.connect(onConnected, onerror);
+ }
+
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ adapter.stopScan();
+ proccessDevice(device);
+ }
+ }
+ });
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothGATTCharacteristic::writeValue">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothGATTCharacteristic::writeValue"></a><code><b><span class="methodName">writeValue</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Writes the characteristic value to the remote device.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void writeValue(byte[] value, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The ErrorCallback is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ UnknownError - If any other error occurs </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">value</span>:
+ the characteristic value to write
+ </li>
+ <li class="param">
+<span class="name">successCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called when the characteristic value is written successfully
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called in case of failure
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type InvalidStateError, if device is currently not connected
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onerror(e) {
+ console.log("Failed to connect to device: " + e.message);
+ }
+
+ function proccessDevice(device) {
+ function onConnected() {
+ var service = device.getService("5BCE9431-6C75-32AB-AFE0-2EC108A30860");
+ if (service.characteristics.length > 0) {
+ var characteristic = service.characteristics[0];
+ var data = new Array(1, 2, 3, 4, 5, 6);
+ characteristic.writeValue(data, function() {
+ console.log("Value written");
+ device.disconnect();
+ }, function(e) {
+ console.log("Failed to write: " + e.message);
+ });
+ }
+ }
+ device.connect(onConnected, onerror);
+ }
+
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ adapter.stopScan();
+ proccessDevice(device);
+ }
+ }
+ });
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothGATTCharacteristic::addValueChangeListener">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothGATTCharacteristic::addValueChangeListener"></a><code><b><span class="methodName">addValueChangeListener</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Registers a callback to be called when characteristic value of the characteristic changes.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">long addValueChangeListener(<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> callback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">callback</span>:
+ Listener function that is called when the connection state changes
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ long The watchID to be used to unregister the listener
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function proccessDevice(device) {
+
+ function onConnected() {
+ var service = device.getService("5BCE9431-6C75-32AB-AFE0-2EC108A30860");
+ if (service.characteristics.length > 0) {
+ var characteristic = service.characteristics[0];
+ var watchID;
+
+ watchID = characteristic.addValueChangeListener(function(value) {
+ console.log("Characteristic value changed: " + value);
+ characteristic.removeValueChangeListener(watchID);
+ device.disconnect();
+ });
+ }
+ }
+
+ device.connect(onConnected);
+ }
+
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ adapter.stopScan();
+ proccessDevice(device);
+ }
+ }
+ });
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothGATTCharacteristic::removeValueChangeListener">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothGATTCharacteristic::removeValueChangeListener"></a><code><b><span class="methodName">removeValueChangeListener</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Unregisters a characteristic value change listener
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void removeValueChangeListener(long watchID);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">watchID</span>:
+ The watchID identifier returned by the addValueChangeListener() method.
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="interface" id="BluetoothGATTDescriptor">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothGATTDescriptor"></a><h3>2.11. BluetoothGATTDescriptor</h3>
+<div class="brief">
+ Bluetooth Low Energy Descriptor.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface BluetoothGATTDescriptor {
+ void readValue(<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void writeValue(byte[] value, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="BluetoothGATTDescriptor::readValue">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothGATTDescriptor::readValue"></a><code><b><span class="methodName">readValue</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Reads descriptor value from remote device. Updates descriptor value attribute.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void readValue(<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The ErrorCallback is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ UnknownError - If any other error occurs </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ Callback function that is called when the descriptor value is read successfully
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called in case of failure
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type InvalidStateError, if device is currently not connected
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onerror(e) {
+ console.log("Failed to connect to device: " + e.message);
+ }
+
+ function proccessDevice(device) {
+ function onConnected() {
+ var service = device.getService("5BCE9431-6C75-32AB-AFE0-2EC108A30860");
+ if (service.characteristics.length > 0) {
+ var characteristic = service.characteristics[0];
+ var descriptor = characteristic.descriptors[0];
+ descriptor.readValue(function onread(value) {
+ console.log("Value read: " + value);
+ device.disconnect();
+ });
+ }
+ }
+ device.connect(onConnected, onerror);
+ }
+
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ adapter.stopScan();
+ proccessDevice(device);
+ }
+ }
+ });
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothGATTDescriptor::writeValue">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothGATTDescriptor::writeValue"></a><code><b><span class="methodName">writeValue</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Writes the descriptor value to the remote device.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void writeValue(byte[] value, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The ErrorCallback is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ UnknownError - If any other error occurs </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">value</span>:
+ the descriptor value to write
+ </li>
+ <li class="param">
+<span class="name">successCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called when the descriptor value is written successfully
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called in case of failure
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type InvalidStateError, if device is currently not connected
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onerror(e) {
+ console.log("Failed to connect to device: " + e.message);
+ }
+
+ function proccessDevice(device) {
+ function onConnected() {
+ var service = device.getService("5BCE9431-6C75-32AB-AFE0-2EC108A30860");
+ if (service.characteristics.length > 0) {
+ var characteristic = service.characteristics[0];
+ var data = new Array(1, 2, 3, 4, 5, 6);
+ var descriptor = characteristic.descriptors[0];
+ descriptor.writeValue(data, function() {
+ console.log("Value written");
+ device.disconnect();
+ }, function(e) {
+ console.log("Failed to write: " + e.message);
+ });
+ }
+ }
+ device.connect(onConnected, onerror);
+ }
+
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ adapter.stopScan();
+ proccessDevice(device);
+ }
+ }
+ });
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="interface" id="BluetoothLEScanCallback">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEScanCallback"></a><h3>2.12. BluetoothLEScanCallback</h3>
+<div class="brief">
+ Bluetooth scanning process interface that defines the success callback for <em>BluetoothLEAdapter.startScan()</em> </div>
+<pre class="webidl prettyprint"> [Callback, NoInterfaceObject] interface BluetoothLEScanCallback {
+ void onstarted();
+ void ondevicefound(<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device);
+ void onfinished(<a href="#BluetoothLEDevice">BluetoothLEDevice</a>[] foundDevices);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="BluetoothLEScanCallback::onstarted">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEScanCallback::onstarted"></a><code><b><span class="methodName">onstarted</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called at the beginning of a device discovery process for finding the nearby Bluetooth LE device.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onstarted();
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+</dd>
+<dt class="method" id="BluetoothLEScanCallback::ondevicefound">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEScanCallback::ondevicefound"></a><code><b><span class="methodName">ondevicefound</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called when a new device is discovered in the process of scanning.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void ondevicefound(<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">device</span>:
+ Device that is found
+ </li>
+ </ul>
+</div>
+</dd>
+<dt class="method" id="BluetoothLEScanCallback::onfinished">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEScanCallback::onfinished"></a><code><b><span class="methodName">onfinished</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called when the device scanning process has finished.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onfinished(<a href="#BluetoothLEDevice">BluetoothLEDevice</a>[] foundDevices);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">foundDevices</span>:
+ Array of devices found in this discovery session
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="interface" id="BluetoothLEAdvertiseCallback">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEAdvertiseCallback"></a><h3>2.13. BluetoothLEAdvertiseCallback</h3>
+<div class="brief">
+ Bluetooth advertising process interface that defines the success callback for <em>BluetoothLEAdapter.startAdvertise()</em> </div>
+<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothLEAdvertiseCallback {
+ void onstate(<a href="#BluetoothAdvertisingState">BluetoothAdvertisingState</a> state);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="BluetoothLEAdvertiseCallback::onstate">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEAdvertiseCallback::onstate"></a><code><b><span class="methodName">onstate</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called when the advertising state is changed.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onstate(<a href="#BluetoothAdvertisingState">BluetoothAdvertisingState</a> state);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">state</span>:
+ State that is Advertising process
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="interface" id="BluetoothLEConnectChangeCallback">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEConnectChangeCallback"></a><h3>2.14. BluetoothLEConnectChangeCallback</h3>
+<div class="brief">
+ Bluetooth LE connecting process interface that defines callbacks for getting notified about changes of connect to a specific LE based service on a remote Bluetooth LE device.
+ </div>
+<pre class="webidl prettyprint"> [Callback, NoInterfaceObject] interface BluetoothLEConnectChangeCallback {
+ void onconnected(<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device);
+ void ondisconnected(<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="BluetoothLEConnectChangeCallback::onconnected">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEConnectChangeCallback::onconnected"></a><code><b><span class="methodName">onconnected</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called at the beginning of connect to a specific LE based service on a remote Bluetooth LE device.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onconnected(<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param"><span class="name">device</span></li>
+ </ul>
+</div>
+</dd>
+<dt class="method" id="BluetoothLEConnectChangeCallback::ondisconnected">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEConnectChangeCallback::ondisconnected"></a><code><b><span class="methodName">ondisconnected</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called at the beginning of disconnect to a specific LE based service on a remote Bluetooth LE device.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void ondisconnected(<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param"><span class="name">device</span></li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="interface" id="ReadValueSuccessCallback">
+<a class="backward-compatibility-anchor" name="::Bluetooth::ReadValueSuccessCallback"></a><h3>2.15. ReadValueSuccessCallback</h3>
+<div class="brief">
+ The ReadValueSuccessCallback interface implements the callback for
+<a href="#BluetoothGATTCharacteristic::readValue">BluetoothGATTCharacteristic.readValue()</a> and
+<a href="#BluetoothGATTDescriptor::readValue">BluetoothGATTDescriptor.readValue()</a> methods.
+ </div>
+<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface ReadValueSuccessCallback {
+ void onread(byte[] value);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="ReadValueSuccessCallback::onread">
+<a class="backward-compatibility-anchor" name="::Bluetooth::ReadValueSuccessCallback::onread"></a><code><b><span class="methodName">onread</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called when a characteristic value has been read.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onread(byte[] value);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">value</span>:
+ Read characteristic value
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="interface" id="BluetoothDevice">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDevice"></a><h3>2.16. BluetoothDevice</h3>
+<div class="brief">
+ The BluetoothDevice interface represents a remote Bluetooth device.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface BluetoothDevice {
+ readonly attribute DOMString name;
+ readonly attribute <a href="#BluetoothAddress">BluetoothAddress</a> address;
readonly attribute <a href="#BluetoothClass">BluetoothClass</a> deviceClass;
readonly attribute boolean isBonded;
readonly attribute boolean isTrusted;
readonly attribute boolean isConnected;
readonly attribute <a href="#BluetoothUUID">BluetoothUUID</a>[] uuids;
- void connectToServiceByUUID(<a href="#BluetoothUUID">BluetoothUUID</a> uuid,
- <a href="#BluetoothSocketSuccessCallback">BluetoothSocketSuccessCallback</a> successCallback,
- optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void connectToServiceByUUID(<a href="#BluetoothUUID">BluetoothUUID</a> uuid,
+ <a href="#BluetoothSocketSuccessCallback">BluetoothSocketSuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="description">
+ <p>
+A <em>BluetoothDevice</em> object can be retrieved using one of the following APIs:
+ </p>
+ <ul>
+ <li>
+ BluetoothAdapter.getDevice() </li>
+ <li>
+ BluetoothAdapter.getKnownDevices() </li>
+ <li>
+ BluetoothAdapter.discoverDevices() </li>
+ <li>
+ BluetoothAdapter.createBonding() </li>
+ </ul>
+ </div>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="BluetoothDevice::name">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">DOMString </span><span class="name">name</span></span><div class="brief">
+ The readable name of this remote device.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
+ adapter.getDevice("11:22:33:44:55:66", function(device) {
+ console.log("Device Name: " + device.name);
+ });
+ </pre>
+</div>
+</li>
+<li class="attribute" id="BluetoothDevice::address">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">BluetoothAddress </span><span class="name">address</span></span><div class="brief">
+ The hardware address of this remote device.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
+ adapter.getDevice("11:22:33:44:55:66", function(device) {
+ console.log("Device Address: " + device.address);
+ });
+ </pre>
+</div>
+</li>
+<li class="attribute" id="BluetoothDevice::deviceClass">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">BluetoothClass </span><span class="name">deviceClass</span></span><div class="brief">
+ The device class, which represents the type of the device and the services it provides.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
+ adapter.getDevice("11:22:33:44:55:66", function(device) {
+ console.log("Device Major Class: " + device.deviceClass.major);
+ });
+ </pre>
+</div>
+</li>
+<li class="attribute" id="BluetoothDevice::isBonded">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isBonded</span></span><div class="brief">
+ The bond state of this remote device with the local device.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
+ adapter.getDevice("11:22:33:44:55:66", function(device) {
+ console.log("Is bonded: " + (device.isBonded ? "Yes" : "No"));
+ });
+ </pre>
+</div>
+</li>
+<li class="attribute" id="BluetoothDevice::isTrusted">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isTrusted</span></span><div class="brief">
+ The flag indicating whether the local device recognizes this remote device as a trusted device or not.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
+ adapter.getDevice("11:22:33:44:55:66", function(device) {
+ console.log("Is trusted: " + (device.isTrusted ? "Yes" : "No"));
+ });
+ </pre>
+</div>
+</li>
+<li class="attribute" id="BluetoothDevice::isConnected">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">boolean </span><span class="name">isConnected</span></span><div class="brief">
+ The flag indicating whether the connection state of this remote device with the local device.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
+ adapter.getDevice("11:22:33:44:55:66", function(device) {
+ console.log("Is connected: " + (device.isConnected ? "Yes" : "No"));
+ });
+ </pre>
+</div>
+</li>
+<li class="attribute" id="BluetoothDevice::uuids">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">BluetoothUUID[]
+ </span><span class="name">uuids</span></span><div class="brief">
+ The list of 128 bit service UUIDs available on this remote device.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
+ var CHAT_SERVICE_UUID = "5BCE9431-6C75-32AB-AFE0-2EC108A30860";
+ adapter.getDevice("11:22:33:44:55:66", function(device) {
+ var uuids = device.uuids;
+ var services = "";
+ for (var i = 0; i < uuids.length; i++) {
+ services += uuids[i] + "<br>";
+ }
+ console.log ("Services found: " + services);
+ if (uuids.indexOf(CHAT_SERVICE_UUID) != -1) {
+ // Connects to service
+ device.connectToServiceByUUID(CHAT_SERVICE_UUID, function(socket) {
+ //
+ // Connected to service, handle socket
+ //
+ }, function (e) {
+ console.log("Could not connect to chat service !!!. Error: " + e.message);
+ });
+ }
+ });
+ </pre>
+</div>
+</li>
+</ul>
+</div>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="BluetoothDevice::connectToServiceByUUID">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDevice::connectToServiceByUUID"></a><code><b><span class="methodName">connectToServiceByUUID</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Connects to a specified service identified by <em>uuid</em> on this remote device.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void connectToServiceByUUID(<a href="#BluetoothUUID">BluetoothUUID</a> uuid, <a href="#BluetoothSocketSuccessCallback">BluetoothSocketSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 1.0
+ </p>
+<div class="description">
+ <p>
+If opening a connection is successful, then a <em>BluetoothSocket</em> object with open state is sent using <em>successCallback</em>, through which data can be exchanged by both devices.
+ </p>
+ <p>
+The ErrorCallback is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ NotFoundError - If there is no service with the specified <em>uuid</em> </li>
+ <li>
+ InvalidValuesError - If any of the input parameters contain an invalid value </li>
+ <li>
+ UnknownError - If any other error occurs </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth.spp
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">uuid</span>:
+ 128 bit unique identifier, which specifies the service on the remote device
+ </li>
+ <li class="param">
+<span class="name">successCallback</span>:
+ Callback function that is called when an asynchronous call completes successfully
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called when opening of a socket fails
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
+ var clientSocket = null;
+
+ // Calls a method that is invoked when user wants to send a message to a remote device.
+ function sendMessage(msg) {
+ // Validates socket state, if everything is ok.
+ if (clientSocket != null && clientSocket.state == "OPEN") {
+ // Sends the message.
+ clientSocket.writeData(msg);
+ }
+ }
+
+ // Calls a method that is invoked when a socket is open.
+ function onSocketConnected(socket) {
+ clientSocket = socket;
+ console.log("Opening a socket successfully!!!");
+ socket.onmessage = function () {
+ var data = socket.readData();
+ var recvmsg = "";
+ for (var i = 0; i < data.length; i++)
+ {
+ recvmsg += String.fromCharCode(data[i]);
+ }
+ console.log("server msg >> " + recvmsg);
+ };
+
+ socket.onclose = function() {
+ console.log("socket disconnected.");
+ };
+ }
+
+ function onDeviceReady(device) {
+ // Validates device and service uuid
+ if (device.uuids.indexOf("5BCE9431-6C75-32AB-AFE0-2EC108A30860") != -1) {
+ // Opens socket
+ device.connectToServiceByUUID("5BCE9431-6C75-32AB-AFE0-2EC108A30860", onSocketConnected, function(e) {
+ console.log ("Error connecting to service. Reason: " + e.message);
+ });
+ }
+ else {
+ console.log ("Chat service is not supported by this device");
+ }
+ }
+
+ function onSetPowered() {
+ // Gets the BluetoothDevice object.
+ adapter.getDevice("35:F4:59:D1:7A:03", onDeviceReady, function(e) { console.log("Error: " + e.message); });
+ }
+
+ adapter.setPowered(true, onSetPowered, function(e) {console.log ("Could not turn on Bluetooth adapter. reason: " + e.message); });
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="interface" id="BluetoothLEDevice">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEDevice"></a><h3>2.17. BluetoothLEDevice</h3>
+<div class="brief">
+ The BluetoothLEDevice interface represents a remote Bluetooth LE device.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface BluetoothLEDevice {
+ readonly attribute <a href="#BluetoothAddress">BluetoothAddress</a> address;
+ readonly attribute DOMString? name;
+ readonly attribute unsigned long? txpowerlevel;
+ readonly attribute unsigned long? appearance;
+ readonly attribute <a href="#BluetoothUUID">BluetoothUUID</a>[]? uuids;
+ readonly attribute <a href="#BluetoothLESolicitationUUID">BluetoothLESolicitationUUID</a>[]? solicitationuuids;
+ readonly attribute <a href="#BluetoothLEServiceData">BluetoothLEServiceData</a>[]? serviceData;
+ readonly attribute <a href="#BluetoothLEManufacturerData">BluetoothLEManufacturerData</a>? manufacturerData;
+
+ void connect(optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void disconnect(optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#BluetoothGATTService">BluetoothGATTService</a> getService(<a href="#BluetoothUUID">BluetoothUUID</a> uuid) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ long addConnectStateChangeListener(<a href="#BluetoothLEConnectChangeCallback">BluetoothLEConnectChangeCallback</a> listener) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void removeConnectStateChangeListener(long watchID);
};</pre>
<p><span class="version">
Since: </span>
- 1.0
+ 2.3.1
</p>
<div class="description">
<p>
-A <em>BluetoothDevice</em> object can be retrieved using one of the following APIs:
+A <em>BluetoothLEDevice</em> object can be retrieved by using one of the following APIs:
</p>
<ul>
<li>
- BluetoothAdapter.getDevice() </li>
- <li>
- BluetoothAdapter.getKnownDevices() </li>
- <li>
- BluetoothAdapter.discoverDevices() </li>
- <li>
- BluetoothAdapter.createBonding() </li>
+ BluetoothLEAdapter.startScan() </li>
</ul>
</div>
<div class="attributes">
<h4>Attributes</h4>
<ul>
-<li class="attribute" id="BluetoothDevice::name">
+<li class="attribute" id="BluetoothLEDevice::address">
<span class="attrName"><span class="readonly"> readonly
-</span><span class="type">DOMString </span><span class="name">name</span></span><div class="brief">
- The readable name of this remote device.
+</span><span class="type">BluetoothAddress </span><span class="name">address</span></span><div class="brief">
+ The address of the Bluetooth LE device from the scan result information.
</div>
<p><span class="version">
Since: </span>
- 1.0
+ 2.3.1
</p>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
- adapter.getDevice("11:22:33:44:55:66", function(device) {
- console.log("Device Name: " + device.name);
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ ondevicefound: function(device) {
+ console.log("Found device: " + device.address);
+ }
});
</pre>
</div>
</li>
-<li class="attribute" id="BluetoothDevice::address">
+<li class="attribute" id="BluetoothLEDevice::name">
<span class="attrName"><span class="readonly"> readonly
-</span><span class="type">BluetoothAddress </span><span class="name">address</span></span><div class="brief">
- The hardware address of this remote device.
+</span><span class="type">DOMString </span><span class="name">name</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The name of the Bluetooth LE device from the scan result information.
</div>
<p><span class="version">
Since: </span>
- 1.0
+ 2.3.1
</p>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
- adapter.getDevice("11:22:33:44:55:66", function(device) {
- console.log("Device Address: " + device.address);
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ ondevicefound: function(device) {
+ console.log("Found device: " + device.name);
+ }
});
</pre>
</div>
</li>
-<li class="attribute" id="BluetoothDevice::deviceClass">
+<li class="attribute" id="BluetoothLEDevice::txpowerlevel">
<span class="attrName"><span class="readonly"> readonly
-</span><span class="type">BluetoothClass </span><span class="name">deviceClass</span></span><div class="brief">
- The device class, which represents the type of the device and the services it provides.
+</span><span class="type">unsigned long </span><span class="name">txpowerlevel</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The transmission power level of the Bluetooth LE device from the scan result information.
</div>
<p><span class="version">
Since: </span>
- 1.0
+ 2.3.1
</p>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
- adapter.getDevice("11:22:33:44:55:66", function(device) {
- console.log("Device Major Class: " + device.deviceClass.major);
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ ondevicefound: function(device) {
+ console.log("Found device: " + device.txpowerlevel);
+ }
});
</pre>
</div>
</li>
-<li class="attribute" id="BluetoothDevice::isBonded">
+<li class="attribute" id="BluetoothLEDevice::appearance">
<span class="attrName"><span class="readonly"> readonly
-</span><span class="type">boolean </span><span class="name">isBonded</span></span><div class="brief">
- The bond state of this remote device with the local device.
+</span><span class="type">unsigned long </span><span class="name">appearance</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The appearance of the Bluetooth LE device from the scan result information.
</div>
<p><span class="version">
Since: </span>
- 1.0
+ 2.3.1
</p>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
- adapter.getDevice("11:22:33:44:55:66", function(device) {
- console.log("Is bonded: " + (device.isBonded ? "Yes" : "No"));
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ ondevicefound: function(device) {
+ console.log("Found device: " + device.appearance);
+ }
});
</pre>
</div>
</li>
-<li class="attribute" id="BluetoothDevice::isTrusted">
+<li class="attribute" id="BluetoothLEDevice::uuids">
<span class="attrName"><span class="readonly"> readonly
-</span><span class="type">boolean </span><span class="name">isTrusted</span></span><div class="brief">
- The flag indicating whether the local device recognizes this remote device as a trusted device or not.
+</span><span class="type">BluetoothUUID[]
+ </span><span class="name">uuids</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The list of 128 bit service UUIDs available on this remote device.
</div>
<p><span class="version">
Since: </span>
- 1.0
+ 2.3.1
</p>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
- adapter.getDevice("11:22:33:44:55:66", function(device) {
- console.log("Is trusted: " + (device.isTrusted ? "Yes" : "No"));
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ var uuids = device.uuids;
+ var services = "";
+ for (var i = 0; i < uuids.length; i++) {
+ services += uuids[i] + "\n";
+ }
+ console.log ("Service found: " + services);
+ },
+ onfinished: function(devices) {
+ console.log("Found devices: " + devices.length);
+ }
});
</pre>
</div>
</li>
-<li class="attribute" id="BluetoothDevice::isConnected">
+<li class="attribute" id="BluetoothLEDevice::solicitationuuids">
<span class="attrName"><span class="readonly"> readonly
-</span><span class="type">boolean </span><span class="name">isConnected</span></span><div class="brief">
- The flag indicating whether the connection state of this remote device with the local device.
+</span><span class="type">BluetoothLESolicitationUUID[]
+ </span><span class="name">solicitationuuids</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The list of service solicitation UUIDs available on Bluetooth LE device from the scan result information.
</div>
<p><span class="version">
Since: </span>
- 1.0
+ 2.3.1
</p>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
- adapter.getDevice("11:22:33:44:55:66", function(device) {
- console.log("Is connected: " + (device.isConnected ? "Yes" : "No"));
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ var uuids = device.solicitationuuids;
+ var services = "";
+ for (var i = 0; i < uuids.length; i++) {
+ services += uuids[i] + "\n";
+ }
+ console.log ("Service solicitations found: " + services);
+ },
+ onfinished: function(devices) {
+ console.log("Found devices: " + devices.length);
+ }
});
</pre>
</div>
</li>
-<li class="attribute" id="BluetoothDevice::uuids">
+<li class="attribute" id="BluetoothLEDevice::serviceData">
<span class="attrName"><span class="readonly"> readonly
-</span><span class="type">BluetoothUUID[]
- </span><span class="name">uuids</span></span><div class="brief">
- The list of 128 bit service UUIDs available on this remote device.
+</span><span class="type">BluetoothLEServiceData[]
+ </span><span class="name">serviceData</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The list of service data available on Bluetooth LE device from the scan result information.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ var serviceData = device.serviceData;
+ var data = "";
+ for (var i = 0; i < serviceData.length; i++) {
+ data += serviceData[i].id + serviceData[i].data + "\n";
+ }
+ console.log ("Service data found: " + data);
+ },
+ onfinished: function(devices) {
+ console.log("Found devices: " + devices.length);
+ }
+ });
+ </pre>
+</div>
+</li>
+<li class="attribute" id="BluetoothLEDevice::manufacturerData">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">BluetoothLEManufacturerData </span><span class="name">manufacturerData</span><span class="optional"> [nullable]</span></span><div class="brief">
+ The manufacturer data from the scan result information.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ onstarted: function() {
+ console.log("Scan started");
+ },
+ ondevicefound: function(device) {
+ var manufacturerData = device.manufacturerData;
+ console.log ("Manufacture id: " + manufacturerData.id);
+ console.log ("Manufacture data: " + manufacturerData.data);
+ },
+ onfinished: function(devices) {
+ console.log("Found devices: " + devices.length);
+ }
+ });
+ </pre>
+</div>
+</li>
+</ul>
+</div>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="BluetoothLEDevice::connect">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEDevice::connect"></a><code><b><span class="methodName">connect</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Establishes Low Energy connection to the device.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void connect(optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+Connection is required to <em>readValue()</em> and <em>writeValue()</em> from the remote device.
+ </p>
+ <p>
+The ErrorCallback is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ UnknownError - If any other error occurs </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called when the connection is established successfully
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called in case of failure
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onerror(e) {
+ console.log("Failed to connect to device: " + e.message);
+ }
+
+ function onconnected() {
+ console.log("Connected to device");
+ }
+
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ ondevicefound: function(device) {
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ device.connect(onconnected, onerror);
+ }
+ }
+ });
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothLEDevice::disconnect">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEDevice::disconnect"></a><code><b><span class="methodName">disconnect</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Disconnects from the device.
</div>
+<div class="synopsis"><pre class="signature prettyprint">void disconnect(optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+ </pre></div>
<p><span class="version">
Since: </span>
- 1.0
+ 2.3.1
+ </p>
+<div class="description">
+ <p>
+The ErrorCallback is launched with these error types:
+ </p>
+ <ul>
+ <li>
+ UnknownError - If any other error occurs </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/bluetooth
</p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called when the connection is finished successfully
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ Callback function that is called in case of failure
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+<li class="list"><p>
+ with error type InvalidStateError, if device is currently not connected
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
- var CHAT_SERVICE_UUID = "5BCE9431-6C75-32AB-AFE0-2EC108A30860";
- adapter.getDevice("11:22:33:44:55:66", function(device) {
- var uuids = device.uuids;
- var services = "";
- for (var i = 0; i < uuids.length; i++) {
- services += uuids[i] + "\n";
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onerror(e) {
+ console.log("Error occured: " + e.message);
+ }
+
+ function onDeviceFound(device) {
+ function ondisconnect() {
+ console.log("Disconnected");
}
- console.log ("Services found: " + services);
- if (uuids.indexOf(CHAT_SERVICE_UUID) != -1) {
- // Connects to service
- device.connectToServiceByUUID(CHAT_SERVICE_UUID, function(socket) {
- //
- // Connected to service, handle socket
- //
- }, function (e) {
- console.log("Could not connect to chat service !!!. Error: " + e.message);
- });
+
+ function onconnected() {
+ console.log("Connected to device");
+ device.disconnect(ondisconnect, onerror);
}
- });
+
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ device.connect(onconnected, onerror);
+ }
+ }
+
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ ondevicefound: onDeviceFound
+ }, onerror);
</pre>
</div>
-</li>
-</ul>
-</div>
-<div class="methods">
-<h4>Methods</h4>
-<dl>
-<dt class="method" id="BluetoothDevice::connectToServiceByUUID">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDevice::connectToServiceByUUID"></a><code><b><span class="methodName">connectToServiceByUUID</span></b></code>
+</dd>
+<dt class="method" id="BluetoothLEDevice::getService">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEDevice::getService"></a><code><b><span class="methodName">getService</span></b></code>
</dt>
<dd>
<div class="brief">
- Connects to a specified service identified by <em>uuid</em> on this remote device.
+ Retrieves a service from the device for the given UUID.
</div>
-<div class="synopsis"><pre class="signature prettyprint">void connectToServiceByUUID(<a href="#BluetoothUUID">BluetoothUUID</a> uuid, <a href="#BluetoothSocketSuccessCallback">BluetoothSocketSuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+<div class="synopsis"><pre class="signature prettyprint"><a href="#BluetoothGATTService">BluetoothGATTService</a> getService(<a href="#BluetoothUUID">BluetoothUUID</a> uuid);
</pre></div>
<p><span class="version">
Since: </span>
- 1.0
+ 2.3.1
</p>
<div class="description">
<p>
-If opening a connection is successful, then a <em>BluetoothSocket</em> object with open state is sent using <em>successCallback</em>, through which data can be exchanged by both devices.
- </p>
- <p>
The ErrorCallback is launched with these error types:
</p>
<ul>
<li>
- NotFoundError - If there is no service with the specified <em>uuid</em> </li>
- <li>
- InvalidValuesError - If any of the input parameters contain an invalid value </li>
- <li>
UnknownError - If any other error occurs </li>
</ul>
</div>
</p>
<p><span class="privilege">
Privilege: </span>
- http://tizen.org/privilege/bluetooth.spp
+ http://tizen.org/privilege/bluetooth
</p>
<div class="parameters">
<p><span class="param">Parameters:</span></p>
<ul>
<li class="param">
<span class="name">uuid</span>:
- 128 bit unique identifier, which specifies the service on the remote device
- </li>
- <li class="param">
-<span class="name">successCallback</span>:
- Callback function that is called when an asynchronous call completes successfully
- </li>
- <li class="param">
-<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
- Callback function that is called when opening of a socket fails
+ UUID of the service
</li>
</ul>
</div>
<p><span class="except">Exceptions:</span></p>
<ul class="exception"><li>WebAPIException<ul>
<li class="list"><p>
- with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter
+ with error type NotFoundError, if there is no service with the given UUID.
</p></li>
<li class="list"><p>
with error type SecurityError, if the application does not have the privilege to call this method.
</p></li>
+<li class="list"><p>
+ with error type InvalidStateError, if the GATT service is not available.
+ </p></li>
+<li class="list"><p>
+ with error type UnknownError, if any other error occurs.
+ </p></li>
</ul>
</li></ul>
</div>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var adapter = tizen.bluetooth.getDefaultAdapter();
- var clientSocket = null;
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onconnected(device) {
+ console.log("Connected to device");
+ var service = device.getService(device.uuids[0]);
+ console.log("Service got");
+ }
- // Calls a method that is invoked when user wants to send a message to a remote device.
- function sendMessage(msg) {
- // Validates socket state, if everything is ok.
- if (clientSocket != null && clientSocket.state == "OPEN") {
- // Sends the message.
- clientSocket.writeData(msg);
- }
+ function onerror(e) {
+ console.log("Error occured: " + e.message);
}
- // Calls a method that is invoked when a socket is open.
- function onSocketConnected(socket) {
- clientSocket = socket;
- console.log("Opening a socket successfully!!!");
- socket.onmessage = function () {
- var data = socket.readData();
- var recvmsg = "";
- for (var i = 0; i < data.length; i++)
- {
- recvmsg += String.fromCharCode(data[i]);
- }
- console.log("server msg >> " + recvmsg);
- };
+ function onDeviceFound(device) {
+ if (device.address == "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ device.connect(onconnected.bind(null, device), onerror);
+ }
+ }
- socket.onclose = function() {
- console.log("socket disconnected.");
- };
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ ondevicefound: onDeviceFound
+ }, onerror);
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothLEDevice::addConnectStateChangeListener">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEDevice::addConnectStateChangeListener"></a><code><b><span class="methodName">addConnectStateChangeListener</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Registers a listener to be called when the device connects or disconnects.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">long addConnectStateChangeListener(<a href="#BluetoothLEConnectChangeCallback">BluetoothLEConnectChangeCallback</a> listener);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">listener</span>:
+ Listener functions that are called when the connection state changes
+ </li>
+ </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ long The watchID to be used to unregister the listener
+ </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul><li class="list"><p>
+ with error type UnknownError, if any other error occurs.
+ </p></li></ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onerror(e) {
+ console.log("Error occured: " + e.message);
}
- function onDeviceReady(device) {
- // Validates device and service uuid
- if (device.uuids.indexOf("5BCE9431-6C75-32AB-AFE0-2EC108A30860") != -1) {
- // Opens socket
- device.connectToServiceByUUID("5BCE9431-6C75-32AB-AFE0-2EC108A30860", onSocketConnected, function(e) {
- console.log ("Error connecting to service. Reason: " + e.message);
- });
+ function onDeviceFound(device) {
+ var onConnectionStateChange = {
+ onconnected: function(device) {
+ console.log("Device " + device.name + " connected");
+ },
+ ondisconnected: function(device) {
+ console.log("Device " + device.name + " disconnected");
+ }
}
- else {
- console.log ("Chat service is not supported by this device");
+
+ if (device.address === "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ device.addConnectStateChangeListener(onConnectionStateChange);
+ device.connect();
}
}
- function onSetPowered() {
- // Gets the BluetoothDevice object.
- adapter.getDevice("35:F4:59:D1:7A:03", onDeviceReady, function(e) { console.log("Error: " + e.message); });
+ var adapter = tizen.bluetooth.getLEAdapter();
+ adapter.startScan({
+ ondevicefound: onDeviceFound
+ }, onerror);
+ </pre>
+</div>
+</dd>
+<dt class="method" id="BluetoothLEDevice::removeConnectStateChangeListener">
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothLEDevice::removeConnectStateChangeListener"></a><code><b><span class="methodName">removeConnectStateChangeListener</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Unregisters a Bluetooth device connection listener
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void removeConnectStateChangeListener(long watchID);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 2.3.1
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">watchID</span>:
+ The watchID identifier returned by the addConnectStateChangeListener() method.
+ </li>
+ </ul>
+</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> function onerror(e) {
+ console.log("Error occured: " + e.message);
}
- adapter.setPowered(true, onSetPowered, function(e) {console.log ("Could not turn on Bluetooth adapter. reason: " + e.message); });
+ function onDeviceFound(device) {
+ var onConnectionStateChange = {
+ onconnected: function(device) {
+ console.log("Device " + device.name + " connected");
+ },
+ ondisconnected: function(device) {
+ console.log("Device " + device.name + " disconnected");
+ device.removeConnectStateChangeListener(listenerID);
+ }
+ }
+
+ if (device.address === "11:22:33:44:55:66") {
+ console.log("Found device: " + device.name);
+ listenerID = device.addConnectStateChangeListener(onConnectionStateChange);
+ device.connect();
+ }
+ }
+
+ var adapter = tizen.bluetooth.getLEAdapter();
+ var listenerID = null;
+ adapter.startScan({
+ ondevicefound: onDeviceFound
+ }, onerror);
</pre>
</div>
</dd>
</div>
</div>
<div class="interface" id="BluetoothSocket">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothSocket"></a><h3>2.5. BluetoothSocket</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothSocket"></a><h3>2.18. BluetoothSocket</h3>
<div class="brief">
The BluetoothSocket interface represents the Bluetooth socket.
</div>
</div>
</div>
<div class="interface" id="BluetoothClass">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothClass"></a><h3>2.6. BluetoothClass</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothClass"></a><h3>2.19. BluetoothClass</h3>
<div class="brief">
The BluetoothClass interface represents Bluetooth Class of Device/Service(CoD).
</div>
</div>
</div>
<div class="interface" id="BluetoothClassDeviceMajor">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothClassDeviceMajor"></a><h3>2.7. BluetoothClassDeviceMajor</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothClassDeviceMajor"></a><h3>2.20. BluetoothClassDeviceMajor</h3>
<div class="brief">
The BluetoothClassDeviceMajor interface holds the identifiers for major device classes of Bluetooth CoD.
</div>
</p>
</div>
<div class="interface" id="BluetoothClassDeviceMinor">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothClassDeviceMinor"></a><h3>2.8. BluetoothClassDeviceMinor</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothClassDeviceMinor"></a><h3>2.21. BluetoothClassDeviceMinor</h3>
<div class="brief">
The BluetoothClassDeviceMinor interface holds the identifiers for minor device classes of Bluetooth CoD.
</div>
</p>
</div>
<div class="interface" id="BluetoothClassDeviceService">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothClassDeviceService"></a><h3>2.9. BluetoothClassDeviceService</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothClassDeviceService"></a><h3>2.22. BluetoothClassDeviceService</h3>
<div class="brief">
The BluetoothClassDeviceService interface holds identifiers for the major service classes of Bluetooth CoD.
</div>
</p>
</div>
<div class="interface" id="BluetoothServiceHandler">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothServiceHandler"></a><h3>2.10. BluetoothServiceHandler</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothServiceHandler"></a><h3>2.23. BluetoothServiceHandler</h3>
<div class="brief">
The BluetoothServiceHandler interface provides methods to handle Bluetooth service.
</div>
</div>
</div>
<div class="interface" id="BluetoothProfileHandler">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothProfileHandler"></a><h3>2.11. BluetoothProfileHandler</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothProfileHandler"></a><h3>2.24. BluetoothProfileHandler</h3>
<div class="brief">
The BluetoothProfileHandler interface represents the Bluetooth profile handler.
</div>
</div>
</div>
<div class="interface" id="BluetoothHealthProfileHandler">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthProfileHandler"></a><h3>2.12. BluetoothHealthProfileHandler</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthProfileHandler"></a><h3>2.25. BluetoothHealthProfileHandler</h3>
<div class="brief">
This interface represents the handler of Bluetooth health device profile.
The BluetoothHealthProfileHandler object is created by <em>BluetoothAdapter.getBluetoothProfileHandler()</em>.
</div>
</div>
<div class="interface" id="BluetoothHealthApplication">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthApplication"></a><h3>2.13. BluetoothHealthApplication</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthApplication"></a><h3>2.26. BluetoothHealthApplication</h3>
<div class="brief">
The BluetoothHealthApplication interface represents the Bluetooth health application.
</div>
<li class="attribute" id="BluetoothHealthApplication::dataType">
<span class="attrName"><span class="readonly"> readonly
</span><span class="type">unsigned short </span><span class="name">dataType</span></span><div class="brief">
- The MDEP data type used for communication, which is referenced in the ISO/IEEE 11073-20601 spec.
+ The MDEP data type used for communication, which is referenced in the ISO/IEEE 11073-20601 spec.
</div>
<div class="description">
<p>
</div>
</div>
<div class="interface" id="BluetoothHealthChannel">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthChannel"></a><h3>2.14. BluetoothHealthChannel</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthChannel"></a><h3>2.27. BluetoothHealthChannel</h3>
<div class="brief">
The BluetoothHealthChannel interface represents the Bluetooth health channel.
</div>
</div>
</div>
<div class="interface" id="BluetoothAdapterChangeCallback">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothAdapterChangeCallback"></a><h3>2.15. BluetoothAdapterChangeCallback</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothAdapterChangeCallback"></a><h3>2.28. BluetoothAdapterChangeCallback</h3>
<div class="brief">
The BluetoothAdapterChangeCallback interface specifies a set of methods to be invoked when the changes of Bluetooth adapter occur.
</div>
</div>
</div>
<div class="interface" id="BluetoothDeviceSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDeviceSuccessCallback"></a><h3>2.16. BluetoothDeviceSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDeviceSuccessCallback"></a><h3>2.29. BluetoothDeviceSuccessCallback</h3>
<div class="brief">
- The BluetoothDeviceSuccessCallback interface implements the success callback <em>BluetoothAdapter.getDevice() </em>and <em>BluetoothAdapter.createBonding()</em>.
+ The BluetoothDeviceSuccessCallback interface implements the success callback <a href="#BluetoothAdapter::getDevice">BluetoothAdapter.getDevice()</a> and <a href="#BluetoothAdapter::createBonding">BluetoothAdapter.createBonding()</a>.
</div>
<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothDeviceSuccessCallback {
void onsuccess(<a href="#BluetoothDevice">BluetoothDevice</a> device);
</div>
</div>
<div class="interface" id="BluetoothDeviceArraySuccessCallback">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDeviceArraySuccessCallback"></a><h3>2.17. BluetoothDeviceArraySuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDeviceArraySuccessCallback"></a><h3>2.30. BluetoothDeviceArraySuccessCallback</h3>
<div class="brief">
- The BluetoothDeviceArraySuccessCallback interface that defines the success callback for <em>BluetoothAdapter.getKnownDevices()</em>.
+ The BluetoothDeviceArraySuccessCallback interface that defines the success callback for <a href="#BluetoothAdapter::getKnownDevices">BluetoothAdapter.getKnownDevices()</a>.
</div>
<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothDeviceArraySuccessCallback {
void onsuccess(<a href="#BluetoothDevice">BluetoothDevice</a>[] devices);
</div>
</div>
<div class="interface" id="BluetoothDiscoverDevicesSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDiscoverDevicesSuccessCallback"></a><h3>2.18. BluetoothDiscoverDevicesSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothDiscoverDevicesSuccessCallback"></a><h3>2.31. BluetoothDiscoverDevicesSuccessCallback</h3>
<div class="brief">
- The BluetoothDiscoverDevicesSuccessCallback interface that defines the success callback for <em>BluetoothAdapter.discoverDevices()</em>.
+ The BluetoothDiscoverDevicesSuccessCallback interface that defines the success callback for <a href="#BluetoothAdapter::discoverDevices">BluetoothAdapter.discoverDevices()</a>.
</div>
<pre class="webidl prettyprint"> [Callback, NoInterfaceObject] interface BluetoothDiscoverDevicesSuccessCallback {
void onstarted();
</div>
</div>
<div class="interface" id="BluetoothSocketSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothSocketSuccessCallback"></a><h3>2.19. BluetoothSocketSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothSocketSuccessCallback"></a><h3>2.32. BluetoothSocketSuccessCallback</h3>
<div class="brief">
- The BluetoothSocketSuccessCallback interface that defines the success method for <em>BluetoothDevice.connectToServiceByUUID()</em>.
+ The BluetoothSocketSuccessCallback interface that defines the success method for <a href="#BluetoothDevice::connectToServiceByUUID">BluetoothDevice.connectToServiceByUUID()</a>.
</div>
<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothSocketSuccessCallback {
void onsuccess(<a href="#BluetoothSocket">BluetoothSocket</a> socket);
</div>
</div>
<div class="interface" id="BluetoothServiceSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothServiceSuccessCallback"></a><h3>2.20. BluetoothServiceSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothServiceSuccessCallback"></a><h3>2.33. BluetoothServiceSuccessCallback</h3>
<div class="brief">
- The BluetoothServiceSuccessCallback interface implements the success callback for <em>BluetoothAdapter.registerRFCOMMServiceByUUID()</em>.
+ The BluetoothServiceSuccessCallback interface implements the success callback for <a href="#BluetoothAdapter::registerRFCOMMServiceByUUID">BluetoothAdapter.registerRFCOMMServiceByUUID()</a>.
</div>
<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothServiceSuccessCallback {
void onsuccess(<a href="#BluetoothServiceHandler">BluetoothServiceHandler</a> handler);
</div>
</div>
<div class="interface" id="BluetoothHealthApplicationSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthApplicationSuccessCallback"></a><h3>2.21. BluetoothHealthApplicationSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthApplicationSuccessCallback"></a><h3>2.34. BluetoothHealthApplicationSuccessCallback</h3>
<div class="brief">
- The BluetoothHealthApplicationSuccessCallback interface that defines the success method for <em>BluetoothHealthProfileHandler.registerSinkApplication()</em>.
+ The BluetoothHealthApplicationSuccessCallback interface that defines the success method for <a href="#BluetoothHealthProfileHandler::registerSinkApplication">BluetoothHealthProfileHandler.registerSinkApplication()</a>.
</div>
<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothHealthApplicationSuccessCallback {
void onsuccess(<a href="#BluetoothHealthApplication">BluetoothHealthApplication</a> application);
</div>
</div>
<div class="interface" id="BluetoothHealthChannelSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthChannelSuccessCallback"></a><h3>2.22. BluetoothHealthChannelSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthChannelSuccessCallback"></a><h3>2.35. BluetoothHealthChannelSuccessCallback</h3>
<div class="brief">
- The BluetoothHealthChannelSuccessCallback interface that defines the success method for <em>BluetoothHealthProfileHandler.connectToSource()</em> and the event callback for <em>BluetoothHealthApplication.onconnect</em>.
+ The BluetoothHealthChannelSuccessCallback interface that defines the success method for <a href="#BluetoothHealthProfileHandler::connectToSource">BluetoothHealthProfileHandler.connectToSource()</a> and the event callback for <a href="#BluetoothHealthApplication::onconnect">BluetoothHealthApplication.onconnect()</a>.
</div>
<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothHealthChannelSuccessCallback {
void onsuccess(<a href="#BluetoothHealthChannel">BluetoothHealthChannel</a> channel);
</div>
</div>
<div class="interface" id="BluetoothHealthChannelChangeCallback">
-<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthChannelChangeCallback"></a><h3>2.23. BluetoothHealthChannelChangeCallback</h3>
+<a class="backward-compatibility-anchor" name="::Bluetooth::BluetoothHealthChannelChangeCallback"></a><h3>2.36. BluetoothHealthChannelChangeCallback</h3>
<div class="brief">
The BluetoothHealthChannelChangeCallback interface specifies a set of methods to be invoked when the changes of heath channel occur.
</div>
</div></p>
<li class="feature">http://tizen.org/feature/network.bluetooth.health</li>
</div>
+<div class="def-api-feature">
+<p><div class="description">
+ <p>
+To guarantee that the Bluetooth Low Energy application runs on a device with Bluetooth Low Energy feature, declare the following feature requirements in the config file:
+ </p>
+ </div></p>
+<li class="feature">http://tizen.org/feature/network.bluetooth.le</li>
+</div>
<p></p>
- For more information, see <a href="../../../../../org.tizen.gettingstarted/html/details/app_filtering.htm#web">Application Filtering</a>.
+ For more information, see <a href="../../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering.</a>
</div>
<h2 id="full-webidl">4. Full WebIDL</h2>
<pre class="webidl prettyprint">module Bluetooth {
enum BluetoothHealthChannelType { "RELIABLE", "STREAMING" };
+ typedef DOMString BluetoothLESolicitationUUID;
+
+ enum BluetoothAdvertisePacketType { "ADVERTISE", "SCAN_RESPONSE" };
+
+ enum BluetoothAdvertisingState { "STARTED", "STOPPED" };
+
+ enum BluetoothAdvertisingMode { "BALANCED", "LOW_LATENCY", "LOW_ENERGY" };
+
[NoInterfaceObject] interface BluetoothManagerObject {
readonly attribute <a href="#BluetoothManager">BluetoothManager</a> bluetooth;
};
<a href="tizen.html#Tizen">Tizen</a> implements <a href="#BluetoothManagerObject">BluetoothManagerObject</a>;
+ interface BluetoothLEServiceData {
+ attribute <a href="#BluetoothUUID">BluetoothUUID</a> serviceuuid;
+ attribute DOMString data;
+ };
+
+ interface BluetoothLEManufacturerData {
+ attribute DOMString id;
+ attribute DOMString data;
+ };
+
+ dictionary BluetoothLEAdvertiseDataInit {
+ boolean? includeName;
+ <a href="#BluetoothUUID">BluetoothUUID</a>[]? serviceuuids;
+ <a href="#BluetoothLESolicitationUUID">BluetoothLESolicitationUUID</a>[]? solicitationuuids;
+ unsigned long? appearance;
+ boolean? includeTxPowerLevel;
+ <a href="#BluetoothLEServiceData">BluetoothLEServiceData</a>[]? serviceData;
+ <a href="#BluetoothLEManufacturerData">BluetoothLEManufacturerData</a>? manufacturerData;
+ };
+
+ [Constructor(optional <a href="#BluetoothLEAdvertiseDataInit">BluetoothLEAdvertiseDataInit</a>? init)]
+ interface BluetoothLEAdvertiseData {
+ attribute boolean? includeName;
+ attribute <a href="#BluetoothUUID">BluetoothUUID</a>[]? serviceuuids;
+ attribute <a href="#BluetoothLESolicitationUUID">BluetoothLESolicitationUUID</a>[]? solicitationuuids;
+ attribute unsigned long? appearance;
+ attribute boolean? includeTxPowerLevel;
+ attribute <a href="#BluetoothLEServiceData">BluetoothLEServiceData</a>[]? serviceData;
+ attribute <a href="#BluetoothLEManufacturerData">BluetoothLEManufacturerData</a>? manufacturerData;
+ };
+
[NoInterfaceObject] interface BluetoothManager {
readonly attribute <a href="#BluetoothClassDeviceMajor">BluetoothClassDeviceMajor</a> deviceMajor;
readonly attribute <a href="#BluetoothClassDeviceMinor">BluetoothClassDeviceMinor</a> deviceMinor;
readonly attribute <a href="#BluetoothClassDeviceService">BluetoothClassDeviceService</a> deviceService;
<a href="#BluetoothAdapter">BluetoothAdapter</a> getDefaultAdapter() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
- };
+ <a href="#BluetoothLEAdapter">BluetoothLEAdapter</a> getLEAdapter() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };
[NoInterfaceObject] interface BluetoothAdapter {
readonly attribute DOMString name;
<a href="#BluetoothProfileHandler">BluetoothProfileHandler</a> getBluetoothProfileHandler(<a href="#BluetoothProfileType">BluetoothProfileType</a> profileType) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};
+ [NoInterfaceObject] interface BluetoothLEAdapter {
+ void startScan(<a href="#BluetoothLEScanCallback">BluetoothLEScanCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void stopScan() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void startAdvertise(<a href="#BluetoothLEAdvertiseData">BluetoothLEAdvertiseData</a> advertiseData, <a href="#BluetoothAdvertisePacketType">BluetoothAdvertisePacketType</a> packetType, <a href="#BluetoothLEAdvertiseCallback">BluetoothLEAdvertiseCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional <a href="#BluetoothAdvertisingMode">BluetoothAdvertisingMode</a>? mode, optional boolean? connectable) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void stopAdvertise() raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };
+
+ [NoInterfaceObject] interface BluetoothGATTService {
+ readonly attribute <a href="#BluetoothUUID">BluetoothUUID</a> uuid;
+ readonly attribute <a href="#BluetoothGATTService">BluetoothGATTService</a>[] services;
+ readonly attribute <a href="#BluetoothGATTCharacteristic">BluetoothGATTCharacteristic</a>[] characteristics;
+ };
+
+ [NoInterfaceObject] interface BluetoothGATTCharacteristic {
+ readonly attribute <a href="#BluetoothGATTDescriptor">BluetoothGATTDescriptor</a>[] descriptors;
+ readonly attribute boolean isBroadcast;
+ readonly attribute boolean hasExtendedProperties;
+ readonly attribute boolean isNotify;
+ readonly attribute boolean isIndication;
+ readonly attribute boolean isReadable;
+ readonly attribute boolean isSignedWrite;
+ readonly attribute boolean isWritable;
+ readonly attribute boolean isWriteNoResponse;
+ void readValue(<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void writeValue(byte[] value, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ long addValueChangeListener(<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> callback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void removeValueChangeListener(long watchID);
+ };
+
+ [NoInterfaceObject] interface BluetoothGATTDescriptor {
+ void readValue(<a href="#ReadValueSuccessCallback">ReadValueSuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void writeValue(byte[] value, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ };
+
+ [Callback, NoInterfaceObject] interface BluetoothLEScanCallback {
+ void onstarted();
+ void ondevicefound(<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device);
+ void onfinished(<a href="#BluetoothLEDevice">BluetoothLEDevice</a>[] foundDevices);
+ };
+
+ [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothLEAdvertiseCallback {
+ void onstate(<a href="#BluetoothAdvertisingState">BluetoothAdvertisingState</a> state);
+ };
+
+ [Callback, NoInterfaceObject] interface BluetoothLEConnectChangeCallback {
+ void onconnected(<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device);
+ void ondisconnected(<a href="#BluetoothLEDevice">BluetoothLEDevice</a> device);
+ };
+
+ [Callback=FunctionOnly, NoInterfaceObject] interface ReadValueSuccessCallback {
+ void onread(byte[] value);
+ };
+
[NoInterfaceObject] interface BluetoothDevice {
readonly attribute DOMString name;
readonly attribute <a href="#BluetoothAddress">BluetoothAddress</a> address;
<a href="#BluetoothSocketSuccessCallback">BluetoothSocketSuccessCallback</a> successCallback,
optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};
+
+ [NoInterfaceObject] interface BluetoothLEDevice {
+ readonly attribute <a href="#BluetoothAddress">BluetoothAddress</a> address;
+ readonly attribute DOMString? name;
+ readonly attribute unsigned long? txpowerlevel;
+ readonly attribute unsigned long? appearance;
+ readonly attribute <a href="#BluetoothUUID">BluetoothUUID</a>[]? uuids;
+ readonly attribute <a href="#BluetoothLESolicitationUUID">BluetoothLESolicitationUUID</a>[]? solicitationuuids;
+ readonly attribute <a href="#BluetoothLEServiceData">BluetoothLEServiceData</a>[]? serviceData;
+ readonly attribute <a href="#BluetoothLEManufacturerData">BluetoothLEManufacturerData</a>? manufacturerData;
+
+ void connect(optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void disconnect(optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ <a href="#BluetoothGATTService">BluetoothGATTService</a> getService(<a href="#BluetoothUUID">BluetoothUUID</a> uuid) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ long addConnectStateChangeListener(<a href="#BluetoothLEConnectChangeCallback">BluetoothLEConnectChangeCallback</a> listener) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+ void removeConnectStateChangeListener(long watchID);
+ };
+
[NoInterfaceObject] interface BluetoothSocket {
readonly attribute <a href="#BluetoothUUID">BluetoothUUID</a> uuid;
readonly attribute <a href="#BluetoothSocketState">BluetoothSocketState</a> state;