zhitong.yu
7 天以前 7fc9c42987a13c1d8d2159591a5803e70518827f
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
package com.hxzk.gps.util.UDP;
 
import com.hxzk.gps.entity.Person.TbPerson;
import com.hxzk.gps.entity.Tag.TbTag;
import com.hxzk.gps.service.System.TbSystemOperationLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
public class UDP_Tag {
    private static final Logger log = LoggerFactory.getLogger(TbSystemOperationLogService.class);
 
 
    /*
     * 新增设备
     * */
    public static void AddTagToCs(TbTag tag) {
        String xieyi = "BSTOCS1,ADDTAG," + tag.getTagId() + ",未绑定,150,10000,1,"+tag.getType()+",END";
        Udp_Out.udp_to_cs(xieyi);
        log.info("发送UDP消息到CS端:" + xieyi);
    }
 
    /*
     * 修改设备
     * */
    public static void UpTagToCs(TbTag tag) {
        String xieyi = "BSTOCS1,ALTERTAG," + tag.getTagId() + ",未绑定,150,10000,1,"+tag.getType()+",END";
        Udp_Out.udp_to_cs(xieyi);
        log.info("发送UDP消息到CS端:" + xieyi);
    }
    /*
     * 删除设备
     * */
    public static void DeTagToCs(TbTag tag) {
        String xieyi = "BSTOCS1,DELETETAG," + tag.getTagId() + ",END";
        Udp_Out.udp_to_cs(xieyi);
        log.info("发送UDP消息到CS端:" + xieyi);
    }
 
}