From 516c5ce3d177aac2c9115286d0b263c71f15fa1c Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 29 Apr 2024 22:01:26 +0800 Subject: [PATCH] =?UTF-8?q?1078-=E6=B7=BB=E5=8A=A0=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/JTDeviceConnectionControl.java | 131 ++++++++++++++++++ .../iot/vmp/jt1078/proc/response/J8105.java | 82 +++++++++++ 2 files changed, 213 insertions(+) create mode 100644 src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConnectionControl.java create mode 100644 src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8105.java diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConnectionControl.java b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConnectionControl.java new file mode 100644 index 000000000..0510048fa --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTDeviceConnectionControl.java @@ -0,0 +1,131 @@ +package com.genersoft.iot.vmp.jt1078.bean; + +import com.genersoft.iot.vmp.jt1078.bean.common.ConfigAttribute; +import com.genersoft.iot.vmp.jt1078.bean.config.CameraTimer; +import com.genersoft.iot.vmp.jt1078.bean.config.CollisionAlarmParams; +import com.genersoft.iot.vmp.jt1078.bean.config.GnssPositioningMode; +import com.genersoft.iot.vmp.jt1078.bean.config.IllegalDrivingPeriods; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * JT 终端控制 + */ +@Schema(description = "终端控制") +public class JTDeviceConnectionControl { + + /** + * false 表示切换到指定监管平台服务器 ,true 表示切换回原 缺省监控平台服务器 + */ + private Boolean switchOn; + /** + * 监管平台鉴权码 + */ + private String authentication; + + /** + * 拨号点名称 + */ + private String name; + + /** + * 拨号用户名 + */ + private String username; + + /** + * 拨号密码 + */ + private String password; + + /** + * 地址 + */ + private String address; + + /** + * TCP端口 + */ + private Integer tcpPort; + + /** + * UDP端口 + */ + private Integer udpPort; + + /** + * 连接到指定服务器时限 + */ + private Long timeLimit; + + public Boolean getSwitchOn() { + return switchOn; + } + + public void setSwitchOn(Boolean switchOn) { + this.switchOn = switchOn; + } + + public String getAuthentication() { + return authentication; + } + + public void setAuthentication(String authentication) { + this.authentication = authentication; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Integer getTcpPort() { + return tcpPort; + } + + public void setTcpPort(Integer tcpPort) { + this.tcpPort = tcpPort; + } + + public Integer getUdpPort() { + return udpPort; + } + + public void setUdpPort(Integer udpPort) { + this.udpPort = udpPort; + } + + public Long getTimeLimit() { + return timeLimit; + } + + public void setTimeLimit(Long timeLimit) { + this.timeLimit = timeLimit; + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8105.java b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8105.java new file mode 100644 index 000000000..00c2354f5 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/proc/response/J8105.java @@ -0,0 +1,82 @@ +package com.genersoft.iot.vmp.jt1078.proc.response; + +import com.genersoft.iot.vmp.jt1078.annotation.MsgId; +import com.genersoft.iot.vmp.jt1078.bean.JTDeviceConnectionControl; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; + +import java.util.Arrays; + +/** + * 终端控制 + */ +@MsgId(id = "8105") +public class J8105 extends Rs { + + private JTDeviceConnectionControl connectionControl; + + /** + * 终端复位 + */ + private Boolean reset; + + /** + * 终端恢复出厂设置 + */ + private Boolean factoryReset; + + @Override + public ByteBuf encode() { + ByteBuf byteBuf = Unpooled.buffer(); + if (reset != null) { + byteBuf.writeByte(4); + }else if (factoryReset != null) { + byteBuf.writeByte(5); + }else if (connectionControl != null) { + byteBuf.writeByte(2); + StringBuffer stringBuffer = new StringBuffer(); + if (connectionControl.getSwitchOn() != null) { + if (connectionControl.getSwitchOn()) { + stringBuffer.append("1"); + }else { + stringBuffer.append("0"); + + } + + } + stringBuffer.append() + } + return byteBuf; + } + + public JTDeviceConnectionControl getConnectionControl() { + return connectionControl; + } + + public void setConnectionControl(JTDeviceConnectionControl connectionControl) { + this.connectionControl = connectionControl; + } + + public Boolean getReset() { + return reset; + } + + public void setReset(Boolean reset) { + this.reset = reset; + } + + public Boolean getFactoryReset() { + return factoryReset; + } + + public void setFactoryReset(Boolean factoryReset) { + this.factoryReset = factoryReset; + } + + @Override + public String toString() { + return "J8106{" + + "params=" + Arrays.toString(params) + + '}'; + } +}