こんにちは私は私のコンピュータから外部BluetoothデバイスのシリアルポートBluetoothサービスを検出したいと思います。そのために私はBluecoveAPIと次のコードを使用しています:
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);
ご協力ありがとうございました