use of com.neuronrobotics.sdk.wireless.bluetooth.BluetoothSerialConnection in project java-bowler by NeuronRobotics.
the class BluetoothConector method main.
/**
* @param args
*/
public static void main(String[] args) {
DyIO dyio;
BlueCoveManager manager = new BlueCoveManager();
String[] devices = manager.getAvailableSerialDevices(true);
System.out.println("Devices: ");
for (String d : devices) {
System.out.println(d);
}
if (devices.length > 0) {
System.out.println("Connecting to : " + devices[0]);
dyio = new DyIO(new BluetoothSerialConnection(manager, devices[0]));
dyio.connect();
if (dyio.ping())
System.out.println("All OK!");
}
System.exit(0);
}
use of com.neuronrobotics.sdk.wireless.bluetooth.BluetoothSerialConnection in project java-bowler by NeuronRobotics.
the class BluetoothConnectionPanel method getConnection.
public BluetoothSerialConnection getConnection() {
try {
String port = connectionCbo.getSelectedItem().toString();
RemoteDevice dev = blue.getDevice(port);
connection = new BluetoothSerialConnection(blue, dev.getBluetoothAddress());
Log.info("Using device:" + port + "\n");
} catch (Exception e) {
Log.warning("Unable to connect with bluetooth connection");
}
return connection;
}
Aggregations