diff --git a/api/src/main/java/org/code_house/bacnet4j/wrapper/api/Device.java b/api/src/main/java/org/code_house/bacnet4j/wrapper/api/Device.java index 3917e01..9f83ade 100644 --- a/api/src/main/java/org/code_house/bacnet4j/wrapper/api/Device.java +++ b/api/src/main/java/org/code_house/bacnet4j/wrapper/api/Device.java @@ -39,6 +39,8 @@ public class Device { private String modelName = ""; private String vendorName = ""; + private int vendorIdentifier ; + private String serialNumber = ""; private String name = ""; private boolean readMultiple; @@ -85,6 +87,22 @@ public String getVendorName() { return vendorName; } + public int getVendorIdentifier() { + return vendorIdentifier; + } + + public void setVendorIdentifier(int vendorIdentifier) { + this.vendorIdentifier = vendorIdentifier; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + public void setName(String name) { this.name = name; } diff --git a/api/src/main/java/org/code_house/bacnet4j/wrapper/api/DiscoveryEventAdapter.java b/api/src/main/java/org/code_house/bacnet4j/wrapper/api/DiscoveryEventAdapter.java index 9fe848f..4f4a32f 100644 --- a/api/src/main/java/org/code_house/bacnet4j/wrapper/api/DiscoveryEventAdapter.java +++ b/api/src/main/java/org/code_house/bacnet4j/wrapper/api/DiscoveryEventAdapter.java @@ -95,6 +95,13 @@ protected Device createDevice(RemoteDevice d) { if (d.getVendorName() != null && !d.getVendorName().isEmpty()) { device.setVendorName(d.getVendorName()); } + if (d.getVendorIdentifier() != -1) { + device.setVendorName(d.getVendorName()); + } + if (d.getCharacterStringProperty(PropertyIdentifier.serialNumber) != null + && !d.getCharacterStringProperty(PropertyIdentifier.serialNumber).isEmpty()) { + device.setSerialNumber(d.getCharacterStringProperty(PropertyIdentifier.serialNumber)); + } if (d.getName() != null && !d.getName().isEmpty()) { device.setName(d.getName()); }