From 7227e33099f0d07c80cea1452cc6089e4a89ef62 Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Thu, 7 Apr 2022 14:21:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85xml=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E7=BC=96=E7=A0=81=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transmit/cmd/impl/SIPCommander.java | 48 ++++++++++++------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java index a8cc8fbf..4baa349e 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java @@ -229,7 +229,8 @@ public class SIPCommander implements ISIPCommander { try { String cmdStr= cmdString(leftRight, upDown, inOut, moveSpeed, zoomSpeed); StringBuffer ptzXml = new StringBuffer(200); - ptzXml.append("\r\n"); + String charset = device.getCharset(); + ptzXml.append("\r\n"); ptzXml.append("\r\n"); ptzXml.append("DeviceControl\r\n"); ptzXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -271,7 +272,8 @@ public class SIPCommander implements ISIPCommander { String cmdStr= frontEndCmdString(cmdCode, parameter1, parameter2, combineCode2); logger.debug("控制字符串:" + cmdStr); StringBuffer ptzXml = new StringBuffer(200); - ptzXml.append("\r\n"); + String charset = device.getCharset(); + ptzXml.append("\r\n"); ptzXml.append("\r\n"); ptzXml.append("DeviceControl\r\n"); ptzXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -306,7 +308,8 @@ public class SIPCommander implements ISIPCommander { public boolean fronEndCmd(Device device, String channelId, String cmdString, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) { try { StringBuffer ptzXml = new StringBuffer(200); - ptzXml.append("\r\n"); + String charset = device.getCharset(); + ptzXml.append("\r\n"); ptzXml.append("\r\n"); ptzXml.append("DeviceControl\r\n"); ptzXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -769,7 +772,8 @@ public class SIPCommander implements ISIPCommander { public boolean audioBroadcastCmd(Device device) { try { StringBuffer broadcastXml = new StringBuffer(200); - broadcastXml.append("\r\n"); + String charset = device.getCharset(); + broadcastXml.append("\r\n"); broadcastXml.append("\r\n"); broadcastXml.append("Broadcast\r\n"); broadcastXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -794,7 +798,8 @@ public class SIPCommander implements ISIPCommander { public void audioBroadcastCmd(Device device, SipSubscribe.Event errorEvent) { try { StringBuffer broadcastXml = new StringBuffer(200); - broadcastXml.append("\r\n"); + String charset = device.getCharset(); + broadcastXml.append("\r\n"); broadcastXml.append("\r\n"); broadcastXml.append("Broadcast\r\n"); broadcastXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -826,7 +831,8 @@ public class SIPCommander implements ISIPCommander { public boolean recordCmd(Device device, String channelId, String recordCmdStr, SipSubscribe.Event errorEvent) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("DeviceControl\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -861,7 +867,8 @@ public class SIPCommander implements ISIPCommander { public boolean teleBootCmd(Device device) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("DeviceControl\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -893,7 +900,8 @@ public class SIPCommander implements ISIPCommander { public boolean guardCmd(Device device, String guardCmdStr, SipSubscribe.Event errorEvent) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("DeviceControl\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -924,7 +932,8 @@ public class SIPCommander implements ISIPCommander { public boolean alarmCmd(Device device, String alarmMethod, String alarmType, SipSubscribe.Event errorEvent) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("DeviceControl\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -968,7 +977,8 @@ public class SIPCommander implements ISIPCommander { public boolean iFrameCmd(Device device, String channelId) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("DeviceControl\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -1006,7 +1016,8 @@ public class SIPCommander implements ISIPCommander { public boolean homePositionCmd(Device device, String channelId, String enabled, String resetTime, String presetIndex, SipSubscribe.Event errorEvent) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("DeviceControl\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -1074,7 +1085,8 @@ public class SIPCommander implements ISIPCommander { String heartBeatInterval, String heartBeatCount, SipSubscribe.Event errorEvent) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("DeviceConfig\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -1288,7 +1300,8 @@ public class SIPCommander implements ISIPCommander { String startTime, String endTime, SipSubscribe.Event errorEvent) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("Alarm\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -1338,7 +1351,8 @@ public class SIPCommander implements ISIPCommander { public boolean deviceConfigQuery(Device device, String channelId, String configType, SipSubscribe.Event errorEvent) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("ConfigDownload\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -1373,7 +1387,8 @@ public class SIPCommander implements ISIPCommander { public boolean presetQuery(Device device, String channelId, SipSubscribe.Event errorEvent) { try { StringBuffer cmdXml = new StringBuffer(200); - cmdXml.append("\r\n"); + String charset = device.getCharset(); + cmdXml.append("\r\n"); cmdXml.append("\r\n"); cmdXml.append("PresetQuery\r\n"); cmdXml.append("" + (int)((Math.random()*9+1)*100000) + "\r\n"); @@ -1561,7 +1576,8 @@ public class SIPCommander implements ISIPCommander { public boolean dragZoomCmd(Device device, String channelId, String cmdString) { try { StringBuffer dragXml = new StringBuffer(200); - dragXml.append("\r\n"); + String charset = device.getCharset(); + dragXml.append("\r\n"); dragXml.append("\r\n"); dragXml.append("DeviceControl\r\n"); dragXml.append("" + (int) ((Math.random() * 9 + 1) * 100000) + "\r\n");