|
@@ -1,6 +1,6 @@
|
|
package com.tidecloud.dataacceptance;
|
|
package com.tidecloud.dataacceptance;
|
|
|
|
|
|
-import javax.xml.bind.DatatypeConverter;
|
|
|
|
|
|
+import java.util.Random;
|
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.Log;
|
|
import org.apache.commons.logging.LogFactory;
|
|
import org.apache.commons.logging.LogFactory;
|
|
@@ -51,10 +51,17 @@ public class HelloClientIntHandler extends ChannelInboundHandlerAdapter {
|
|
,0x00 ,0x00 ,0x00 ,0x00 ,0x2B ,0x04 ,0x4B ,0x7D ,0x02 ,0x01 ,(byte)0xD9 ,0x30 ,0x01 ,0x1C ,0x31 ,0x01 ,0x0F ,0x13 ,0x7E
|
|
,0x00 ,0x00 ,0x00 ,0x00 ,0x2B ,0x04 ,0x4B ,0x7D ,0x02 ,0x01 ,(byte)0xD9 ,0x30 ,0x01 ,0x1C ,0x31 ,0x01 ,0x0F ,0x13 ,0x7E
|
|
|
|
|
|
};
|
|
};
|
|
- String message = "[3G*3925079946*0116*UD2,070418,155939,V,38.034930,N,114.4015300,E,0.00,0.0,0.0,0,60,52,4,0,00000010,7,255,460,0,12447,45388,132,12500,40896,127,12500,10589,125,12500,40897,122,13000,40087,121,12500,47974,120,12500,49241,120,2,TP-LINK_5AEC,b0:95:8e:d7:5a:ec,-94,guojiahuan,50:bd:5f:7b:af:7c,-85,13.1]";
|
|
|
|
- msg = message.getBytes();
|
|
|
|
- // String message = "[3G*3925160519*00A1*UD,040418,101823,A,29.719760,N,119.6245500,E,2.81,49.2,0.0,3,71,9,0,0,00000011,4,255,460,0,22463,34421,130,22463,24421,120,22575,14074,119,22463,34961,113,0,78.8]";
|
|
|
|
-// byte[] a= {0x02,0x00,0x00,0x35,0x01,0x23,0x12,0x31,0x23,0x12,0x07,0x5D,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x13,0x01,
|
|
|
|
|
|
+
|
|
|
|
+ String message = "[3G*3925160519*00A1*UD,040418,101823,A,29.719760,N,119.6245500,E,2.81,49.2,0.0,3,71,9,0,0,00000011,4,255,460,0,22463,34421,130,22463,24421,120,22575,14074,119,22463,34961,113,0,78.8]";
|
|
|
|
+ String msg1 = "[3G*3925160532*00CB*UD,100418,065535,A,30.632577,N,120.6878867,E,0.00,0.0,0.0,0,100,98,0,0,00000010,7,255,460,0,6234,57713,148,6234,57714,129,6234,57683,124,6234,57698,123,6234,57697,122,6234,57457,119,6234,57729,118,0,16.6]";
|
|
|
|
+ String msg2 = "[3G*3925160531*00CB*UD,100418,065535,A,30.632577,N,120.6878867,E,0.00,0.0,0.0,0,100,98,0,0,00000010,7,255,460,0,6234,57713,148,6234,57714,129,6234,57683,124,6234,57698,123,6234,57697,122,6234,57457,119,6234,57729,118,0,16.6]";
|
|
|
|
+ String msg3 = "[3G*3925140531*00CB*UD,100418,065535,A,30.632577,N,120.6878867,E,0.00,0.0,0.0,0,100,98,0,0,00000010,7,255,460,0,6234,57713,148,6234,57714,129,6234,57683,124,6234,57698,123,6234,57697,122,6234,57457,119,6234,57729,118,0,16.6]";
|
|
|
|
+
|
|
|
|
+ String[] msgs = {message,msg1,msg2,msg3};
|
|
|
|
+ Random ran = new Random();
|
|
|
|
+ int a= ran.nextInt(3);
|
|
|
|
+ msg = msgs[a].getBytes();
|
|
|
|
+ // byte[] a= {0x02,0x00,0x00,0x35,0x01,0x23,0x12,0x31,0x23,0x12,0x07,0x5D,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x13,0x01,
|
|
// 0x8D,0x6D,0xB4,0x07,0x1B,0x08,
|
|
// 0x8D,0x6D,0xB4,0x07,0x1B,0x08,
|
|
// 0x8A,0x00,0x37,0x00,0x00,0x00,0xFC,0x18,0x03,0x30,0x14,0x27,0x37,0x01,0x04,0x00,0x00,0x00,0x00,0x03,0x02,0x00,0x00,
|
|
// 0x8A,0x00,0x37,0x00,0x00,0x00,0xFC,0x18,0x03,0x30,0x14,0x27,0x37,0x01,0x04,0x00,0x00,0x00,0x00,0x03,0x02,0x00,0x00,
|
|
// 0xE8,0x01,0x00,
|
|
// 0xE8,0x01,0x00,
|
|
@@ -65,8 +72,8 @@ public class HelloClientIntHandler extends ChannelInboundHandlerAdapter {
|
|
// String msg1 ="7e0102000A010000000001007D0230303030303030343434737e";
|
|
// String msg1 ="7e0102000A010000000001007D0230303030303030343434737e";
|
|
// String msg1 = "[3G*3925160532*00CB*UD,100418,065535,V,30.632577,N,120.6878867,E,0.00,0.0,0.0,0,100,98,0,0,00000010,7,255,460,0,6234,57713,148,6234,57714,129,6234,57683,124,6234,57698,123,6234,57697,122,6234,57457,119,6234,57729,118,0,16.6]";
|
|
// String msg1 = "[3G*3925160532*00CB*UD,100418,065535,V,30.632577,N,120.6878867,E,0.00,0.0,0.0,0,100,98,0,0,00000010,7,255,460,0,6234,57713,148,6234,57714,129,6234,57683,124,6234,57698,123,6234,57697,122,6234,57457,119,6234,57729,118,0,16.6]";
|
|
|
|
|
|
- String msg1 = "7e0200004401414218432307D200000000000000030243191806D316180000015E00A2180506235959010400016C3DEB20000800233032302E3633000C00B2898607B609170001687400060089FFFFFFFF947e";
|
|
|
|
- msg= DatatypeConverter.parseHexBinary(msg1);
|
|
|
|
|
|
+ // String msg1 = "7e0200004401414218432307D200000000000000030243191806D316180000015E00A2180506235959010400016C3DEB20000800233032302E3633000C00B2898607B609170001687400060089FFFFFFFF947e";
|
|
|
|
+ // msg= DatatypeConverter.parseHexBinary(msg1);
|
|
// String printHexBinary = DatatypeConverter.printHexBinary(msg);
|
|
// String printHexBinary = DatatypeConverter.printHexBinary(msg);
|
|
// System.out.println(printHexBinary);
|
|
// System.out.println(printHexBinary);
|
|
|
|
|