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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
package JNADell;
import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import BaoWen.Udp_Receive;
import BaoWen.Urt_7000_port;
import DataBase.DatabaseManagement;
import Frame.Tool;
import Method.BaoWenShow;
import Method.ControTag;
import Method.GetNowTime;
import Method.StringToHex;
import PbuliClass.ShowMessage;
import anchor.Anchor;
import anchor.Anchor_Dell;
import person.Person;
import person.person_Dell;
import tag.Tag;
import tag.Tag_Dell;
import tbDataModel.UseTagAndAnchor;
import tbDataModel_Dell.ReadPeizhiMessage;
import urt.Control_urt;
 
/**´¦ÀíÐèҪʹÓõıêÇ©*/
public class Dell_usetaganchor {
 
    static Vector<UseTagAndAnchor>  useta=new Vector<UseTagAndAnchor> ();
 
    /**»ñÈ¡±êÇ©ÐèÒªÓÃÀ´¼ÆËãµÄ»ùÕ¾*/
    public static Vector<UseTagAndAnchor> getUseta() {
        return useta;
    }
 
    /**²åÈëÒ»¸ö±êÇ©ÐèÒªÓÃÀ´²â¾àµÄ»ùÕ¾*/
    public static void insert_taganchor(String tagid,String anchorid1,String anchorid2,
            String anchorid3,String anchorid4,boolean use) {
        if(get_UseTagAndAnchor(tagid)==null) {
            UseTagAndAnchor newusetaganc=new UseTagAndAnchor();
            newusetaganc.setTagid(tagid);
            newusetaganc.setAnchorid1(anchorid1);
            newusetaganc.setAnchorid2(anchorid2);
            newusetaganc.setAnchorid3(anchorid3);
            newusetaganc.setAnchorid4(anchorid4);
            newusetaganc.setUse(use);
            useta.add(newusetaganc);
        }
 
    }
 
    /**ѰÕÒij¸ö±êÇ©¶ÔÏó*/
    public static UseTagAndAnchor get_UseTagAndAnchor(String tagid) {        
        UseTagAndAnchor  uta=null;    
        int size=useta.size();
        if( size!=0) {            
            for(int i=0;i<size;i++) {
                UseTagAndAnchor uta1=useta.get(i);
                String tagid1=uta1.getTagid();
                if(tagid1.equals(tagid)) {
                    uta=uta1;
                    break;
                }
            }
        }
        return uta;        
    }
 
    /**¸Ä±ä±êÇ©µÄʹÓÃ״̬*/
    public static void  alert_use(String tagid,boolean use) {
        if( get_UseTagAndAnchor(tagid) !=null) {
            get_UseTagAndAnchor(tagid).setUse(use);
        }
    }
 
 
    /**ÐÞ¸Äij¸ö±êÇ©¶ÔÏó*/
    public static void alert_taganc(String tagid,String anchorid1,String anchorid2,
            String anchorid3,String anchorid4,boolean use) {
        get_UseTagAndAnchor( tagid).setAnchorid1(anchorid1);
        get_UseTagAndAnchor( tagid).setAnchorid2(anchorid2);
        get_UseTagAndAnchor( tagid).setAnchorid3(anchorid3);
        get_UseTagAndAnchor( tagid).setAnchorid4(anchorid4);
        get_UseTagAndAnchor( tagid).setUse(true);
    }
 
 
    public static void dell_udp_message(String message) {
        String[] mess=message.split(",");
        if(mess.length==5) {
            //Ö¸ÁîÀàÐÍ
            String zhiling=replace(mess[1]).toUpperCase();
            String a3=mess[3];//±êÇ©ID
            String a2=mess[2];//ÄÚÈÝ
            switch(zhiling){
            case "TAG_SHAKE" :
                TAG_SHAKE(a2,a3);
                break;
            case "OPEN_OR_CLOSE_SLEEP" :
                OPEN_OR_CLOSE_SLEEP(a2,a3);
                break;
 
            case "ALERT_SLEEP_TIME" :
                ALERT_SLEEP_TIME(a2,a3);
                break;
 
            case "ALERT_TAG_HZ" :
                ALERT_TAG_HZ(a2,a3);
                break;
            case "USERINFO":
                USERINFO(a2,a3);
                break;
            case "TAG_OLED":
                oledshow(a2,a3);
                break;
            case "TAG_VOICE":
                voice(a3,a2);
                break;
            case "HEIGHTMODIFY":
                Tool.HeightModify(message);
                break;
            }
 
            //55BB,[±êÇ©id],[»ùÕ¾1id],[»ùÕ¾2id],[»ùÕ¾4id],[¿ªÊ¼]
        }else if(mess.length==6) {
            boolean use=false;
            if(mess[6].equals("1")) {
                use=true;
            }
            //Èç¹û±êÇ©´æÔÚ
            if(get_UseTagAndAnchor(mess[1])==null) {
                insert_taganchor(mess[1],mess[2],mess[3],mess[4],mess[5],use);
            }else {
                alert_taganc(mess[1],mess[2],mess[3],mess[4],mess[5],use);
            }
        }
 
    }
 
