1078-添加设备控制

This commit is contained in:
648540858
2024-04-29 22:01:26 +08:00
parent 9facff13b1
commit 516c5ce3d1
2 changed files with 213 additions and 0 deletions

View File

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

View File

@@ -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) +
'}';
}
}