Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for fetching the VendorIdentifier and SerialNumber information from BACnet device #38

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading