Struct DacStatus

Source
#[repr(C)]
pub struct DacStatus { pub protocol: u8, pub light_engine_state: u8, pub playback_state: u8, pub source: u8, pub light_engine_flags: u16, pub playback_flags: u16, pub source_flags: u16, pub buffer_fullness: u16, pub point_rate: u32, pub point_count: u32, }
Expand description

Periodically, and as part of ACK packets, the DAC sends its current playback status to the host.

Fields§

§protocol: u8

This remains undocumented in the protocol.

The original implementation source simply sets this to 0.

§light_engine_state: u8

The current state of the “light engine” state machine.

§playback_state: u8

The current state of the “playback” state machine.

§source: u8

The currently-selected data source:

  • 0: Network streaming (the protocol implemented in this library).
  • 1: ILDA playback from SD card.
  • 2: Internal abstract generator.
§light_engine_flags: u16

If the light engine is Ready, this will be 0.

Otherwise, bits will be set as follows:

  • 0: Emergency stop occurred due to E-Stop packet or invalid command.
  • 1: Emergency stop occurred due to E-Stop input to projector.
  • 2: Emergency stop input to projector is currently active.
  • 3: Emergency stop occurred due to over-temperature condition.
  • 4: Over-temperature condition is currently active.
  • 5: Emergency stop occurred due to loss of ethernet link.

All remaining are reserved for future use.

§playback_flags: u16

These flags may be non-zero during normal operation.

Bits are defined as follows:

  • 0: Shutter state. 0 is closed, 1 is open.
  • 1: Underflow. 1 if the last stream ended with underflow rather than a Stop command. This is reset to 0 by the Prepare command.
  • 2: E-Stop. 1 if the last stream ended because the E-Stop state was entered. Reset to zero by the Prepare command.
§source_flags: u16

This field is undocumented within the protocol reference.

By looking at the source code of the original implementation, this seems to represent the state of the current source.

If source is set to 1 for ILDA playback from SD card, the following flags are defined:

  • 0: ILDA_PLAYER_PLAYING.
  • 1: ILDA_PLAYER_REPEAT.

If source is set to 2 for the internal abstract generator, the flags are defined as follows:

  • 0: ABSTRACT_PLAYING.
§buffer_fullness: u16

The number of points currently buffered.

§point_rate: u32

If in the Prepared or Playing playback states, this is the number of points per second for which the DAC is configured.

If in the Idle playback state, this will be 0.

§point_count: u32

If in the Playing playback state, this is the number of points that the DAC has actually emitted since it started playing.

If in the Prepared or Idle playback states, this will be 0.

Implementations§

Source§

impl DacStatus

Source

pub const LIGHT_ENGINE_READY: u8 = 0u8

The light engine is ready.

Source

pub const LIGHT_ENGINE_WARMUP: u8 = 1u8

In the case where the DAC is also used for thermal control of laser apparatus, this is the state that is entered after power-up.

Source

pub const LIGHT_ENGINE_COOLDOWN: u8 = 2u8

Lasers are off but thermal control is still active.

Source

pub const LIGHT_ENGINE_EMERGENCY_STOP: u8 = 3u8

An emergency stop has been triggered, either by an E-stop input on the DAC, an E-stop command over the network, or a fault such as over-temperature.

Source

pub const PLAYBACK_IDLE: u8 = 0u8

The default state:

  • No points may be added to the buffer.
  • No output is generated.
  • All analog outputs are at 0v.
  • The shutter is controlled by the data source.
Source

pub const PLAYBACK_PREPARED: u8 = 1u8

The buffer will accept points.

The output is the same as the Idle state

Source

pub const PLAYBACK_PLAYING: u8 = 2u8

Points are being sent to the output.

Source

pub const SOURCE_NETWORK_STREAMING: u8 = 0u8

Network streaming (the protocol implemented in this library).

Source

pub const SOURCE_ILDA_PLAYBACK_SD: u8 = 1u8

ILDA playback from SD card.

Source

pub const SOURCE_INTERNAL_ABSTRACT_GENERATOR: u8 = 2u8

Internal abstract generator.

Trait Implementations§

Source§

impl Clone for DacStatus

Source§

fn clone(&self) -> DacStatus

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DacStatus

Source§

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

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

impl Hash for DacStatus

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DacStatus

Source§

fn eq(&self, other: &DacStatus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ReadFromBytes for DacStatus

Source§

fn read_from_bytes<R: ReadBytesExt>(reader: R) -> Result<Self>

Read the command from bytes.
Source§

impl SizeBytes for DacStatus

Source§

const SIZE_BYTES: usize = 20usize

Source§

impl WriteToBytes for DacStatus

Source§

fn write_to_bytes<W: WriteBytesExt>(&self, writer: W) -> Result<()>

Write the command to bytes.
Source§

impl Copy for DacStatus

Source§

impl Eq for DacStatus

Source§

impl StructuralPartialEq for DacStatus

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.