diff --git a/sec-beidou/src/main/java/com/imdroid/beidou/controller/APIController.java b/sec-beidou/src/main/java/com/imdroid/beidou/controller/APIController.java index f97f3d4d..a9b85e9b 100644 --- a/sec-beidou/src/main/java/com/imdroid/beidou/controller/APIController.java +++ b/sec-beidou/src/main/java/com/imdroid/beidou/controller/APIController.java @@ -164,18 +164,6 @@ public class APIController extends BasicController{ return null; } - void checkAndAskICCID(GnssDevice device){ - if(device.getIccid() == null) { - String sendCmd = "AT+ICCID"; - int msgType = 0xD310 + 10; // DTU - short len = (short) (sendCmd.length() + 5); - sendCmd = Integer.toHexString(msgType) + HexUtil.Short2HexString(len) + - HexUtil.Int2HexString(Integer.parseInt(device.getDeviceid())) + - "01" + HexUtil.String2HexString(sendCmd); - rtcmClient.config(device.getDeviceid(), sendCmd); - } - } - /****** device stop *******/ @PostMapping(value = "/api/device_stop") @ResponseBody @@ -224,6 +212,17 @@ public class APIController extends BasicController{ msgMapper.insert(gnssMsg); } + void checkAndAskICCID(GnssDevice device){ + if(device.getIccid() == null || device.getIccid().trim().isEmpty()) { + String sendCmd = "AT+ICCID"; + int msgType = 0xD310 + 10; // DTU + short len = (short) (sendCmd.length() + 5); + sendCmd = Integer.toHexString(msgType) + HexUtil.Short2HexString(len) + + HexUtil.Int2HexString(Integer.parseInt(device.getDeviceid())) + + "01" + HexUtil.String2HexString(sendCmd); + rtcmClient.config(device.getDeviceid(), sendCmd); + } + } void updateICCID(GnssDevice device, String dtuAck) { // 只检查 "ICCID:" 的十六进制部分 if(!dtuAck.contains("49434349443a")){