RdmResponderPackageHandler

Struct RdmResponderPackageHandler 

Source
pub struct RdmResponderPackageHandler<const MQ_SIZE: usize> {
    pub dmx_start_address: DmxStartAddress,
    pub dmx_footprint: u16,
    /* private fields */
}
Expand description

A structure to handle RDM requests and generate the responses.

This struct is used by the crate::dmx_receiver::RdmResponder, but can be used without it in order to realize custom dmx setups that can’t rely on the dmx_driver pattern. MQ_SIZE specifies the size of the message queue and the status vector. MQ_SIZE cannot be greater than 255.

Fields§

§dmx_start_address: DmxStartAddress

The start of the dmx address space.

§dmx_footprint: u16

The amount of addresses the dmx device allocates.

Implementations§

Source§

impl<const MQ_SIZE: usize> RdmResponderPackageHandler<MQ_SIZE>

Source

pub fn new(config: RdmResponderConfig) -> Self

Source

pub fn get_uid(&self) -> UniqueIdentifier

Get the uid of the rdm responder.

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.

Source

pub fn get_context(&mut self) -> DmxReceiverContext<'_>

Gets a context object that contains references to the current internal state of some of the parameters.

Source

pub fn handle_rdm_request<HandlerError>( &mut self, request: RdmRequestData, handler: &mut dyn RdmResponderHandlerFunc<Error = HandlerError>, ) -> Result<RdmAnswer, HandlerError>

Method to handle a received and deserialized RdmPackage from the RDM-Controller. This method will return the response package that has to be sent back to the RDM-Controller.

Auto Trait Implementations§

§

impl<const MQ_SIZE: usize> Freeze for RdmResponderPackageHandler<MQ_SIZE>

§

impl<const MQ_SIZE: usize> RefUnwindSafe for RdmResponderPackageHandler<MQ_SIZE>

§

impl<const MQ_SIZE: usize> Send for RdmResponderPackageHandler<MQ_SIZE>

§

impl<const MQ_SIZE: usize> Sync for RdmResponderPackageHandler<MQ_SIZE>

§

impl<const MQ_SIZE: usize> Unpin for RdmResponderPackageHandler<MQ_SIZE>

§

impl<const MQ_SIZE: usize> UnwindSafe for RdmResponderPackageHandler<MQ_SIZE>

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.