package BaoWen;
|
import java.math.BigInteger;
|
import Judge.JugeNumber;
|
import Method.BaoWenShow;
|
import Method.StringToHex;
|
import PbuliClass.ShowMessage;
|
public class Dell_55AA01_Ceju {
|
|
/**16½øÖÆ×ªÎª10½øÖÆ*/
|
public static int decodeHEX(String hexs){
|
String hex=hexs.trim();
|
boolean a=JugeNumber.isLetterDigit(hex);
|
int numb=0;
|
if(a) {
|
BigInteger bigint=new BigInteger(hex,16);
|
numb=bigint.intValue();
|
}else {
|
ShowMessage.zidingyi_24("16½øÖÆ×ª10½øÖƳö´í,ÊÕµ½£º"+hex);
|
}
|
return numb;
|
|
}
|
|
public static void dell_55aa01(String info,String ip,int port) {
|
String[] aa=info.split("55AA01");
|
int size=aa.length;
|
for(int i=0;i<size;i++) {
|
String bb="55AA01"+aa[i];
|
if(bb.length()>10) {
|
dell55aa2(bb,ip,port);
|
}
|
}
|
}
|
|
public static void dell55aa2(String infom,String ip,int port) {
|
//ÔʼÊý¾Ý
|
String[] hex=StringToHex.hex(infom);
|
|
if(hex.length<14) {
|
return;
|
}
|
//Ö¸ÁîÀàÐÍ
|
//String zhilingtype=hex[2] ;
|
|
//Êý¾Ý³¤¶È
|
//String lenth= String.valueOf(decodeHEX(hex[3]));
|
|
//°üÐò
|
String receive_baoxu=String.valueOf(decodeHEX(hex[4]));
|
|
//Ä£¿éID receive_tagid
|
String receive_tagid=hex[6]+hex[5];
|
|
//Ä£¿éID receive_anchorid
|
String receive_anchorid=hex[8]+hex[7];
|
|
//¾àÀë
|
int receive_distance=decodeHEX(hex[12]+hex[11]+hex[10]+hex[9]);
|
|
//µçÁ¿
|
String battery=String.valueOf(decodeHEX(hex[13]));
|
|
String datas="°üÐò:"+receive_baoxu+",±êÇ©ID:"+receive_tagid+",»ùÕ¾ID:"
|
+receive_anchorid+",¾àÀë:"+receive_distance+",µçÁ¿:"+battery+"\n ";
|
|
BaoWenShow.showbaowen4("±¨ÎÄÊý¾Ý",datas,receive_anchorid);
|
}
|
}
|