|  |  | 
 |  |  |     public Boolean isThisProtocolHead(byte[] bs) throws Exception{ | 
 |  |  |         if(bs == null){ | 
 |  |  |             return null ; | 
 |  |  |         }else if(bs.length >= (ProtocolConstantV206V202404.ctrlIndex - 1) | 
 |  |  |         }else if(bs.length >= ProtocolConstantV206V202404.ctrlIndex | 
 |  |  |                 && bs[0] == ProtocolConstantV206V202404.P_Head_Byte){ | 
 |  |  |             if(bs[2] == ProtocolConstantV206V202404.P_Head_Byte){ | 
 |  |  |                 return true ; | 
 |  |  |                 if(bs[3] == (byte)0x80 || bs[3] == (byte)0x81){ | 
 |  |  |                     return true ; | 
 |  |  |                 }else{ | 
 |  |  |                     return false ; | 
 |  |  |                 } | 
 |  |  |             }else if((byte)(bs[2] & 0xF8) == ProtocolConstantV206V202404.P_Head_Byte){ | 
 |  |  |                 //如果控制域、地址域、用户数据域(应用层)的字节总数大于255,则通过扩展第二个开始字符0x68的低3位作为长L的高位扩展 | 
 |  |  |                 //0xF8二进制: 11111000 | 
 |  |  |                 return true ; | 
 |  |  |                 if(bs[3] == (byte)0x80 || bs[3] == (byte)0x81){ | 
 |  |  |                     return true ; | 
 |  |  |                 }else{ | 
 |  |  |                     return false ; | 
 |  |  |                 } | 
 |  |  |             }else{ | 
 |  |  |                 return false ; | 
 |  |  |             } | 
 |  |  | 
 |  |  |     public byte createCtrl(byte dir, byte funcCode){ | 
 |  |  |         byte b = dir;//DIR = 1(0x80),表示此帧报文是由终端发出的上行报文; | 
 |  |  |         b = (byte)(b | funcCode) ; | 
 |  |  |         //DIV = 1(0x40),表示此报文已被拆分为若干帧 | 
 |  |  |         //FCB = 1(0x08),表示只发一次 | 
 |  |  |         b = (byte)(b |0x08) ; | 
 |  |  |         //DIV = 1(0x20),表示此报文已被拆分为若干帧 | 
 |  |  |         //FCB = 1(0x10),表示只发一次 | 
 |  |  |         b = (byte)(b |0x10) ; | 
 |  |  |         //DIR = 0 下行,则功能码采用0 | 
 |  |  |         return b ; | 
 |  |  |     } |