|
|
|
@ -247,14 +247,14 @@ public class SimUtil {
|
|
|
|
|
int encrypto = -1;
|
|
|
|
|
if (integer != null) {
|
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
|
if (split2.length == 4) {
|
|
|
|
|
String s1 = split2[2];
|
|
|
|
|
utcp = StringUtils.convert2Int(s1);
|
|
|
|
|
String s2 = split2[3];
|
|
|
|
|
encrypto = StringUtils.convert2Int(s2);
|
|
|
|
|
}
|
|
|
|
|
UpdateSysConfigUtil.setIP(context, server, integer, utcp, encrypto);
|
|
|
|
|
}
|
|
|
|
|
if (split2.length == 4) {
|
|
|
|
|
String s1 = split2[2];
|
|
|
|
|
utcp = StringUtils.convert2Int(s1);
|
|
|
|
|
String s2 = split2[3];
|
|
|
|
|
encrypto = StringUtils.convert2Int(s2);
|
|
|
|
|
}
|
|
|
|
|
UpdateSysConfigUtil.setIP(context, server, integer, utcp, encrypto);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String menssageBack = "";
|
|
|
|
@ -272,12 +272,6 @@ public class SimUtil {
|
|
|
|
|
} else if (content.contains(SmsTypeEnum.SET_OSD.value())) {
|
|
|
|
|
sendtype = SmsTypeEnum.SET_OSD.value();
|
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
|
String s = split1[1];
|
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
|
if (split2 != null && split2.length == 2) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String menssageBack = "";
|
|
|
|
|
if (ifmessageCorrect) {
|
|
|
|
|
menssageBack = " OK";
|
|
|
|
@ -285,11 +279,81 @@ public class SimUtil {
|
|
|
|
|
menssageBack = " ERROR";
|
|
|
|
|
}
|
|
|
|
|
sendmessage = content + menssageBack;
|
|
|
|
|
if (split1 != null && split1.length == 2) {
|
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
|
HashMap<String, String> osdmap = new HashMap<>();
|
|
|
|
|
String s = split1[1];
|
|
|
|
|
String[] split2 = StringUtils.splitString2(s);
|
|
|
|
|
int spilt2len = split2.length;
|
|
|
|
|
if (split2 != null && spilt2len > 1 && spilt2len % 2 == 1) {
|
|
|
|
|
String num = split2[0];
|
|
|
|
|
Integer integer = StringUtils.convert2Int(num);
|
|
|
|
|
if (integer != null) {
|
|
|
|
|
if (integer == 0) {//所有通道
|
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
|
} else {
|
|
|
|
|
for (int i = 0; i < spilt2len; i++) {
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (i % 2 == 1) {
|
|
|
|
|
if ((i + 1) <= spilt2len) {
|
|
|
|
|
String s1 = split2[i];
|
|
|
|
|
Integer position = StringUtils.convert2Int(s1);
|
|
|
|
|
if (position != null) {
|
|
|
|
|
if (position == 1) {
|
|
|
|
|
osdmap.put("leftTop", split2[i + 1]);
|
|
|
|
|
} else if (position == 2) {
|
|
|
|
|
osdmap.put("rightTop", split2[i + 1]);
|
|
|
|
|
} else if (position == 3) {
|
|
|
|
|
osdmap.put("leftBottom", split2[i + 1]);
|
|
|
|
|
} else if (position == 4) {
|
|
|
|
|
osdmap.put("rightBottom", split2[i + 1]);
|
|
|
|
|
} else {
|
|
|
|
|
ifmessageCorrect = false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
ifmessageCorrect = false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
ifmessageCorrect = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (ifmessageCorrect) {
|
|
|
|
|
UpdateSysConfigUtil.setChannelOSD(integer, osdmap);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (content.contains(SmsTypeEnum.GET_OSD.value())) {
|
|
|
|
|
sendtype = SmsTypeEnum.GET_OSD.value();
|
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
|
String[] split = StringUtils.splitString1(content);
|
|
|
|
|
if (split != null && split.length == 2) {
|
|
|
|
|
sendmessage = SmsTypeEnum.GET_OSD.value() + "=";
|
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
|
Integer channel = StringUtils.convert2Int(split[0]);
|
|
|
|
|
HashMap<String, String> channelOSD = UpdateSysConfigUtil.getChannelOSD(channel);
|
|
|
|
|
String leftTop = channelOSD.get("leftTop");
|
|
|
|
|
String rightTop = channelOSD.get("rightTop");
|
|
|
|
|
String leftBottom = channelOSD.get("leftBottom");
|
|
|
|
|
String rightBottom = channelOSD.get("rightBottom");
|
|
|
|
|
if (leftTop != null && StringUtils.isNotEmpty(leftTop)) {
|
|
|
|
|
sendmessage += "1," + leftTop;
|
|
|
|
|
}
|
|
|
|
|
if (rightTop != null && StringUtils.isNotEmpty(rightTop)) {
|
|
|
|
|
sendmessage += "2," + rightTop;
|
|
|
|
|
}
|
|
|
|
|
if (leftBottom != null && StringUtils.isNotEmpty(leftBottom)) {
|
|
|
|
|
sendmessage += "3" + leftBottom;
|
|
|
|
|
}
|
|
|
|
|
if (rightBottom != null && StringUtils.isNotEmpty(rightBottom)) {
|
|
|
|
|
sendmessage += "4," + leftTop;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (content.contains(SmsTypeEnum.SET_PHOTO_SCHEDULE_LIST.value())) {
|
|
|
|
|
sendtype = SmsTypeEnum.SET_OSD.value();
|
|
|
|
|
sendtype = SmsTypeEnum.SET_PHOTO_SCHEDULE_LIST.value();
|
|
|
|
|
String[] split1 = StringUtils.splitString1(content);
|
|
|
|
|
if (split1 != null && split1.length > 1) {
|
|
|
|
|
String s = split1[1];
|
|
|
|
@ -321,7 +385,7 @@ public class SimUtil {
|
|
|
|
|
Integer videoCY = StringUtils.convert2Int(split2[4]);
|
|
|
|
|
if (channel != null && resolutionCX != null && resolutionCY != null && videoCX != null && videoCY != null) {
|
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
|
UpdateSysConfigUtil.setChannelResolution(packageName, channel, resolutionCX, resolutionCY, videoCX, videoCY);
|
|
|
|
|
UpdateSysConfigUtil.setChannelResolution(channel, resolutionCX, resolutionCY, videoCX, videoCY);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -337,7 +401,7 @@ public class SimUtil {
|
|
|
|
|
ifmessageCorrect = true;
|
|
|
|
|
String[] split = StringUtils.splitString1(content);
|
|
|
|
|
Integer channel = StringUtils.convert2Int(split[0]);
|
|
|
|
|
HashMap<String, Integer> hashMap = UpdateSysConfigUtil.getChannelResolution(packageName, channel);
|
|
|
|
|
HashMap<String, Integer> hashMap = UpdateSysConfigUtil.getChannelResolution(channel);
|
|
|
|
|
Integer resolutionCX = hashMap.get("resolutionCX");
|
|
|
|
|
Integer resolutionCY = hashMap.get("resolutionCY");
|
|
|
|
|
Integer videoCX = hashMap.get("videoCX");
|
|
|
|
|