1
안녕하세요 저는 내 컴퓨터에서 외부 블루투스 장치의 직렬 포트 블루투스 서비스를 감지하고 있습니다. Bluecove의 API 및 다음 코드를블루투스 서비스를 감지 할 수 없습니다 (java.lang.NumberFormatException : 입력 문자열 : "0S")
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);
가 감사를 당신의 도움
내가 문제가 지금 무엇을보고 감사하지만, 나는 정확히 uuid가 무엇인지 모르며 UUID 생성자에 대한 인수로 전달해야하는 것은 무엇인지, 내가 아는 것은 블루투스 장치의 주소 다. –