@Override public void startAsServer() { if (mBluetoothService != null){ mBluetoothService.start(); } }
public void run() { mAdapter.cancelDiscovery(); try { mmSocket.connect(); } catch (IOException e) { setState(co.lujun.lmbluetoothsdk.base.State.STATE_LISTEN); try { mmSocket.close(); } catch (IOException e2) {} BluetoothService.this.start(); return; } synchronized (BluetoothService.this) { mConnectThread = null; } connected(mmSocket); }