ninjasource / embedded-bacnet

A library to read and write bacnet packets for embedded devices
Apache License 2.0
12 stars 2 forks source link

Add support for "Segments" (and Segment-ACK) #4

Closed mnbbrown closed 2 months ago

mnbbrown commented 2 months ago

Segments are partially decoded APDUs that include sufficient information for the application to buffer/accumulate into a non-segmented APDU. The include information like invoke_id, sequence number, if more segments are to follow, window size, etc.

This is a first pass. The new "Segment" struct may be unnecessary - instead just implementing encode_for_accumulation on each service choice may be sufficient. TBC as my app matures.

ninjasource commented 2 months ago

Awesome, thanks for adding this! I'll have to experiment with segmentation when I need it one day but the implementation looks good to me.