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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package BaoWen;
import java.util.Vector;
import Method.BaoWenShow;
import Method.GetNowTime;
import tbDataModel.Baowen;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
/**
 * ´¦Àíԭʼ±¨ÎÄ
 * »ùÕ¾10ÃëÖÓ×Ô¶¯Æô¶¯Êý¾Ý
 * BBF9D5BE49443A2037313239202E0D0ABBF9D5BEC0E0D0CD3A2042202E0D0AB5A5B4CECDA8D1B6BBF9D5BECAFDC1BF3A203130B8F62E0D0A
 */
public class Dell_Baowen implements Runnable {
    static int sleeptime = 1;
    static Thread t;
    static Vector<Baowen> baowenvec = new Vector<Baowen>();
    static int a = 0;
    final static Logger logger = LoggerFactory.getLogger(Dell_Baowen.class);
 
    public static void intsert(String ip, String hex, String time, int port) {
        Baowen baowen = new Baowen();
        baowen.setHex(hex);
        baowen.setIp(ip);
        baowen.setAddtime(time);
        baowen.setTimestamp(GetNowTime.timestamp());
        baowen.setPort(port);
        baowenvec.add(baowen);
    }
 
 
    /**
     * ´¦Àíԭʼ±¨ÎÄ
     */
    public void dellhex() {
        int size = baowenvec.size();
        if (size == 0) {
            sleeptime = 50;
            return;
        }
        if (size > 100000) {//Èç¹ûÊý¾Ý´óÓÚ10ÍòÌõûÓд¦ÀíÔòÇå¿Õ
            baowenvec.removeAllElements();
        } else {
            sleeptime = 0;
            Baowen baowen0 = baowenvec.get(0);
            String ip = baowen0.getIp();
            int port = baowen0.getPort();
            String hex = baowen0.getHex();
            String time = baowen0.getAddtime();
            int timestamp = baowen0.getTimestamp();
            int lenth = hex.length();
            dellhex2(ip, port, hex, time, timestamp, lenth);//´¦ÀíԭʼÊý¾Ý
            baowenvec.remove(baowen0);//ɾ³ý´¦Àí¹ýµÄ±¨ÎÄ
        }
    }
 
 
    /**
     * Æô¶¯Ï̵߳ķ½·¨
     */
    public void startThread() {
        t = new Thread(this);
        t.start();
    }
 
    public void run() {
        while (true) {
            try {
                dellhex();
                Thread.sleep(sleeptime);//ÐÝÃßʱ¼ä
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
 
 
    public static Vector<Baowen> getBaowenvec() {
        return baowenvec;
    }
 
    /**
     * yang2023.07.08
     */
    public static void dellhex2(String ip, int port, String hex, String time, int timestamp, int lenth) {
        Have_Yuanshi_Do.Dell_yuanshi(ip, hex, time);
////        if (AnchorSet.isReadpeizhi()) {//Èç¹ûÉ豸´¦ÓÚ¶ÁÈ¡ÅäÖÃģʽ}
//         else if (hex.startsWith("55AA02") && lenth == 32) {
//            Dell_55AA02.dellrgs(hex, ip, port);
//        } else
        if (hex != null) {
            if (hex.startsWith("55AA01") && lenth == 42) {//Èç¹ûÊǺϷ¨µÄ55AA01Êý¾Ý
                Dell_55AA01.dell_55AA01(ip, hex, time, timestamp, port);
                BaoWenShow.ok("2", "55AA01", hex, ip, "´¦Àíԭʼ±¨ÎÄ");//±¨ÎÄÏÔʾ
                //Èç¹ûÊǺϷ¨µÄ²â¾àÊý¾Ý
            } else if (hex.startsWith("55AA0C")) {
                BaoWenShow.ok("2", "55AA0C", hex, ip, "´¦Àíԭʼ±¨ÎÄ");
                String s = GetNowTime.timestamp2();
                BaoWenShow.show("{Êý¾Ý¼¯ºÏÊý¾Ý:" + s + ":" + hex, "´¦Àíʱ¼ä", "Êý¾Ý¼¯ºÏ");
                Dell_baowen_55AA0C.intsert(ip, hex, time, port);
                //Èç¹ûÊÇÀ´×Ô±êÇ©²â¾àÊý¾Ý
            } else if (hex.startsWith("55AA12")) {
                BaoWenShow.ok("2", "ԭʼÊý¾Ý", hex, ip, "´¦Àíԭʼ±¨ÎÄ");
                Dell_55AA12.dell_12(ip, time, hex, timestamp, port);
 
            }else if (hex.startsWith("55AA03")) {
                BaoWenShow.ok("2", "55AA03", hex, ip, "´¦Àíԭʼ±¨ÎÄ");
                Dell_55AA03.dell(ip, hex);
                //Èç¹ûÊÇÐÄÌø°ü
            }else if (hex.startsWith("55AA02") && lenth == 32) {
                Dell_55AA02.dellrgs(hex, ip, port);
                //´¦Àí×¢²á±¨ÎÄ
            } else if (hex.startsWith("55AA0A") && lenth == 48) {
                Dell_55AA0A.dellrgs(hex, ip, port);
                BaoWenShow.ok("2", "55AA0A", hex, ip, "´¦Àíԭʼ±¨ÎÄ");
 
            } else if (hex.startsWith("55AA07")) {
                //Ð޸ķµ»ØÐÅÏ¢
                Dell_55AA07.dell(ip, hex.toString());
                BaoWenShow.ok("2", "55AA07", hex, ip, "´¦Àíԭʼ±¨ÎÄ");
                //»ùÕ¾ÊÕµ½ÅúÁ¿Ð޸ıêÇ©ÐÅÏ¢55AA09080B0C00000000D7FFio
            } else if (hex.startsWith("55AA09") && lenth == 24) {
                BaoWenShow.ok("2", "55AA09", hex, ip, "´¦Àíԭʼ±¨ÎÄ");
                //»ùÕ¾·µ»Ø×´Ì¬Öµ55AA100E18980100000000000000000030
            } else if (hex.startsWith("55AA10") && lenth == 34) {
                //µ÷Óô¦Àí×¢²áÐÅÏ¢µÄ·½·¨
                Dell_55AA10.dell(hex);
                BaoWenShow.ok("2", "55AA10", hex, ip, "´¦Àíԭʼ±¨ÎÄ");
 
            } else if (hex.startsWith("55AA0E")) {
                BaoWenShow.ok("2", "55AA0E", hex, ip, "´¦Àíԭʼ±¨ÎÄ");
                Dell_55AA0E.dell(hex);
            } else if (hex.startsWith("55AA1A") && lenth == 48) {
                Dell_55AA1A.dell(hex, ip, port);
                BaoWenShow.ok("2", "55AA0A", hex, ip, "´¦Àíԭʼ±¨ÎÄ");
 
            }
        }
    }
 
}