private static RemoteDevice remoteDevice;
private static BluetoothStack bluetooth;
public static final void main(String[] args) throws Exception {
HCIDriver.init(new UARTTransport("serial0"));
BluetoothStack.init(new BluetoothStackLocal());
BluetoothLocalStack blue = new BluetoothLocalStack();
while (remoteDevice == null) { Thread.sleep(1000); }
System.out.println("Remote Name is " + remoteDevice.getFriendlyName(false));
SDPClientChannel sdpChannel = new SDPClientChannel(remoteDevice, blue);
bluetooth.connectL2CAPChannel(sdpChannel, remoteDevice, (short)0x0001);