1、修改ICCID获取的bug
2、增加参数一致性检查的接口
This commit is contained in:
parent
9b4f7f434c
commit
ad836fb18c
@ -164,18 +164,6 @@ public class APIController extends BasicController{
|
|||||||
return null;
|
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 *******/
|
/****** device stop *******/
|
||||||
@PostMapping(value = "/api/device_stop")
|
@PostMapping(value = "/api/device_stop")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ -224,6 +212,17 @@ public class APIController extends BasicController{
|
|||||||
msgMapper.insert(gnssMsg);
|
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) {
|
void updateICCID(GnssDevice device, String dtuAck) {
|
||||||
// 只检查 "ICCID:" 的十六进制部分
|
// 只检查 "ICCID:" 的十六进制部分
|
||||||
if(!dtuAck.contains("49434349443a")){
|
if(!dtuAck.contains("49434349443a")){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user