Skip to main content

Crate atdecc

Crate atdecc 

Source
Expand description

IEEE 1722.1-2021 ATDECC (formerly AVDECC) with Milan 1.3 and AVB Lite extensions: frame encoding and decoding, and the controller and entity state machines.

The protocol code does no I/O, keeps no clock and starts no threads. The caller hands it received frames and the current time, and takes back frames to send, events and the next deadline, so the same code runs in a blocking loop, under an async runtime or on a microcontroller.

Frames are the octets after the Ethernet header. Fixed-size PDUs such as Adpdu and Acmpdu decode into plain values and encode into the caller’s buffer, without allocating. Values the standard reserves are kept, so a frame decodes and encodes back unchanged.

Features:

  • alloc: the controller and entity state machines, which keep tables.
  • std (default, includes alloc): raw Ethernet on Linux, macOS and Windows through avb-net, and a blocking driver for apps without a loop of their own. Without it the crate is no_std.

Re-exports§

pub use acmp::AcmpFlags;
pub use acmp::AcmpIp;
pub use acmp::AcmpMessageType;
pub use acmp::AcmpStatus;
pub use acmp::Acmpdu;
pub use adp::AdpMessageType;
pub use adp::Adpdu;
pub use adp::ControllerCapabilities;
pub use adp::EntityCapabilities;
pub use adp::ListenerCapabilities;
pub use adp::TalkerCapabilities;
pub use aecp::AecpHeader;
pub use aecp::AecpMessageType;
pub use aecp::AemCommandType;
pub use aecp::AemPdu;
pub use aecp::AemStatus;
pub use aecp::VendorUniquePdu;
pub use descriptor::DescriptorType;
pub use descriptor::LocalizedStringRef;
pub use error::DecodeError;
pub use error::EncodeError;
pub use id::ClockIdentity;
pub use id::EntityId;
pub use id::EntityModelId;
pub use id::StreamId;
pub use pdu::Pdu;
pub use pdu::decode;
pub use stream_format::StreamFormat;
pub use time::Instant;
pub use controller::Controller;
pub use controller::DiscoveredEntity;
pub use controller::Event;
pub use controller::OfflineReason;

Modules§

acmp
ATDECC Connection Management Protocol PDUs (IEEE 1722.1-2021, 8.2.1), with the names Milan 1.3 gives some of them (5.5.2.2).
adp
ATDECC Discovery Protocol PDUs (IEEE 1722.1-2021, 6.2.2).
aecp
ATDECC Enumeration and Control Protocol PDUs (IEEE 1722.1-2021, 9.2 and 9.3): the common header, ATDECC Entity Model (AEM) commands and responses, and vendor unique messages such as Milan’s MVU.
aem
The AEM commands the controller uses, built on AemPdu.
avtp
The IEEE 1722-2016 alternative AVTPDU header that ADP, AECP and ACMP share, and the subtypes that tell them apart.
blocking
A blocking driver for apps without a loop of their own: one raw socket on one interface, feeding a Controller on the calling thread.
cache
Entity models kept between runs: the descriptors read from an entity, by its entity model, firmware and configuration, so that when an entity of that model comes online again only what changes on it is read.
control
Controls (IEEE 1722.1-2021, 7.2.22 and 7.3.4 to 7.3.6): the CONTROL descriptor, what kind of control it is, the type and units of its values, and the current values SET_CONTROL and GET_CONTROL carry.
controller
The controller role, without I/O: the caller passes in received frames and the time, and takes back frames to send, events and the next deadline.
descriptor
AEM descriptors (IEEE 1722.1-2021, 7.2): their types, and views of the ones a controller reads to show an entity. A view borrows the descriptor’s octets, from its descriptor_type field on, and checks their length when made; arrays are found through the offsets the descriptor gives, as their position changed between revisions.
entity
An ATDECC talker or listener entity (IEEE 1722.1-2021 with Milan 1.3): it advertises itself with ADP, answers the AEM commands controllers send, and connects its streams with Milan’s ACMP, a listener probing the talker it is bound to.
error
Why a frame could not be decoded or encoded.
id
The EUI-64 identifiers of ATDECC: entity IDs, entity model IDs, stream IDs and gPTP clock identities.
lite
AVB Lite’s ATDECC messages (AVB Lite profile, 2.4 and 6): the status query an endpoint reports its mode with, and the CVU SRP messages that carry MSRP declarations where bridges do not. Both are AECP vendor unique messages under the AVB Lite MA-S OUI 8C-1F-64-36-C.
log
A log an entity keeps in a LOG_OBJECT memory object (IEEE 1722.1-2021, 7.2.10), for a controller to read through Address Access (9.4), so a device’s log needs no console cable. The controller pulls: an entity sends nothing unless asked.
maap
MAAP, the MAC Address Acquisition Protocol (IEEE 1722-2016, Annex B): claiming a block of the multicast addresses talkers stream to. A claim probes three times, then announces the block and defends it; when two claims meet, the lower MAC address keeps the block.
media_clock
Media clock across entities (Milan 1.3, 7.6): the clock each entity’s clock domain follows, through the stream input its clock source names and the talker that input is bound to, back to the domain keeping its own clock, the media clock reference of them all.
model
What the controller has read of an entity: its descriptors, kept as the octets the entity sent, with typed views over them, and its Milan information.
mvu
Milan Vendor Unique (MVU) messages (Milan 1.3, 5.4.3 and 5.4.4), carried in AECP vendor unique PDUs.
neighbor
What this computer is plugged into, from the gPTP messages heard on its link without taking part in gPTP: the AVB bridge port, which stops every other port’s peer delay requests, or a switch taking no part in AVB, which lets the endpoints’ sharing it through.
pdu
Telling ATDECC PDUs apart by subtype.
stream_format
Stream formats (IEEE 1722-2016, Annex I; IEEE 1722.1-2021, 7.3.3): the 64-bit description of what a stream carries, decoded for the formats audio devices use, and whether a talker’s stream suits a listener.
time
Time as the state machines see it: an instant on a monotonic clock the caller keeps, and core::time::Duration.
wireless
AVB Wireless’s ATDECC messages (AVB Wireless profile, 5): the status query a station or an access point reports its wireless interface with, and the configuration a controller sets on it. Both are AECP vendor unique messages under the AVB Lite MA-S OUI 8C-1F-64-36-C.

Structs§

MacAddress

Constants§

ADP_ACMP_MULTICAST
Destination of ADP and ACMP messages (IEEE 1722.1-2021, Table B.1).
ETHERTYPE_AVTP
Ethertype of AVTP, which carries ADP, AECP and ACMP.