From ad836fb18c5680a50bb05acd466eaceff212fdcc Mon Sep 17 00:00:00 2001 From: weidong Date: Sun, 30 Mar 2025 07:16:06 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9ICCID=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=9A=84bug=202=E3=80=81=E5=A2=9E=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=B8=80=E8=87=B4=E6=80=A7=E6=A3=80=E6=9F=A5=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beidou/controller/APIController.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) 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")){