zsh_root
2025-01-06 7857a444de69124e9f7fb45f98b0ae818b107f23
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
package baowen;
 
 
import index.JPanelMoudle.readParamsComp;
import index.JPanelMoudle.versionUpgradeComp;
 
import tools.ShowMessage;
import tools.Tools;
 
import java.math.BigInteger;
 
 
//标签心跳包
public class Dell_55AA34 {
    static String[] hex;//字节数组
    static String ip;
    static int port;
 
//55AA3403240000
    public static void dellrgs( String ip1,String infom, int port1) {
        String jinDu="";//升级进度
        ip = ip1;
        port = port1;
        hex = Tools.hex(infom);
        if (hex.length>3) {
            int datalenth1 = Tools.decodeHEX(hex[3]);//数据长度
            datalenth1 = datalenth1 * 2 + 8;
            int lenth = infom.length();
            if (lenth == datalenth1) {
                int i = decodeHEX(hex[4]);
                String tagid="-----";
                if (hex[3].equals("05")){
                    tagid = hex[6] + hex[5];
                }
                String anchorID = readParamsComp.getAnchorId_jf().getText();
                if (tagid.equals(anchorID)||tagid.equals("-----")){
                    versionUpgradeComp.getUpdateAnchor_jf().setValue(i);
                }
                if (i==100||i==99){//设备升级进度达到100或者99时
                    ShowMessage.zidingyi("信标升级完成");
                    versionUpgradeComp.exitUpgradeXinBiao();
                }
            }
        }
    }
 
 
 
 
    /**16进制转为10进制*/
    public static int decodeHEX(String hexs){
        BigInteger bigint=new BigInteger(hexs, 16);
        int numb=bigint.intValue();
        return numb;
 
    }
 
 
 
}