|
@@ -7,6 +7,7 @@ import android.util.Log;
|
|
|
|
|
|
import com.donsee.devices.CardReader;
|
|
import com.donsee.devices.CardReader;
|
|
import com.donsee.devices.HexUtil;
|
|
import com.donsee.devices.HexUtil;
|
|
|
|
+import com.hh.lib_base.Constants;
|
|
import com.hh.lib_m1_card.bean.AmpeResultM1CardBean;
|
|
import com.hh.lib_m1_card.bean.AmpeResultM1CardBean;
|
|
import com.hh.lib_m1_card.bean.DxM1CardLoopResultBean;
|
|
import com.hh.lib_m1_card.bean.DxM1CardLoopResultBean;
|
|
import com.hh.lib_m1_card.config.M1CardConfig;
|
|
import com.hh.lib_m1_card.config.M1CardConfig;
|
|
@@ -141,6 +142,15 @@ public class DxM1CardReader {
|
|
}else{
|
|
}else{
|
|
Thread.sleep(20);
|
|
Thread.sleep(20);
|
|
String uidInfo = HexUtil.bytesToHex(uid, 4);
|
|
String uidInfo = HexUtil.bytesToHex(uid, 4);
|
|
|
|
+ if(Constants.Ampe.EVENT_M1_GETUID.equals(m1CardLoopConfig.getEvent())){
|
|
|
|
+ DxM1CardLoopResultBean data=new DxM1CardLoopResultBean();
|
|
|
|
+ data.setEvent(m1CardLoopConfig.getEvent());
|
|
|
|
+ data.setUid(uidInfo);
|
|
|
|
+ if(m1CardReaderResultListener!=null){
|
|
|
|
+ m1CardReaderResultListener.onJsonInfo(GsonUtils.getGson().toJson(data));
|
|
|
|
+ }
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
ret = cardReader.Donsee_M1VerifyPass(m1CardLoopConfig.getKeyMode(),
|
|
ret = cardReader.Donsee_M1VerifyPass(m1CardLoopConfig.getKeyMode(),
|
|
((byte) m1CardLoopConfig.getSector()), HexUtil.hexToBytes(m1CardLoopConfig.getSecretKey()));
|
|
((byte) m1CardLoopConfig.getSector()), HexUtil.hexToBytes(m1CardLoopConfig.getSecretKey()));
|
|
if (ret != SUCCESS) {
|
|
if (ret != SUCCESS) {
|
|
@@ -182,8 +192,10 @@ public class DxM1CardReader {
|
|
|
|
|
|
}
|
|
}
|
|
DxM1CardLoopResultBean data=new DxM1CardLoopResultBean();
|
|
DxM1CardLoopResultBean data=new DxM1CardLoopResultBean();
|
|
|
|
+ data.setEvent(m1CardLoopConfig.getEvent());
|
|
data.setUid(uidInfo);
|
|
data.setUid(uidInfo);
|
|
data.setReadContent(cardStr.toString());
|
|
data.setReadContent(cardStr.toString());
|
|
|
|
+
|
|
if(m1CardReaderResultListener!=null){
|
|
if(m1CardReaderResultListener!=null){
|
|
m1CardReaderResultListener.onJsonInfo(GsonUtils.getGson().toJson(data));
|
|
m1CardReaderResultListener.onJsonInfo(GsonUtils.getGson().toJson(data));
|
|
}
|
|
}
|