我從網上得到連接ELM 327到Android(藍牙) - 獲取UUID
try {
BluetoothDevice device = btAdapter.getRemoteDevice(bdDevice.toString());
UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
socket = device.createInsecureRfcommSocketToServiceRecord(uuid);
socket.connect();
Toast.makeText(MainActivity.this,"socket bonded", Toast.LENGTH_LONG).show();
} catch(Exception e) {
tv.setText(e.toString());
}
當然
的UUID是隻例如隨機碼下面的代碼,所以我如何獲得所需的UUID?它應該是我的ELM327設備或其他uuid的uuid嗎?對不起,我是uuid和android開發的新手。