- fixed bug #366: SCL parser now (only) accepts hexadecimal values for APPID and VLAN-ID

This commit is contained in:
Michael Zillgith 2015-06-16 14:58:47 +02:00
parent b1eda97ab4
commit a3c4e32197
3 changed files with 8 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View file

@ -44,13 +44,19 @@ public class GSEAddress {
String type = ParserUtils.parseAttribute(pNode, "type");
if (type.equals("VLAN-ID")) {
vlanId = new Integer(pNode.getTextContent());
vlanId = Integer.parseInt(pNode.getTextContent(), 16);
if (vlanId > 0xfff)
throw new SclParserException(addressNode, "VLAN-ID value out of range");
}
else if (type.equals("VLAN-PRIORITY")) {
vlanPriority = new Integer(pNode.getTextContent());
}
else if (type.equals("APPID")) {
appId = new Integer(pNode.getTextContent());
appId = Integer.parseInt(pNode.getTextContent(), 16);
if (appId > 0xfff)
throw new SclParserException(addressNode, "APPID value out of range");
}
else if (type.equals("MAC-Address")) {
String[] addressElements = pNode.getTextContent().split("-");