Skip to content

Commit

Permalink
Support for fetching the VendorIdentifier and SerialNumber informatio…
Browse files Browse the repository at this point in the history
…n from BACnet device

Added support for extracting deviceIdentifier and serialNumber from actual device.
  • Loading branch information
saransh14 authored Apr 15, 2024
1 parent 23ae720 commit 0a199e2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/src/main/java/org/code_house/bacnet4j/wrapper/api/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 0a199e2

Please sign in to comment.