@@ -8,11 +8,11 @@ public class GZMessageContentFactory { | |||||
public static IMessageContent build(byte type, byte[] content){ | public static IMessageContent build(byte type, byte[] content){ | ||||
IMessageContent item = null; | IMessageContent item = null; | ||||
if(type == 0x00){ | |||||
if(type == (byte)0x00){ | |||||
item = new GZPlatformDeviceConfig(); | item = new GZPlatformDeviceConfig(); | ||||
item.create(content); | item.create(content); | ||||
} | } | ||||
else if(type == 0x01){ | |||||
else if(type == (byte)0x01){ | |||||
item = new GZPlatformCmd(); | item = new GZPlatformCmd(); | ||||
item.create(content); | item.create(content); | ||||
} | } | ||||
@@ -21,7 +21,9 @@ public class GZResponseHandle { | |||||
GZHttpUtil gzHttpUtil; | GZHttpUtil gzHttpUtil; | ||||
public Object process(String sourceImei, byte[] res) throws IOException { | public Object process(String sourceImei, byte[] res) throws IOException { | ||||
if(res[1] == 0xFF){ | |||||
System.out.println(res[1]); | |||||
System.out.println((byte)0xFF); | |||||
if(res[1] == (byte)0xFF){ | |||||
// 常规应答 | // 常规应答 | ||||
return null; | return null; | ||||
@@ -14,10 +14,10 @@ public class GZServiceFactory { | |||||
IGZPlatformSettingService settingService; | IGZPlatformSettingService settingService; | ||||
public IGZPlatformService getService(byte tag){ | public IGZPlatformService getService(byte tag){ | ||||
if(tag == 0x00) { | |||||
if(tag == (byte)0x00) { | |||||
return settingService; | return settingService; | ||||
} | } | ||||
else if(tag == 0x01){ | |||||
else if(tag == (byte)0x01){ | |||||
return cmdService; | return cmdService; | ||||
} | } | ||||
return null; | return null; | ||||
@@ -38,7 +38,7 @@ public class GZSyncSetting extends QuartzJobBean { | |||||
GZAskSetting askSetting = new GZAskSetting(); | GZAskSetting askSetting = new GZAskSetting(); | ||||
try { | try { | ||||
byte[] res = httpUtil.send(device.getImei(), device.getPhone(), askSetting); | 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); | res = (byte[]) responseHandle.process(device.getImei(), res); | ||||
// System.out.println(ByteUtil.bytesToHexString(res)); | // System.out.println(ByteUtil.bytesToHexString(res)); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
@@ -27,6 +27,7 @@ public class GZHttpUtil { | |||||
byte[] res = httpUtil.postBytes(url, b, headers); | byte[] res = httpUtil.postBytes(url, b, headers); | ||||
return res; | return res; | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
log.info("timeout目标地址:" + url); | |||||
e.printStackTrace(); | e.printStackTrace(); | ||||
throw e; | throw e; | ||||
} | } | ||||
@@ -48,7 +49,7 @@ public class GZHttpUtil { | |||||
byte[] res = httpUtil.postBytes(url, b, headers); | byte[] res = httpUtil.postBytes(url, b, headers); | ||||
return res; | return res; | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
log.info("目标地址:" + url); | |||||
log.info("timeout目标地址:" + url); | |||||
e.printStackTrace(); | e.printStackTrace(); | ||||
throw e; | throw e; | ||||
} | } | ||||
@@ -39,21 +39,21 @@ netty.port=8888 | |||||
4g.api.token = 123Te1p0Te1p0321 | 4g.api.token = 123Te1p0Te1p0321 | ||||
# \u8D35\u5DDE\u7535\u4FE1\u53C2\u6570 | # \u8D35\u5DDE\u7535\u4FE1\u53C2\u6570 | ||||
guizhou.protocol=T01.4 | guizhou.protocol=T01.4 | ||||
guizhou.factory=telpo | |||||
guizhou.device.model=TPS401 | |||||
guizhou.device.version=ACB_1001 | |||||
#guizhou.factory=zhizhong | |||||
#guizhou.device.model=RZL600 | |||||
#guizhou.device.version=RZL_2021 | |||||
#guizhou.factory=telpo | |||||
#guizhou.device.model=TPS401 | |||||
#guizhou.device.version=ACB_1001 | |||||
guizhou.factory=zhizhong | |||||
guizhou.device.model=RZL600 | |||||
guizhou.device.version=RZL_2021 | |||||
#guizhou.factory=zhanneng | #guizhou.factory=zhanneng | ||||
#guizhou.device.model=TPE390 | #guizhou.device.model=TPE390 | ||||
#guizhou.device.version=TPE_0056 | #guizhou.device.version=TPE_0056 | ||||
guizhou.http.url=http://120.24.195.54:24183 | guizhou.http.url=http://120.24.195.54:24183 | ||||
#\u5929\u6CE2 | #\u5929\u6CE2 | ||||
#guizhou.device.testList= [{ "imei": "862622050253671","phone": "" },{ "imei": "862622050253358","phone": "" },{ "imei": "800115470000678","phone": "" }] | #guizhou.device.testList= [{ "imei": "862622050253671","phone": "" },{ "imei": "862622050253358","phone": "" },{ "imei": "800115470000678","phone": "" }] | ||||
guizhou.device.testList= [{ "imei": "862622050253671","phone": "" }] | |||||
#guizhou.device.testList= [{ "imei": "862622050253671","phone": "" }] | |||||
#\u667A\u4E2D | #\u667A\u4E2D | ||||
#guizhou.device.testList= [{ "imei": "862622050654340","phone": "" },{ "imei": "862622050317740","phone": "" }] | |||||
guizhou.device.testList= [{ "imei": "862622050654340","phone": "" },{ "imei": "862622050317740","phone": "" }] | |||||
#\u5C55\u80FD | #\u5C55\u80FD | ||||
#guizhou.device.testList= [{ "imei": "862622050927027","phone": "" },{ "imei": "862622050925104","phone": "" }] | #guizhou.device.testList= [{ "imei": "862622050927027","phone": "" },{ "imei": "862622050925104","phone": "" }] | ||||