Commit 932da70f by onuma

計測終了後にRDY状態に戻るように修正

parent 6d3a69d6
...@@ -26,7 +26,7 @@ public class AlcoholCheckerTimerTask extends TimerTask { ...@@ -26,7 +26,7 @@ public class AlcoholCheckerTimerTask extends TimerTask {
@Override @Override
public void run() { public void run() {
alcoholCheckerUtil.gi_rxlength = 0; //alcoholCheckerUtil.gi_rxlength = 0;
switch (alcoholCheckerUtil.gi_status) { switch (alcoholCheckerUtil.gi_status) {
case F_BLE_COM_INIT: case F_BLE_COM_INIT:
...@@ -34,18 +34,23 @@ public class AlcoholCheckerTimerTask extends TimerTask { ...@@ -34,18 +34,23 @@ public class AlcoholCheckerTimerTask extends TimerTask {
break; break;
case F_BLE_COM_RP_START: case F_BLE_COM_RP_START:
// RP Command Send // RP Command Send
Logger.d(TAG,"F_BLE_COM_RP_START"); //Logger.d(TAG,"F_BLE_COM_RP_START");
alcoholCheckerUtil.sendMessage(F_BLE_COM_RP_COMMAND); //alcoholCheckerUtil.sendMessage(F_BLE_COM_RP_COMMAND);
break; break;
case AlcoholCheckerUtil.F_BLE_COM_RD_START: case AlcoholCheckerUtil.F_BLE_COM_RD_START:
// RD Command Send // RD Command Send
Logger.d(TAG,"F_BLE_COM_RD_START"); //Logger.d(TAG,"F_BLE_COM_RD_START");
alcoholCheckerUtil.sendMessage(F_BLE_COM_RD_COMMAND); //alcoholCheckerUtil.sendMessage(F_BLE_COM_RD_COMMAND);
break; break;
case AlcoholCheckerUtil.F_BLE_COM_FC_START: case AlcoholCheckerUtil.F_BLE_COM_FC_START:
// Fc Command Send // Fc Command Send
Logger.d(TAG,"F_BLE_COM_FC_START"); //Logger.d(TAG,"F_BLE_COM_FC_START");
alcoholCheckerUtil.sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F11); //alcoholCheckerUtil.sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F11);
break;
case AlcoholCheckerUtil.F_BLE_COM_FC_START22:
// Fc Command Send
//Logger.d(TAG,"F_BLE_COM_FC_START22");
//alcoholCheckerUtil.sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F22);
break; break;
// case F_BLE_COM_RECONNECT1: // case F_BLE_COM_RECONNECT1:
// // ReConecting(NOTIFICATION Disable) // @@@ // // ReConecting(NOTIFICATION Disable) // @@@
......
...@@ -12,6 +12,8 @@ import java.io.UnsupportedEncodingException; ...@@ -12,6 +12,8 @@ import java.io.UnsupportedEncodingException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Timer; import java.util.Timer;
import java.util.UUID; import java.util.UUID;
import java.util.logging.Handler;
import java.util.logging.LogRecord;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -72,6 +74,8 @@ public class AlcoholCheckerUtil { ...@@ -72,6 +74,8 @@ public class AlcoholCheckerUtil {
public static final int F_BLE_COM_RECONNECT3 = 7; // ReConecting(NOTIFICATION Enable) public static final int F_BLE_COM_RECONNECT3 = 7; // ReConecting(NOTIFICATION Enable)
public static final int F_BLE_COM_FC_START = 8; // FC Command Sned public static final int F_BLE_COM_FC_START = 8; // FC Command Sned
public static final int F_BLE_COM_FC_WAIT = 9; // FC Command Wait public static final int F_BLE_COM_FC_WAIT = 9; // FC Command Wait
public static final int F_BLE_COM_FC_START22 = 10; // RDYに戻す FC Command Send
public static final int F_BLE_COM_FC_WAIT22 = 11; // RDYに戻す FC Command Wait
// @BLE Command // @BLE Command
public static final String F_BLE_COM_RP_COMMAND = "01525000A304"; // 01 52 50 00 A3 04 // RP 送信 public static final String F_BLE_COM_RP_COMMAND = "01525000A304"; // 01 52 50 00 A3 04 // RP 送信
...@@ -157,58 +161,56 @@ public class AlcoholCheckerUtil { ...@@ -157,58 +161,56 @@ public class AlcoholCheckerUtil {
// Bluetoothアダプタの取得処理 // Bluetoothアダプタの取得処理
public boolean startGetDeviceInfo() { public boolean startGetDeviceInfo() {
// BLE管理 // BLE管理
bleManagerUtil = new BleManagerUtil(context, new BleManagerUtilListener() { bleManagerUtil = new BleManagerUtil(context, new BleManagerUtilListener() {
@Override @Override
public void onConnectionState(int status) { public void onConnectionState(int status) {
Logger.i(TAG,"onConnectionState = %s" + status); // Logger.i(TAG,"-------------------------------------------------------------- = %s", status);
// Logger.i(TAG,"onConnectionState = %s", status);
if (status == BluetoothProfile.STATE_CONNECTED) { // Logger.i(TAG,"-------------------------------------------------------------- = %s", status);
Log.d(TAG, "Connected to GATT server."); // if (status == BluetoothProfile.STATE_CONNECTED) {
// Log.d(TAG, "Connected to GATT server.");
// ペリフェラルとの接続に成功した時点でサービスを検索する //
if (bleManagerUtil.mBluetoothGatt.discoverServices()) { // // ペリフェラルとの接続に成功した時点でサービスを検索する
Logger.d(TAG, "Started discovering services"); // if (bleManagerUtil.mBluetoothGatt.discoverServices()) {
} else { // Logger.d(TAG, "Started discovering services");
Logger.d(TAG, "Failed to start discovering services"); // } else {
} // Logger.d(TAG, "Failed to start discovering services");
isConnected = true; // }
// isConnected = true;
} else if (status == BluetoothProfile.STATE_DISCONNECTED) { //
// } else if (status == BluetoothProfile.STATE_DISCONNECTED) {
if (bleManagerUtil.mBluetoothGatt == null) { //
return; // if (bleManagerUtil.mBluetoothGatt == null) {
} else { // return;
Logger.i(TAG, "Disconnected from GATT server."); // } else {
listener.onConnectionError(19); // Logger.i(TAG, "Disconnected from GATT server.");
} // listener.onConnectionError(19);
} else { // }
Logger.i(TAG,"UNKNOW STATE = " + status); // } else {
} // Logger.i(TAG,"UNKNOW STATE = " + status);
// }
} }
@Override @Override
public void onDisConnectionState() { public void onDisConnectionState() {
Logger.d(TAG,"onDisConnectionState"); // Logger.d(TAG,"onDisConnectionState");
listener.onConnectionError(0); // listener.onConnectionError(0);
//isConnected = false; // //isConnected = false;
} }
@Override @Override
public void onConnectionError(int status) { public void onConnectionError(int status) {
Logger.d(TAG,"onConnectionError = %s", status); Logger.d(TAG,"onConnectionError = %s", status);
listener.onConnectionError(status); listener.onConnectionError(status);
//isConnected = false;
//stopAlcTimer();
//disconnect(true);
} }
@Override @Override
public void onServicesDiscovered(int status) { public void onServicesDiscovered(int status) {
Logger.d(TAG,"onServicesDiscovered = %s", status); Logger.i(TAG,"-------------------------------------------------------------- = %s", status);
Logger.i(TAG,"onServicesDiscovered = %s", status);
Logger.i(TAG,"-------------------------------------------------------------- = %s", status);
if (status == BluetoothGatt.GATT_SUCCESS) { if (status == BluetoothGatt.GATT_SUCCESS) {
Logger.i(TAG,"BluetoothGatt.GATT_SUCCESS"); Logger.i(TAG,"BluetoothGatt.GATT_SUCCESS");
...@@ -219,10 +221,11 @@ public class AlcoholCheckerUtil { ...@@ -219,10 +221,11 @@ public class AlcoholCheckerUtil {
// Check TX and RX UUIDs // Check TX and RX UUIDs
RxChar = TaiyoYudenService.getCharacteristic(RX_CHARACTERISTIC_UUID); RxChar = TaiyoYudenService.getCharacteristic(RX_CHARACTERISTIC_UUID);
TxChar = TaiyoYudenService.getCharacteristic(TX_CHARACTERISTIC_UUID); TxChar = TaiyoYudenService.getCharacteristic(TX_CHARACTERISTIC_UUID);
//Logger.i(TAG,"iiiiiiiiiiiiiiiiiiiiiii");
if (RxChar == null || TxChar == null) { if (RxChar == null || TxChar == null) {
Logger.e(TAG, "No Tx/Rx"); Logger.e(TAG, "No Tx/Rx");
} else { } else {
//Logger.i(TAG,"iiiiiiiiiiiiiiiiiiiiiii");
gi_status = F_BLE_COM_INIT; gi_status = F_BLE_COM_INIT;
gi_rxlength = 0; gi_rxlength = 0;
...@@ -247,9 +250,13 @@ public class AlcoholCheckerUtil { ...@@ -247,9 +250,13 @@ public class AlcoholCheckerUtil {
gi_status = F_BLE_COM_RP_START; gi_status = F_BLE_COM_RP_START;
startAlcTimer(); //startAlcTimer();
SendMessage(gi_status);
listener.onServicesDiscovered(status); listener.onServicesDiscovered(status);
Logger.i(TAG,"iiiiiiiiiiiiiiiiiiiiiii");
} }
} }
} else { } else {
...@@ -259,7 +266,7 @@ public class AlcoholCheckerUtil { ...@@ -259,7 +266,7 @@ public class AlcoholCheckerUtil {
@Override @Override
public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) {
Logger.d(TAG,"onCharacteristicChanged"); //Logger.d(TAG,"onCharacteristicChanged");
byte[] rx = characteristic.getValue(); byte[] rx = characteristic.getValue();
String rxStr = " "; String rxStr = " ";
...@@ -270,36 +277,55 @@ public class AlcoholCheckerUtil { ...@@ -270,36 +277,55 @@ public class AlcoholCheckerUtil {
} }
sub_rx_chk(rx); sub_rx_chk(rx);
if (gi_status == F_BLE_COM_FC_WAIT) { // if (gi_status == F_BLE_COM_FC_WAIT) {
Logger.d(TAG,"FC_WAIT"); // Logger.d(TAG,"FC_WAIT");
} // }
} }
@Override @Override
public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) {
Logger.d(TAG,"onDescriptorWrite"); //Logger.d(TAG,"onDescriptorWrite");
if (bleManagerUtil.mBluetoothGatt != null) { if (bleManagerUtil.mBluetoothGatt != null) {
if (bleManagerUtil.mBluetoothGatt.getService(TY_SERVICE_UUID).getCharacteristic(INDICATION_CHARACTERISTIC_UUID) == null) { if (bleManagerUtil.mBluetoothGatt.getService(TY_SERVICE_UUID).getCharacteristic(INDICATION_CHARACTERISTIC_UUID) == null) {
Logger.d(TAG, "Old version"); Logger.d(TAG, "Old version");
// This version doesn't support latest characteristics // This version doesn't support latest characteristics
return; return;
} }
} else { } else {
return; return;
} }
gatt = bleManagerUtil.mBluetoothGatt;
TaiyoYudenService = gatt.getService(TY_SERVICE_UUID);
BatteryService = gatt.getService(BATTERY_SERVICE_UUID);
NotificationChar = TaiyoYudenService.getCharacteristic(NOTIFICATION_CHARACTERISTIC_UUID);
IndicationChar = TaiyoYudenService.getCharacteristic(INDICATION_CHARACTERISTIC_UUID);
WriteChar = TaiyoYudenService.getCharacteristic(WRITE_NO_RESPONSE_CHARACTERISTIC_UUID);
batteryLevelChar = BatteryService.getCharacteristic(BATTERY_LEVEL_UUID);
connectionPHY = 0;
bleManagerUtil.readPhyConnection();
bleManagerUtil.mBluetoothGatt.setCharacteristicNotification(NotificationChar, true);
BluetoothGattDescriptor notification_descriptor = NotificationChar.getDescriptor(CCCD);
notification_descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
bleManagerUtil.mBluetoothGatt.writeDescriptor(notification_descriptor);
UUID characteristic_uuid = descriptor.getCharacteristic().getUuid(); UUID characteristic_uuid = descriptor.getCharacteristic().getUuid();
if(characteristic_uuid.equals(NOTIFICATION_CHARACTERISTIC_UUID)){ if(characteristic_uuid.equals(NOTIFICATION_CHARACTERISTIC_UUID)){
bleManagerUtil.mBluetoothGatt.setCharacteristicNotification(IndicationChar, true); if (IndicationChar == null) {
IndicationChar = TaiyoYudenService.getCharacteristic(INDICATION_CHARACTERISTIC_UUID);
}
gatt.setCharacteristicNotification(IndicationChar, true);
BluetoothGattDescriptor indication_descriptor = IndicationChar.getDescriptor(CCCD); BluetoothGattDescriptor indication_descriptor = IndicationChar.getDescriptor(CCCD);
indication_descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE); indication_descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
bleManagerUtil.mBluetoothGatt.writeDescriptor(indication_descriptor); gatt.writeDescriptor(indication_descriptor);
} else if(characteristic_uuid.equals(INDICATION_CHARACTERISTIC_UUID)){ } else if(characteristic_uuid.equals(INDICATION_CHARACTERISTIC_UUID)){
// Enable notification on receiving data // Enable notification on receiving data
bleManagerUtil.mBluetoothGatt.setCharacteristicNotification(batteryLevelChar, true); gatt.setCharacteristicNotification(batteryLevelChar, true);
BluetoothGattDescriptor notification_descriptor = batteryLevelChar.getDescriptor(CCCD); notification_descriptor = batteryLevelChar.getDescriptor(CCCD);
notification_descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE); notification_descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
bleManagerUtil.mBluetoothGatt.writeDescriptor(notification_descriptor); gatt.writeDescriptor(notification_descriptor);
} else if(characteristic_uuid.equals(BATTERY_LEVEL_UUID)){ } else if(characteristic_uuid.equals(BATTERY_LEVEL_UUID)){
Logger.d(TAG, "Wrote descriptor: " + BATTERY_LEVEL_UUID); Logger.d(TAG, "Wrote descriptor: " + BATTERY_LEVEL_UUID);
} }
...@@ -313,6 +339,39 @@ public class AlcoholCheckerUtil { ...@@ -313,6 +339,39 @@ public class AlcoholCheckerUtil {
return true; return true;
} }
public int lastSendCmd;
public void SendMessage(final int statusa) {
// if (statusa == 1 || statusa == 3 || statusa ==8) {
// Logger.d(TAG, "SendMessage = " + statusa);
// }
// if (lastSendCmd == statusa) {
// return;
// }
lastSendCmd = statusa;
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//gi_rxlength = 0;
if (statusa == F_BLE_COM_RP_START) {
sendMessage(F_BLE_COM_RP_COMMAND);
} else if (statusa == F_BLE_COM_RD_START) {
sendMessage(F_BLE_COM_RD_COMMAND);
} else if (statusa == F_BLE_COM_FC_START) {
sendMessage(F_BLE_COM_FC_COMMAND_F11);
} else if (statusa == F_BLE_COM_FC_START22) {
sendMessage(F_BLE_COM_FC_COMMAND_F22);
}
}
});
thread.start();
}
/** /**
* アルコールチェッカーを監視するタイマーを開始する * アルコールチェッカーを監視するタイマーを開始する
*/ */
...@@ -370,6 +429,7 @@ public class AlcoholCheckerUtil { ...@@ -370,6 +429,7 @@ public class AlcoholCheckerUtil {
@Override @Override
public void run() { public void run() {
gi_rxlength = 0;
final int PACKET_SIZE = 20; final int PACKET_SIZE = 20;
BluetoothGatt s_mBluetoothGatt; // @@@ BluetoothGatt s_mBluetoothGatt; // @@@
String error_msg = ""; String error_msg = "";
...@@ -411,28 +471,35 @@ public class AlcoholCheckerUtil { ...@@ -411,28 +471,35 @@ public class AlcoholCheckerUtil {
} }
Logger.i(TAG,"Tx:" + message); Logger.i(TAG,"Tx:" + message);
if (message.equals("01464301F27D04")) {
Logger.d(TAG,"aaaaaaaaaaa");
}
// @Mode Change // @Mode Change
switch (gi_status) { switch (gi_status) {
case F_BLE_COM_RP_START: case F_BLE_COM_RP_START:
//listener.onUpdateStatus("sendMessage = F_BLE_COM_RP_WAIT");
gi_status = F_BLE_COM_RP_WAIT; gi_status = F_BLE_COM_RP_WAIT;
Logger.d(TAG,"F_BLE_COM_RP_WAIT:" + gi_status); Logger.d(TAG,"F_BLE_COM_RP_WAIT:" + gi_status);
break; break;
case F_BLE_COM_RD_START: case F_BLE_COM_RD_START:
//listener.onUpdateStatus("sendMessage = F_BLE_COM_RD_WAIT");
gi_status = F_BLE_COM_RD_WAIT; gi_status = F_BLE_COM_RD_WAIT;
Logger.d(TAG,"F_BLE_COM_RD_WAIT:" + gi_status); Logger.d(TAG,"F_BLE_COM_RD_WAIT:" + gi_status);
break; break;
case F_BLE_COM_FC_START: case F_BLE_COM_FC_START:
//listener.onUpdateStatus("sendMessage = F_BLE_COM_FC_WAIT");
gi_status = F_BLE_COM_FC_WAIT; gi_status = F_BLE_COM_FC_WAIT;
Logger.d(TAG,"F_BLE_COM_FC_WAIT:" + gi_status); Logger.d(TAG,"F_BLE_COM_FC_WAIT:" + gi_status);
break; break;
case F_BLE_COM_FC_START22:
gi_status = F_BLE_COM_FC_WAIT22;
Logger.d(TAG,"F_BLE_COM_FC_WAIT22:" + gi_status);
break;
default: default:
// None // None
break; break;
} }
//SendMessage(gi_status);
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
Logger.w(TAG,e); Logger.w(TAG,e);
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -528,7 +595,8 @@ public class AlcoholCheckerUtil { ...@@ -528,7 +595,8 @@ public class AlcoholCheckerUtil {
sub_rx_data_gen(rxdata); sub_rx_data_gen(rxdata);
// Mode // Mode
Logger.i(TAG,"sub_rx_chk gi_status = " + gi_status); int gi = gi_status;
//Logger.i(TAG,"sub_rx_chk gi_status = " + gi_status);
switch (gi_status) { switch (gi_status) {
case F_BLE_COM_INIT: case F_BLE_COM_INIT:
// BLE Init // BLE Init
...@@ -544,16 +612,27 @@ public class AlcoholCheckerUtil { ...@@ -544,16 +612,27 @@ public class AlcoholCheckerUtil {
case F_BLE_COM_FC_WAIT: case F_BLE_COM_FC_WAIT:
gi_status = fn_rx_fc_chk(rxdata); gi_status = fn_rx_fc_chk(rxdata);
break; break;
case F_BLE_COM_FC_WAIT22:
gi_status = fn_rx_fc_chk2(rxdata);
break;
default: default:
// Others(Include Error) // Others(Include Error)
gi_status = F_BLE_COM_RP_START; gi_status = F_BLE_COM_RP_START;
break; break;
} }
//if (gi!=gi_status)
{
SendMessage(gi_status);
}
} catch (IndexOutOfBoundsException e) { } catch (IndexOutOfBoundsException e) {
Logger.e(TAG,e); Logger.e(TAG,e);
} }
} }
public void SendResponse() {
}
/* @Read Flame Generation */ /* @Read Flame Generation */
private void sub_rx_data_gen(byte[] rxdata) { private void sub_rx_data_gen(byte[] rxdata) {
int si_length; int si_length;
...@@ -578,14 +657,26 @@ public class AlcoholCheckerUtil { ...@@ -578,14 +657,26 @@ public class AlcoholCheckerUtil {
/* @RP Command Check */ /* @RP Command Check */
private int fn_rx_rp_chk(byte[] rxdata) { private int fn_rx_rp_chk(byte[] rxdata) {
Logger.d(TAG,"fn_rx_rp_chk");
int si_ret; int si_ret;
byte sb_mode; byte sb_mode;
for (byte b: rxdata) {
Logger.d(TAG,"%s, ", Byte.toString(b));
}
si_ret = F_BLE_COM_RP_WAIT; si_ret = F_BLE_COM_RP_WAIT;
// 01 72 70 02
//
boolean go = false;
if (rxdata[0] == 2 && rxdata[1] == 14 && rxdata[2] == -11 && rxdata[3] == 4) {
go = true;
}
// Command Check // Command Check
Logger.d(TAG,"RP_RENGTH=" + gi_rxlength); Logger.d(TAG,"RP_RENGTH=" + gi_rxlength);
if (gi_rxlength == F_RX_RP_LENGTH) { if (gi_rxlength == F_RX_RP_LENGTH || go) {
if ((gb_rxdat[F_RX_COMMAND_POS] == F_RP_COMMAND_MSB) && (gb_rxdat[(F_RX_COMMAND_POS + 1)] == F_RP_COMMAND_LSB)) { if ((gb_rxdat[F_RX_COMMAND_POS] == F_RP_COMMAND_MSB) && (gb_rxdat[(F_RX_COMMAND_POS + 1)] == F_RP_COMMAND_LSB)) {
sb_mode = gb_rxdat[F_RX_RP_MODE_POS]; sb_mode = gb_rxdat[F_RX_RP_MODE_POS];
switch (sb_mode) { switch (sb_mode) {
...@@ -627,6 +718,7 @@ public class AlcoholCheckerUtil { ...@@ -627,6 +718,7 @@ public class AlcoholCheckerUtil {
// リザルトが出たら、FCでRDYに戻す // リザルトが出たら、FCでRDYに戻す
// si_ret = F_BLE_COM_FC_START; // si_ret = F_BLE_COM_FC_START;
break; break;
case (byte) 0x0D: case (byte) 0x0D:
// Wait // Wait
...@@ -714,20 +806,59 @@ public class AlcoholCheckerUtil { ...@@ -714,20 +806,59 @@ public class AlcoholCheckerUtil {
return si_ret; return si_ret;
} }
private int fn_rx_fc_chk2(byte[] rxdata) {
Logger.d(TAG, "fn_rx_fc_chk2");
int si_ret = F_BLE_COM_FC_WAIT22;
if (fcWaitMode == 0) {
if (rxdata[0] == 1 && rxdata[1] == 102 && rxdata[2] == 99 && rxdata[3] == 3) {
fcWaitMode = 1;
}
} else if (fcWaitMode == 1) {
if (rxdata.length == 5) {
// 49 05 32 35 4
// 0x31 05 20 23 4 実行完了 本体動作モード リアルタイム測定進行状況 チェックサム 4
if (rxdata[0] == 49 && rxdata[1] == 2) {
Logger.i(TAG, "------FC2成功");
si_ret = F_BLE_COM_RP_START;
}
//if (rxdata[1] == 0x05)
listener.onGetDeviceInfo(alcol);
// if (StringUtil.isNullOrEmpty(alcol)) {
// // 空文字の時は BLEに戻す
// si_ret = F_BLE_COM_FC_START;
// } else {
// if (status == F_BLE_COM_FC_WAIT22) {
// // RDY戻し待ちの場合は
// //si_ret = F_BLE_COM_FC_START22;
// si_ret = F_BLE_COM_RP_START;
// } else {
// //si_ret = F_BLE_COM_FC_START22;
// }
// si_ret = F_BLE_COM_RP_START;
// }
fcWaitMode = 0;
//si_ret = F_BLE_COM_FC_START22;
//SendMessage(si_ret);
//listener.onGetDeviceInfo(alcol);
}
}
return si_ret;
}
private int fn_rx_fc_chk(byte[] rxdata) { private int fn_rx_fc_chk(byte[] rxdata) {
Logger.d(TAG,"fn_rx_fc_chk");
int si_ret = F_BLE_COM_FC_WAIT; int si_ret = F_BLE_COM_FC_WAIT;
byte sb_data;
short ss_data;
String str_msg = "";
//str_msg = hex2string(rxdata);
byte[] res = hex2string(rxdata);
for (byte b: rxdata) { for (byte b: rxdata) {
//str_msg += Byte.toString(b); Logger.d(TAG,"%s, ", Byte.toString(b));
Logger.d(TAG,"%s, " + Byte.toString(b));
} }
//Logger.i(TAG, "fn_rx_fc_chk = " + str_msg);
// 01 72 70 02 rp 上位 // 01 72 70 02 rp 上位
// 01 114 112 02 // 01 114 112 02
...@@ -740,27 +871,39 @@ public class AlcoholCheckerUtil { ...@@ -740,27 +871,39 @@ public class AlcoholCheckerUtil {
// //
if (fcWaitMode == 0) { if (fcWaitMode == 0) {
if (rxdata[0] == 1 && rxdata[1] == 102 && rxdata[2] == 99 && rxdata[3] == 3) { if (rxdata[0] == 1 && rxdata[1] == 102 && rxdata[2] == 99 && rxdata[3] == 3) {
//Logger.i(TAG, "fc--------------------");
fcWaitMode = 1; fcWaitMode = 1;
} }
} else if (fcWaitMode == 1) { } else if (fcWaitMode == 1) {
if (rxdata.length == 5) { if (rxdata.length == 5) {
// 0x31 49 // 49 05 32 35 4
// 2 2 // 0x31 05 20 23 4 実行完了 本体動作モード リアルタイム測定進行状況 チェックサム 4
// E 14
// E 14 チェックサム if (rxdata[0] ==49 && rxdata[1] == 2) {
// 4 4
if (rxdata[0] != 0x31) {
//Logger.i(TAG, "------FC失敗"); //Logger.i(TAG, "------FC失敗");
//si_ret = F_BLE_COM_RP_START;
//return si_ret;
} }
//Logger.i(TAG, "fc=" + fcWaitMode);
listener.onGetDeviceInfo(alcol); //listener.onGetDeviceInfo(alcol);
if (StringUtil.isNullOrEmpty(alcol)) {
si_ret = F_BLE_COM_FC_START; // if (StringUtil.isNullOrEmpty(alcol)) {
} else { // // 空文字の時は BLEに戻す
si_ret = F_BLE_COM_RP_START; // si_ret = F_BLE_COM_FC_START;
} // //} else {
//// if (status == F_BLE_COM_FC_WAIT22) {
//// // RDY戻し待ちの場合は
//// //si_ret = F_BLE_COM_FC_START22;
//// si_ret = F_BLE_COM_RP_START;
//// } else {
//// //si_ret = F_BLE_COM_FC_START22;
//// }
// //si_ret = F_BLE_COM_RP_START;
// }
fcWaitMode = 0; fcWaitMode = 0;
//si_ret = F_BLE_COM_FC_START22;
//SendMessage(si_ret);
//listener.onGetDeviceInfo(alcol);
} }
} }
return si_ret; return si_ret;
...@@ -770,6 +913,7 @@ public class AlcoholCheckerUtil { ...@@ -770,6 +913,7 @@ public class AlcoholCheckerUtil {
/* @RD Command Check */ /* @RD Command Check */
private int fn_rx_rd_chk(byte[] rxdata) { private int fn_rx_rd_chk(byte[] rxdata) {
Logger.d(TAG,"fn_rx_rd_chk");
int si_ret; int si_ret;
byte sb_data; byte sb_data;
short ss_data; short ss_data;
...@@ -778,7 +922,9 @@ public class AlcoholCheckerUtil { ...@@ -778,7 +922,9 @@ public class AlcoholCheckerUtil {
si_ret = F_BLE_COM_RD_WAIT; si_ret = F_BLE_COM_RD_WAIT;
// Command Check // Command Check
Logger.d(TAG,"RD_LENGTH="+gi_rxlength);
if (gi_rxlength == F_RX_RD_LENGTH) { if (gi_rxlength == F_RX_RD_LENGTH) {
// 0x72, 0x64
if ((gb_rxdat[F_RX_COMMAND_POS] == F_RD_COMMAND_MSB) && (gb_rxdat[(F_RX_COMMAND_POS + 1)] == F_RD_COMMAND_LSB)) { if ((gb_rxdat[F_RX_COMMAND_POS] == F_RD_COMMAND_MSB) && (gb_rxdat[(F_RX_COMMAND_POS + 1)] == F_RD_COMMAND_LSB)) {
sb_data = gb_rxdat[F_RX_RD_DATA_POS]; sb_data = gb_rxdat[F_RX_RD_DATA_POS];
str_msg = ""; str_msg = "";
...@@ -799,13 +945,12 @@ public class AlcoholCheckerUtil { ...@@ -799,13 +945,12 @@ public class AlcoholCheckerUtil {
str_msg += String.format("%1$02d", ss_data); str_msg += String.format("%1$02d", ss_data);
} }
Logger.d(TAG,"測定結果表示");
//str_msg += "[mg/L]"; //str_msg += "[mg/L]";
//listener.onUpdateTBVCalc(str_msg + " 0x0C 測定結果表示状態"); // 0x0C 測定結果表示状態");
//listener.onGetDeviceInfo(str_msg);
alcol = str_msg; alcol = str_msg;
si_ret = F_BLE_COM_FC_START; si_ret = F_BLE_COM_FC_START22;
//alcoholCheckerUtil.
//sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F11);
return si_ret; return si_ret;
} else { } else {
// Error // Error
......
...@@ -12,6 +12,7 @@ import android.bluetooth.BluetoothProfile; ...@@ -12,6 +12,7 @@ import android.bluetooth.BluetoothProfile;
import android.bluetooth.le.ScanCallback; import android.bluetooth.le.ScanCallback;
import android.bluetooth.le.ScanResult; import android.bluetooth.le.ScanResult;
import android.content.Context; import android.content.Context;
import android.graphics.RenderNode;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
...@@ -59,7 +60,9 @@ public class BleManagerUtil { ...@@ -59,7 +60,9 @@ public class BleManagerUtil {
@Override @Override
public void onConnectionStateChange(BluetoothGatt gatt, final int status, final int newState ) { public void onConnectionStateChange(BluetoothGatt gatt, final int status, final int newState ) {
Logger.i("onConnectionStateChange status = " + status + " newState = " + newState); Logger.i("onConnectionStateChange status = " + status + " newState = " + newState);
if (newState == BluetoothProfile.STATE_CONNECTED) {
gatt.discoverServices();
}
// デバイスと接続されていない場合のメッセージコード:133, 62 // デバイスと接続されていない場合のメッセージコード:133, 62
// デバイスと離れて応答がなく、タイムアウトになる場合:8 // デバイスと離れて応答がなく、タイムアウトになる場合:8
// デバイスと接続が切れた場合のメッセージコード:19 // デバイスと接続が切れた場合のメッセージコード:19
...@@ -73,6 +76,13 @@ public class BleManagerUtil { ...@@ -73,6 +76,13 @@ public class BleManagerUtil {
Logger.e(TAG,"onConnectionStateChange status = " + status); Logger.e(TAG,"onConnectionStateChange status = " + status);
} }
}); });
// runOnUiThread(new Runnable() {
// @Override
// public void run() {
// //mBluetoothGatt = device.connectGatt(mContext, false, mGattcallback, TRANSPORT_LE);
// bleGattReconnect();
// }
// });
return; return;
} }
...@@ -116,25 +126,36 @@ public class BleManagerUtil { ...@@ -116,25 +126,36 @@ public class BleManagerUtil {
// サービス検索が完了したときの処理(mBluetoothGatt.discoverServices()の結果として呼ばれる。) // サービス検索が完了したときの処理(mBluetoothGatt.discoverServices()の結果として呼ばれる。)
@Override @Override
public void onServicesDiscovered(BluetoothGatt gatt, final int status) { public void onServicesDiscovered(BluetoothGatt gatt, final int status) {
Logger.i(TAG,"onServicesDiscovered status = %s", status); try {
Logger.i(TAG, "onServicesDiscovered status = %s", status);
if( BluetoothGatt.GATT_SUCCESS != status ) { if (BluetoothGatt.GATT_SUCCESS != status) {
return; return;
} }
mBluetoothGatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_HIGH);
// アルコールチェッカー mBluetoothGatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_HIGH);
mListener.onServicesDiscovered(status);
if (mListener != null)
{
// アルコールチェッカー
mListener.onServicesDiscovered(status);
}
} catch (Exception e) {
Logger.d(TAG,e);
}
} }
// キャラクタリスティックが読み込まれたときの処理 // キャラクタリスティックが読み込まれたときの処理
@Override @Override
public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status ) { public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status ) {
Logger.d(TAG, "onCharacteristicRead"); try {
if (BluetoothGatt.GATT_SUCCESS != status) { Logger.d(TAG, "onCharacteristicRead");
return; if (BluetoothGatt.GATT_SUCCESS != status)
{
return;
}
} catch (Exception e) {
Logger.d(TAG,"null");
} }
} }
...@@ -142,14 +163,24 @@ public class BleManagerUtil { ...@@ -142,14 +163,24 @@ public class BleManagerUtil {
@Override @Override
public void onCharacteristicChanged( BluetoothGatt gatt, BluetoothGattCharacteristic characteristic ) { public void onCharacteristicChanged( BluetoothGatt gatt, BluetoothGattCharacteristic characteristic ) {
Logger.d(TAG,"onCharacteristicChanged"); Logger.d(TAG,"onCharacteristicChanged");
if (mListener != null) { try {
mListener.onCharacteristicChanged(gatt, characteristic); //if (mListener != null)
{
mListener.onCharacteristicChanged(gatt, characteristic);
}
} catch (Exception e) {
Logger.e(TAG,e);
} }
} }
@Override @Override
public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status){ public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status){
Logger.d(TAG,"onDescriptorWrite"); Logger.d(TAG,"onDescriptorWrite");
mListener.onDescriptorWrite(gatt, descriptor, status); try {
mListener.onDescriptorWrite(gatt, descriptor, status);
} catch ( Exception e) {
Logger.e(TAG,e);
}
} }
}; };
......
...@@ -187,6 +187,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -187,6 +187,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 二重起動防止フラグ(アルコールチェッカー) // 二重起動防止フラグ(アルコールチェッカー)
private boolean isAlcBlock = false; private boolean isAlcBlock = false;
// 終了フラグ
private boolean isFinish = false;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -280,9 +282,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -280,9 +282,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} else { } else {
return; return;
} }
runOnUiThread(new Runnable() { // runOnUiThread(new Runnable() {
@Override // @Override
public void run() { // public void run() {
if (mWaitingDialog != null) { if (mWaitingDialog != null) {
mWaitingDialog.dismiss(); mWaitingDialog.dismiss();
mWaitingDialog = null; mWaitingDialog = null;
...@@ -290,18 +292,23 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -290,18 +292,23 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
alcoholCheckerUtil.isConnected = true; alcoholCheckerUtil.isConnected = true;
// 測定開始ボタン押し待ち // 測定開始ボタン押し待ち
showWaitMeasureDialog(getString(R.string.alcohol_checker), getString(R.string.connection_completed)); showWaitMeasureDialog(getString(R.string.alcohol_checker), getString(R.string.connection_completed));
} // }
}); // });
} }
@Override @Override
public void onGetDeviceInfo(String alcohol) { public void onGetDeviceInfo(final String alcohol) {
Logger.d(TAG, "測定完了 = " + alcohol); // runOnUiThread(new Runnable() {
if (!alcohol.equals("")) { // @Override
successAfterAbookCheckApi(alcohol, false); // public void run() {
} else { Logger.d(TAG, "測定完了 = " + alcohol);
if (!alcohol.equals("")) {
successAfterAbookCheckApi(alcohol, false);
} else {
} }
// }
// });
} }
@Override @Override
...@@ -312,16 +319,16 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -312,16 +319,16 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} else { } else {
return; return;
} }
runOnUiThread(new Runnable() { // runOnUiThread(new Runnable() {
@Override // @Override
public void run() { // public void run() {
if (mWaitMeasureDialog != null) { if (mWaitMeasureDialog != null) {
mWaitMeasureDialog.dismiss(); mWaitMeasureDialog.dismiss();
mWaitMeasureDialog = null; mWaitMeasureDialog = null;
} }
showMeasureDialog(getString(R.string.alcohol_checker), getString(R.string.wait_breathe)); showMeasureDialog(getString(R.string.alcohol_checker), getString(R.string.wait_breathe));
} // }
}); // });
} }
@Override @Override
...@@ -399,7 +406,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -399,7 +406,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
* 各デバイスから値を正常に取得された場合、HTML側にコールする * 各デバイスから値を正常に取得された場合、HTML側にコールする
* @param value 各種デバイスから取得した値 * @param value 各種デバイスから取得した値
*/ */
private void successAfterAbookCheckApi(final String value, final boolean isFinish) { private void successAfterAbookCheckApi(final String value, boolean isFinish) {
this.isFinish = isFinish;
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -407,7 +415,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -407,7 +415,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
JSONObject responseJson = new JSONObject(); JSONObject responseJson = new JSONObject();
responseJson.put(ABookKeys.TASK_QUESTION_ID, mQid); responseJson.put(ABookKeys.TASK_QUESTION_ID, mQid);
responseJson.put("value", value); responseJson.put("value", value);
alcoholCheckerUtil.sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F11); // alcoholCheckerUtil.sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F11);
//alcoholCheckerUtil.sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F22);
//alcoholCheckerUtil.gi_status = AlcoholCheckerUtil.F_BLE_COM_FC_START22;
afterABookCheckApi(mCmd, "", 0, "", responseJson.toString()); afterABookCheckApi(mCmd, "", 0, "", responseJson.toString());
Logger.i(TAG, "successAfterAbookCheckAip JSON [%s]", responseJson.toString()); Logger.i(TAG, "successAfterAbookCheckAip JSON [%s]", responseJson.toString());
} }
...@@ -419,11 +429,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -419,11 +429,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
* @param errorMessage 各種デバイスから取得した値 * @param errorMessage 各種デバイスから取得した値
*/ */
private void errorAfterAbookCheckApi(final String errorMessage) { private void errorAfterAbookCheckApi(final String errorMessage) {
// エラーの時は終了
isFinish = true;
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
dismissAllDialog(); dismissAllDialog();
alcoholCheckerUtil.sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F11); //alcoholCheckerUtil.gi_status = AlcoholCheckerUtil.F_BLE_COM_FC_START;
//alcoholCheckerUtil.sendMessage(AlcoholCheckerUtil.F_BLE_COM_FC_COMMAND_F11);
afterABookCheckApi(mCmd, "", 1, errorMessage, null); afterABookCheckApi(mCmd, "", 1, errorMessage, null);
Logger.e(TAG,errorMessage); Logger.e(TAG,errorMessage);
} }
...@@ -444,6 +457,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -444,6 +457,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
Logger.i(TAG, "waiting Dialog stop click"); Logger.i(TAG, "waiting Dialog stop click");
successAfterAbookCheckApi("", true); successAfterAbookCheckApi("", true);
//errorAfterAbookCheckApi("");
} }
}); });
mWaitingDialog.show(); mWaitingDialog.show();
...@@ -462,7 +476,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -462,7 +476,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
Logger.i(TAG, "waiting mWaitMeasureDialog stop clickf"); Logger.i(TAG, "waiting mWaitMeasureDialog stop clickf");
successAfterAbookCheckApi("", true); successAfterAbookCheckApi("", false);
//errorAfterAbookCheckApi("");
} }
}); });
mWaitMeasureDialog.show(); mWaitMeasureDialog.show();
...@@ -481,7 +496,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -481,7 +496,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
Logger.i(TAG, "wait mMeasureDialog stop click"); Logger.i(TAG, "wait mMeasureDialog stop click");
successAfterAbookCheckApi("", true); successAfterAbookCheckApi("", false);
//errorAfterAbookCheckApi("");
} }
}); });
mMeasureDialog.show(); mMeasureDialog.show();
...@@ -627,12 +643,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -627,12 +643,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// タイマーにFCコマンド // タイマーにFCコマンド
if (alcoholCheckerUtil != null) { if (alcoholCheckerUtil != null) {
isAlcBlock = false; // false にしないと2回目押せない isAlcBlock = false; // false にしないと2回目押せない
alcoholCheckerUtil.gi_status = AlcoholCheckerUtil.F_BLE_COM_FC_START; //alcoholCheckerUtil.gi_status = AlcoholCheckerUtil.F_BLE_COM_FC_START;
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
// チェッカーも終了 // チェッカーも終了
alcoholCheckerUtil.finish(); //alcoholCheckerUtil.finish();
} }
}, 1000); }, 1000);
...@@ -644,7 +660,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -644,7 +660,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
Logger.d(TAG,"-------------------------------------------------"); Logger.d(TAG,"-------------------------------------------------");
Logger.d(TAG,"onDestroy"); Logger.d(TAG,"onDestroy");
Logger.d(TAG,"-------------------------------------------------"); Logger.d(TAG,"-------------------------------------------------");
//Logger.d(TAG, "onDestroy");
if (readingLogFlg) { if (readingLogFlg) {
ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class); ContentReadingLogLogic logic = AbstractLogic.getLogic(ContentReadingLogLogic.class);
logic.endContentReadLog(contentId); logic.endContentReadLog(contentId);
...@@ -1372,12 +1387,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1372,12 +1387,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mCmd, mTaskKey, mEnableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(), mCmd, mTaskKey, mEnableReportHistory, abookCheckParam, mOperationId, mContentPath, getContentId(),
operationDto.reportType, finishCallback, taskReportLevel); operationDto.reportType, finishCallback, taskReportLevel);
// if (StringUtil.equalsAny(mCmd,ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, if (StringUtil.equalsAny(mCmd,ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
// ABookKeys.CMD_DELETE_TASK_REPORT , ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT) ABookKeys.CMD_DELETE_TASK_REPORT , ABookKeys.CMD_CANCEL_TASK_REPORT, ABookKeys.CMD_LOCAL_SAVE_TASK_REPORT)
// ){ ){
// // 作業一覧に戻る時,bluetoothを切断する。 // 作業一覧に戻る時,bluetoothを切断する。
// disconnectBluetoothDevice(); //disconnectBluetoothDevice();
// } }
} catch(Exception e) { } catch(Exception e) {
Logger.e(TAG, "doABookCheckParam error", e); Logger.e(TAG, "doABookCheckParam error", e);
...@@ -1683,13 +1698,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1683,13 +1698,25 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message)); webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message));
} }
if (cmd.equals(ABookKeys.CMD_GET_DEVICE_INFO)) { if (cmd.equals(ABookKeys.CMD_GET_DEVICE_INFO)) {
if (alcoholCheckerUtil != null) {
alcoholCheckerUtil.finish();
alcoholCheckerUtil = null;
}
// アルコールチェッカー終了 // アルコールチェッカー終了
isAlcBlock = false; isAlcBlock = false;
// if (alcoholCheckerUtil != null) {
// if (!isFinish) {
// alcoholCheckerUtil.gi_status = AlcoholCheckerUtil.F_BLE_COM_FC_START22;
// } else {
// alcoholCheckerUtil.gi_status = AlcoholCheckerUtil.F_BLE_COM_FC_START;
// }
// }
} }
// if (cmd.equals(ABookKeys.CMD_GET_DEVICE_INFO)) {
//// if (alcoholCheckerUtil != null) {
//// alcoholCheckerUtil.finish();
//// alcoholCheckerUtil = null;
//// }
// // アルコールチェッカー終了
// isAlcBlock = false;
// }
} }
}); });
} }
...@@ -1941,4 +1968,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1941,4 +1968,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
this.mPhotoEditDialog.show(); this.mPhotoEditDialog.show();
} }
} }
private void disconnectBluetoothDevice() {
Logger.d(TAG, "disconnectBluetoothDevice");
// if (alcoholCheckerUtil != null) {
// alcoholCheckerUtil.finish();
// alcoholCheckerUtil = null;
// }
}
} }
\ No newline at end of file
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