@@ -26,6 +26,9 @@ public class GZResponseHandle { | |||
if(res[1] == (byte)0xFF){ | |||
// 常规应答 | |||
return null; | |||
}else if(res[0] != (byte)0x7E){ | |||
// 非正常应答 | |||
return null; | |||
}else { | |||
// 其他命令 | |||
@@ -42,13 +42,18 @@ public class GZHeartJob extends QuartzJobBean { | |||
String imei = device.getImei(); | |||
String phone = device.getPhone(); | |||
GpsDeviceStatus gpsDeviceStatus = statusMapper.selectByImei(imei); | |||
String statusStr = gpsDeviceStatus.getDeviceStatus(); | |||
IOTDeviceStatus status = IOTDeviceStatus.build(statusStr); | |||
int pow = 50; | |||
if(gpsDeviceStatus != null){ | |||
String statusStr = gpsDeviceStatus.getDeviceStatus(); | |||
IOTDeviceStatus status = IOTDeviceStatus.build(statusStr); | |||
pow = status.getBattery(); | |||
} | |||
DianxinGzDeviceConfig config = configMapper.selectByImei(imei); | |||
GZHeart heart = new GZHeart(); | |||
GZDevicePower power = new GZDevicePower(); | |||
power.setPower(status.getBattery()); | |||
power.setPower(pow); | |||
power.setCharge(false); | |||
heart.setPower(power); | |||
GZDeviceStatus gzStatus = new GZDeviceStatus(); | |||
@@ -38,7 +38,7 @@ public class GZSyncSetting extends QuartzJobBean { | |||
GZAskSetting askSetting = new GZAskSetting(); | |||
try { | |||
byte[] res = httpUtil.send(device.getImei(), device.getPhone(), askSetting); | |||
//System.out.println(ByteUtil.bytesToHexString(res)); | |||
System.out.println(ByteUtil.bytesToHexString(res)); | |||
res = (byte[]) responseHandle.process(device.getImei(), res); | |||
// System.out.println(ByteUtil.bytesToHexString(res)); | |||
} catch (IOException e) { | |||
@@ -45,15 +45,15 @@ guizhou.protocol=T01.4 | |||
#guizhou.device.version=ACB_1001 | |||
#guizhou.device.testList= [{ "imei": "862622050253671","phone": "" },{ "imei": "862622050253358","phone": "" },{ "imei": "800115470000678","phone": "" }] | |||
guizhou.factory=zhizhong | |||
guizhou.device.model=RZL600 | |||
guizhou.device.version=RZL_2021 | |||
guizhou.device.testList= [{ "imei": "862622050654340","phone": "" },{ "imei": "862622050317740","phone": "" }] | |||
#guizhou.factory=zhizhong | |||
#guizhou.device.model=RZL600 | |||
#guizhou.device.version=RZL_2021 | |||
#guizhou.device.testList= [{ "imei": "862622050654340","phone": "" },{ "imei": "862622050317740","phone": "" }] | |||
#guizhou.factory=zhanneng | |||
#guizhou.device.model=TPE390 | |||
#guizhou.device.version=TPE_0056 | |||
#guizhou.device.testList= [{ "imei": "862622050925104","phone": "" },{ "imei": "862622050927027","phone": "" }] | |||
guizhou.factory=zhanneng | |||
guizhou.device.model=TPE390 | |||
guizhou.device.version=TPE_0056 | |||
guizhou.device.testList= [{ "imei": "862622050925104","phone": "" },{ "imei": "862622050927027","phone": "" }] | |||
guizhou.http.url=http://120.24.195.54:24183 | |||