优化对Parental字段的判断

pull/461/head
648540858 2022-04-28 10:05:56 +08:00
parent 4e0a463f88
commit 420a87cfd7
1 changed files with 2 additions and 1 deletions

View File

@ -219,7 +219,8 @@ public class XmlUtil {
deviceChannel.setParental(0);
}
} else {
deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental")));
// 由于海康会错误的发送65535作为这里的取值,所以这里除非是0否则认为是1
deviceChannel.setParental(Integer.parseInt(XmlUtil.getText(itemDevice, "Parental")) == 1?1:0);
}
deviceChannel.setParentId(XmlUtil.getText(itemDevice, "ParentID"));
String parentId = XmlUtil.getText(itemDevice, "ParentID");