    /**È¥µô×Ö·û´®ÖеĻ»Ðпոñ»Ø³µ*/
    public static String replace(String str) {
        String destination = "";
        if (str!=null) {
            Pattern p = Pattern.compile("\\s*|\t|\r|\n");
            Matcher m = p.matcher(str);
            destination = m.replaceAll("");
        }
        return destination;
    }    
 
    /**±êÇ©Õñ¶¯*/
    public static void TAG_SHAKE(String a2,String a3) {
        String tagid=replace(a3);
        int time=Integer.parseInt(replace(a2));    
        if(tagid.equals("ALL")) {
            tagid="ËùÓбêÇ©";
 
        }
        Person person=person_Dell.get_Person(tagid);
        if(person==null) {
            return;
        }
        String type=person.getBaoliu19();
        if(type.equals("URT+CO")) {
            Control_urt.say_voice(tagid,"ƽ̨Ï·¢ÁËÒ»ÌõÓïÒô",0,10);
        }else {        
            ControTag.konghzitag(time, tagid,(byte)(byte)0x10,"","Dell_usetaganchorÏ·¢Õð¶¯");
            Control_urt.beeper(tagid, time);
            Control_urt.say_fengming(tagid);
        }
    }
 
    /**¿ª¹Ø±êÇ©ÐÝÃß¹¦ÄÜ*/
    public static void OPEN_OR_CLOSE_SLEEP(String a2,String a3) {
        int time=Integer.parseInt(replace(a2));
        String tagid=replace(a3);
        if(tagid.equals("ALL")) {
            tagid="ËùÓбêÇ©";
        }
        ControTag.konghzitag(time, tagid,(byte)(byte)0x3e,"","Dell_usetaganchor¿ª¹ØÐÝÃß");
    }
 
    /**Ð޸ıêÇ©µÄÐÝÃßʱ¼ä*/
    public static void ALERT_SLEEP_TIME(String a2,String a3) {
        int time=Integer.parseInt(replace(a2));
        String tagid=replace(a3);
        if(tagid.equals("ALL")) {
            tagid="ËùÓбêÇ©";
        }
        ControTag.konghzitag(time, tagid,(byte)(byte)0x3a,"","Dell_usetaganchorÏ·¢ÐÝÃßʱ¼ä");
    }
 
    /**Ð޸ıêÇ©µÄƵÂÊ
     * 55BB,ALERT_TAG_HZ,10,1860,END
     * 55BB,ALERT_TAG_HZ,10,ALL,END*/
    public static void ALERT_TAG_HZ(String zhi,String tag_id) {
        String time=replace(zhi);
        String tagid=replace(tag_id);
        if(tagid.equals("ALL")) {
            tagid="ËùÓбêÇ©";
        }
        ControTag.set_tag_hz(time, tagid);
        ShowMessage.zidingyi(tagid+"ÊÕµ½Ð޸ıêǩƵÂÊÖ¸Áî"+time);
    }
 
