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>
[src]
Constructs a new DmxSource with DMX START code set to 0.
fn with_ip(name: &str, ip: &str) -> Result<DmxSource>
[src]
Consturcts a new DmxSource with binding to the supplied ip and a DMX START code set to 0.
fn with_cid(name: &str, cid: Uuid) -> Result<DmxSource>
[src]
Constructs a new DmxSource with DMX START code set to 0 with specified CID.
fn with_cid_ip(name: &str, cid: Uuid, ip: &str) -> Result<DmxSource>
[src]
Constructs a new DmxSource with DMX START code set to 0 with specified CID and IP address.
fn send(&self, universe: u16, data: &[u8]) -> Result<()>
[src]
Sends DMX data to specified universe.
fn send_with_priority(
&self,
universe: u16,
data: &[u8],
priority: u8
) -> Result<()>
[src]
&self,
universe: u16,
data: &[u8],
priority: u8
) -> Result<()>
Sends DMX data to specified universe with specified priority.
fn terminate_stream(&self, universe: u16) -> Result<()>
[src]
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) -> &Uuid
[src]
Returns the ACN CID device identifier of the DmxSource.
fn set_cid(&mut self, cid: Uuid)
[src]
Sets the ACN CID device identifier.
fn name(&self) -> &str
[src]
Returns the ACN source name.
fn set_name(&mut self, name: &str)
[src]
Sets ACN source name.
fn preview_mode(&self) -> bool
[src]
Returns if DmxSource is in preview mode.
fn set_preview_mode(&mut self, preview_mode: bool)
[src]
Sets the DmxSource to preview mode.
All packets will be sent with Preview_Data flag set to 1.
fn start_code(&self) -> u8
[src]
Returns the current DMX START code.
fn set_start_code(&mut self, start_code: u8)
[src]
Sets the DMX START code.
fn set_multicast_ttl(&self, multicast_ttl: u32) -> Result<()>
[src]
Sets the multicast time to live.
fn multicast_ttl(&self) -> Result<u32>
[src]
Returns the multicast time to live of the socket.
fn set_multicast_loop(&self, multicast_loop: bool) -> Result<()>
[src]
Sets if multicast loop is enabled.
fn multicast_loop(&self) -> Result<bool>
[src]
Returns if multicast loop of the socket is enabled.