-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathBluetoothConector.java
More file actions
37 lines (32 loc) · 994 Bytes
/
BluetoothConector.java
File metadata and controls
37 lines (32 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.neuronrobotics.test.nrdk;
import com.neuronrobotics.sdk.dyio.DyIO;
import com.neuronrobotics.sdk.wireless.bluetooth.BlueCoveManager;
import com.neuronrobotics.sdk.wireless.bluetooth.BluetoothSerialConnection;
// Auto-generated Javadoc
/**
* The Class BluetoothConector.
*/
public class BluetoothConector {
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
DyIO dyio;
BlueCoveManager manager = new BlueCoveManager();
String devices[] = manager.getAvailableSerialDevices(true);
com.neuronrobotics.sdk.common.Log.error("Devices: ");
for (String d: devices) {
com.neuronrobotics.sdk.common.Log.error(d);
}
if (devices.length > 0) {
com.neuronrobotics.sdk.common.Log.error("Connecting to : "+devices[0]);
dyio = new DyIO(new BluetoothSerialConnection(manager, devices[0]));
dyio.connect();
if(dyio.ping() )
com.neuronrobotics.sdk.common.Log.error("All OK!");
}
System.exit(0);
}
}