From 1077db14b02ff5086c9cdb8652f0af8021fe2205 Mon Sep 17 00:00:00 2001 From: it232115 Date: Tue, 23 Jan 2024 02:59:54 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/example/childguard/TestService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/example/childguard/TestService.java b/app/src/main/java/com/example/childguard/TestService.java index 7c5b02e..db5a37e 100644 --- a/app/src/main/java/com/example/childguard/TestService.java +++ b/app/src/main/java/com/example/childguard/TestService.java @@ -249,6 +249,7 @@ public class TestService extends Service { if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) { //Do something if connected + //Bluetoothデバイスが接続されたときの処理 Log.d("BT", "Device connected"); @@ -256,10 +257,12 @@ public class TestService extends Service { Log.d("BT_Judge", "Registered: " + registeredId); if (deviceHardwareAddress.equals(registeredId)) { + //登録済みのデバイスだったときの処理 Log.d("BT_Judge", "登録済み"); e.putBoolean("connection_status",true); } else{ + //登録していないデバイスだったときの処理 Log.d("BT_Judge", "未登録"); e.putBoolean("connection_status",false); } @@ -268,6 +271,7 @@ public class TestService extends Service { } else if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)&&!isInCar) {//bluetoothが切断されたときに乗車状態のとき //Do something if disconnected + //デバイスが切断されたときの処理 if (deviceHardwareAddress.equals(registeredId)) { // 5分待機する Handler handler = new Handler();