Discovering Bluetooth device

This code shows how to discover bluetooth devices using Tizen Web API.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//config.xml
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<tizen:privilege name="http://tizen.org/privilege/bluetooth"/>
//main.js
var adapter = tizen.bluetooth.getDefaultAdapter();
var discoverDevicesSuccessCallback = {
            /* When a device is found */
            ondevicefound: function(device) {
                console.log('Found device - name: ' + device.name);
                console.log('Found device - name: ' + device.address);
            }
        }
        /* Discover devices */
    adapter.discoverDevices(discoverDevicesSuccessCallback, null);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX