From 7578dff07382686239c66f1c0851bad33c76ea53 Mon Sep 17 00:00:00 2001 From: Lukasz Bardeli Date: Tue, 12 May 2015 13:47:16 +0200 Subject: [PATCH] [BLE] generated html file generated from widl on commit http://168.219.209.56/gerrit/#/c/40274/ Change-Id: Ifc19aea96e20842d3756e0c6d56d598a67cd0d40 Signed-off-by: Lukasz Bardeli --- .../html/device_api/mobile/tizen/bluetooth.html | 2851 ++++++++++++++++++-- 1 file changed, 2644 insertions(+), 207 deletions(-) diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/bluetooth.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/bluetooth.html index a9d84ad..370588e 100644 --- a/org.tizen.web.apireference/html/device_api/mobile/tizen/bluetooth.html +++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/bluetooth.html @@ -22,7 +22,7 @@ Controls local Bluetooth device, that is, turn Bluetooth on/off, etc. <
  • Sets visibility
  • -Discovers nearby Bluetooth devices (Device discovery)
  • +Discovers nearby Bluetooth devices (Device discovery, including Bluetooth LE devices)
  • Gets bonded devices information
  • @@ -31,6 +31,10 @@ Controls bonding
  • Connects to a service on a remote device and exchanges data
  • Registers a service (RFCOMM) on a local device, which can be consumed by remote devices to exchange data
  • +
  • +Advertise for remote devices (including Bluetooth LE devices)
  • +
  • +Act as a GATT client (Generic Attribute Profile client)
  • For more information on the Bluetooth features, see Bluetooth Guide. @@ -53,54 +57,88 @@ For more information on the Bluetooth features, see BluetoothHealthChannelType +

  • 1.6. BluetoothLESolicitationUUID +
  • +
  • 1.7. BluetoothAdvertisePacketType +
  • +
  • 1.8. BluetoothAdvertisingState +
  • +
  • 1.9. BluetoothAdvertisingMode +
  • 2. Interfaces
  • @@ -122,9 +160,26 @@ For more information on the Bluetooth features, see BluetoothLEServiceData + + + +BluetoothLEManufacturerData + + + +BluetoothLEAdvertiseDataInit + + + +BluetoothLEAdvertiseData + + + BluetoothManager -BluetoothAdapter getDefaultAdapter () +BluetoothAdapter getDefaultAdapter ()
    + BluetoothLEAdapter getLEAdapter () BluetoothAdapter @@ -143,10 +198,60 @@ For more information on the Bluetooth features, see BluetoothProfileHandler getBluetoothProfileHandler (BluetoothProfileType profileType) +BluetoothLEAdapter +void startScan (BluetoothLEScanCallback successCallback, optional ErrorCallback? errorCallback)
    + void stopScan ()
    + void startAdvertise (BluetoothLEAdvertiseData advertiseData, BluetoothAdvertisePacketType packetType, BluetoothLEAdvertiseCallback successCallback, optional ErrorCallback? errorCallback, optional BluetoothAdvertisingMode? mode, optional boolean? connectable)
    + void stopAdvertise () + + +BluetoothGATTService + + + +BluetoothGATTCharacteristic +void readValue (ReadValueSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    + void writeValue (byte[] value, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
    + long addValueChangeListener (ReadValueSuccessCallback callback)
    + void removeValueChangeListener (long watchID) + + +BluetoothGATTDescriptor +void readValue (ReadValueSuccessCallback successCallback, optional ErrorCallback? errorCallback)
    + void writeValue (byte[] value, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) + + +BluetoothLEScanCallback +void onstarted ()
    + void ondevicefound (BluetoothLEDevice device)
    + void onfinished (BluetoothLEDevice[] foundDevices) + + +BluetoothLEAdvertiseCallback +void onstate (BluetoothAdvertisingState state) + + +BluetoothLEConnectChangeCallback +void onconnected (BluetoothLEDevice device)
    + void ondisconnected (BluetoothLEDevice device) + + +ReadValueSuccessCallback +void onread (byte[] value) + + BluetoothDevice void connectToServiceByUUID (BluetoothUUID uuid, BluetoothSocketSuccessCallback successCallback, optional ErrorCallback? errorCallback) +BluetoothLEDevice +void connect (optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
    + void disconnect (optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
    + BluetoothGATTService getService (BluetoothUUID uuid)
    + long addConnectStateChangeListener (BluetoothLEConnectChangeCallback listener)
    + void removeConnectStateChangeListener (long watchID) + + BluetoothSocket unsigned long writeData (byte[] data)
    byte[] readData ()
    @@ -293,6 +398,76 @@ For more information on the Bluetooth features, see +

    1.6. BluetoothLESolicitationUUID

    +
    + The service solicitation UUID of the Bluetooth LE device. +
    +
        typedef DOMString BluetoothLESolicitationUUID;
    +

    + Since: + 2.3.1 +

    + +
    +

    1.7. BluetoothAdvertisePacketType

    +
    + The Bluetooth LE packet type +
    +
        enum BluetoothAdvertisePacketType { "ADVERTISE", "SCAN_RESPONSE" };
    +

    + Since: + 2.3.1 +

    +
    +
      +
    • +ADVERTISE - the advertising packet
    • +
    • +SCAN_RESPONSE- the scan response packet
    • +
    +
    +
    +
    +

    1.8. BluetoothAdvertisingState

    +
    + The Bluetooth advertising state +
    +
        enum BluetoothAdvertisingState { "STARTED", "STOPPED" };
    +

    + Since: + 2.3.1 +

    +
    +
      +
    • +STARTED - advertising has started
    • +
    • +STOPPED - advertising has stopped
    • +
    +
    +
    +
    +

    1.9. BluetoothAdvertisingMode

    +
    + The Bluetooth advertising mode +
    +
        enum BluetoothAdvertisingMode { "BALANCED", "LOW_LATENCY", "LOW_ENERGY" };
    +

    + Since: + 2.3.1 +

    +
    +
      +
    • +BALANCED- Balanced advertising mode
    • +
    • +LOW_LATENCY- Low latency advertising mode
    • +
    • +LOW_ENERGY - Low energy advertising mode
    • +
    +
    +

    2. Interfaces

    @@ -315,8 +490,219 @@ The tizen.bluetooth object allows access to the Bluetooth API.

    +
    +

    2.2. BluetoothLEServiceData

    +
    + The BluetoothLEServiceData interface is a service specific data container of Bluetooth LE device. +
    +
        interface BluetoothLEServiceData {
    +        attribute BluetoothUUID serviceuuid;
    +        attribute DOMString data;
    +     };
    +

    + Since: + 2.3.1 +

    +
    +

    Attributes

    +
      +
    • +BluetoothUUID serviceuuid
      + The 16 bit UUID of service data +
      +

      + Since: + 2.3.1 +

      +
    • +
    • +DOMString data
      + The service data of the Bluetooth LE device +
      +

      + Since: + 2.3.1 +

      +
    • +
    +
    +
    +
    +

    2.3. BluetoothLEManufacturerData

    +
    + The BluetoothLEManufacturerData interface is a manufacturer specific data container for an advertise or scan response data. +
    +
        interface BluetoothLEManufacturerData {
    +        attribute DOMString id;
    +        attribute DOMString data;
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    Attributes

    +
      +
    • +DOMString id
      + The manufacturer assigned ID. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • +DOMString data
      + The manufacturer data content. +
      +

      + Since: + 2.3.1 +

      +
    • +
    +
    +
    +
    +

    2.4. BluetoothLEAdvertiseDataInit

    +
    + Provides a dictionary for specifying advertise or scan response data. +
    +
        dictionary BluetoothLEAdvertiseDataInit {
    +        boolean? includeName;
    +        BluetoothUUID[]? serviceuuids;
    +        BluetoothLESolicitationUUID[]? solicitationuuids;
    +        unsigned long? appearance;
    +        boolean? includeTxPowerLevel;
    +        BluetoothLEServiceData[]? serviceData;
    +        BluetoothLEManufacturerData? manufacturerData;
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    +This dictionary is used as an input parameter of the BluetoothLEAdvertiseData construtor. +

    +
    +
    +
    +

    2.5. BluetoothLEAdvertiseData

    +
    + The BluetoothLEAdvertiseData interface is an advertise or scan response data container for Bluetooth advertising. +
    +
        [Constructor(optional BluetoothLEAdvertiseDataInit? init)]
    +    interface BluetoothLEAdvertiseData {
    +         attribute boolean? includeName;
    +         attribute BluetoothUUID[]? serviceuuids;
    +         attribute BluetoothLESolicitationUUID[]? solicitationuuids;
    +         attribute unsigned long? appearance;
    +         attribute boolean? includeTxPowerLevel;
    +         attribute BluetoothLEServiceData[]? serviceData;
    +         attribute BluetoothLEManufacturerData? manufacturerData;
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    +The BluetoothLEAdvertiseData container for Bluetooth LE advertising. +This represents the data to be advertised as well as the scan response data for active scans. +

    +
    +
    +

    Constructors

    +
    BluetoothLEAdvertiseData(optional BluetoothLEAdvertiseDataInit? init);
    +
    +
    +

    Attributes

    +
      +
    • +boolean includeName [nullable]
      + 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. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • +BluetoothUUID[] + serviceuuids [nullable]
      + The service UUID for advertise or scan response data. +By default, this attribute is set to null. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • +BluetoothLESolicitationUUID[] + solicitationuuids [nullable]
      + The service solicitation UUID for advertise or scan response data. +By default, this attribute is set to null. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • +unsigned long appearance [nullable]
      + The external appearance of this device for advertise or scan response data. +By default, this attribute is set to null. +
      +
      +

      +See the list of appearance codes for sample values. +

      +
      +

      + Since: + 2.3.1 +

      +
    • +
    • +boolean includeTxPowerLevel [nullable]
      + The transmission power level should be included in advertise or scan response data. +By default, this attribute is set to null. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • +BluetoothLEServiceData[] + serviceData [nullable]
      + The service data for advertise or scan response data. +By default, this attribute is set to null. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • +BluetoothLEManufacturerData manufacturerData [nullable]
      + The manufacturer specific data for advertise or scan response data. +By default, this attribute is set to null. +
      +

      + Since: + 2.3.1 +

      +
    • +
    +
    +
    -

    2.2. BluetoothManager

    +

    2.6. BluetoothManager

    The BluetoothManager interface provides access to the BluetoothAdapter object.
    @@ -325,6 +711,8 @@ The tizen.bluetooth object allows access to the Bluetooth API. readonly attribute BluetoothClassDeviceMinor deviceMinor; readonly attribute BluetoothClassDeviceService deviceService; BluetoothAdapter getDefaultAdapter() raises(WebAPIException); + + BluetoothLEAdapter getLEAdapter() raises(WebAPIException); };

    Since: @@ -414,11 +802,63 @@ The tizen.bluetooth object allows access to the Bluetooth API.

    +
    +getLEAdapter +
    +
    +
    + Gets the default Low Energy Bluetooth adapter. +
    +
    BluetoothLEAdapter getLEAdapter();
    +             
    +

    + Since: + 2.3.1 +

    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +

    Remark : + To check if this method is supported or not, use tizen.systeminfo.getCapability("http://tizen.org/feature/network.bluetooth.le"). +

    +
    +

    Return value:

    + BluetoothLEAdapter The local BluetoothLEAdapter object. +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      • + with error type NotSupportedError, if the feature is not supported. +

      • +
      • + with error type UnknownError, if any other error occurs. +

      • +
      +
    +
    +
    +

    Code example:

     try {
    +     var adapter = tizen.bluetooth.getLEAdapter();
    + } catch (err) {
    +     console.log(err.name +": " + err.message);
    + }
    + 
    +
    +
    -

    2.3. BluetoothAdapter

    +

    2.7. BluetoothAdapter

    The BluetoothAdapter interface provides access to control the device's Bluetooth adapter.
    @@ -787,7 +1227,7 @@ The ErrorCallback is launched with these error names: Sets the local device visibility by sending a request to a Bluetooth hardware to change the device visible state to mode.

    Deprecated. - 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 Bluetooth 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 Bluetooth Tutorial.

    void setVisible(boolean mode, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback, optional unsigned short? timeout);
                  
    @@ -1467,7 +1907,7 @@ The ErrorCallback is launched with these error types:

    Code example:

     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("
    ")); } function onError(e) { @@ -1749,213 +2189,1996 @@ The ErrorCallback is launched with these error types: -
    -

    2.4. BluetoothDevice

    +
    +

    2.8. BluetoothLEAdapter

    - The BluetoothDevice interface represents a remote Bluetooth device. + The BluetoothLEAdapter interface provides access to control the device's Bluetooth Low Energy adapter.
    -
        [NoInterfaceObject] interface BluetoothDevice {
    -        readonly attribute DOMString name;
    -        readonly attribute BluetoothAddress address;
    +
        [NoInterfaceObject] interface BluetoothLEAdapter {
    +        void startScan(BluetoothLEScanCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void stopScan() raises(WebAPIException);
    +        void startAdvertise(BluetoothLEAdvertiseData advertiseData, BluetoothAdvertisePacketType packetType, BluetoothLEAdvertiseCallback successCallback, optional ErrorCallback? errorCallback, optional BluetoothAdvertisingMode? mode, optional boolean? connectable) raises(WebAPIException);
    +        void stopAdvertise() raises(WebAPIException);
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    +This interface offers methods to control local Bluetooth Low Energy behavior, such as: +

    +
      +
    • +Scanning for remote devices
    • +
    • +Listening for changes in Bluetooth Low Energy state
    • +
    +
    +
    +

    Methods

    +
    +
    +startScan +
    +
    +
    + Starts scanning for Low Energy advertisement. +
    +
    void startScan(BluetoothLEScanCallback successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    +The scanning process can be canceled anytime, by calling the stopScan() method in the BluetoothLEAdapter interface. +

    +

    +The ErrorCallback will be launched in the following situations: +

    +
      +
    • + ServiceNotAvailableError - If a Bluetooth device is turned off
    • +
    • + UnknownError - If any other error occurs.
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Parameters:

    +
      +
    • +successCallback: + called when advertisement is found. +
    • +
    • +errorCallback [optional] [nullable]: + The method to invoke when an error occurs. +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if any input attribute is not compatible with the expected type for this attribute. +

      • +
      • + with error type InvalidStateError, if device is currently in progress of scanning +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      +
    +
    +
    +

    Code example:

     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);
    +     }
    + });
    + 
    +
    +
    +
    +stopScan +
    +
    +
    + Stops scanning for Low Energy advertisement. +
    +
    void stopScan();
    +             
    +

    + Since: + 2.3.1 +

    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      • + with error type UnknownError, if any other error occurs +

      • +
      +
    +
    +
    +

    Code example:

     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);
    +     }
    + });
    + 
    +
    +
    +
    +startAdvertise +
    +
    +
    + Starts advertising for Low Energy Devices. +
    +
    void startAdvertise(BluetoothLEAdvertiseData advertiseData, BluetoothAdvertisePacketType packetType, BluetoothLEAdvertiseCallback successCallback, optional ErrorCallback? errorCallback, optional BluetoothAdvertisingMode? mode, optional boolean? connectable);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    +A advertising process can be canceled anytime, by calling stopAdvertise() on the BluetoothLEAdapter. +

    +

    +The ErrorCallback will be launched in the following situations: +

    +
      +
    • + ServiceNotAvailableError - If a Bluetooth device is turned off
    • +
    • + UnknownError - If any other error occurs
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Parameters:

    +
      +
    • +advertiseData: + BluetoothLEAdvertiseData object to be added +
    • +
    • +packetType: + The bluetooth LE packet type +
    • +
    • +successCallback: + called when edvertisement is found. +
    • +
    • +errorCallback [optional] [nullable]: + The method to invoke when an error occurs. +
    • +
    • +mode [optional] [nullable]: + The power and latency mode of advertising. The default mode is "BALANCED". +
    • +
    • +connectable [optional] [nullable]: + The connectable status. It's true if the advertisement will be connectable. The default value of the parameter is true. +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if any input attribute is not compatible with the expected type for this attribute. +

      • +
      • + with error type QuotaPatameterError, if any input attribute is not compatible with the maximum data size for this attribute. +

      • +
      • + with error type InvalidStateError, if device is currently in progress of advertising +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      +
    +
    +
    +

    Code example:

     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);
    + 
    +
    +
    +
    +stopAdvertise +
    +
    +
    + Stops advertising for Low Energy Devices. +
    +
    void stopAdvertise();
    +             
    +

    + Since: + 2.3.1 +

    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      • + with error type UnknownError, if any other error occurs +

      • +
      +
    +
    +
    +

    Code example:

     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();
    + 
    +
    +
    +
    +
    +
    +
    +

    2.9. BluetoothGATTService

    +
    + Bluetooth Low Energy Service. The service can be retrieved with BluetoothLEDevice.getService(). +
    +
        [NoInterfaceObject] interface BluetoothGATTService {
    +        readonly attribute BluetoothUUID uuid;
    +        readonly attribute BluetoothGATTService[] services;
    +        readonly attribute BluetoothGATTCharacteristic[] characteristics;
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    Code example:

     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);
    + 
    +
    +
    +

    Attributes

    +
      +
    • + readonly +BluetoothUUID uuid
      + UUID of the service. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +BluetoothGATTService[] + services
      + A list of services included in this service. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +BluetoothGATTCharacteristic[] + characteristics
      + A list of characteristics in this service. +
      +

      + Since: + 2.3.1 +

      +
    • +
    +
    +
    +
    +

    2.10. BluetoothGATTCharacteristic

    +
    + A characteristic provided by Bluetooth Low Energy service. +
    +
        [NoInterfaceObject] interface BluetoothGATTCharacteristic {
    +        readonly attribute BluetoothGATTDescriptor[] 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(ReadValueSuccessCallback successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void writeValue(byte[] value, optional SuccessCallback? successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +
    +        long addValueChangeListener(ReadValueSuccessCallback callback) raises(WebAPIException);
    +
    +        void removeValueChangeListener(long watchID);
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    Attributes

    +
      +
    • + readonly +BluetoothGATTDescriptor[] + descriptors
      + A list of descriptors in this characteristic. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean isBroadcast
      + Indicates if the characteristic is broadcastable. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean hasExtendedProperties
      + Indicates if the characteristic has extended properties. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean isNotify
      + Indicates if the characteristic supports notification. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean isIndication
      + Indicates if the characteristic supports indication. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean isReadable
      + Indicates if the characteristic is readable. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean isSignedWrite
      + Indicates if the characteristic supports write with the signature. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean isWritable
      + Indicates if the characteristic is writable. +
      +

      + Since: + 2.3.1 +

      +
    • +
    • + readonly +boolean isWriteNoResponse
      + Indicates if the characteristic supports writing without response. +
      +

      + Since: + 2.3.1 +

      +
    • +
    +
    +
    +

    Methods

    +
    +
    +readValue +
    +
    +
    + Reads the characteristic value from the remote device. Updates characteristic value attribute. +
    +
    void readValue(ReadValueSuccessCallback successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    +The ErrorCallback is launched with these error types: +

    +
      +
    • + UnknownError - If any other error occurs
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Parameters:

    +
      +
    • +successCallback: + Callback function that is called when the characteristic value is read successfully +
    • +
    • +errorCallback [optional] [nullable]: + Callback function that is called in case of failure +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter. +

      • +
      • + with error type InvalidStateError, if device is currently not connected +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      +
    +
    +
    +

    Code example:

     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);
    +         }
    +     }
    + });
    + 
    +
    +
    +
    +writeValue +
    +
    +
    + Writes the characteristic value to the remote device. +
    +
    void writeValue(byte[] value, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    +The ErrorCallback is launched with these error types: +

    +
      +
    • + UnknownError - If any other error occurs
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Parameters:

    +
      +
    • +value: + the characteristic value to write +
    • +
    • +successCallback [optional] [nullable]: + Callback function that is called when the characteristic value is written successfully +
    • +
    • +errorCallback [optional] [nullable]: + Callback function that is called in case of failure +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter. +

      • +
      • + with error type InvalidStateError, if device is currently not connected +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      +
    +
    +
    +

    Code example:

     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);
    +         }
    +     }
    + });
    + 
    +
    +
    +
    +addValueChangeListener +
    +
    +
    + Registers a callback to be called when characteristic value of the characteristic changes. +
    +
    long addValueChangeListener(ReadValueSuccessCallback callback);
    +             
    +

    + Since: + 2.3.1 +

    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Parameters:

    +
      +
    • +callback: + Listener function that is called when the connection state changes +
    • +
    +
    +
    +

    Return value:

    + long The watchID to be used to unregister the listener +
    +
    +

    Exceptions:

    +
    • WebAPIException
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      +
    +
    +
    +

    Code example:

     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);
    +         }
    +     }
    + });
    + 
    +
    +
    +
    +removeValueChangeListener +
    +
    +
    + Unregisters a characteristic value change listener +
    +
    void removeValueChangeListener(long watchID);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +watchID: + The watchID identifier returned by the addValueChangeListener() method. +
    • +
    +
    +
    +
    +
    +
    +
    +

    2.11. BluetoothGATTDescriptor

    +
    + Bluetooth Low Energy Descriptor. +
    +
        [NoInterfaceObject] interface BluetoothGATTDescriptor {
    +        void readValue(ReadValueSuccessCallback successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void writeValue(byte[] value, optional SuccessCallback? successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    Methods

    +
    +
    +readValue +
    +
    +
    + Reads descriptor value from remote device. Updates descriptor value attribute. +
    +
    void readValue(ReadValueSuccessCallback successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    +The ErrorCallback is launched with these error types: +

    +
      +
    • + UnknownError - If any other error occurs
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Parameters:

    +
      +
    • +successCallback: + Callback function that is called when the descriptor value is read successfully +
    • +
    • +errorCallback [optional] [nullable]: + Callback function that is called in case of failure +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter. +

      • +
      • + with error type InvalidStateError, if device is currently not connected +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      +
    +
    +
    +

    Code example:

     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);
    +         }
    +     }
    + });
    + 
    +
    +
    +
    +writeValue +
    +
    +
    + Writes the descriptor value to the remote device. +
    +
    void writeValue(byte[] value, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    +The ErrorCallback is launched with these error types: +

    +
      +
    • + UnknownError - If any other error occurs
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Parameters:

    +
      +
    • +value: + the descriptor value to write +
    • +
    • +successCallback [optional] [nullable]: + Callback function that is called when the descriptor value is written successfully +
    • +
    • +errorCallback [optional] [nullable]: + Callback function that is called in case of failure +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter. +

      • +
      • + with error type InvalidStateError, if device is currently not connected +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      +
    +
    +
    +

    Code example:

     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);
    +         }
    +     }
    + });
    + 
    +
    +
    +
    +
    +
    +
    +

    2.12. BluetoothLEScanCallback

    +
    + Bluetooth scanning process interface that defines the success callback for BluetoothLEAdapter.startScan()
    +
        [Callback, NoInterfaceObject] interface BluetoothLEScanCallback {
    +        void onstarted();
    +        void ondevicefound(BluetoothLEDevice device);
    +        void onfinished(BluetoothLEDevice[] foundDevices);
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    Methods

    +
    +
    +onstarted +
    +
    +
    + Called at the beginning of a device discovery process for finding the nearby Bluetooth LE device. +
    +
    void onstarted();
    +             
    +

    + Since: + 2.3.1 +

    +
    +
    +ondevicefound +
    +
    +
    + Called when a new device is discovered in the process of scanning. +
    +
    void ondevicefound(BluetoothLEDevice device);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +device: + Device that is found +
    • +
    +
    +
    +
    +onfinished +
    +
    +
    + Called when the device scanning process has finished. +
    +
    void onfinished(BluetoothLEDevice[] foundDevices);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +foundDevices: + Array of devices found in this discovery session +
    • +
    +
    +
    +
    +
    +
    +
    +

    2.13. BluetoothLEAdvertiseCallback

    +
    + Bluetooth advertising process interface that defines the success callback for BluetoothLEAdapter.startAdvertise()
    +
        [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothLEAdvertiseCallback {
    +        void onstate(BluetoothAdvertisingState state);
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    Methods

    +
    +
    +onstate +
    +
    +
    + Called when the advertising state is changed. +
    +
    void onstate(BluetoothAdvertisingState state);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +state: + State that is Advertising process +
    • +
    +
    +
    +
    +
    +
    +
    +

    2.14. BluetoothLEConnectChangeCallback

    +
    + 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. +
    +
        [Callback, NoInterfaceObject] interface BluetoothLEConnectChangeCallback {
    +        void onconnected(BluetoothLEDevice device);
    +        void ondisconnected(BluetoothLEDevice device);
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    Methods

    +
    +
    +onconnected +
    +
    +
    + Called at the beginning of connect to a specific LE based service on a remote Bluetooth LE device. +
    +
    void onconnected(BluetoothLEDevice device);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • device
    • +
    +
    +
    +
    +ondisconnected +
    +
    +
    + Called at the beginning of disconnect to a specific LE based service on a remote Bluetooth LE device. +
    +
    void ondisconnected(BluetoothLEDevice device);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • device
    • +
    +
    +
    +
    +
    +
    +
    +

    2.15. ReadValueSuccessCallback

    +
    + The ReadValueSuccessCallback interface implements the callback for +BluetoothGATTCharacteristic.readValue() and +BluetoothGATTDescriptor.readValue() methods. +
    +
        [Callback=FunctionOnly, NoInterfaceObject] interface ReadValueSuccessCallback {
    +        void onread(byte[] value);
    +    };
    +

    + Since: + 2.3.1 +

    +
    +

    Methods

    +
    +
    +onread +
    +
    +
    + Called when a characteristic value has been read. +
    +
    void onread(byte[] value);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +value: + Read characteristic value +
    • +
    +
    +
    +
    +
    +
    +
    +

    2.16. BluetoothDevice

    +
    + The BluetoothDevice interface represents a remote Bluetooth device. +
    +
        [NoInterfaceObject] interface BluetoothDevice {
    +        readonly attribute DOMString name;
    +        readonly attribute BluetoothAddress address;
             readonly attribute BluetoothClass deviceClass;
             readonly attribute boolean isBonded;
             readonly attribute boolean isTrusted;
             readonly attribute boolean isConnected;
             readonly attribute BluetoothUUID[] uuids;
     
    -        void connectToServiceByUUID(BluetoothUUID uuid,
    -                                    BluetoothSocketSuccessCallback successCallback,
    -                                    optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void connectToServiceByUUID(BluetoothUUID uuid,
    +                                    BluetoothSocketSuccessCallback successCallback,
    +                                    optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +

    + Since: + 1.0 +

    +
    +

    +A BluetoothDevice object can be retrieved using one of the following APIs: +

    +
      +
    • + BluetoothAdapter.getDevice()
    • +
    • + BluetoothAdapter.getKnownDevices()
    • +
    • + BluetoothAdapter.discoverDevices()
    • +
    • + BluetoothAdapter.createBonding()
    • +
    +
    +
    +

    Attributes

    +
      +
    • + readonly +DOMString name
      + The readable name of this remote device. +
      +

      + Since: + 1.0 +

      +
      +

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      + adapter.getDevice("11:22:33:44:55:66", function(device) {
      +    console.log("Device Name: " + device.name);
      + });
      + 
      +
      +
    • +
    • + readonly +BluetoothAddress address
      + The hardware address of this remote device. +
      +

      + Since: + 1.0 +

      +
      +

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      + adapter.getDevice("11:22:33:44:55:66", function(device) {
      +    console.log("Device Address: " + device.address);
      + });
      + 
      +
      +
    • +
    • + readonly +BluetoothClass deviceClass
      + The device class, which represents the type of the device and the services it provides. +
      +

      + Since: + 1.0 +

      +
      +

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      + adapter.getDevice("11:22:33:44:55:66", function(device) {
      +    console.log("Device Major Class: " + device.deviceClass.major);
      + });
      + 
      +
      +
    • +
    • + readonly +boolean isBonded
      + The bond state of this remote device with the local device. +
      +

      + Since: + 1.0 +

      +
      +

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      + adapter.getDevice("11:22:33:44:55:66", function(device) {
      +    console.log("Is bonded: " + (device.isBonded ? "Yes" : "No"));
      + });
      + 
      +
      +
    • +
    • + readonly +boolean isTrusted
      + The flag indicating whether the local device recognizes this remote device as a trusted device or not. +
      +

      + Since: + 1.0 +

      +
      +

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      + adapter.getDevice("11:22:33:44:55:66", function(device) {
      +    console.log("Is trusted: " + (device.isTrusted ? "Yes" : "No"));
      + });
      + 
      +
      +
    • +
    • + readonly +boolean isConnected
      + The flag indicating whether the connection state of this remote device with the local device. +
      +

      + Since: + 1.0 +

      +
      +

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      + adapter.getDevice("11:22:33:44:55:66", function(device) {
      +    console.log("Is connected: " + (device.isConnected ? "Yes" : "No"));
      + });
      + 
      +
      +
    • +
    • + readonly +BluetoothUUID[] + uuids
      + The list of 128 bit service UUIDs available on this remote device. +
      +

      + Since: + 1.0 +

      +
      +

      Code example:

       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] + "
      "; + } + 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); + }); + } + }); +
      +
      +
    • +
    +
    +
    +

    Methods

    +
    +
    +connectToServiceByUUID +
    +
    +
    + Connects to a specified service identified by uuid on this remote device. +
    +
    void connectToServiceByUUID(BluetoothUUID uuid, BluetoothSocketSuccessCallback successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 1.0 +

    +
    +

    +If opening a connection is successful, then a BluetoothSocket object with open state is sent using successCallback, through which data can be exchanged by both devices. +

    +

    +The ErrorCallback is launched with these error types: +

    +
      +
    • + NotFoundError - If there is no service with the specified uuid
    • +
    • + InvalidValuesError - If any of the input parameters contain an invalid value
    • +
    • + UnknownError - If any other error occurs
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth.spp +

    +
    +

    Parameters:

    +
      +
    • +uuid: + 128 bit unique identifier, which specifies the service on the remote device +
    • +
    • +successCallback: + Callback function that is called when an asynchronous call completes successfully +
    • +
    • +errorCallback [optional] [nullable]: + Callback function that is called when opening of a socket fails +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      +
    +
    +
    +

    Code example:

     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); });
    + 
    +
    +
    +
    +
    +
    +
    +

    2.17. BluetoothLEDevice

    +
    + The BluetoothLEDevice interface represents a remote Bluetooth LE device. +
    +
        [NoInterfaceObject] interface BluetoothLEDevice {
    +        readonly attribute BluetoothAddress address;
    +        readonly attribute DOMString? name;
    +        readonly attribute unsigned long? txpowerlevel;
    +        readonly attribute unsigned long? appearance;
    +        readonly attribute BluetoothUUID[]? uuids;
    +        readonly attribute BluetoothLESolicitationUUID[]? solicitationuuids;
    +        readonly attribute BluetoothLEServiceData[]? serviceData;
    +        readonly attribute BluetoothLEManufacturerData? manufacturerData;
    +
    +        void connect(optional SuccessCallback? successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void disconnect(optional SuccessCallback? successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +
    +        BluetoothGATTService getService(BluetoothUUID uuid) raises(WebAPIException);
    +
    +        long addConnectStateChangeListener(BluetoothLEConnectChangeCallback listener) raises(WebAPIException);
    +
    +        void removeConnectStateChangeListener(long watchID);
         };

    Since: - 1.0 + 2.3.1

    -A BluetoothDevice object can be retrieved using one of the following APIs: +A BluetoothLEDevice object can be retrieved by using one of the following APIs:

    • - BluetoothAdapter.getDevice()
    • -
    • - BluetoothAdapter.getKnownDevices()
    • -
    • - BluetoothAdapter.discoverDevices()
    • -
    • - BluetoothAdapter.createBonding()
    • + BluetoothLEAdapter.startScan()

    Attributes

      -
    • +
    • readonly -DOMString name
      - The readable name of this remote device. +BluetoothAddress address
      + The address of the Bluetooth LE device from the scan result information.

      Since: - 1.0 + 2.3.1

      -

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      - adapter.getDevice("11:22:33:44:55:66", function(device) {
      -    console.log("Device Name: " + device.name);
      +

      Code example:

       var adapter = tizen.bluetooth.getLEAdapter();
      + adapter.startScan({
      +     ondevicefound: function(device) {
      +         console.log("Found device: " + device.address);
      +     }
        });
        
    • -
    • +
    • readonly -BluetoothAddress address
      - The hardware address of this remote device. +DOMString name [nullable]
      + The name of the Bluetooth LE device from the scan result information.

      Since: - 1.0 + 2.3.1

      -

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      - adapter.getDevice("11:22:33:44:55:66", function(device) {
      -    console.log("Device Address: " + device.address);
      +

      Code example:

       var adapter = tizen.bluetooth.getLEAdapter();
      + adapter.startScan({
      +     ondevicefound: function(device) {
      +         console.log("Found device: " + device.name);
      +     }
        });
        
    • -
    • +
    • readonly -BluetoothClass deviceClass
      - The device class, which represents the type of the device and the services it provides. +unsigned long txpowerlevel [nullable]
      + The transmission power level of the Bluetooth LE device from the scan result information.

      Since: - 1.0 + 2.3.1

      -

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      - adapter.getDevice("11:22:33:44:55:66", function(device) {
      -    console.log("Device Major Class: " + device.deviceClass.major);
      +

      Code example:

       var adapter = tizen.bluetooth.getLEAdapter();
      + adapter.startScan({
      +     ondevicefound: function(device) {
      +         console.log("Found device: " + device.txpowerlevel);
      +     }
        });
        
    • -
    • +
    • readonly -boolean isBonded
      - The bond state of this remote device with the local device. +unsigned long appearance [nullable]
      + The appearance of the Bluetooth LE device from the scan result information.

      Since: - 1.0 + 2.3.1

      -

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      - adapter.getDevice("11:22:33:44:55:66", function(device) {
      -    console.log("Is bonded: " + (device.isBonded ? "Yes" : "No"));
      +

      Code example:

       var adapter = tizen.bluetooth.getLEAdapter();
      + adapter.startScan({
      +     ondevicefound: function(device) {
      +         console.log("Found device: " + device.appearance);
      +     }
        });
        
    • -
    • +
    • readonly -boolean isTrusted
      - The flag indicating whether the local device recognizes this remote device as a trusted device or not. +BluetoothUUID[] + uuids [nullable]
      + The list of 128 bit service UUIDs available on this remote device.

      Since: - 1.0 + 2.3.1

      -

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      - adapter.getDevice("11:22:33:44:55:66", function(device) {
      -    console.log("Is trusted: " + (device.isTrusted ? "Yes" : "No"));
      +

      Code example:

       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);
      +     }
        });
        
    • -
    • +
    • readonly -boolean isConnected
      - The flag indicating whether the connection state of this remote device with the local device. +BluetoothLESolicitationUUID[] + solicitationuuids [nullable]
      + The list of service solicitation UUIDs available on Bluetooth LE device from the scan result information.

      Since: - 1.0 + 2.3.1

      -

      Code example:

       var adapter = tizen.bluetooth.getDefaultAdapter();
      - adapter.getDevice("11:22:33:44:55:66", function(device) {
      -    console.log("Is connected: " + (device.isConnected ? "Yes" : "No"));
      +

      Code example:

       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);
      +     }
        });
        
    • -
    • +
    • readonly -BluetoothUUID[] - uuids
      - The list of 128 bit service UUIDs available on this remote device. +BluetoothLEServiceData[] + serviceData [nullable]
      + The list of service data available on Bluetooth LE device from the scan result information. +
      +

      + Since: + 2.3.1 +

      +
      +

      Code example:

       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);
      +     }
      + });
      + 
      +
      +
    • +
    • + readonly +BluetoothLEManufacturerData manufacturerData [nullable]
      + The manufacturer data from the scan result information. +
      +

      + Since: + 2.3.1 +

      +
      +

      Code example:

       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);
      +     }
      + });
      + 
      +
      +
    • +
    +
    +
    +

    Methods

    +
    +
    +connect +
    +
    +
    + Establishes Low Energy connection to the device. +
    +
    void connect(optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    +Connection is required to readValue() and writeValue() from the remote device. +

    +

    +The ErrorCallback is launched with these error types: +

    +
      +
    • + UnknownError - If any other error occurs
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth +

    +
    +

    Parameters:

    +
      +
    • +successCallback [optional] [nullable]: + Callback function that is called when the connection is established successfully +
    • +
    • +errorCallback [optional] [nullable]: + Callback function that is called in case of failure +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter. +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      +
    +
    +
    +

    Code example:

     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);
    +         }
    +     }
    + });
    + 
    +
    +
    +
    +disconnect +
    +
    +
    + Disconnects from the device.
    +
    void disconnect(optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
    +             

    Since: - 1.0 + 2.3.1 +

    +
    +

    +The ErrorCallback is launched with these error types: +

    +
      +
    • + UnknownError - If any other error occurs
    • +
    +
    +

    + Privilege level: + public +

    +

    + Privilege: + http://tizen.org/privilege/bluetooth

    +
    +

    Parameters:

    +
      +
    • +successCallback [optional] [nullable]: + Callback function that is called when the connection is finished successfully +
    • +
    • +errorCallback [optional] [nullable]: + Callback function that is called in case of failure +
    • +
    +
    +
    +

    Exceptions:

    +
    • WebAPIException
        +
      • + with error type TypeMismatchError, if the input parameter is not compatible with the expected type for that parameter. +

      • +
      • + with error type InvalidStateError, if device is currently not connected +

      • +
      • + with error type SecurityError, if the application does not have the privilege to call this method. +

      • +
      +
    +
    -

    Code example:

     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";
    +

    Code example:

     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);
      
    - - -
    -
    -

    Methods

    -
    -
    -connectToServiceByUUID + +
    +getService
    - Connects to a specified service identified by uuid on this remote device. + Retrieves a service from the device for the given UUID.
    -
    void connectToServiceByUUID(BluetoothUUID uuid, BluetoothSocketSuccessCallback successCallback, optional ErrorCallback? errorCallback);
    +
     

    Since: - 1.0 + 2.3.1

    -If opening a connection is successful, then a BluetoothSocket object with open state is sent using successCallback, through which data can be exchanged by both devices. -

    -

    The ErrorCallback is launched with these error types:

    • - NotFoundError - If there is no service with the specified uuid
    • -
    • - InvalidValuesError - If any of the input parameters contain an invalid value
    • -
    • UnknownError - If any other error occurs
    @@ -1965,22 +4188,14 @@ The ErrorCallback is launched with these error types:

    Privilege: - http://tizen.org/privilege/bluetooth.spp + http://tizen.org/privilege/bluetooth

    Parameters:

    • uuid: - 128 bit unique identifier, which specifies the service on the remote device -
    • -
    • -successCallback: - Callback function that is called when an asynchronous call completes successfully -
    • -
    • -errorCallback [optional] [nullable]: - Callback function that is called when opening of a socket fails + UUID of the service
    @@ -1988,65 +4203,157 @@ The ErrorCallback is launched with these error types:

    Exceptions:

    • WebAPIException
      • - 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.

      • with error type SecurityError, if the application does not have the privilege to call this method.

      • +
      • + with error type InvalidStateError, if the GATT service is not available. +

      • +
      • + with error type UnknownError, if any other error occurs. +

    -

    Code example:

     var adapter = tizen.bluetooth.getDefaultAdapter();
    - var clientSocket = null;
    +

    Code example:

     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);
    + 
    +
    +
    +
    +addConnectStateChangeListener +
    +
    +
    + Registers a listener to be called when the device connects or disconnects. +
    +
    long addConnectStateChangeListener(BluetoothLEConnectChangeCallback listener);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +listener: + Listener functions that are called when the connection state changes +
    • +
    +
    +
    +

    Return value:

    + long The watchID to be used to unregister the listener +
    +
    +

    Exceptions:

    +
    • WebAPIException
      • + with error type UnknownError, if any other error occurs. +

      +
    +
    +
    +

    Code example:

     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);
    + 
    +
    +
    +
    +removeConnectStateChangeListener +
    +
    +
    + Unregisters a Bluetooth device connection listener +
    +
    void removeConnectStateChangeListener(long watchID);
    +             
    +

    + Since: + 2.3.1 +

    +
    +

    Parameters:

    +
      +
    • +watchID: + The watchID identifier returned by the addConnectStateChangeListener() method. +
    • +
    +
    +
    +

    Code example:

     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);
      
    @@ -2054,7 +4361,7 @@ The ErrorCallback is launched with these error types:
    -

    2.5. BluetoothSocket

    +

    2.18. BluetoothSocket

    The BluetoothSocket interface represents the Bluetooth socket.
    @@ -2370,7 +4677,7 @@ This method should be called only in the BluetoothSocket.onmessage hand
    -

    2.6. BluetoothClass

    +

    2.19. BluetoothClass

    The BluetoothClass interface represents Bluetooth Class of Device/Service(CoD).
    @@ -2539,7 +4846,7 @@ values.
    -

    2.7. BluetoothClassDeviceMajor

    +

    2.20. BluetoothClassDeviceMajor

    The BluetoothClassDeviceMajor interface holds the identifiers for major device classes of Bluetooth CoD.
    @@ -2563,7 +4870,7 @@ values.

    -

    2.8. BluetoothClassDeviceMinor

    +

    2.21. BluetoothClassDeviceMinor

    The BluetoothClassDeviceMinor interface holds the identifiers for minor device classes of Bluetooth CoD.
    @@ -2654,7 +4961,7 @@ values.

    -

    2.9. BluetoothClassDeviceService

    +

    2.22. BluetoothClassDeviceService

    The BluetoothClassDeviceService interface holds identifiers for the major service classes of Bluetooth CoD.
    @@ -2675,7 +4982,7 @@ values.

    -

    2.10. BluetoothServiceHandler

    +

    2.23. BluetoothServiceHandler

    The BluetoothServiceHandler interface provides methods to handle Bluetooth service.
    @@ -2851,7 +5158,7 @@ The ErrorCallback is launched with these error types:
    -

    2.11. BluetoothProfileHandler

    +

    2.24. BluetoothProfileHandler

    The BluetoothProfileHandler interface represents the Bluetooth profile handler.
    @@ -2878,7 +5185,7 @@ The ErrorCallback is launched with these error types:
    -

    2.12. BluetoothHealthProfileHandler

    +

    2.25. BluetoothHealthProfileHandler

    This interface represents the handler of Bluetooth health device profile. The BluetoothHealthProfileHandler object is created by BluetoothAdapter.getBluetoothProfileHandler(). @@ -3082,7 +5389,7 @@ The ErrorCallback is launched with these error types:
    -

    2.13. BluetoothHealthApplication

    +

    2.26. BluetoothHealthApplication

    The BluetoothHealthApplication interface represents the Bluetooth health application.
    @@ -3107,7 +5414,7 @@ The ErrorCallback is launched with these error types:
  • readonly unsigned short dataType
    - 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.

    @@ -3259,7 +5566,7 @@ The ErrorCallback is launched with these error types:

  • -

    2.14. BluetoothHealthChannel

    +

    2.27. BluetoothHealthChannel

    The BluetoothHealthChannel interface represents the Bluetooth health channel.
    @@ -3607,7 +5914,7 @@ This stops receiving notifications.
    -

    2.15. BluetoothAdapterChangeCallback

    +

    2.28. BluetoothAdapterChangeCallback

    The BluetoothAdapterChangeCallback interface specifies a set of methods to be invoked when the changes of Bluetooth adapter occur.
    @@ -3696,9 +6003,9 @@ This stops receiving notifications.
    -

    2.16. BluetoothDeviceSuccessCallback

    +

    2.29. BluetoothDeviceSuccessCallback

    - The BluetoothDeviceSuccessCallback interface implements the success callback BluetoothAdapter.getDevice() and BluetoothAdapter.createBonding(). + The BluetoothDeviceSuccessCallback interface implements the success callback BluetoothAdapter.getDevice() and BluetoothAdapter.createBonding().
        [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothDeviceSuccessCallback {
             void onsuccess(BluetoothDevice device);
    @@ -3737,9 +6044,9 @@ This stops receiving notifications.
     
    -

    2.17. BluetoothDeviceArraySuccessCallback

    +

    2.30. BluetoothDeviceArraySuccessCallback

    - The BluetoothDeviceArraySuccessCallback interface that defines the success callback for BluetoothAdapter.getKnownDevices(). + The BluetoothDeviceArraySuccessCallback interface that defines the success callback for BluetoothAdapter.getKnownDevices().
        [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothDeviceArraySuccessCallback {
             void onsuccess(BluetoothDevice[] devices);
    @@ -3779,9 +6086,9 @@ Each element is a BluetoothDevice.
     
    -

    2.18. BluetoothDiscoverDevicesSuccessCallback

    +

    2.31. BluetoothDiscoverDevicesSuccessCallback

    - The BluetoothDiscoverDevicesSuccessCallback interface that defines the success callback for BluetoothAdapter.discoverDevices(). + The BluetoothDiscoverDevicesSuccessCallback interface that defines the success callback for BluetoothAdapter.discoverDevices().
        [Callback, NoInterfaceObject] interface BluetoothDiscoverDevicesSuccessCallback {
             void onstarted();
    @@ -3884,9 +6191,9 @@ After that, this device is no longer visible.
     
    -

    2.19. BluetoothSocketSuccessCallback

    +

    2.32. BluetoothSocketSuccessCallback

    - The BluetoothSocketSuccessCallback interface that defines the success method for BluetoothDevice.connectToServiceByUUID(). + The BluetoothSocketSuccessCallback interface that defines the success method for BluetoothDevice.connectToServiceByUUID().
        [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothSocketSuccessCallback {
             void onsuccess(BluetoothSocket socket);
    @@ -3925,9 +6232,9 @@ After that, this device is no longer visible.
     
    -

    2.20. BluetoothServiceSuccessCallback

    +

    2.33. BluetoothServiceSuccessCallback

    - The BluetoothServiceSuccessCallback interface implements the success callback for BluetoothAdapter.registerRFCOMMServiceByUUID(). + The BluetoothServiceSuccessCallback interface implements the success callback for BluetoothAdapter.registerRFCOMMServiceByUUID().
        [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothServiceSuccessCallback {
             void onsuccess(BluetoothServiceHandler handler);
    @@ -3966,9 +6273,9 @@ After that, this device is no longer visible.
     
    -

    2.21. BluetoothHealthApplicationSuccessCallback

    +

    2.34. BluetoothHealthApplicationSuccessCallback

    - The BluetoothHealthApplicationSuccessCallback interface that defines the success method for BluetoothHealthProfileHandler.registerSinkApplication(). + The BluetoothHealthApplicationSuccessCallback interface that defines the success method for BluetoothHealthProfileHandler.registerSinkApplication().
        [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothHealthApplicationSuccessCallback {
             void onsuccess(BluetoothHealthApplication application);
    @@ -4007,9 +6314,9 @@ After that, this device is no longer visible.
     
    -

    2.22. BluetoothHealthChannelSuccessCallback

    +

    2.35. BluetoothHealthChannelSuccessCallback

    - The BluetoothHealthChannelSuccessCallback interface that defines the success method for BluetoothHealthProfileHandler.connectToSource() and the event callback for BluetoothHealthApplication.onconnect. + The BluetoothHealthChannelSuccessCallback interface that defines the success method for BluetoothHealthProfileHandler.connectToSource() and the event callback for BluetoothHealthApplication.onconnect().
        [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothHealthChannelSuccessCallback {
             void onsuccess(BluetoothHealthChannel channel);
    @@ -4048,7 +6355,7 @@ After that, this device is no longer visible.
     
    -

    2.23. BluetoothHealthChannelChangeCallback

    +

    2.36. BluetoothHealthChannelChangeCallback

    The BluetoothHealthChannelChangeCallback interface specifies a set of methods to be invoked when the changes of heath channel occur.
    @@ -4124,8 +6431,16 @@ To guarantee that the Bluetooth healthcare application runs on a device with Blu

  • http://tizen.org/feature/network.bluetooth.health
  • +
    +

    +

    +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: +

    +

    +
  • http://tizen.org/feature/network.bluetooth.le
  • +

    - For more information, see Application Filtering. + For more information, see Application Filtering.

    4. Full WebIDL

    module Bluetooth {
    @@ -4139,18 +6454,58 @@ To guarantee that the Bluetooth healthcare application runs on a device with Blu
     
         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 BluetoothManager bluetooth;
         };
         Tizen implements BluetoothManagerObject;
     
    +    interface BluetoothLEServiceData {
    +        attribute BluetoothUUID serviceuuid;
    +        attribute DOMString data;
    +     };
    +
    +    interface BluetoothLEManufacturerData {
    +        attribute DOMString id;
    +        attribute DOMString data;
    +    };
    +
    +    dictionary BluetoothLEAdvertiseDataInit {
    +        boolean? includeName;
    +        BluetoothUUID[]? serviceuuids;
    +        BluetoothLESolicitationUUID[]? solicitationuuids;
    +        unsigned long? appearance;
    +        boolean? includeTxPowerLevel;
    +        BluetoothLEServiceData[]? serviceData;
    +        BluetoothLEManufacturerData? manufacturerData;
    +    };
    +
    +    [Constructor(optional BluetoothLEAdvertiseDataInit? init)]
    +    interface BluetoothLEAdvertiseData {
    +         attribute boolean? includeName;
    +         attribute BluetoothUUID[]? serviceuuids;
    +         attribute BluetoothLESolicitationUUID[]? solicitationuuids;
    +         attribute unsigned long? appearance;
    +         attribute boolean? includeTxPowerLevel;
    +         attribute BluetoothLEServiceData[]? serviceData;
    +         attribute BluetoothLEManufacturerData? manufacturerData;
    +    };
    +
         [NoInterfaceObject] interface BluetoothManager {
             readonly attribute BluetoothClassDeviceMajor deviceMajor;
             readonly attribute BluetoothClassDeviceMinor deviceMinor;
             readonly attribute BluetoothClassDeviceService deviceService;
             BluetoothAdapter getDefaultAdapter() raises(WebAPIException);
    -    };
     
    +        BluetoothLEAdapter getLEAdapter() raises(WebAPIException);
    +    };
     
         [NoInterfaceObject] interface BluetoothAdapter {
             readonly attribute DOMString name;
    @@ -4206,6 +6561,65 @@ To guarantee that the Bluetooth healthcare application runs on a device with Blu
             BluetoothProfileHandler getBluetoothProfileHandler(BluetoothProfileType profileType) raises(WebAPIException);
         };
     
    +    [NoInterfaceObject] interface BluetoothLEAdapter {
    +        void startScan(BluetoothLEScanCallback successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void stopScan() raises(WebAPIException);
    +        void startAdvertise(BluetoothLEAdvertiseData advertiseData, BluetoothAdvertisePacketType packetType, BluetoothLEAdvertiseCallback successCallback, optional ErrorCallback? errorCallback, optional BluetoothAdvertisingMode? mode, optional boolean? connectable) raises(WebAPIException);
    +        void stopAdvertise() raises(WebAPIException);
    +    };
    +
    +    [NoInterfaceObject] interface BluetoothGATTService {
    +        readonly attribute BluetoothUUID uuid;
    +        readonly attribute BluetoothGATTService[] services;
    +        readonly attribute BluetoothGATTCharacteristic[] characteristics;
    +    };
    +
    +    [NoInterfaceObject] interface BluetoothGATTCharacteristic {
    +        readonly attribute BluetoothGATTDescriptor[] 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(ReadValueSuccessCallback successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void writeValue(byte[] value, optional SuccessCallback? successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +
    +        long addValueChangeListener(ReadValueSuccessCallback callback) raises(WebAPIException);
    +
    +        void removeValueChangeListener(long watchID);
    +    };
    +
    +    [NoInterfaceObject] interface BluetoothGATTDescriptor {
    +        void readValue(ReadValueSuccessCallback successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void writeValue(byte[] value, optional SuccessCallback? successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +    };
    +
    +    [Callback, NoInterfaceObject] interface BluetoothLEScanCallback {
    +        void onstarted();
    +        void ondevicefound(BluetoothLEDevice device);
    +        void onfinished(BluetoothLEDevice[] foundDevices);
    +    };
    +
    +    [Callback=FunctionOnly, NoInterfaceObject] interface BluetoothLEAdvertiseCallback {
    +        void onstate(BluetoothAdvertisingState state);
    +    };
    +
    +    [Callback, NoInterfaceObject] interface BluetoothLEConnectChangeCallback {
    +        void onconnected(BluetoothLEDevice device);
    +        void ondisconnected(BluetoothLEDevice device);
    +    };
    +
    +    [Callback=FunctionOnly, NoInterfaceObject] interface ReadValueSuccessCallback {
    +        void onread(byte[] value);
    +    };
    +
         [NoInterfaceObject] interface BluetoothDevice {
             readonly attribute DOMString name;
             readonly attribute BluetoothAddress address;
    @@ -4219,6 +6633,29 @@ To guarantee that the Bluetooth healthcare application runs on a device with Blu
                                         BluetoothSocketSuccessCallback successCallback,
                                         optional ErrorCallback? errorCallback) raises(WebAPIException);
         };
    +
    +    [NoInterfaceObject] interface BluetoothLEDevice {
    +        readonly attribute BluetoothAddress address;
    +        readonly attribute DOMString? name;
    +        readonly attribute unsigned long? txpowerlevel;
    +        readonly attribute unsigned long? appearance;
    +        readonly attribute BluetoothUUID[]? uuids;
    +        readonly attribute BluetoothLESolicitationUUID[]? solicitationuuids;
    +        readonly attribute BluetoothLEServiceData[]? serviceData;
    +        readonly attribute BluetoothLEManufacturerData? manufacturerData;
    +
    +        void connect(optional SuccessCallback? successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +        void disconnect(optional SuccessCallback? successCallback,
    +                     optional ErrorCallback? errorCallback) raises(WebAPIException);
    +
    +        BluetoothGATTService getService(BluetoothUUID uuid) raises(WebAPIException);
    +
    +        long addConnectStateChangeListener(BluetoothLEConnectChangeCallback listener) raises(WebAPIException);
    +
    +        void removeConnectStateChangeListener(long watchID);
    +    };
    +
         [NoInterfaceObject] interface BluetoothSocket {
             readonly attribute BluetoothUUID uuid;
             readonly attribute BluetoothSocketState state;
    -- 
    2.7.4