pub struct GroupTelegram { /* private fields */ }Expand description
A single group service, addressed and carrying its data: the device it came from, the group it is addressed to, the service, and the payload in the form it travels in.
Every route to a value of this type ends at Self::new, decoding
included, so a telegram that exists is one whose service and payload
agree: a read carrying data, or a write carrying none, is refused rather
than held.
Implementations§
Source§impl GroupTelegram
impl GroupTelegram
Sourcepub fn new(
source: IndividualAddress,
destination: GroupAddress,
apci: Apci,
payload: GroupPayload,
) -> Result<Self>
pub fn new( source: IndividualAddress, destination: GroupAddress, apci: Apci, payload: GroupPayload, ) -> Result<Self>
Builds a validated group telegram.
Payload rules:
GroupValueReadcarriesGroupPayload::Noneand nothing else.GroupValueWrite/GroupValueResponsemust carry data: either the optimized form or a non-empty octet sequence.- An optimized value above six bits is rejected: it does not fit the service octet.
- Octet sequences longer than
GroupPayload::MAX_OCTETSare rejected.
Sourcepub const fn source(&self) -> IndividualAddress
pub const fn source(&self) -> IndividualAddress
The individual address in the frame’s source field: for a decoded telegram, the device that sent it; for one being built, the address the sender stamps on its own traffic.
Sourcepub const fn destination(&self) -> GroupAddress
pub const fn destination(&self) -> GroupAddress
The group this telegram is addressed to.
Sourcepub const fn payload(&self) -> &GroupPayload
pub const fn payload(&self) -> &GroupPayload
The payload in the transmitted form it was built or decoded with. The form is reported as held, never re-derived from the values.
Sourcepub fn npdu_len(&self) -> u8
pub fn npdu_len(&self) -> u8
The NPDU length this telegram states: the APDU octet count less the one octet the length field does not count.
The constructor bounds an octet payload at
GroupPayload::MAX_OCTETS, so the result always fits; the
fallback states the corrected maximum length value rather than
assuming the bound - never 0xFF, the standard’s reserved
escape.
Trait Implementations§
Source§impl Clone for GroupTelegram
impl Clone for GroupTelegram
Source§fn clone(&self) -> GroupTelegram
fn clone(&self) -> GroupTelegram
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more