BACnet.Stack.EncoderProtocol protocol (bacstack v0.0.1)
View SourceThis protocol is used inside the BACnet stack (transport modules) to encode APDU structs into binary BACnet APDUs, which then are sent through the transport layer.
Summary
Functions
Encodes the struct into a BACnet APDU binary packet.
Same as encode/1
, but respects the APDU maximum size.
Whether the struct expects a reply (i.e. Confirmed Service Request).
Whether the struct is a request.
Whether the struct is a response.
Whether the struct can be segmented (supported by the BACnet protocol).
Types
@type t() :: term()
All the types that implement this protocol.
Functions
Encodes the struct into a BACnet APDU binary packet.
Any information that is additionally required by the transport layer, must be added by the transport layer.
Any segmentation that needs to be applied, can not and will not be respected by this function.
Same as encode/1
, but respects the APDU maximum size.
It will output a list of segmented binaries, that can be sent ordered to the transport layer. Rules around segmentation (such as Segment ACK) still apply for the transport layer.
Conventionally, this function simply takes the encoded body and splits it apart into individual segments and adds the header.
Whether the struct expects a reply (i.e. Confirmed Service Request).
This is useful for NPCI calculation.
Whether the struct is a request.
Whether the struct is a response.
Whether the struct can be segmented (supported by the BACnet protocol).