1、参数一致性检查放在online函数
2、修改获取工作周期的指令bug
This commit is contained in:
parent
803f2475b6
commit
7c5bcfea5d
@ -15,7 +15,6 @@ import java.time.LocalDateTime;
|
|||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class APIController extends BasicController{
|
public class APIController extends BasicController{
|
||||||
final String getWorkCycleCmd = "d3120005";
|
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yy-MM-dd HH:mm:ss");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yy-MM-dd HH:mm:ss");
|
||||||
@Autowired
|
@Autowired
|
||||||
RtcmClient rtcmClient;
|
RtcmClient rtcmClient;
|
||||||
@ -105,6 +104,20 @@ public class APIController extends BasicController{
|
|||||||
warningMsg.setLevel(WarningCfg.LEVEL_2);
|
warningMsg.setLevel(WarningCfg.LEVEL_2);
|
||||||
warningMsg.setInfo(WarningCfg.TYPE_NAME_CFG_ABNORMAL);
|
warningMsg.setInfo(WarningCfg.TYPE_NAME_CFG_ABNORMAL);
|
||||||
warningMsgMapper.insert(warningMsg);
|
warningMsgMapper.insert(warningMsg);
|
||||||
|
//重新配置
|
||||||
|
String sendCmd = HexUtil.Byte2HexString(gnssGroup.getWork_cycle().byteValue())+
|
||||||
|
HexUtil.Byte2HexString(gnssGroup.getActive_time().byteValue())+
|
||||||
|
HexUtil.Byte2HexString(gnssGroup.getActive_offset().byteValue())+
|
||||||
|
HexUtil.Byte2HexString(gnssGroup.getRs_adv().byteValue())+
|
||||||
|
HexUtil.Byte2HexString(gnssGroup.getPower_mode().byteValue())+
|
||||||
|
HexUtil.Byte2HexString(gnssGroup.getGnss_sample_s().byteValue());
|
||||||
|
short len = (short) (sendCmd.length()/2+4);
|
||||||
|
sendCmd = "d311" + HexUtil.Short2HexString(len)+
|
||||||
|
HexUtil.Int2HexString(Integer.parseInt(device.getDeviceid()))+
|
||||||
|
HexUtil.String2HexString(sendCmd);
|
||||||
|
rtcmClient.config(device.getDeviceid(), sendCmd);
|
||||||
|
// 保存
|
||||||
|
saveMsg(device.getDeviceid(), device.getTenantid(),0xD311, sendCmd, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,8 +128,11 @@ public class APIController extends BasicController{
|
|||||||
public String onLine(String deviceId, Integer tenantId, LocalDateTime lastOnlineTime) {
|
public String onLine(String deviceId, Integer tenantId, LocalDateTime lastOnlineTime) {
|
||||||
onDeviceActive(deviceId,tenantId);
|
onDeviceActive(deviceId,tenantId);
|
||||||
// 检查参数一致性
|
// 检查参数一致性
|
||||||
rtcmClient.config(deviceId, getWorkCycleCmd+
|
String getWorkCycleCmd = "d3120005"+
|
||||||
HexUtil.Int2HexString(Integer.parseInt(deviceId))+"01");
|
HexUtil.Int2HexString(Integer.parseInt(deviceId))+"01";
|
||||||
|
rtcmClient.config(deviceId, getWorkCycleCmd);
|
||||||
|
// 保存
|
||||||
|
saveMsg(deviceId, tenantId,0xD312, getWorkCycleCmd, true);
|
||||||
|
|
||||||
// 检查是否自动补传
|
// 检查是否自动补传
|
||||||
GnssDevice device = deviceMapper.queryByDeviceId(deviceId);
|
GnssDevice device = deviceMapper.queryByDeviceId(deviceId);
|
||||||
@ -126,7 +142,7 @@ public class APIController extends BasicController{
|
|||||||
|
|
||||||
// 检查上次是否离线,如果是则启动补传
|
// 检查上次是否离线,如果是则启动补传
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
Short len = 15;
|
short len = 15;
|
||||||
String uploadCmd = "D312" + HexUtil.Short2HexString(len) +
|
String uploadCmd = "D312" + HexUtil.Short2HexString(len) +
|
||||||
HexUtil.Int2HexString(Integer.parseInt(deviceId)) +
|
HexUtil.Int2HexString(Integer.parseInt(deviceId)) +
|
||||||
"1B"
|
"1B"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user