您好我想从我的电脑上检测外部蓝牙设备的串口蓝牙服务,因为我正在使用Bluecove API和以下代码:
BluetoothDeviceDiscovery bluetoothDeviceDiscovery=new BluetoothDeviceDiscovery();
//display local device address and name
LocalDevice localDevice = LocalDevice.getLocalDevice();
System.out.println("Address: "+localDevice.getBluetoothAddress());
System.out.println("Name: "+localDevice.getFriendlyName());
//find devices
DiscoveryAgent agent = localDevice.getDiscoveryAgent();
UUID uuid = new UUID("SPP", true);
String ServiceURL = agent.selectService(uuid,ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);//"btspp://localhost:"+rd.getBluetoothAddress()+";name=SPP";
if( ServiceURL == null) {
System.out.println("Connection failed: "+ uuid +"\n");
return;
}
但是我继续使用“java.lang.NumberFormatException:对于输入字符串:行中的”0S“”异常:
UUID uuid = new UUID("SPP", true);
谢谢你的帮助
答案 0 :(得分:0)