package baowen;
|
import data_model.Dell_shebei;
|
import frame.Index1;
|
import publicclass.JugeNumber;
|
import publicclass.ShowMessage;
|
|
/**´¦ÀíÐÄÌøÊý¾Ý*/
|
public class Dell_55AA02 {
|
static int ok=0;
|
|
|
|
public static void dell_55aa02_start(String message,String ip,int port) {
|
if(!message.startsWith("55AA02")) {
|
return;
|
}
|
if(Index1.isShoware()) {
|
Index1.ara_show(message);
|
}
|
message=message.replaceAll("\r\n|\r|\n", "");//È¡³öËùÓÐQÐкͻسµ
|
String[] aa0=message.split("55AA02");
|
int size=aa0.length;
|
for(int i=0;i<size;i++) {
|
String info="55AA02"+aa0[i];
|
dellrgs(info,ip,port);
|
}
|
}
|
|
/**´¦Àí»ùÕ¾ÐÄÌøÊý¾Ý
|
* 2¡¢Ö¸ÁîÀàÐÍ£¨1byte£©
|
* 3¡¢Êý¾Ý³¤¶È£¨1byte£©
|
* 4¡¢»ùÕ¾ID£¨2byte£©
|
* 6¡¢»ùվͬ²½×´Ì¬£¨1byte£©
|
* 7¡¢»ùÕ¾ÆøÑ¹¼Æ¸ß¶È£¨4byte£©µ¥Î»ÀåÃ×
|
* 11¡¢±£Áô£¨4BYTE£©*/
|
public static void dellrgs(String infom,String ip,int port) {
|
String[] hex=hex(infom);
|
if(infom.length()<10) {
|
return;
|
}
|
String anchorid=hex[5]+hex[4];
|
String b3="ÐÄÌø°ü:"+anchorid+","+infom;
|
if(Index1.isShoware()) {
|
Index1.ara_show(b3);
|
}
|
if(!JugeNumber.isLetterDigit(anchorid)) {
|
if(ok==0) {
|
ok++;
|
ShowMessage.zidingyi_24(anchorid+"»ùÕ¾ID±ØÐëHEX¸ñʽ£¡");
|
}
|
return;
|
}
|
|
//»ùվͬ²½×´Ì¬
|
// int tongbu=Integer.parseInt(hex[6],16);
|
// String tongbustate=String.valueOf(tongbu) ;
|
Dell_shebei.add_shebei(anchorid, ip,"","δ°ó");
|
|
|
}
|
|
public static String[] hex(String message) {
|
int size=message.length()/2;
|
String[] hex=new String[size];
|
for(int i=0;i<size;i++) {
|
hex[i]=message.substring(i*2, 2+i*2);
|
}
|
|
return hex;
|
}
|
}
|