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());
|
}
|
}
|
|
}
|