zsh_root
2024-01-02 7b595546af704983dbafcd0d385c8768ddacefc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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);
    }
}