DmxController

Struct DmxController 

Source
pub struct DmxController<C: ControllerDriverErrorDef> { /* private fields */ }
Expand description

An RDM controller

Implementations§

Source§

impl<D: ControllerDriverErrorDef> DmxController<D>

Source

pub fn new(driver: D, config: &DmxControllerConfig) -> Self

Creates a new DmxManager instance.

Source

pub fn get_driver(&mut self) -> &mut D

Get a reference to the underlying driver.

Source§

impl<D: CustomStartCodeControllerDriver> DmxController<D>

Source

pub fn send_custom_package( &mut self, start_code: u8, package: &[u8], ) -> Result<(), RdmResponseError<D::DriverError>>

Sends a package with a custom start code.

Source§

impl<D: DmxControllerDriver> DmxController<D>

Source

pub fn send_dmx_package( &mut self, package: &[u8], ) -> Result<(), RdmResponseError<D::DriverError>>

Sends a dmx package. Package can’t be bigger than 512 bytes.

Source§

impl<D: RdmControllerDriver> DmxController<D>

Source

pub fn rdm_get( &mut self, request: RdmRequest, ) -> Result<RdmResponse, RdmResponseError<D::DriverError>>

Sends a get request.

Source

pub fn rdm_set( &mut self, request: RdmRequest, ) -> Result<RdmResponse, RdmResponseError<D::DriverError>>

Sends a set request.

Source

pub fn rdm_discover( &mut self, first_uid: u64, last_uid: u64, ) -> Result<DiscoveryOption, RdmResponseError<D::DriverError>>

Sends a discovery request to a range of device ids and returns the found uid if there is no collision and the device does not have its discovery muted.

Source

pub fn rdm_disc_mute( &mut self, uid: PackageAddress, ) -> Result<Option<DiscoveryMuteResponse>, RdmResponseError<D::DriverError>>

Mute device from discovery. It will not respond to discovery requests anymore. Returns None if the request was a broadcast.

Source

pub fn rdm_disc_un_mute( &mut self, uid: PackageAddress, ) -> Result<Option<DiscoveryMuteResponse>, RdmResponseError<D::DriverError>>

Unmute device from discovery. It will respond to discovery requests again. Returns None if the request was a broadcast.

Source

pub fn rdm_get_identify( &mut self, uid: UniqueIdentifier, ) -> Result<bool, RdmResponseError<D::DriverError>>

Get the identify state in the rdm device (led for searching)

Source

pub fn rdm_set_identify( &mut self, uid: PackageAddress, enabled: bool, ) -> Result<(), RdmResponseError<D::DriverError>>

Set the identify state in the rdm device (led for searching)

Source

pub fn rdm_get_software_version_label( &mut self, uid: UniqueIdentifier, ) -> Result<String<32>, RdmResponseError<D::DriverError>>

Get the software version label.

Source

pub fn rdm_get_dmx_start_address( &mut self, uid: UniqueIdentifier, ) -> Result<DmxStartAddress, RdmResponseError<D::DriverError>>

Get the current start address of the dmx slave.

Source

pub fn rdm_set_dmx_start_address( &mut self, uid: PackageAddress, start_address: u16, ) -> Result<(), RdmResponseError<D::DriverError>>

Set the current start address of the dmx slave. The address has to be between 1 and 512.

Source

pub fn rdm_get_queued_message( &mut self, uid: UniqueIdentifier, status_requested: StatusType, ) -> Result<RdmResponsePackage, RdmResponseError<D::DriverError>>

Get the last queued message.

Use DmxController::rdm_get_last_message_count to receive the message count from the last request.

If no messages are queued this will return the current StatusMessages. You can use the StatusType to filter these StatusMessages.

Note that you can only use StatusType::StatusAdvisory, StatusType::StatusWarning, StatusType::StatusError and StatusType::StatusGetLastMessage.

If you want to receive the previous response use StatusType::StatusGetLastMessage.

Source

pub fn rdm_get_status_messages( &mut self, uid: UniqueIdentifier, status_requested: StatusType, ) -> Result<OverflowMessageResp<StatusMessages>, RdmResponseError<D::DriverError>>

Get status messages. Filter severity by using the StatusType::StatusAdvisory, StatusType::StatusWarning and StatusType::StatusError.

If you want to receive the previously set of status messages again use StatusType::StatusGetLastMessage. To perform an availability test use StatusType::StatusNone.

If this parameter message is properly implemented on the slave you should never get a OverflowMessageResp::Incomplete back, since STATUS_MESSAGE uses its own queuing.

Source

pub fn rdm_get_supported_parameters( &mut self, uid: UniqueIdentifier, ) -> Result<OverflowMessageResp<SupportedParameters>, RdmResponseError<D::DriverError>>

Get the parameter ids that are supported by the responder.

Note that this only includes optional parameter ids that are not required to be compliant with ANSI E1.20.
Source

pub fn rdm_get_device_info( &mut self, uid: UniqueIdentifier, ) -> Result<DeviceInfo, RdmResponseError<D::DriverError>>

Get the device info from the rdm device.

Source

pub fn rdm_get_last_message_count(&self) -> u8

Returns the message count that was received on the last request using this instance.

Auto Trait Implementations§

§

impl<C> Freeze for DmxController<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for DmxController<C>
where C: RefUnwindSafe,

§

impl<C> Send for DmxController<C>
where C: Send,

§

impl<C> Sync for DmxController<C>
where C: Sync,

§

impl<C> Unpin for DmxController<C>
where C: Unpin,

§

impl<C> UnwindSafe for DmxController<C>
where C: UnwindSafe,

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.