    /**Êý¾Ý͸´«¸ñʽ
     *55BB,userinfo,tagid,message,end
     *55BB:°üÍ·
     *userinfo£ºÊý¾ÝÀàÐÍ
     *tagid£º±êÇ©IDºÅ
     *message:Óû§Êý¾Ý³¤¶È²»³¬¹ý30byte
     *end:½áÊø±ê־λ*/
    public static void USERINFO(String tagid,String message) {//ÏÔʾÎÄ×ÖµÄÖ¸Áî
        String tou="74302E7478743D22";//t0.txt="
        if(message.startsWith("music") || message.startsWith("MUSIC") ) {//²¥·ÅÒôÀÖµÄÖ¸Áî
            tou="7A68696C696E2E7478743D22";//zhilin.txt="
        }
        String hexmes=tou+str2HexStr(message)+"22FFFFFF";
        int a0=hexmes.length();
        String n=Integer.toHexString(a0/2);
        int a12=a0+10;
        String lenth=Integer.toHexString(a12/2);
        String baotou="55AA0D"+lenth+gettagid(tagid)+n;
        String jiaoyan=jiaoyan("0D"+lenth+tagid+n+hexmes);
        String mes=baotou+hexmes+jiaoyan;
        Tag tag=Tag_Dell.get_tag(tagid);
        String info=message+"\n"+mes;
        if(tag==null) {
            BaoWenShow.show2(info, "TOANC",tagid+"tagid is null",8234);
            return;
        }
        String anchorid=tag.getAnchorid();
        if(anchorid !=null) {
            Anchor ac=Anchor_Dell.get_anchor(anchorid);
            if(ac !=null) {
                String ip=ac.getAnc_ip();
                int port=ac.getPort();
                BaoWenShow.show2(info, "TOANC", ip, port);
                byte[] byt=ReadPeizhiMessage.toByteArray(mes);
                //½«Êý¾Ýfa¸øÖ÷»ùÕ¾
                Udp_Receive.out(byt,byt.length,ac,"Êý¾Ý͸´«");
            }    
        }else {
            BaoWenShow.show2(info, "TOANC","anchorid is null",8234);
        }
    }
 
    /** ½«ºº×Öת»»Îª16½øÖÆ×Ö·û´®Êý,¿É°üº¬Êý×Ö¼°·ûºÅ*/    
    public  static  String str2HexStr(String str) {
        char [] chars =  "0123456789ABCDEF" .toCharArray();
        StringBuilder sb =  new  StringBuilder( "" );
        byte [] bs = str.getBytes();
        int  bit;
        for  ( int  i =  0 ; i < bs.length; i++) {
            bit = (bs[i] &  0x0f0 ) >>  4 ;
        sb.append(chars[bit]);
        bit = bs[i] &  0x0f ;
        sb.append(chars[bit]);
        }
        return  sb.toString().trim();
    }
 
 
 
 
 
    /**½«×Ö½ÚÊý×éת»»Îª16½øÖÆ×Ö·û´®ÎÞ¿Õ¸ñ*/
    public static  String BinaryToHexString2(byte[] bytes) {
        String hexStr = "0123456789ABCDEF";
        String result = "";
        String hex = "";
        for (byte b : bytes) {
            hex = String.valueOf(hexStr.charAt((& 0xF0) >> 4));
            hex += String.valueOf(hexStr.charAt(& 0x0F));
            result += hex + "";
        }
        return result;
    }
 
    /** 
     * 16½øÖÆ×Ö·û´®×ª×Ö½ÚÊý×é 
     * @param hexString 16½øÖÆ×Ö·û´® 
     * @return ×Ö½ÚÊý×é 
     */  
    public static byte[] hexString2ByteArray(String hexString) {  
        if (hexString == null || "".equals(hexString)) {  
            return null;  
        }  
        //ÏȰÑ×Ö·û´®×ª»»Îªchar[]£¬ÔÙת»»Îªbyte[]  
        int length = hexString.length() / 2;  
        char[] hexChars = hexString.toCharArray();  
        byte[] bytes = new byte[length];  
        String hexDigits = "0123456789ABCDEF";  
        for (int i = 0; i < length; i++) {  
            int pos = i * 2; // Á½¸ö×Ö·û¶ÔÓ¦Ò»¸öbyte  
            int h = hexDigits.indexOf(hexChars[pos]) << 4; // ×¢1  
            int l = hexDigits.indexOf(hexChars[pos + 1]); // ×¢2  
            if (== -1 || l == -1) { // ·Ç16½øÖÆ×Ö·û  
                return null;  
            }  
            bytes[i] = (byte) (| l);  
        }  
        return bytes;  
    }  
 
