Commit 7ad28af0e385d31cb8aa5e803da33b8fd3f3219b

Authored by 648540858
1 parent 76226c41

补充xml缺失的编码信息

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
... ... @@ -229,7 +229,8 @@ public class SIPCommander implements ISIPCommander {
229 229 try {
230 230 String cmdStr= cmdString(leftRight, upDown, inOut, moveSpeed, zoomSpeed);
231 231 StringBuffer ptzXml = new StringBuffer(200);
232   - ptzXml.append("<?xml version=\"1.0\" ?>\r\n");
  232 + String charset = device.getCharset();
  233 + ptzXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
233 234 ptzXml.append("<Control>\r\n");
234 235 ptzXml.append("<CmdType>DeviceControl</CmdType>\r\n");
235 236 ptzXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -271,7 +272,8 @@ public class SIPCommander implements ISIPCommander {
271 272 String cmdStr= frontEndCmdString(cmdCode, parameter1, parameter2, combineCode2);
272 273 logger.debug("控制字符串:" + cmdStr);
273 274 StringBuffer ptzXml = new StringBuffer(200);
274   - ptzXml.append("<?xml version=\"1.0\" ?>\r\n");
  275 + String charset = device.getCharset();
  276 + ptzXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
275 277 ptzXml.append("<Control>\r\n");
276 278 ptzXml.append("<CmdType>DeviceControl</CmdType>\r\n");
277 279 ptzXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -306,7 +308,8 @@ public class SIPCommander implements ISIPCommander {
306 308 public boolean fronEndCmd(Device device, String channelId, String cmdString, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent) {
307 309 try {
308 310 StringBuffer ptzXml = new StringBuffer(200);
309   - ptzXml.append("<?xml version=\"1.0\" ?>\r\n");
  311 + String charset = device.getCharset();
  312 + ptzXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
310 313 ptzXml.append("<Control>\r\n");
311 314 ptzXml.append("<CmdType>DeviceControl</CmdType>\r\n");
312 315 ptzXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -769,7 +772,8 @@ public class SIPCommander implements ISIPCommander {
769 772 public boolean audioBroadcastCmd(Device device) {
770 773 try {
771 774 StringBuffer broadcastXml = new StringBuffer(200);
772   - broadcastXml.append("<?xml version=\"1.0\" ?>\r\n");
  775 + String charset = device.getCharset();
  776 + broadcastXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
773 777 broadcastXml.append("<Notify>\r\n");
774 778 broadcastXml.append("<CmdType>Broadcast</CmdType>\r\n");
775 779 broadcastXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -794,7 +798,8 @@ public class SIPCommander implements ISIPCommander {
794 798 public void audioBroadcastCmd(Device device, SipSubscribe.Event errorEvent) {
795 799 try {
796 800 StringBuffer broadcastXml = new StringBuffer(200);
797   - broadcastXml.append("<?xml version=\"1.0\" ?>\r\n");
  801 + String charset = device.getCharset();
  802 + broadcastXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
798 803 broadcastXml.append("<Notify>\r\n");
799 804 broadcastXml.append("<CmdType>Broadcast</CmdType>\r\n");
800 805 broadcastXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -826,7 +831,8 @@ public class SIPCommander implements ISIPCommander {
826 831 public boolean recordCmd(Device device, String channelId, String recordCmdStr, SipSubscribe.Event errorEvent) {
827 832 try {
828 833 StringBuffer cmdXml = new StringBuffer(200);
829   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  834 + String charset = device.getCharset();
  835 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
830 836 cmdXml.append("<Control>\r\n");
831 837 cmdXml.append("<CmdType>DeviceControl</CmdType>\r\n");
832 838 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -861,7 +867,8 @@ public class SIPCommander implements ISIPCommander {
861 867 public boolean teleBootCmd(Device device) {
862 868 try {
863 869 StringBuffer cmdXml = new StringBuffer(200);
864   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  870 + String charset = device.getCharset();
  871 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
865 872 cmdXml.append("<Control>\r\n");
866 873 cmdXml.append("<CmdType>DeviceControl</CmdType>\r\n");
867 874 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -893,7 +900,8 @@ public class SIPCommander implements ISIPCommander {
893 900 public boolean guardCmd(Device device, String guardCmdStr, SipSubscribe.Event errorEvent) {
894 901 try {
895 902 StringBuffer cmdXml = new StringBuffer(200);
896   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  903 + String charset = device.getCharset();
  904 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
897 905 cmdXml.append("<Control>\r\n");
898 906 cmdXml.append("<CmdType>DeviceControl</CmdType>\r\n");
899 907 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -924,7 +932,8 @@ public class SIPCommander implements ISIPCommander {
924 932 public boolean alarmCmd(Device device, String alarmMethod, String alarmType, SipSubscribe.Event errorEvent) {
925 933 try {
926 934 StringBuffer cmdXml = new StringBuffer(200);
927   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  935 + String charset = device.getCharset();
  936 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
928 937 cmdXml.append("<Control>\r\n");
929 938 cmdXml.append("<CmdType>DeviceControl</CmdType>\r\n");
930 939 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -968,7 +977,8 @@ public class SIPCommander implements ISIPCommander {
968 977 public boolean iFrameCmd(Device device, String channelId) {
969 978 try {
970 979 StringBuffer cmdXml = new StringBuffer(200);
971   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  980 + String charset = device.getCharset();
  981 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
972 982 cmdXml.append("<Control>\r\n");
973 983 cmdXml.append("<CmdType>DeviceControl</CmdType>\r\n");
974 984 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -1006,7 +1016,8 @@ public class SIPCommander implements ISIPCommander {
1006 1016 public boolean homePositionCmd(Device device, String channelId, String enabled, String resetTime, String presetIndex, SipSubscribe.Event errorEvent) {
1007 1017 try {
1008 1018 StringBuffer cmdXml = new StringBuffer(200);
1009   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  1019 + String charset = device.getCharset();
  1020 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
1010 1021 cmdXml.append("<Control>\r\n");
1011 1022 cmdXml.append("<CmdType>DeviceControl</CmdType>\r\n");
1012 1023 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -1074,7 +1085,8 @@ public class SIPCommander implements ISIPCommander {
1074 1085 String heartBeatInterval, String heartBeatCount, SipSubscribe.Event errorEvent) {
1075 1086 try {
1076 1087 StringBuffer cmdXml = new StringBuffer(200);
1077   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  1088 + String charset = device.getCharset();
  1089 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
1078 1090 cmdXml.append("<Control>\r\n");
1079 1091 cmdXml.append("<CmdType>DeviceConfig</CmdType>\r\n");
1080 1092 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -1288,7 +1300,8 @@ public class SIPCommander implements ISIPCommander {
1288 1300 String startTime, String endTime, SipSubscribe.Event errorEvent) {
1289 1301 try {
1290 1302 StringBuffer cmdXml = new StringBuffer(200);
1291   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  1303 + String charset = device.getCharset();
  1304 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
1292 1305 cmdXml.append("<Query>\r\n");
1293 1306 cmdXml.append("<CmdType>Alarm</CmdType>\r\n");
1294 1307 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -1338,7 +1351,8 @@ public class SIPCommander implements ISIPCommander {
1338 1351 public boolean deviceConfigQuery(Device device, String channelId, String configType, SipSubscribe.Event errorEvent) {
1339 1352 try {
1340 1353 StringBuffer cmdXml = new StringBuffer(200);
1341   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  1354 + String charset = device.getCharset();
  1355 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
1342 1356 cmdXml.append("<Query>\r\n");
1343 1357 cmdXml.append("<CmdType>ConfigDownload</CmdType>\r\n");
1344 1358 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -1373,7 +1387,8 @@ public class SIPCommander implements ISIPCommander {
1373 1387 public boolean presetQuery(Device device, String channelId, SipSubscribe.Event errorEvent) {
1374 1388 try {
1375 1389 StringBuffer cmdXml = new StringBuffer(200);
1376   - cmdXml.append("<?xml version=\"1.0\" ?>\r\n");
  1390 + String charset = device.getCharset();
  1391 + cmdXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
1377 1392 cmdXml.append("<Query>\r\n");
1378 1393 cmdXml.append("<CmdType>PresetQuery</CmdType>\r\n");
1379 1394 cmdXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
... ... @@ -1561,7 +1576,8 @@ public class SIPCommander implements ISIPCommander {
1561 1576 public boolean dragZoomCmd(Device device, String channelId, String cmdString) {
1562 1577 try {
1563 1578 StringBuffer dragXml = new StringBuffer(200);
1564   - dragXml.append("<?xml version=\"1.0\" ?>\r\n");
  1579 + String charset = device.getCharset();
  1580 + dragXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n");
1565 1581 dragXml.append("<Control>\r\n");
1566 1582 dragXml.append("<CmdType>DeviceControl</CmdType>\r\n");
1567 1583 dragXml.append("<SN>" + (int) ((Math.random() * 9 + 1) * 100000) + "</SN>\r\n");
... ...