Commit f386bbe4 by Lee Jaebin

デモ用 検証

parent bd120dc4
......@@ -34,6 +34,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -652,6 +653,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
// return; // 以下の処理にかからないようにreturnする
// }
// 登録されている定量計量器がある
showWaitingDialog(getString(R.string.weighing_machine), getString(R.string.ble_connecting));
......@@ -659,8 +661,18 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
BluetoothDevice bluetoothDevice = mBluetoothAdapter.getRemoteDevice(deviceAddress);
BluetoothDevice bluetoothDevice = null;
Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
// getBondedDevices() はエラー時に null を返すのでチェックが必要.
if (pairedDevices != null) {
for (BluetoothDevice device : pairedDevices) {
if (device.getName().startsWith("BT")) {
bluetoothDevice = device;
break;
}
}
}
// BluetoothDevice bluetoothDevice = mBluetoothAdapter.getRemoteDevice(bluetoothDevice);
if (bluetoothDevice != null) {
mBluetoothConnectThread = new BluetoothConnectThread(bluetoothDevice, new BluetoothConnectThread.bluetoothConnectThreadListener() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment