Skip to main content

decode_timestamp_choice

Function decode_timestamp_choice 

Source
pub fn decode_timestamp_choice(
    data: &[u8],
    offset: usize,
) -> Result<(BACnetTimeStamp, usize), Error>
Expand description

Decode a bare-CHOICE BACnetTimeStamp starting at offset.

Returns the decoded timestamp and the new offset past its encoding. Only the Clause 20.2.1.5-conformant tag forms described on encode_timestamp_choice are accepted; sequence-number contents beyond 0..=65535 are rejected. Errors follow the rule of constructed::tagged: a Time or Date with the wrong length is Error::Decoding, contents that run past the end of data are Error::BufferTooShort.