|
@@ -1,4 +1,4 @@
|
|
|
-package com.telpo.faceSuZhouPark.activity;
|
|
|
+package com.telpo.faceHengDian.activity;
|
|
|
|
|
|
import android.Manifest;
|
|
|
import android.annotation.SuppressLint;
|
|
@@ -71,42 +71,41 @@ import com.silencefun.comtest.SerialHelper;
|
|
|
import com.silencefun.comtest.been.AssistBean;
|
|
|
import com.silencefun.comtest.been.ComBean;
|
|
|
import com.silencefun.comtest.serialport.SerialPortFinder;
|
|
|
-import com.telpo.faceSuZhouPark.MyAppliction;
|
|
|
-import com.telpo.faceSuZhouPark.NetBroadcastReceiver;
|
|
|
-import com.telpo.faceSuZhouPark.R;
|
|
|
-import com.telpo.faceSuZhouPark.ZKUSBManager.ZKUSBManagerListener;
|
|
|
-import com.telpo.faceSuZhouPark.adapter.OutcomeAdapter;
|
|
|
-import com.telpo.faceSuZhouPark.adapter.StatusPendingAdapter;
|
|
|
-import com.telpo.faceSuZhouPark.bean.AlipayUserInfoBean;
|
|
|
-import com.telpo.faceSuZhouPark.bean.AuthenticationBean;
|
|
|
-import com.telpo.faceSuZhouPark.bean.CheckNumBean;
|
|
|
-import com.telpo.faceSuZhouPark.bean.DeviceInstallationReportBean;
|
|
|
-import com.telpo.faceSuZhouPark.bean.DeviceUpdateBean;
|
|
|
-import com.telpo.faceSuZhouPark.bean.EventRecordsBean;
|
|
|
-import com.telpo.faceSuZhouPark.bean.GetFederatedPlatformsBean;
|
|
|
-import com.telpo.faceSuZhouPark.bean.InvokeScanFaceBean;
|
|
|
-import com.telpo.faceSuZhouPark.bean.SetFederatedPlatformsBean;
|
|
|
-import com.telpo.faceSuZhouPark.bean.WebSocketEvent;
|
|
|
-import com.telpo.faceSuZhouPark.contract.ContractInterface;
|
|
|
-import com.telpo.faceSuZhouPark.presenter.MyPresenter;
|
|
|
-import com.telpo.faceSuZhouPark.service.AppLogService;
|
|
|
-import com.telpo.faceSuZhouPark.service.RegularReportingService;
|
|
|
-import com.telpo.faceSuZhouPark.usbserialdemo.HexUtil;
|
|
|
-import com.telpo.faceSuZhouPark.usbserialdemo.UsbService;
|
|
|
-import com.telpo.faceSuZhouPark.utile.BeanMapUtilByJson;
|
|
|
-import com.telpo.faceSuZhouPark.utile.Config;
|
|
|
-import com.telpo.faceSuZhouPark.utile.DX_IDCardUtile;
|
|
|
-import com.telpo.faceSuZhouPark.utile.DateUtil;
|
|
|
-import com.telpo.faceSuZhouPark.utile.FaceScenicUtile;
|
|
|
-import com.telpo.faceSuZhouPark.utile.MTTSDemo;
|
|
|
-import com.telpo.faceSuZhouPark.utile.Serial.SerialInter;
|
|
|
-import com.telpo.faceSuZhouPark.utile.Serial.SerialManage;
|
|
|
-import com.telpo.faceSuZhouPark.utile.Serial.SerialManage2;
|
|
|
-import com.telpo.faceSuZhouPark.utile.SharedPreferencesUtils;
|
|
|
-import com.telpo.faceSuZhouPark.utile.StringUtils;
|
|
|
-import com.telpo.faceSuZhouPark.utile.IDCardUtile;
|
|
|
-import com.telpo.faceSuZhouPark.utile.VolumeUtil;
|
|
|
-import com.telpo.faceSuZhouPark.utile.loacat.AppLogUtils;
|
|
|
+import com.telpo.faceHengDian.MyAppliction;
|
|
|
+import com.telpo.faceHengDian.NetBroadcastReceiver;
|
|
|
+import com.telpo.faceHengDian.R;
|
|
|
+import com.telpo.faceHengDian.ZKUSBManager.ZKUSBManagerListener;
|
|
|
+import com.telpo.faceHengDian.adapter.OutcomeAdapter;
|
|
|
+import com.telpo.faceHengDian.adapter.StatusPendingAdapter;
|
|
|
+import com.telpo.faceHengDian.bean.AlipayUserInfoBean;
|
|
|
+import com.telpo.faceHengDian.bean.AuthenticationBean;
|
|
|
+import com.telpo.faceHengDian.bean.CheckNumBean;
|
|
|
+import com.telpo.faceHengDian.bean.DeviceInstallationReportBean;
|
|
|
+import com.telpo.faceHengDian.bean.DeviceUpdateBean;
|
|
|
+import com.telpo.faceHengDian.bean.EventRecordsBean;
|
|
|
+import com.telpo.faceHengDian.bean.GetFederatedPlatformsBean;
|
|
|
+import com.telpo.faceHengDian.bean.InvokeScanFaceBean;
|
|
|
+import com.telpo.faceHengDian.bean.SetFederatedPlatformsBean;
|
|
|
+import com.telpo.faceHengDian.bean.WebSocketEvent;
|
|
|
+import com.telpo.faceHengDian.contract.ContractInterface;
|
|
|
+import com.telpo.faceHengDian.presenter.MyPresenter;
|
|
|
+import com.telpo.faceHengDian.service.AppLogService;
|
|
|
+import com.telpo.faceHengDian.service.RegularReportingService;
|
|
|
+import com.telpo.faceHengDian.usbserialdemo.HexUtil;
|
|
|
+import com.telpo.faceHengDian.usbserialdemo.UsbService;
|
|
|
+import com.telpo.faceHengDian.utile.BeanMapUtilByJson;
|
|
|
+import com.telpo.faceHengDian.utile.Config;
|
|
|
+import com.telpo.faceHengDian.utile.DX_IDCardUtile;
|
|
|
+import com.telpo.faceHengDian.utile.DateUtil;
|
|
|
+import com.telpo.faceHengDian.utile.FaceScenicUtile;
|
|
|
+import com.telpo.faceHengDian.utile.MTTSDemo;
|
|
|
+import com.telpo.faceHengDian.utile.Serial.SerialInter;
|
|
|
+import com.telpo.faceHengDian.utile.Serial.SerialManage;
|
|
|
+import com.telpo.faceHengDian.utile.SharedPreferencesUtils;
|
|
|
+import com.telpo.faceHengDian.utile.StringUtils;
|
|
|
+import com.telpo.faceHengDian.utile.IDCardUtile;
|
|
|
+import com.telpo.faceHengDian.utile.VolumeUtil;
|
|
|
+import com.telpo.faceHengDian.utile.loacat.AppLogUtils;
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
@@ -136,7 +135,7 @@ import java.util.TimerTask;
|
|
|
|
|
|
import pl.droidsonroids.gif.GifImageView;
|
|
|
|
|
|
-import static com.telpo.faceSuZhouPark.utile.Config.CheckList;
|
|
|
+import static com.telpo.faceHengDian.utile.Config.CheckList;
|
|
|
|
|
|
public class MainActivity extends BaseActivity implements ContractInterface.VAuthentication,
|
|
|
ContractInterface.VDevice,DX_IDCardUtile.OnIDCardReaderListener,
|
|
@@ -504,12 +503,21 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
int volume=Config.getAuthenticationBean().getData().get(0).getVolume();
|
|
|
int MediaVolume= (int) (volume*0.15);
|
|
|
volumeUtil.setMediaVolume(MediaVolume);
|
|
|
- //下拉配置
|
|
|
- faceScenicUtile.enableStatusBar(activity,
|
|
|
- Config.getAuthenticationBean().getData().get(0).isForbidPullDown());
|
|
|
- //底部导航栏
|
|
|
- faceScenicUtile.showNavigationBar(activity,
|
|
|
- Config.getAuthenticationBean().getData().get(0).isHideNavigationBar());
|
|
|
+ if (Build.MODEL.indexOf("F2")!=-1) {
|
|
|
+ //下拉配置
|
|
|
+ faceScenicUtile.enableStatusBar(activity,
|
|
|
+ !Config.getAuthenticationBean().getData().get(0).isForbidPullDown());
|
|
|
+ //底部导航栏
|
|
|
+ faceScenicUtile.showNavigationBar(activity,
|
|
|
+ !Config.getAuthenticationBean().getData().get(0).isHideNavigationBar());
|
|
|
+ }else {
|
|
|
+ //下拉配置
|
|
|
+ faceScenicUtile.enableStatusBar(activity,
|
|
|
+ Config.getAuthenticationBean().getData().get(0).isForbidPullDown());
|
|
|
+ //底部导航栏
|
|
|
+ faceScenicUtile.showNavigationBar(activity,
|
|
|
+ Config.getAuthenticationBean().getData().get(0).isHideNavigationBar());
|
|
|
+ }
|
|
|
}
|
|
|
}else {
|
|
|
Main_APPStuter.setText("本地配置无数据,请检查网络后,重启设备");
|
|
@@ -675,12 +683,22 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
int volume=Config.getAuthenticationBean().getData().get(0).getVolume();
|
|
|
int MediaVolume= (int) (volume*0.15);
|
|
|
volumeUtil.setMediaVolume(MediaVolume);
|
|
|
- //下拉配置
|
|
|
- faceScenicUtile.enableStatusBar(activity,
|
|
|
- !Config.getAuthenticationBean().getData().get(0).isForbidPullDown());
|
|
|
- //底部导航栏
|
|
|
- faceScenicUtile.showNavigationBar(activity,
|
|
|
- !Config.getAuthenticationBean().getData().get(0).isHideNavigationBar());
|
|
|
+ if (Build.MODEL.indexOf("F2")!=-1) {
|
|
|
+ //下拉配置
|
|
|
+ faceScenicUtile.enableStatusBar(activity,
|
|
|
+ !Config.getAuthenticationBean().getData().get(0).isForbidPullDown());
|
|
|
+ //底部导航栏
|
|
|
+ faceScenicUtile.showNavigationBar(activity,
|
|
|
+ !Config.getAuthenticationBean().getData().get(0).isHideNavigationBar());
|
|
|
+ }else {
|
|
|
+ //下拉配置
|
|
|
+ faceScenicUtile.enableStatusBar(activity,
|
|
|
+ Config.getAuthenticationBean().getData().get(0).isForbidPullDown());
|
|
|
+ //底部导航栏
|
|
|
+ faceScenicUtile.showNavigationBar(activity,
|
|
|
+ Config.getAuthenticationBean().getData().get(0).isHideNavigationBar());
|
|
|
+ }
|
|
|
+
|
|
|
//主页背景图片
|
|
|
if (Config.getAuthenticationBean().getData().get(0).getHomePageUrl()!=null){
|
|
|
//首页背景替换
|
|
@@ -1097,10 +1115,10 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
}
|
|
|
//1000等于核点超时 1004smile异常
|
|
|
if (bPaaSResponse.getCode()==1000||bPaaSResponse.getCode()==1004){
|
|
|
- Config.taskStatus = "wait";
|
|
|
- CardOrCode = "face";
|
|
|
+// Config.taskStatus = "wait";
|
|
|
+// CardOrCode = "face";
|
|
|
//重新启动核点服务
|
|
|
- startBpaasService(trade, need1v1, groupId, scanFaceCheckWay, finalMSessionId,
|
|
|
+ startBpaasService2(trade, need1v1, groupId, scanFaceCheckWay, finalMSessionId,
|
|
|
merchantAppId, checkWay);
|
|
|
}
|
|
|
}
|
|
@@ -1195,7 +1213,6 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
}
|
|
|
});
|
|
|
} else if (invokeScanFaceBean.getCode() == 2006||invokeScanFaceBean.getCode() == 1001){
|
|
|
- Config.taskStatus = "complete";
|
|
|
runOnUiThread(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
@@ -1256,7 +1273,170 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
}, 2000); // 延时3s执行run内代码
|
|
|
|
|
|
}
|
|
|
+ public void startBpaasService2(String trade, boolean need1v1, String groupId, int scanFaceCheckWay, String mSessionId
|
|
|
+ , String merchantAppId, String checkWay) {
|
|
|
+ Main_APPStuter.setText("BPAAS服务启动中……");
|
|
|
+ if (mSessionId != null || (!mSessionId.equals(""))) {
|
|
|
+ Config.stopBpaasService(mSessionId,faceScenicUtile);
|
|
|
+ }
|
|
|
+ Bundle params = new Bundle();
|
|
|
+ params.putString("trade", trade);
|
|
|
+ params.putBoolean("need1v1", need1v1);
|
|
|
+ params.putString("checkWay", checkWay);
|
|
|
+ if (Config.getAuthenticationBean().getData().get(0).getMode().equals("elasticity")){
|
|
|
+ params.putString("logicGroupID", groupId);
|
|
|
+ }else if (Config.getAuthenticationBean().getData().get(0).getMode().equals("close")){
|
|
|
+ params.putString("groupID", groupId);
|
|
|
+ }
|
|
|
|
|
|
+ //这里 xxxxx 需替换成 isv 自己的需要授权的 merchantAppId
|
|
|
+ params.putString("merchantAppId", Config.serviceAppId);
|
|
|
+ //各设备 zolozConfig 参数,参考 zolozConfig
|
|
|
+ params.putString("zolozConfig", getHardWareConfig());
|
|
|
+ params.putLong(BPaaSApi.KEY_BPAAS_IPC_TIME_OUT, -1L);
|
|
|
+// AppLogUtils.e("---startBPaaSService 入参: " + new Gson().toJson(params));
|
|
|
+ String finalMSessionId = mSessionId;
|
|
|
+ mSessionId = BPaaSApi.getInstance().startBPaaSService(Config.machineAppId,
|
|
|
+ "BPaasVerifyID", params, new BPaaSCallback() {
|
|
|
+ @Override
|
|
|
+ public void onResponse(BPaaSResponse bPaaSResponse) {
|
|
|
+ AppLogUtils.e("---startBpaasService onResponse返回数据: " + bPaaSResponse);
|
|
|
+ //这里返回1000时重启核点服务
|
|
|
+ if (bPaaSResponse.getCode()==1001){//初始化失败
|
|
|
+ isAPPStuter=false;
|
|
|
+ Main_APPStuter.setText("BPAAS服务启动失败");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //1000等于核点超时 1004smile异常
|
|
|
+ if (bPaaSResponse.getCode()==1000||bPaaSResponse.getCode()==1004){
|
|
|
+// Config.taskStatus = "wait";
|
|
|
+// CardOrCode = "face";
|
|
|
+ //重新启动核点服务
|
|
|
+ startBpaasService2(trade, need1v1, groupId, scanFaceCheckWay, finalMSessionId,
|
|
|
+ merchantAppId, checkWay);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onEvent(String s, String s1, Bundle bundle) {
|
|
|
+ if (Config.taskStatus.equals("complete")){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ AppLogUtils.e("----startBpaasService onEvent(),s: " + s + "\n,s1:" + s1 + "\n,bundle = " + new Gson().toJson(bundle));
|
|
|
+ if (s1.indexOf("code") != -1) {
|
|
|
+ Config.setFaceScenicUtile(faceScenicUtile,false);
|
|
|
+ InvokeScanFaceBean invokeScanFaceBean = new Gson().fromJson(s1, InvokeScanFaceBean.class);
|
|
|
+ if (invokeScanFaceBean.getCode() == 1000) {
|
|
|
+ time = TIME_HANDELER;
|
|
|
+ if (!isOnEvent(invokeScanFaceBean)){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Config.taskStatus = "complete";
|
|
|
+ runOnUiThread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ LocalWindowManager(activity);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ final SetFederatedPlatformsBean[] setFederatedPlatformsBean = new SetFederatedPlatformsBean[1];
|
|
|
+ if (CardOrCode.equals("face")) {//刷脸
|
|
|
+ Timeout = 10;
|
|
|
+ TimeoutString = "商户平台请求超时";
|
|
|
+ TimeoutHandler.postDelayed(TimeoutBeatRunnable, 1000);
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(s1);
|
|
|
+ Map jsonToMap = JSONObject.parseObject(jsonObject.toJSONString());
|
|
|
+ jsonToMap.put("sn", Config.SN);
|
|
|
+ AppLogUtils.e("------刷码map转换 "+new Gson().toJson(jsonToMap));
|
|
|
+ final String[] value = {""};
|
|
|
+ pAuthentication.PThirdPartyPlatforms(jsonToMap, new MyPresenter.MyPCallBreak() {
|
|
|
+ @Override
|
|
|
+ public void sressco(Object o) {
|
|
|
+ value[0] = (String) o;
|
|
|
+ //商户平台
|
|
|
+ TimeoutHandler.removeCallbacks(TimeoutBeatRunnable);
|
|
|
+ AlipayUserInfoBean alipayUserInfoBean = new Gson().fromJson(value[0], AlipayUserInfoBean.class);
|
|
|
+ if (alipayUserInfoBean.getErrcode().equals("0")) {
|
|
|
+ setFederatedPlatformsBean[0] = new SetFederatedPlatformsBean();
|
|
|
+ setFederatedPlatformsBean[0].setSN(Config.SN);
|
|
|
+ setFederatedPlatformsBean[0].setAction(1);
|
|
|
+ SetFederatedPlatformsBean.DataDTO dataDTO = new SetFederatedPlatformsBean.DataDTO();
|
|
|
+ dataDTO.setExtend3("");
|
|
|
+ dataDTO.setExtend6("");
|
|
|
+ dataDTO.setExtend7("");
|
|
|
+ dataDTO.setHsStatus("");
|
|
|
+ dataDTO.setJkmStatus("");
|
|
|
+ dataDTO.setJkmType("0");
|
|
|
+ dataDTO.setVerifytype(2);
|
|
|
+ dataDTO.setCardid(alipayUserInfoBean.getData().getCertNo());
|
|
|
+ dataDTO.setName(alipayUserInfoBean.getData().getUserName());
|
|
|
+ dataDTO.setPhone(alipayUserInfoBean.getData().getMobile());
|
|
|
+ dataDTO.setTime(DateUtil.getTime("yyyy年MM月dd日 HH:mm:ss"));
|
|
|
+ List<SetFederatedPlatformsBean.DataDTO> list = new ArrayList<>();
|
|
|
+ list.add(dataDTO);
|
|
|
+ setFederatedPlatformsBean[0].setData(list);
|
|
|
+ Config.setSetFederatedPlatformsBean(setFederatedPlatformsBean[0]);
|
|
|
+ //推送刷脸刷卡记录
|
|
|
+ setEventRecords("face",alipayUserInfoBean.getData().getUserName(),
|
|
|
+ alipayUserInfoBean.getData().getCertNo(),
|
|
|
+ alipayUserInfoBean.getData().getPhotoBase64(),"",
|
|
|
+ alipayUserInfoBean.getData().getMobile());
|
|
|
+ } else {
|
|
|
+ if (alipayUserInfoBean.getErrmsg().isEmpty()) {
|
|
|
+ alipayUserInfoBean.setErrmsg("联动平台请求失败");
|
|
|
+ }
|
|
|
+ ErroeWindowManager(activity, alipayUserInfoBean.getErrmsg());
|
|
|
+ }
|
|
|
+ //联动平台请求
|
|
|
+ setMyFederatedPlatforms( Config.getSetFederatedPlatformsBean(),
|
|
|
+ Config.getSetFederatedPlatformsBean().getData().get(0).getName()+"",
|
|
|
+ Config.getSetFederatedPlatformsBean().getData().get(0).getCardid()+"",
|
|
|
+ Config.getSetFederatedPlatformsBean().getData().get(0).getPhone()+""
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //因为异步请求,所以只能在获取商户平台结果后去请求联动平台,最后return出去
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //联动平台请求
|
|
|
+ setMyFederatedPlatforms( Config.getSetFederatedPlatformsBean(),
|
|
|
+ Config.getSetFederatedPlatformsBean().getData().get(0).getName(),
|
|
|
+ Config.getSetFederatedPlatformsBean().getData().get(0).getCardid(),
|
|
|
+ Config.getSetFederatedPlatformsBean().getData().get(0).getPhone());
|
|
|
+
|
|
|
+ }else if (invokeScanFaceBean.getCode() == 1003) {
|
|
|
+ runOnUiThread(new Runnable() {
|
|
|
+ public void run() {
|
|
|
+ invokeResume(Config.mSessionId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (invokeScanFaceBean.getCode() == 2006||invokeScanFaceBean.getCode() == 1001){
|
|
|
+ Config.taskStatus = "complete";
|
|
|
+ runOnUiThread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ if (Config.getAuthenticationBean()!=null){
|
|
|
+ ErroeWindowManager(activity,
|
|
|
+ Config.getAuthenticationBean().getData().get(0).getFailText());
|
|
|
+ }else {
|
|
|
+ ErroeWindowManager(activity, "比对失败,请联系现场工作人员");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ runOnUiThread(new Runnable() {
|
|
|
+ public void run() {
|
|
|
+ invokeResume(Config.mSessionId);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ Config.mSessionId = mSessionId;
|
|
|
+
|
|
|
+ }
|
|
|
/**
|
|
|
* 开门展示结果页
|
|
|
*/
|
|
@@ -1633,7 +1813,9 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
} else {
|
|
|
rightTopBarText.setVisibility(View.GONE);
|
|
|
}
|
|
|
-
|
|
|
+ //添加成功显示值
|
|
|
+ int NumberOfTicketChecks = Config.getNumberOfTicketChecks(activity);
|
|
|
+ LoadingLocally_NumberOfTicketChecks.setText(NumberOfTicketChecks + "");
|
|
|
} else {
|
|
|
LoadingLocally_titleRelativeLayout.setVisibility(View.GONE);
|
|
|
isHideNavigationBar = false;
|
|
@@ -2101,7 +2283,8 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
if (UseSerialPort.equals("RS232")) {
|
|
|
if (!(SignalNo+"").equals("null")){
|
|
|
SerialManage.getInstance().send(SignalNo);//发送指令
|
|
|
- SerialManage2.getInstance().send(SignalNo);//发送指令
|
|
|
+ // SerialManage2.getInstance().send(SignalNo);//发送指令
|
|
|
+ sendPortData(ComA,SignalNo);
|
|
|
}else {
|
|
|
AppLogUtils.e("--RS232开门信号为空");
|
|
|
}
|
|
@@ -2859,7 +3042,7 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
}else if (Build.MODEL.indexOf("TPS980")!=-1){
|
|
|
pat="/dev/ttyS0";
|
|
|
}else {
|
|
|
- String[] DevicesPath=new com.telpo.faceSuZhouPark.utile.SerialPortFinder().getAllDevicesPath();
|
|
|
+ String[] DevicesPath=new com.telpo.faceHengDian.utile.SerialPortFinder().getAllDevicesPath();
|
|
|
boolean isACM=false;
|
|
|
for (int i = 0; i < DevicesPath.length; i++) {
|
|
|
if (DevicesPath[i].indexOf("/dev/ttyACM")!=-1){
|
|
@@ -2876,6 +3059,7 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
}
|
|
|
}else {
|
|
|
AppLogUtils.e("-----------未能找到对应串口,串口连接失败 ");
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
ComA.setPort(pat);
|
|
@@ -3015,4 +3199,10 @@ public class MainActivity extends BaseActivity implements ContractInterface.VAut
|
|
|
ComPort.close();
|
|
|
}
|
|
|
}
|
|
|
+ //----------------------------------------------------串口发送
|
|
|
+ private void sendPortData(SerialHelper ComPort, String sOut) {
|
|
|
+ if (ComPort != null && ComPort.isOpen()) {
|
|
|
+ ComPort.sendTxt(sOut);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|