RdmResponder

Struct RdmResponder 

Source
pub struct RdmResponder<D: DmxReceiver + RdmControllerDriver, const MQ_SIZE: usize> { /* private fields */ }
Expand description

The structure to build an RDM Receiver. MQ_SIZE specifies the size of the message queue and the status vector. MQ_SIZE cannot be greater than 255.

Implementations§

Source§

impl<D: DmxReceiver + RdmControllerDriver, const MQ_SIZE: usize> RdmResponder<D, MQ_SIZE>

Source

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

Creates a new RdmResponder.

Source

pub fn poll<HandlerError>( &mut self, handler: &mut dyn DmxResponderHandler<Error = HandlerError>, ) -> Result<bool, PollingError<D::DriverError, HandlerError>>

Call this function as often as you can or on a serial interrupt. It will receive a package and handle it.

Returns false if no package was received.

Source

pub fn get_message_queue(&self) -> &Deque<RdmResponseData, MQ_SIZE>

Get the message queue that contains the results of RdmResult::AcknowledgedTimer packages.

Source

pub fn get_message_queue_mut(&mut self) -> &mut Deque<RdmResponseData, MQ_SIZE>

Get the message queue to add the results of RdmResult::AcknowledgedTimer packages to.

Source

pub fn get_message_count(&self) -> u8

Get the amount of queued messages.

Source

pub fn get_status_vec(&self) -> &Vec<StatusMessage, MQ_SIZE>

Get the status queue that contains the current status messages.

Source

pub fn get_status_vec_mut(&mut self) -> &mut Vec<StatusMessage, MQ_SIZE>

Get the status queue to add or remove status messages.

Auto Trait Implementations§

§

impl<D, const MQ_SIZE: usize> Freeze for RdmResponder<D, MQ_SIZE>
where D: Freeze,

§

impl<D, const MQ_SIZE: usize> RefUnwindSafe for RdmResponder<D, MQ_SIZE>
where D: RefUnwindSafe,

§

impl<D, const MQ_SIZE: usize> Send for RdmResponder<D, MQ_SIZE>
where D: Send,

§

impl<D, const MQ_SIZE: usize> Sync for RdmResponder<D, MQ_SIZE>
where D: Sync,

§

impl<D, const MQ_SIZE: usize> Unpin for RdmResponder<D, MQ_SIZE>
where D: Unpin,

§

impl<D, const MQ_SIZE: usize> UnwindSafe for RdmResponder<D, MQ_SIZE>
where D: 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.