Discovering Bluetooth device

This code shows how to discover bluetooth devices using Tizen Web API.
//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);

Responses

0 Replies