This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/main/java/no/entra/bacnet/services/ReadObjectPropertiesResultParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package no.entra.bacnet.services; | ||
|
||
import no.entra.bacnet.objects.ObjectId; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
|
||
public class ReadObjectPropertiesResultParser { | ||
|
||
public static ReadObjectPropertiesResult parse(String hexString) throws BacnetParserException { | ||
ObjectId objectId = null;// TODO: 08.04.2021 | ||
List<ReadPropertyResult> readPropertyResults = new ArrayList<>();//TODO | ||
|
||
//Iterate over list of | ||
} | ||
} |
94 changes: 94 additions & 0 deletions
94
src/test/java/no/entra/bacnet/services/ReadObjectPropertiesResultParserTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package no.entra.bacnet.services; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
/* | ||
Single object multiple properties | ||
{ | ||
"objectId": "analog-value, 0", | ||
"results": [ | ||
{ | ||
"property-identifier": "object-name", | ||
"read-result": { | ||
"Object Name": "UI1_ZoneTemperature" | ||
} | ||
}, | ||
{ | ||
"property-identifier": "description", | ||
"read-result": { | ||
"description": "Analog Value 0" | ||
} | ||
}, | ||
{ | ||
"property-identifier": "units", | ||
"read-result": { | ||
"units": "No Units" | ||
} | ||
}, | ||
{ | ||
"property-identifier": "present-value", | ||
"read-result": { | ||
"Present Value": 22.3999862670898 | ||
} | ||
} | ||
] | ||
} | ||
HexString: 0c008000001e294d4e7514005549315f5a6f6e6554656d70657261747572654f291c4e750f00416e616c6f672056616c756520304f29754e915f4f29554e4441b3332c4f1f | ||
With Error | ||
{ | ||
"objectId": "device, 8", | ||
"results": [ | ||
{ | ||
"property-identifier": "object-name", | ||
"read-result": { | ||
"Object Name": "FWFCU" | ||
} | ||
}, | ||
{ | ||
"property-identifier": "description", | ||
"read-result": { | ||
"description": "FW Series Bacnet Device" | ||
} | ||
}, | ||
{ | ||
"property-identifier": "present-value", | ||
"read-result": { | ||
"propertyAccessError": { | ||
"errorClass": "property", | ||
"errorCode": "unknown-property" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
HexString: 0c020000081e294d4e75060046574643554f291c4e751800465720536572696573204261636e6574204465766963654f29755e910291205f29555e910291205f1f | ||
With Array | ||
{ | ||
"objectId": "device, 8", | ||
"results": [ | ||
{ | ||
"property-identifier": "object-list", | ||
"property-array-index": "1", | ||
"read-result": { | ||
"objectId": "device, 8" | ||
} | ||
}, | ||
{ | ||
"property-identifier": "object-list", | ||
"property-array-index": "2", | ||
"read-result": { | ||
"objectId": "analog-value, 0" | ||
} | ||
} | ||
] | ||
} | ||
HexString: 30460e0c020000081e294c39014ec4020000084f294c39024ec4008000004f294c39034e1f | ||
*/ | ||
class ReadObjectPropertiesResultParserTest { | ||
|
||
@Test | ||
void parse() { | ||
} | ||
} |