调整了部分问题
This commit is contained in:
@@ -155,12 +155,10 @@ public class ScanGunKeyEventHelper {
|
||||
* @return
|
||||
*/
|
||||
public boolean isScanGunEvent(KeyEvent event) {
|
||||
// L.e("event===" + event.getDevice().getName() +
|
||||
// "===Char===" + event.getCharacters() +
|
||||
// "===Action===" + event.getAction());
|
||||
// return event.getDevice().getName().equals(mDeviceName);
|
||||
|
||||
return true;
|
||||
L.e("event===" + event.getDevice().getName() +
|
||||
"===Char===" + event.getCharacters() +
|
||||
"===Action===" + event.getAction());
|
||||
return event.getDevice().getName().equals(mDeviceName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import com.sw.plate.App;
|
||||
import com.sw.plate.utils.L;
|
||||
import com.sw.plate.utils.arcface.face.model.FacePreviewInfo;
|
||||
import com.sw.plate.utils.arcface.facedb.FaceDatabase;
|
||||
import com.sw.plate.utils.arcface.facedb.dao.FaceDao;
|
||||
import com.sw.plate.utils.arcface.facedb.entity.FaceEntity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FaceApi {
|
||||
@@ -27,13 +27,13 @@ public class FaceApi {
|
||||
* @param list
|
||||
*/
|
||||
public void updateFaceData(int index, List<FaceEntity> list) {
|
||||
FaceDao faceDao = FaceDatabase.getInstance(App.getContext()).faceDao();
|
||||
if (index == 0) {
|
||||
FaceDatabase.getInstance(App.getContext()).faceDao().deleteAll();
|
||||
FaceDatabase.getInstance(App.getContext()).faceDao().resetId();
|
||||
faceDao.deleteAll();
|
||||
faceDao.resetId();
|
||||
}
|
||||
|
||||
List<FaceEntity> faceEntities = new ArrayList<>();
|
||||
FaceDatabase.getInstance(App.getContext()).faceDao().insert(faceEntities);
|
||||
faceDao.insert(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,6 @@ import static com.sw.plate.utils.CabinetLockCommand.generateOpenCommand;
|
||||
|
||||
import android.serialport.SerialPort;
|
||||
|
||||
import com.sw.plate.utils.ToastUtils;
|
||||
|
||||
public class SerialApi {
|
||||
private static String path = "/dev/ttyS2";
|
||||
private static int speed = 19200;
|
||||
@@ -15,9 +13,9 @@ public class SerialApi {
|
||||
public static void init() {
|
||||
serialPortManager = SerialPortManager.instance();
|
||||
serialPort = serialPortManager.open(new Device(path, String.valueOf(speed)));
|
||||
if (serialPort == null) {
|
||||
ToastUtils.showToast("打开串口失败");
|
||||
}
|
||||
// if (serialPort == null) {
|
||||
// ToastUtils.showToast("打开串口失败");
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,6 +29,7 @@ public class SerialApi {
|
||||
init();
|
||||
}
|
||||
if (serialPort == null) {
|
||||
callback.onFail(new Exception("打开串口失败"));
|
||||
return;
|
||||
}
|
||||
serialPortManager.sendCommand(generateOpenCommand(boxNumber), callback);
|
||||
|
||||
Reference in New Issue
Block a user