    /**УÑé*/
    public static String jiaoyan(String a) {
        String[] hex=StringToHex.hex(a);
        int size=hex.length;
        int sum=0;
        for(int i=0;i<size;i++) {
            sum+=Integer.parseInt(hex[i],16);
        }         
        String hex16=Integer.toHexString(~sum);//È¡·´×ªÎª16½øÖÆ×Ö·û´®        
        int lenth=hex16.length();//×Ö·û´®µÄ³¤¶È    
        String hh=hex16.substring(lenth-4, lenth-2);
        String ens=hex16.substring(lenth-2, lenth)+hh;
        return ens;
    }
 
 
    public static String gettagid(String id) {
        String a=id.substring(0, 2);
        String b=id.substring(2,4);
        String tagid=b+a;
        return tagid;
    }
 
    /**×Ô½âËãģʽÏÂÊý¾Ý͸´«*/
    public static String touchuan(String message,String tagid) {
        String hexmes=str2HexStr(message);
        int a0=hexmes.length();
        String n=Integer.toHexString(a0/2);
        int a12=a0+10;
        String lenth=Integer.toHexString(a12/2);
        String baotou="55AA0D"+lenth+gettagid(tagid)+n;
        String jiaoyan=jiaoyan("0D"+lenth+tagid+n+hexmes);
        String mes=baotou+hexmes+jiaoyan;
        return mes;
    }
 
    /**¿ØÖƱêÇ©OLEDÎÄ×ÖÏÔʾ
     * 55BB,[TAG_OLED],[TEXT],[TAGID],[END]
     * ËµÃ÷£º
     * 55BB£ºÎª°üÍ·£»
     * [TAG_OLED]£º ÐèÒªÖ´ÐеÄÖ¸ÁîΪÈñêÇ©OLEDÏÔʾÄÚÈÝ£»
     * [TEXT]£º ÐèÒªÏÔʾµÄÄÚÈÝ£»
     * [TAGID]£º ±êÇ©µÄ±àºÅ,ALL±íʾËùÓбêÇ©;
     * [END]£º ±¨ÎĽáÊø±êÖ¾¡£
     * Ê¾·¶1£ºÈñêÇ©ÏÔʾÄÚÈÝ1£»
     * 55BB,TAG_OLED,1,2001,END*/
    public static void oledshow(String info,String tagid) {
        if(tagid.equals("ALL")) {
            Dell_usetaganchor.alltagtomessge(info,"ϵͳĬÈÏ");
            ShowMessage.zidingyi(tagid+"ÐÅϢϷ¢:"+info);
        }else {
            Tag  tag=Tag_Dell.get_tag(tagid);
            if(tag==null) {
                ShowMessage.zidingyi(tagid+"²»´æÔÚoledshow");
                return;
            }
            String tagtype=tag.getTagtype();
            if(tagtype.equals("ÐÄÂÊ´øÆÁ")) {
                Dell_usetaganchor.message_to_oled(tagid, info,"ϵͳĬÈÏ");
                ShowMessage.zidingyi(tagid+"ÐÅϢϷ¢:"+info);
            }else {
                ShowMessage.zidingyi(tagid+"²»ÊÇÐÄÂÊ´øÆÁ±êÇ©");
            }
        }
    }
 
