Struct Output

Source
pub struct Output {
    pub version: [u8; 2],
    pub sequence: u8,
    pub physical: u8,
    pub port_address: PortAddress,
    pub length: BigEndianLength<Output>,
    pub data: PaddedData,
}
Expand description

ArtDmx is the data packet used to transfer DMX512 data. The format is identical for Node to Controller, Node to Node and Controller to Node.

The Data is output through the DMX O/P port corresponding to the Universe setting. In the absence of received ArtDmx packets, each DMX O/P port re-transmits the same frame continuously.

The first complete DMX frame received at each input port is placed in an ArtDmx packet as above and transmitted as an ArtDmx packet containing the relevant Universe parameter. Each subsequent DMX frame containing new data (different length or different contents) is also transmitted as an ArtDmx packet.

Nodes do not transmit ArtDmx for DMX512 inputs that have not received data since power on.

However, an input that is active but not changing, will re-transmit the last valid ArtDmx packet at approximately 4-second intervals. (Note. In order to converge the needs of ArtNet and sACN it is recommended that Art-Net devices actually use a re-transmit time of 800mS to 1000mS).

A DMX input that fails will not continue to transmit ArtDmx data.

Fields§

§version: [u8; 2]

Determines which version the server has. Will be ARTNET_PROTOCOL_VERSION by default

§sequence: u8

The sequence number is used to ensure that ArtDmx packets are used in the correct order. When Art-Net is carried over a medium such as the Internet, it is possible that ArtDmx packets will reach the receiver out of order. This field is incremented in the range 0x01 to 0xff to allow the receiving node to resequence packets.

The Sequence field is set to 0x00 to disable this feature

§physical: u8

The physical input port from which DMX512 data was input. This field is for information only. Use Universe for data routing

§port_address: PortAddress

The 15 bit Port-Address to which this packet is destined

§length: BigEndianLength<Output>

The length of the message, set by the artnet library itself

§data: PaddedData

A variable length array of DMX512 lighting data

Implementations§

Source§

impl Output

Source

pub fn to_bytes(&self) -> Result<Vec<u8>>

Convert this struct to a byte array.

Source

pub fn from(data: &[u8]) -> Result<Output>

Convert a byte array to an instance of this struct.

Trait Implementations§

Source§

impl Debug for Output

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Output

Source§

fn default() -> Output

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Output

§

impl RefUnwindSafe for Output

§

impl Send for Output

§

impl Sync for Output

§

impl Unpin for Output

§

impl UnwindSafe for Output

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.