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