    /**·¢ËÍÊý¾Ý¸ø´øOLEDÆÁÄ»µÄ±êÇ©
     *55BB,userinfo,tagid,message,end
     *55BB:°üÍ·
     *userinfo£ºÊý¾ÝÀàÐÍ
     *tagid£º±êÇ©IDºÅ
     *message:Óû§Êý¾Ý³¤¶È²»³¬¹ý30byte
     *end:½áÊø±ê־λ*/
    public static void message_to_oled(String tagid,String message,String name) {
        String infom="";
        int size=message.length();
        if(size>24) {
            ShowMessage.zidingyi("·¢Ëͳ¤¶È"+size+"£¬³¤¶È´óÓÚ24·¢ËÍʧ°Ü");
            return;
        }
        if(size<13) {
            infom="1"+message+" "+GetNowTime.nowfinename();            
        }else if(size>12 && size<20) {
            infom="1"+message+" "+GetNowTime.HH_MM_SS();
        }else if(size>20) {
            infom="1"+message;
        }
        Tag tag=Tag_Dell.get_tag(tagid);        
        if(tag==null) {
            ShowMessage.zidingyi(tagid+"·¢ËÍÎÄ×Ö±êÇ©²»´æÔÚ");
            return;
        }                
        String anchorid=tag.getAnchorid();
        if(anchorid ==null) {
            ShowMessage.zidingyi(anchorid+"·¢ËÍÎÄ×ÖÖ÷»ùÕ¾²»´æÔÚ");
            return;
        }
        Anchor ac=Anchor_Dell.get_anchor(anchorid);
        if(ac !=null) {            
            String mes=getmes(tagid,infom);
            String info=infom+"\n"+mes;
            String ip=ac.getAnc_ip();
            int port=ac.getPort();            
            byte[] byt=ReadPeizhiMessage.toByteArray(mes);            
            Udp_Receive.out(byt,byt.length,ac,"Êý¾Ý͸´«");//½«Êý¾Ýfa¸øÖ÷»ùÕ¾
            BaoWenShow.show2(info, "TOANC", ip, port);
            sendmessagejilu_intodata(tagid,message,name);//Êý¾Ý²åÈëÊý¾Ý¿â
        }            
    }
 
    /**¸øËùÓÐÐÄÂÊ´øÆÁÄ»±êÇ©·¢ÎÄ×ÖÐÅÏ¢*/
    public static void alltagtomessge(String message,String name) {
        Vector<Tag> tagvc=Tag_Dell.getTag_vector();
        int size=tagvc.size();
        for(int i=0;i<size;i++) {
            Tag  tag=tagvc.get(i);
            String tagtype=tag.getTagtype();
            String tagid=tag.getTag_id();
            String online=person_Dell.get_Person(tagid).getP_online();
            if(online.equals("1")) {            
                if(tagtype.equals("ÐÄÂÊ´øÆÁ")) {
                    message_to_oled(tagid, message,name);
                }else if(tagtype.equals("³µÔØ´øÆÁ")) {
                    USERINFO(tagid, message);
                }else if(tagtype.equals("ϵͳĬÈÏ")) {
                    ControTag.konghzitag(10, tagid,(byte)0x10,"Õñ¶¯","Dell_usetaganchor1Ï·¢Õð¶¯");
                }else {
                    ControTag.konghzitag(10, tagid,(byte)0x10,"Õñ¶¯","Dell_usetaganchor2Ï·¢Õð¶¯");
                }
            }
        }        
    }
 
    /**·¢ËÍʱ¼äºÍIDµÄ·½·¨*/
    public static void sendid_time(String tagid,Person person) {
        Tag tag=Tag_Dell.get_tag(tagid);
        if(tag==null) {
            return;
        }
        String anchorid=tag.getAnchorid();
        if(anchorid ==null) {
            return;
        }
        Anchor ac=Anchor_Dell.get_anchor(anchorid);
        if(ac !=null) {    
            String ip=ac.getAnc_ip();
            int port=ac.getPort();    
            String info="";
            String mes="";
            String infom="2ID"+tagid+" "+person.getP_power()+"% "+GetNowTime.HH_MM_SS();
            ShowMessage.zidingyi(infom);
            mes=getmes(tagid,infom);
            info=infom+"\n"+mes;
            byte[] byt=ReadPeizhiMessage.toByteArray(mes);            
            Udp_Receive.out(byt,byt.length,ac,"Êý¾Ý͸´«");//½«Êý¾Ýfa¸øÖ÷»ùÕ¾
            BaoWenShow.show2(info, "TOANC", ip, port);
        }            
    }
 
    /**»ñÈ¡ÎÄ×ÖÐÅÏ¢*/
    public static String getmes(String tagid,String message) {
        String hexmes=str2HexStr(message);//½«ºº×ÖתΪ16½øÖÆ×Ö·û´®Êý
        int a0=hexmes.length();
        String n=Integer.toHexString(a0/2);
        if(n.length()==1) {
            n="0"+n;
        }
        int a12=a0+10;
        String lenth=Integer.toHexString(a12/2);
        if(lenth.length()==1) {
            lenth="0"+lenth;
        }
        String baotou="55AA0D"+lenth+gettagid(tagid)+n;
        String jiaoyan=jiaoyan("0D"+lenth+tagid+n+hexmes);
        String mes=baotou+hexmes+jiaoyan;
        return mes;
    }
 
