Trait dmx::DmxTransmitter
[−]
[src]
pub trait DmxTransmitter { fn send_break(&mut self) -> Result<()>; fn send_raw_data(&mut self, data: &[u8]) -> Result<()>; fn send_raw_dmx_packet(&mut self, data: &[u8]) -> Result<()>; fn send_dmx_packet(&mut self, channels: &[u8]) -> Result<()> { ... } fn send_dmx_alt_packet(&mut self, channels: &[u8], start: u8) -> Result<()> { ... } }
A DMX transmitter.
Usually there is one transmitter on a bus, the master. Transmitters send DMX data.
Required Methods
fn send_break(&mut self) -> Result<()>
Send a single break.
Sends a break and returns as soon as possible afterwards. A caller is itself responsible for waiting an appropriate amount of time before sending data.
fn send_raw_data(&mut self, data: &[u8]) -> Result<()>
Send raw data.
Sends out bytes at the appropriate bitrate for DMX. Does not send a break first. Returns after the data is buffered, which might be before transmitting is complete.
fn send_raw_dmx_packet(&mut self, data: &[u8]) -> Result<()>
Blocking send a DMX packet including start code.
Sends a break, followed by the specified data. Returns after buffering.
Provided Methods
fn send_dmx_packet(&mut self, channels: &[u8]) -> Result<()>
Blocking send a full DMX packet.
Preprends a default start code of 0x00
before sending a
break
and channel data.
Will block until the full send is buffered to be sent out, but may
return before the transmission is complete.
This will create an additional stack copy of channels
; see
send_dmx_alt_packet
for details.
fn send_dmx_alt_packet(&mut self, channels: &[u8], start: u8) -> Result<()>
Blocking send a full DMX packet with a non-standard start code.
Prepends an arbitrary start code start
to a packet using a buffer
on the stack (no allocations are made, but the cost of an extra copy
is incurred). If required, this can be avoided by using
send_raw_dmx_packet
.
Like send_dmx_packet
will send a break first and returns after
buffering.
Implementors
impl<T: SerialPort> DmxTransmitter for T