examples/core-api/hexiwear-bonding/app.js
function searchForBondedDevice(params)
{
	console.log('Searching for bonded device')
	evothings.ble.getBondedDevices(
		// Success function.
		function(devices)
		{
			for (var i in devices)
			{
				var device = devices[i]
				if (device.name == params.name)
				{
					console.log('Found bonded device: ' + device.name)
					params.onFound(device)
					return // bonded device found
				}
			}
			params.onNotFound()
		},
		// Error function.
		function(error)
		{
			params.onNotFound()
		},
		{ serviceUUIDs: params.serviceUUIDs })
}
function searchForBondedDevice(params)
{
	console.log('Searching for bonded device')
	evothings.ble.getBondedDevices(
		// Success function.
		function(devices)
		{
			for (var i in devices)
			{
				var device = devices[i]
				if (device.name == params.name)
				{
					console.log('Found bonded device: ' + device.name)
					params.onFound(device)
					return // bonded device found
				}
			}
			params.onNotFound()
		},
		// Error function.
		function(error)
		{
			params.onNotFound()
		},
		{ serviceUUIDs: params.serviceUUIDs })
}
function searchForBondedDevice ( params ) { console . log ( 'Searching for bonded device' ) evothings . ble . getBondedDevices ( // Success function. function ( devices ) { for ( var i in devices ) { var device = devices [ i ] if ( device . name == params . name ) { console . log ( 'Found bonded device: ' + device . name ) params . onFound ( device ) return // bonded device found } } params . onNotFound ( ) } , // Error function. function ( error ) { params . onNotFound ( ) } , { serviceUUIDs : params . serviceUUIDs } ) }
Search for bonded device with a given name.
Useful if the address is not known.
Search for bonded device with a given name . Useful if the address is not known .