Skip to content

Commit

Permalink
feat(bacnet): added helper functions for segmentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed May 23, 2022
1 parent ec16e74 commit 09c1e79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,11 @@ func CreateSignedPayload(value int) (uint32, *BACnetTagPayloadSignedInteger) {
return length, payload
}

func CreatBACnetSegmentationTagged(value BACnetSegmentation) *BACnetSegmentationTagged {
header := CreateBACnetTagHeaderBalanced(false, 0, 1)
return NewBACnetSegmentationTagged(header, value, 0, TagClass_APPLICATION_TAGS)
}

func CreateBACnetApplicationTagBoolean(value bool) *BACnetApplicationTagBoolean {
_value := uint32(0)
if value {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,11 @@ public static BACnetPropertyIdentifierTagged createBACnetPropertyIdentifierTagge
return new BACnetPropertyIdentifierTagged(header, propertyIdentifier, proprietaryValue, (short) tagNum, TagClass.CONTEXT_SPECIFIC_TAGS);
}

public static BACnetSegmentationTagged creatBACnetSegmentationTagged(BACnetSegmentation value) {
BACnetTagHeader header = createBACnetTagHeaderBalanced(false, (byte) 0, 1);
return new BACnetSegmentationTagged(header, value, (short) 0, TagClass.APPLICATION_TAGS);
}

public static BACnetApplicationTagBoolean createBACnetApplicationTagBoolean(boolean value) {
BACnetTagHeader header = createBACnetTagHeaderBalanced(false, BACnetDataType.BOOLEAN.getValue(), value ? 1L : 0L);
return new BACnetApplicationTagBoolean(header, new BACnetTagPayloadBoolean(value ? 1L : 0L));
Expand Down

0 comments on commit 09c1e79

Please sign in to comment.