package BaoWen;
|
import Method.BaoWenShow;
|
import Method.StringToHex;
|
import anchor.Anchor;
|
import anchor.Anchor_Dell;
|
import tag.Tag;
|
import tag.Tag_Dell;
|
|
/**
|
*
|
1.°üÍ·£¬55AA,£»¡¾0,1¡¿
|
* 2.Ö¸ÁîÀàÐÍ,14£»¡¾2¡¿
|
* 3.Êý¾Ý³¤¶È£¬1£»¡¾3¡¿
|
* 4.±êÇ©ID£¬2£»¡¾4,5¡¿
|
* 5.»ùÕ¾ID£¬2£»¡¾6,7¡¿
|
* 6.±£Áô£¬1£»¡¾8¡¿
|
* 7.»ùÕ¾°æ±¾£¬2£»¡¾9,10¡¿
|
* 8.µçÁ¿£¬1£»¡¾11¡¿
|
* 9.¹¦ÂÊ,1£¬¡¾12¡¿
|
* 10.С×éID£¬2£¬¡¾13£¬14¡¿
|
* 11.¾àÀëÎó²î£¬2£¬¡¾15,16¡¿
|
* 12.ÐźÅÇ¿¶È£¬1£¬¡¾17¡¿
|
* 13.±£Áô£¬2£¬¡¾19£¬20¡¿
|
* 14.УÑ飬2£¬¡¾21£¬22¡¿
|
* 55 AA 14 14 5169 4814 01 4001 64 01 0200 E1FF 60 0A00 1367 54FB
|
*/
|
public class Dell_55AA14 {
|
|
|
public static void dell_14(String ip, String intime, String message, int timestamp, int port) {
|
message = message.replaceAll("\r\n|\r|\n", "");//È¡³öËùÓÐQÐкͻسµ
|
int lenth = message.length();
|
if (lenth < 48) {//³¤¶È²»¶Ô²»´¦Àí
|
Dell_uanshi_byt.intsert(ip, message, intime, timestamp, port);
|
return;
|
}
|
//ÔʼÊý¾Ý
|
String[] hex = StringToHex.hex(message);
|
// int datalenth1 = DellMessage.decodeHEX(hex[3]);//Êý¾Ý³¤¶È
|
String tagid = hex[5] + hex[4];//±êÇ©ID
|
String anchrId = hex[7] + hex[6];//»ùÕ¾ID
|
|
|
int i = DellMessage.decodeHEX(hex[10]);
|
int i1 = DellMessage.decodeHEX(hex[9]);
|
String version = i +"."+ i1;//»ùÕ¾°æ±¾ºÅ
|
int power = DellMessage.decodeHEX(hex[11]);//µçÁ¿
|
int gonglv = DellMessage.decodeHEX(hex[12]);//¹¦ÂÊ
|
String groupId = hex[14] + hex[13];//»ùÕ¾×éId
|
int wuchadistance = DellMessage.decodeHEX(hex[16] + hex[15]); ;//Îó²î¾àÀë
|
int signal = DellMessage.decodeHEX(hex[17]);//ÐźÅÇ¿¶È
|
String jiexi="±êÇ©ID:"+tagid+",»ùÕ¾ID:"+anchrId+",»ùÕ¾°æ±¾:"+version+",»ùÕ¾µçÁ¿:"+power+",»ùÕ¾¹¦ÂÊ:"+gonglv+",С×éID:"+groupId+",¾àÀëÎó²î:"+wuchadistance+",ÐźÅÇ¿¶È:"+signal;
|
Anchor anchor = Anchor_Dell.get_anchor(anchrId);
|
if (anchor != null) {
|
anchor.setVersion(version);
|
anchor.setBaoliu8(String.valueOf(power));
|
anchor.setBaoliu10(String.valueOf(gonglv));
|
anchor.setBaoliu11(groupId);
|
//anchor.setAnc_status("1");
|
Anchor_Dell.set_anchor_mode(anchor,anchrId,ip,port);//Ð޸ĻùÕ¾ÔÚÏß״̬
|
}
|
Tag tag = Tag_Dell.get_tag(tagid);
|
if (tag!=null){
|
tag.setTag_state("1");
|
}
|
if (anchor==null||tagid==null){
|
BaoWenShow.show("»ùÕ¾»ò±êǩδÌí¼Ó["+jiexi+"]","55AA14",anchrId);
|
}else {
|
BaoWenShow.show(jiexi,"55AA14",anchrId);
|
}
|
|
|
|
|
|
}
|
|
}
|