copy from pipIrr-platform/pipIrr-mw/pipIrr-com-creator/src/main/java/com/dy/pipirrComCreator/p206V1/Cd02.java
copy to pipIrr-platform/pipIrr-mw/pipIrr-com-creator/src/main/java/com/dy/pipirrComCreator/p206V1/P206V1Cd66.java
File was copied from pipIrr-platform/pipIrr-mw/pipIrr-com-creator/src/main/java/com/dy/pipirrComCreator/p206V1/Cd02.java |
| | |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/7 8:42 |
| | | * @Date: 2025/5/7 14:08 |
| | | * @Description |
| | | */ |
| | | public class Cd02 extends Cd { |
| | | public class P206V1Cd66 extends P206V1Cd { |
| | | |
| | | public static final String ComCode = "02" ; |
| | | public static final String ComCode = "66" ; |
| | | |
| | | public String checkParams(String ...params){ |
| | | return null ; |
| | | } |
| | | public String helpInfo() { |
| | | return ComCode + "[Enter](查询服务端IP和端口)" ; |
| | | } |
| | | /** |
| | | * 构造心跳数据 |
| | | * @return 字节数组 |
| | | * @throws Exception 异常 |
| | | */ |
| | | public String hex(String rtuAddr) throws Exception { |
| | | byte[] bytes = bs(rtuAddr) ; |
| | | public String hex(String rtuAddr, String ...params) throws Exception { |
| | | byte[] bytes = bs(rtuAddr, params) ; |
| | | String hex = ByteUtil.bytes2Hex(bytes, false) ; |
| | | return hex ; |
| | | } |
| | |
| | | * @return 字节数组 |
| | | * @throws Exception 异常 |
| | | */ |
| | | public byte[] bs(String rtuAddr) throws Exception { |
| | | byte[] bytes = createHead(rtuAddr, ComCode, Cd.CTRL); |
| | | |
| | | byte[] bs = new byte[1] ; |
| | | |
| | | bs[0] = (byte)0xF2 ;//数据域: 1 个字节,F0 登录, F1 退出登录,F2 在线保持。 |
| | | |
| | | bytes = ByteUtil.bytesMerge(bytes, bs) ; |
| | | public byte[] bs(String rtuAddr, String ...params) throws Exception { |
| | | byte[] bytes = createHead(rtuAddr, ComCode, P206V1Cd.CTRL); |
| | | |
| | | GlCreate.createLen(bytes);//长度放字节数组中 |
| | | |