code: function onConnectError(error)
  	{
  		++connectErrorCount
  		showMessage('Connect error: ' + error)
  
  		// If we get Android connect error 133, we wait and try to connect again.
  		// This can resolve connect problems on Android when error 133 is seen.
  		// In a production app you may want to have a function for aborting or
  		// maximising the number of connect attempts. Note that attempting reconnect
  		// does not block the app however, so you can still do other tasks and
  		// update the UI of the app.
  		if (133 == error)
  		{
  			showMessage('Reconnecting...')
  			setTimeout(function() { connectToDevice(device) }, 1000)
  		}
  	}
docs: Function called when a connect error or disconnect occurs.