yzt
2023-05-05 4c558c77a6a9d23f057f094c4dc3e315eabef497
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
package com.hxzkoa.udp;
 
import com.hxzkoa.json.tb_tag;
import com.hxzkoa.util.Config;
import com.hxzkoa.util.HttpUtil;
 
import net.sf.json.JSONObject;
 
public class Tag_info {
    /*
     * 5.标签相关信息tag_info 定位标签相关信息,默认定位引擎开启时候发送一次
     * Tag_info,[length],[tagid],[name],[power],[gao],[speed],[hz],[version],[
     * sleepopen],[sleeptime],[gonglv],[mcuzhi],[mcutime],[moveopen],[标志]
     */
    static String postUrl = Config.getPostUrl();
 
    public static void tag_info(String message) {
        postUrl = postUrl + "labelManagement_add.do";
        String[] dis = message.split(",");
        String tagid = dis[2];
        String name = dis[3];
        String power = dis[4];
        String gao = dis[5];
        String speed = dis[6];
        String hz = dis[7];
        String version = dis[8];
        String sleepopen = dis[9];
        String sleeptime = dis[10];
        String gonglv = dis[11];
        String mcuzhi = dis[12];
        String mcutime = dis[13];
        String moveopen = dis[14];
        tb_tag tag = new tb_tag();
        tag.setTag_id(tagid);
        tag.setPower(power);
        tag.setGaodu(gao);
        tag.setSudu(speed);
        tag.setPinglv(hz);
        tag.setVersion(version);
        tag.setSleep_satus(sleepopen);
        tag.setSleep_time(sleeptime);
        tag.setGongfang(gonglv);
        tag.setImu(mcuzhi);
        tag.setSleep_time(mcutime);
        tag.setDong_status(moveopen);
        JSONObject tagObject = JSONObject.fromObject(tag);
        HttpUtil.doPost(postUrl, tagObject.toString(), Config.getCharset());
    }
    
    /*
     * 12.获取标签信息get_taginfo,[tagid/all],[end]
     */
    public static void get_tag_info(String message) {
        String[] dis = message.split(",");
        String tagid = dis[1];
        if (("all").equals(tagid)) {
            postUrl = postUrl + "labelManagement.do";
            HttpUtil.doPost(postUrl, "", Config.getCharset());
        } else {
            postUrl = postUrl + "labelManagement_search.do";
            String messageJson = "{\"input\":\"" + tagid + "\"}";
            JSONObject jsonObject = JSONObject.fromObject(messageJson);
            HttpUtil.doPost(postUrl, jsonObject.toString(), Config.getCharset());
        }
    }
 
}