Commit 61e9951f by Lee Jaebin

検証のため、ログ追加

parent 5e5dbf1b
......@@ -156,7 +156,7 @@ public abstract class ABVActivity extends Activity {
}
public void showProgressPopup(String msg) {
if (!isFinishing() && progressDialog != null && !progressDialog.isShowing()) {
Logger.d(TAG, "-------------------------showProgressPopup");
Logger.d(TAG, "-------------------------showProgressPopup msg " + msg);
printLog("showProgressPopup");
if(msg != null) {
progressDialog.setMessage(msg);
......
......@@ -670,6 +670,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
final BluetoothDevice bluetoothDevice = mBluetoothAdapter.getRemoteDevice(sppDeviceDto.pairingDeviceAddress);
if (bluetoothDevice != null) {
Logger.d(TAG, "----bluetoothDevice is not null");
// 既に接続している場合、端末アドレスが一致すれば、接続済みと見做す。
if (mSppBluetoothConnectThread != null && mSppBluetoothConnectThread.getConnectedAddress().equals(bluetoothDevice.getAddress())) {
// 接続完了後、処理
......@@ -681,10 +682,12 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
}
});
}
Logger.d(TAG, "----mSppBluetoothConnectThread is not null address Same");
} else { // 初回のbluetooth接続・bluetooth対象アドレスが異なる場合、新規で接続するようにする。
// 初回ではない場合はbluetoothを一度接続を切る。
if (mSppBluetoothConnectThread != null) {
Logger.i("------------------------------1");
Logger.d(TAG, "----mSppBluetoothConnectThread is not null address diff");
disConnectSppBluetooth();
handler.postDelayed(new Runnable() {
@Override
......@@ -693,6 +696,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
}
}, 5000);
} else {
Logger.d(TAG, "----mSppBluetoothConnectThread null");
setSppBluetoothThread(bluetoothDevice, sppDeviceDto);
}
}
......@@ -701,6 +705,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
}
private void setSppBluetoothThread(final BluetoothDevice bluetoothDevice, final SppDeviceDto sppDeviceDto) {
Logger.d("-------setSppBluetoothThread start");
// 接続が切れた時、tureにセットするため、接続起動時falseに初期化する。
mDisConnectSppBluetoothFlg = false;
......@@ -711,6 +716,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
mSppBluetoothConnectThread = new SppBluetoothConnectThread(bluetoothDevice, new SppBluetoothConnectThread.bluetoothConnectThreadListener() {
@Override
public void onConnect(BluetoothSocket socket) {
Logger.d(TAG, "---connect");
// 接続完了後、処理
if (mWaitingDialog != null) {
handler.post(new Runnable() {
......@@ -733,7 +739,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
@Override
public void onFail(boolean dataFormatErrorFlg) {
Logger.e(TAG, "receiveTaskThread fail");
Logger.e(TAG, "receiveTaskThread fail dataFormatErrorFlg : " + dataFormatErrorFlg);
connectErrorSppDevice(sppDeviceDto.sppDeviceName, dataFormatErrorFlg);
}
});
......@@ -806,7 +812,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
// データ取得時のエラーはbluetoothを切断しない
errorAfterAbookCheckAip(String.format(getString(R.string.msg_bluetooth_receive_data_error), deviceName));
} else {
disConnectSppBluetooth();
// disConnectSppBluetooth();
errorAfterAbookCheckAip(String.format(getString(R.string.msg_bluetooth_connect_error), deviceName));
}
if (mWaitingDialog != null && mWaitingDialog.isShowing()) {
......@@ -976,6 +982,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
// SPP通信のタスクが存在すれば接続を切るにする
private void disConnectSppBluetooth() {
Logger.d(TAG, "----disConnectSppBluetooth");
mDisConnectSppBluetoothFlg = true;
if (mYamatoReceiveTask != null) {
mYamatoReceiveTask.finish();
......
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