Expand description
Full ASN.1 framing codecs for constructed Clause-21 types whose property values are CHOICE/SEQUENCE productions — context-tagged framing per ASHRAE 135-2020 Clause 20.2.1.5/20.2.1.6.
These codecs encode to and decode from raw application-layer bytes, the
same bytes carried by bacnet_types::primitives::PropertyValue::ApplicationData.
Objects serve framed properties (e.g. Event_Parameters,
Fault_Parameters, Recipient_List) by encoding with these functions;
the flat application-tagged model in crate::primitives::encode_property_value
cannot express their wire form.
Tag-form rules applied here:
- A CHOICE alternative over a
SEQUENCEis an opening/closing context tag pair around the SEQUENCE’s members. - A CHOICE alternative over a primitive base type is a context-specific
primitive tag holding the raw contents (e.g.
none [0] NULL). - A context-tagged inner
CHOICEis always explicitly tagged: an opening/closing pair around the alternative’s own encoding. - Inner members declared
[n] Tover primitiveTare context-tagged primitives; innerSEQUENCE OF/ embeddedSEQUENCEmembers are constructed opening/closing pairs holding application-tagged elements.
Re-exports§
pub use access_credential::decode_assigned_access_rights;pub use access_credential::decode_authentication_factor;pub use access_credential::decode_authentication_factor_format;pub use access_credential::decode_credential_authentication_factor;pub use access_credential::encode_assigned_access_rights;pub use access_credential::encode_authentication_factor;pub use access_credential::encode_authentication_factor_format;pub use access_credential::encode_credential_authentication_factor;pub use access_rule::decode_access_rule;pub use access_rule::encode_access_rule;pub use assigned_landing_calls::decode_assigned_landing_calls;pub use assigned_landing_calls::encode_assigned_landing_calls;pub use authentication_policy::decode_authentication_policy;pub use authentication_policy::encode_authentication_policy;pub use calendar::decode_calendar_entry;pub use calendar::decode_calendar_entry_list;pub use calendar::decode_date_range;pub use calendar::encode_calendar_entry;pub use calendar::encode_calendar_entry_list;pub use calendar::encode_date_range;pub use cov_subscription::decode_cov_multiple_subscription;pub use cov_subscription::decode_cov_subscription;pub use cov_subscription::encode_cov_multiple_subscription;pub use cov_subscription::encode_cov_multiple_subscription_list;pub use cov_subscription::encode_cov_subscription;pub use cov_subscription::encode_cov_subscription_list;pub use event_notification_subscription::decode_event_notification_subscription;pub use event_notification_subscription::encode_event_notification_subscription;pub use event_notification_subscription::encode_event_notification_subscription_list;pub use event_parameter::decode_event_parameter;pub use event_parameter::encode_event_parameter;pub use fault_parameter::decode_fault_parameters;pub use fault_parameter::encode_fault_parameters;pub use landing_call_status::decode_landing_call_status;pub use landing_call_status::decode_landing_call_status_list;pub use landing_call_status::encode_landing_call_status;pub use landing_call_status::encode_landing_call_status_list;pub use landing_door_status::decode_landing_door_status;pub use landing_door_status::encode_landing_door_status;pub use lift_car_call_list::decode_lift_car_call_list;pub use lift_car_call_list::encode_lift_car_call_list;pub use network_port::decode_bdt_entry;pub use network_port::decode_bdt_entry_list;pub use network_port::decode_fdt_entry;pub use network_port::decode_fdt_entry_list;pub use network_port::decode_host_address;pub use network_port::decode_host_n_port;pub use network_port::encode_bdt_entry;pub use network_port::encode_bdt_entry_list;pub use network_port::encode_fdt_entry;pub use network_port::encode_fdt_entry_list;pub use network_port::encode_host_address;pub use network_port::encode_host_n_port;pub use object_property_reference::decode_object_property_reference;pub use object_property_reference::decode_object_property_reference_at;pub use object_property_reference::decode_setpoint_reference;pub use object_property_reference::decode_setpoint_reference_at;pub use object_property_reference::encode_object_property_reference;pub use object_property_reference::encode_setpoint_reference;pub use port_permission::decode_port_permission;pub use port_permission::encode_port_permission;pub use recipient::check_decoded_mac_len;pub use recipient::check_encoded_mac_len;pub use recipient::decode_destination;pub use recipient::decode_destination_list;pub use recipient::decode_recipient;pub use recipient::encode_destination;pub use recipient::encode_destination_list;pub use recipient::encode_recipient;pub use schedule::decode_daily_schedule;pub use schedule::decode_exception_schedule;pub use schedule::decode_special_event;pub use schedule::decode_special_event_period;pub use schedule::decode_time_value;pub use schedule::decode_weekly_schedule;pub use schedule::encode_daily_schedule;pub use schedule::encode_exception_schedule;pub use schedule::encode_special_event;pub use schedule::encode_special_event_period;pub use schedule::encode_time_value;pub use schedule::encode_weekly_schedule;pub use staging::decode_device_object_reference;pub use staging::decode_stage_limit_value;pub use staging::encode_device_object_reference;pub use staging::encode_stage_limit_value;
Modules§
- access_
credential - Clause 21 codecs for the elements of two Access Credential arrays
(Clause 12.35): Assigned_Access_Rights (
BACnetAssignedAccessRights) and Authentication_Factors (BACnetCredentialAuthenticationFactor, which embeds aBACnetAuthenticationFactor). The Credential Data Input serves the bare factor as its Present_Value and an array ofBACnetAuthenticationFactorFormatas Supported_Formats (Clause 12.36). - access_
rule - Clause 21 codec for
BACnetAccessRule, the element of an Access Rights object’s Positive_Access_Rules and Negative_Access_Rules arrays (Clause 12.34.9.1). - assigned_
landing_ calls - Clause 21 codec for
BACnetAssignedLandingCalls, the value of each element of the Lift object’s Assigned_Landing_Calls array (Clause 12.59). - authentication_
policy - Clause 21 codec for
BACnetAuthenticationPolicy, the element of an Access Point’s Authentication_Policy_List array (Clause 12.31.12). - calendar
- Clause 21 codecs for
BACnetCalendarEntryandBACnetDateRange. - cov_
subscription - Encode and decode the constructed values carried by Device
Active_COV_SubscriptionsandActive_COV_Multiple_Subscriptions. - event_
notification_ subscription - Encode and decode a Notification Forwarder’s Subscribed_Recipients elements (Clause 12.51.9, Clause 21 BACnetEventNotificationSubscription).
- event_
parameter BACnetEventParameterfull ASN.1 framing.- fault_
parameter BACnetFaultParameterfull ASN.1 framing.- landing_
call_ status - Clause 21 codec for
BACnetLandingCallStatus, the value of the Elevator Group object’s Landing_Call_Control and of each Landing_Calls element (Clause 12.58). - landing_
door_ status - Clause 21 codec for
BACnetLandingDoorStatus, the value of each element of the Lift object’s Landing_Door_Status array (Clause 12.59). - lift_
car_ call_ list - Clause 21 codec for
BACnetLiftCarCallList, the value of each element of the Lift object’s Registered_Car_Call array (Clause 12.59). - network_
port - Clause 21 codecs for the Network Port object’s host and broadcast-table
values:
BACnetHostAddress,BACnetHostNPort,BACnetBDTEntryandBACnetFDTEntry(Clause 12.56). - object_
property_ reference BACnetObjectPropertyReferenceand itsBACnetSetpointReferencewrapper (ASHRAE 135-2020 Clause 21) — wire codecs for the object-reference properties of the Loop (Clause 12.17) and Pulse Converter (Clause 12.23) objects.- port_
permission - Encode and decode a Notification Forwarder’s Port_Filter elements (Clause 12.51.11, Clause 21 BACnetPortPermission).
- recipient
Recipient_Listfull ASN.1 framing (ASHRAE 135-2020 Clauses 12.21, 21).- schedule
- Clause 21 codecs for the Schedule object’s constructed properties (Clause 12.24): Weekly_Schedule and Exception_Schedule.
- staging
- Clause 21 codecs used by the Staging object.
- tagged
- Decode helpers for tagged fields, shared by the constructed codecs, the
formal Error bodies in
apdu/and the service parameters bacnet-services decodes.
Structs§
- Property
Value Decode Error - A failed property value decode, with what was read before the failure.
Enums§
- Constructed
Channel Value - A constructed alternative of a BACnetChannelValue: which context tag frames it.
- Property
Value Boundary - A tag that may follow an encoded property value in the enclosing production, used to find where the value ends.
- Property
Value Decode Failure - Why a property value failed to decode.
- Property
Value Decode Stage - The member a property value decode was reading when it failed.
Functions§
- channel_
value_ end - Return the offset just past the single BACnetChannelValue starting at
offset. - constructed_
channel_ value - Which constructed alternative
datais, when it is exactly one well-formed constructed BACnetChannelValue;Nonefor a primitive, anything malformed, or octets left over. - decode_
action_ command - Decode one bare
BACnetActionCommandatoffset; returns it and the offset past its write-successful flag. - decode_
action_ list - Decode one
BACnetActionListatoffset; returns it and the offset past its closing[0]tag, so an Action array is walked by calling this at each element’s start. - decode_
audit_ log_ record - Decode a complete bare
BACnetAuditLogRecordfield sequence. - decode_
audit_ log_ record_ at - Decode one bare
BACnetAuditLogRecordstarting atoffset, returning it and the offset just past it, so the records of a ReadRange item list decode one after another. - decode_
audit_ log_ record_ result_ at - Decode one adjacent result sequence starting at
offset. - decode_
audit_ notification_ at - Decode one bare
BACnetAuditNotificationstarting atoffset. - decode_
bacnet_ property_ value - Decode a property value at
offsetindata; returns it and the offset just past it. - decode_
bacnet_ property_ value_ in_ list - Decode one property value of a list that ends with the closing tag
closing_tag; returns it and the offset just past it. - decode_
bacnet_ property_ value_ in_ list_ detailed decode_bacnet_property_value_in_list, reporting the stage, the reject reason and the reference read so far when the value is malformed.- decode_
color_ command - Decode one unframed
BACnetColorCommandSEQUENCE atoffset. - decode_
color_ command_ value - Decode a
BACnetColorCommandthat fillsdata, as a WriteProperty of Color_Command carries it. - decode_
device_ object_ property_ reference - Decode one bare
BACnetDeviceObjectPropertyReferenceatoffset; returns it and the offset past its last member. A BACnetLIST of these references concatenates its elements with no frame, so walking the list calls this at each element’s start. - decode_
event_ log_ record - Decode one Event Log record starting at
offset, returning it and the offset just past it. - decode_
event_ notification - Decode request parameters from
data; errors on missing, malformed or truncated fields. - decode_
event_ notification_ tolerant decode_event_notification, except that a message text whose characters don’t decode is dropped, so the request reads withmessage_text: None.- decode_
lighting_ command - Decode one unframed
BACnetLightingCommandSEQUENCE atoffset. - decode_
lighting_ command_ value - Decode a
BACnetLightingCommandthat fillsdata, as a WriteProperty of Lighting_Command carries it. - decode_
log_ multiple_ record - Decode one Trend Log Multiple record starting at
offset, returning it and the offset just past it. - decode_
log_ record - Decode one Trend Log record starting at
offset, returning it and the offset just past it. - decode_
name_ value - Decode one
BACnetNameValueatoffset, returning it and the next offset. - decode_
notification_ parameters - Decode one notification-parameter choice, with an optional enclosing
[12]close. - decode_
prescale - Decode one
BACnetPrescaleSEQUENCE atoffset; returns it and the offset past its[1]member. A member left out (the data ends, or[1]comes first) isDecodingKind::Missing, another tag where a member is dueDecodingKind::InvalidTag, an Unsigned of no octetsDecodingKind::InvalidEncoding, and a value past unsigned32, the width the object keeps,DecodingKind::OutOfRange. - decode_
property_ access_ result - Decode one bare
BACnetPropertyAccessResultatoffset; returns it and the offset past its closing[4]or[5]tag, so an array is walked by calling this at each element’s start. - decode_
property_ reference - Decode one
BACnetPropertyReferenceatoffset; returns it and the offset just past it. The array index is read only when the next tag is a primitive context tag[1], so a reference may end the input or be followed by anything else. - decode_
property_ state - Decode one
BACnetPropertyStatesCHOICE element atoffset. - decode_
read_ access_ specification - Decode one
ReadAccessSpecificationatoffset; returns it and the offset just past its closing[1]tag, so a sequence of them is walked by calling this at each element’s start. Errors are as fordecode_property_reference. - decode_
scale - Decode one
BACnetScaleCHOICE atoffset. - decode_
shed_ level - Decode one
BACnetShedLevelCHOICE atoffset. - decode_
value_ source - Decode one ValueSource CHOICE at
offset, returning its value and next offset. - decode_
xy_ color - Decode one
BACnetxyColoratoffset: two application-tagged REALs. - encode_
action_ command - Encode one bare
BACnetActionCommand, appending tobuf. - encode_
action_ list - Encode one
BACnetActionList, its[0]frame included, appending tobuf. Fails, leavingbufas it was, when a command fails to encode. - encode_
audit_ log_ record - Encode one bare
BACnetAuditLogRecordfield sequence. - encode_
audit_ log_ record_ result - Encode one adjacent
BACnetAuditLogRecordResultsequence. - encode_
audit_ notification - Encode one bare
BACnetAuditNotificationfield sequence. - encode_
bacnet_ property_ value - Append the encoding of one property value to
buf. - encode_
color_ command - Encode one unframed
BACnetColorCommandSEQUENCE: the operation, then each field that is present. - encode_
device_ object_ property_ reference - Encode one bare
BACnetDeviceObjectPropertyReference, the counterpart ofdecode_device_object_property_reference: its members with no enclosing frame, so a BACnetLIST of these references is their encodings back to back. - encode_
event_ log_ record - Encode one Event Log record.
- encode_
event_ notification - Append the encoded request parameters to
buf;bufis unchanged if validation fails. - encode_
lighting_ command - Encode one unframed
BACnetLightingCommandSEQUENCE: the operation, then each field that is present. - encode_
log_ multiple_ record - Encode one Trend Log Multiple record.
- encode_
log_ record - Encode one Trend Log record.
- encode_
name_ value - Encode one
BACnetNameValue, appending tobuf. - encode_
notification_ parameters - Encode notification parameters into the buffer.
- encode_
prescale - Encode one
BACnetPrescaleSEQUENCE, appending tobuf. - encode_
property_ access_ result - Encode one bare
BACnetPropertyAccessResult, appending tobuf. - encode_
property_ reference - Encode one
BACnetPropertyReference, appending tobuf. - encode_
property_ state - Encode a
BACnetPropertyStatesusing the Standard 135-2020 Clause 21 tags. - encode_
read_ access_ specification - Encode one
ReadAccessSpecification, appending tobuf. An empty reference list encodes as the bare[1]pair; the ReadPropertyMultiple request encoder is what refuses one. - encode_
scale - Encode one
BACnetScaleCHOICE, appending tobuf. - encode_
shed_ level - Encode one
BACnetShedLevelCHOICE, appending tobuf. - encode_
value_ source - Encode one ValueSource CHOICE, appending to
buf. - encode_
xy_ color - Encode one
BACnetxyColor: x, then y, each an application-tagged REAL. - extract_
property_ value - Extract the encoded value of
propertythat starts atoffset, just inside the opening tagclosing_tag, returning the value bytes and the offset past the matching closing tag. - validate_
tlv_ sequence - Validate a BACnet TLV sequence without normalizing its encoded values.