Struct sacn::DmxSource
[−]
[src]
pub struct DmxSource { /* fields omitted */ }
A DMX over sACN sender.
DmxSource is used for sending sACN packets over ethernet.
Each universe will be sent to a dedicated multicast address "239.255.{universe_high_byte}.{universe_low_byte}".
Examples
use sacn::DmxSource; let mut dmx_source = DmxSource::new("Controller").unwrap(); dmx_source.send(1, &[100, 100, 100, 100, 100, 100]); dmx_source.terminate_stream(1);
Methods
impl DmxSource
[src]
fn new(name: &str) -> Result<DmxSource>
Constructs a new DmxSource with DMX START code set to 0.
fn with_cid(name: &str, cid: &[u8; 16]) -> Result<DmxSource>
Constructs a new DmxSource with DMX START code set to 0 with specified CID.
fn send(&self, universe: u16, data: &[u8]) -> Result<()>
Sends DMX data to specified universe.
fn send_with_priority(
&self,
universe: u16,
data: &[u8],
priority: u8
) -> Result<()>
&self,
universe: u16,
data: &[u8],
priority: u8
) -> Result<()>
Sends DMX data to specified universe with specified priority.
fn terminate_stream(&self, universe: u16) -> Result<()>
Terminates a universe stream.
Terminates a stream to a specified universe by sending three packages with Stream_Terminated flag set to 1.
fn cid(&self) -> &[u8; 16]
Returns the ACN CID device identifier of the DmxSource.
fn set_cid(&mut self, cid: [u8; 16]) -> Result<()>
Sets the ACN CID device identifier.
fn name(&self) -> &str
Returns the ACN source name.
fn set_name(&mut self, name: &str)
Sets ACN source name.
fn preview_mode(&self) -> bool
Returns if DmxSource is in preview mode.
fn set_preview_mode(&mut self, preview_mode: bool)
Sets the DmxSource to preview mode.
All packets will be sent with Preview_Data flag set to 1.
fn start_code(&self) -> u8
Returns the current DMX START code.
fn set_start_code(&mut self, start_code: u8)
Sets the DMX START code.
fn set_multicast_ttl(&self, multicast_ttl: u32) -> Result<()>
Sets the multicast time to live.
fn multicast_ttl(&self) -> Result<u32>
Returns the multicast time to live of the socket.
fn set_multicast_loop(&self, multicast_loop: bool) -> Result<()>
Sets if multicast loop is enabled.
fn multicast_loop(&self) -> Result<bool>
Returns if multicast loop of the socket is enabled.