    /**
     * »ñÈ¡ÎÄ×ÖÐÅÏ¢
     */
    public static String getmes2(String tagid, String message, String type) {
        String hexmes = str2HexStr(message+"end");//½«ºº×ÖתΪ16½øÖÆ×Ö·û´®Êý
        String mes = null;
        if (type.equals("88")) {
            mes = "55BB88" + tagid + hexmes;
        } else if (type.equals("66")) {
            mes = "55BB66" + tagid + hexmes;
        }
        return mes;
    }
 
 
    public static void sendmessagejilu_intodata(String tagid,String info,String username) {
        Person pr=person_Dell.get_Person(tagid);
        String bianma=GetNowTime.sss();
        String sendtime=GetNowTime.now();
        String name=pr.getP_name();
        String[]  ziduan= {"bianma","tagid","username","info","sendtime","baoliu1" };
        String[] zhi= {bianma,tagid,username,info,sendtime,name};
        DatabaseManagement.insertfast("tb_message_history",ziduan, zhi);
        pr.setMessagerelaystate(0);
        pr.setMessagebianma(bianma);
        pr.setMessagesend(info);
    }
 
    /**¿ØÖÆÓïÒô²¥·Å
     * ËµÃ÷£º¸ÄÖ¸ÁîÖ»¶ÔÖ§³ÖÓïÒô¹¦ÄÜÉ豸ÉúЧ
     * 55BB,TAG_VOICE,TEXT,TAGID,END
     * Ö¸Áî˵Ã÷£º
     * 55BB£ºÎª°üÍ·£»
     * TAG_VOICE£ºÖ¸ÁîÀàÐͲ¥·ÅÓïÒô
     * TEXT£ºÓïÒôÎÄ×Ö
     * TAGID£º±êÇ©ID£¬HEX¸ñʽΨһ±êʶ
     * END£º½áÊø±êÖ¾
     * Ê¾·¶1£ºÈñêÇ©²¥·ÅÄÚÈÝÓïÒô£»
     * 55BB,TAG_VOICE,²âÊÔÒ»ÏÂÓïÒô²¥·Å,2001,END*/
    public static void voice(String tagid,String text) {
        Control_urt.say_voice(tagid,text,0,3);        
    }
 
 
    /**·¢ËÍÊý¾Ý¸ø´øloraÆÁÄ»µÄ±êÇ©
     *55BB,tagid,message,end;
     *55BB:°üÍ·
     *info:ÀàÐÍ
     *tagid£º±êÇ©IDºÅ
     *message:Êý¾ÝÄÚÈÝ
     *end:½áÊø±ê־λ*/
    public static void message_to_Lora(String tagid,String message,String name,String type) {
        Person tag=person_Dell.get_Person(tagid);
        if(tag==null) {
            ShowMessage.zidingyi(tagid+"·¢ËÍÎÄ×Ö±êÇ©²»´æÔÚ");
            return;
        }
        int port = Integer.parseInt(tag.getBaoliu9());
        if ("88".equals(type)){
                String s = getmes2(tagid, message, type);
                byte[] byt=ReadPeizhiMessage.toByteArray(s);
                Urt_7000_port.outlora(byt,byt.length,tag.getBaoliu8(),port,"Êý¾Ý͸´«");//½«Êý¾Ýfa¸øÖ÷»ùÕ¾
                BaoWenShow.show2(message, "TOANC", tag.getBaoliu8(), port);
                sendmessagejilu_intodata(tagid,message,name);//Êý¾Ý²åÈëÊý¾Ý¿â
            }else if ("66".equals(type)){
                String s = getmes2(tagid, message, type);
                byte[] byt=ReadPeizhiMessage.toByteArray(s);
                Urt_7000_port.outlora(byt,byt.length,tag.getBaoliu8(),port,"Êý¾Ý͸´«");//½«Êý¾Ýfa¸øÖ÷»ùÕ¾
                BaoWenShow.show2(message, "TOANC", tag.getBaoliu8(), port);
                sendmessagejilu_intodata(tagid,message,name);//Êý¾Ý²åÈëÊý¾Ý¿â
            }
        }
    }