Commit 61e9951f by Lee Jaebin

検証のため、ログ追加

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