| | |
| | | public class DownData { |
| | | |
| | | public void parseData(byte[] bs){ |
| | | if(bs != null && bs.length >= ProtocolConstantV206V1.lenHead2Code){ |
| | | if(bs != null && bs.length > 0){ |
| | | if(bs.length >= (ProtocolConstantV206V1.ctrlIndex) |
| | | && bs[0] == ProtocolConstantV206V1.P_Head_Byte |
| | | && bs[2] == ProtocolConstantV206V1.P_Head_Byte){ |
| | |
| | | //应该是链路检测数据 |
| | | } |
| | | private void dealUpgrade(byte[] bs){ |
| | | String cdPre = ByteUtil.bytes2Hex(bs, false, ProtocolConstantV206V1.codeIndex, 1); |
| | | String cdPre = ByteUtil.bytes2Hex(bs, false, ProtocolConstantV206V1.UG_codeIndex, 1); |
| | | if(cdPre.equals("16")){ |
| | | //升级功能码 |
| | | UpHeartBeat.upHeartBeat = false ;//不上行心跳 |
| | | if(bs.length >= ProtocolConstantV206V1.lenHead2Code + 1){ |
| | | String cdSuf = ByteUtil.bytes2Hex(bs, false, ProtocolConstantV206V1.codeIndex + 1, 1); |
| | | if(bs.length >= ProtocolConstantV206V1.UG_lenHead2Cmd + 1){ |
| | | String cdSuf = ByteUtil.bytes2Hex(bs, false, ProtocolConstantV206V1.UG_codeIndex + 1, 1); |
| | | String cd = cdPre + cdSuf; |
| | | if(cd.equals("1601")){ |
| | | //升级配置 |