Эх сурвалжийг харах

add logs 4 ICReaderByIDR211

Melon 1 жил өмнө
parent
commit
340ae6d707

+ 5 - 0
app/src/main/java/vinno/sportinspect/devices/ICReaderByIDR211.java

@@ -15,6 +15,7 @@ import vinno.sportinspect.bean.ErrorEntity;
 import vinno.sportinspect.bean.IDCardEntity;
 import vinno.sportinspect.config.StatusConstant;
 import vinno.sportinspect.utils.Utils;
+import vinno.sportinspect.utils.log.LogUtil;
 import vinno.sportinspect.utils.routon.ReaderCallback;
 import vinno.sportinspect.utils.routon.ReaderTask;
 
@@ -74,6 +75,8 @@ public class ICReaderByIDR211 extends BaseDevices {
         final BluetoothDevice device = BluetoothAdapter.getDefaultAdapter().getRemoteDevice(this.mac);
         readerTask.setBleDevice(device);
         readerTask.start();
+
+        LogUtil.d("MELON==>Connect ICReader Start!");
     }
 
     @Override
@@ -83,6 +86,8 @@ public class ICReaderByIDR211 extends BaseDevices {
         readerTask.release();
 
         super.disConnectDevice();
+
+        LogUtil.d("MELON==> ICReader Disconnect!");
     }
 
     @Override

+ 8 - 0
app/src/main/java/vinno/sportinspect/utils/routon/ReaderTask.java

@@ -25,6 +25,8 @@ import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.ThreadMode;
 
+import vinno.sportinspect.utils.log.LogUtil;
+
 public class ReaderTask {
     private final String TAG = "ReaderTask";
     private static ReaderTask INSTANCE = null;
@@ -229,13 +231,19 @@ public class ReaderTask {
             ret = mReader.SDT_OpenPort(device);
             Log.d(TAG, "SDT_OpenPort ret=" + ret);
 
+            LogUtil.d("MELON==> ICReader SDK Init RET: "+ret);
+
             if (ret >= 0) {
+                LogUtil.d("MELON==> ICReader SDK Init success.");
+
                 // 2. 启动读卡线程
                 setReaderState(READER_ST_WORK);
                 startReadcardThread();
 
                 callback(ReaderCallback.CONNECT_SUCCESS);
             } else {
+                LogUtil.d("MELON==> ICReader SDK Init fail.");
+
                 callback(ReaderCallback.CONNECT_FAIL);
             }
         }