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>
impl<const MQ_SIZE: usize> RdmResponderPackageHandler<MQ_SIZE>
Sourcepub fn new(config: RdmResponderConfig) -> Self
pub fn new(config: RdmResponderConfig) -> Self
Creates a new RdmResponderPackageHandler.
Sourcepub fn get_uid(&self) -> UniqueIdentifier
pub fn get_uid(&self) -> UniqueIdentifier
Get the uid of the rdm responder.
Sourcepub fn get_message_queue(&self) -> &Deque<RdmResponseData, MQ_SIZE>
pub fn get_message_queue(&self) -> &Deque<RdmResponseData, MQ_SIZE>
Get the message queue that contains the results of RdmResult::AcknowledgedTimer packages.
Sourcepub fn get_message_queue_mut(&mut self) -> &mut Deque<RdmResponseData, MQ_SIZE>
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.
Sourcepub fn get_message_count(&self) -> u8
pub fn get_message_count(&self) -> u8
Get the amount of queued messages.
Sourcepub fn get_status_vec(&self) -> &Vec<StatusMessage, MQ_SIZE>
pub fn get_status_vec(&self) -> &Vec<StatusMessage, MQ_SIZE>
Get the status queue that contains the current status messages.
Sourcepub fn get_status_vec_mut(&mut self) -> &mut Vec<StatusMessage, MQ_SIZE>
pub fn get_status_vec_mut(&mut self) -> &mut Vec<StatusMessage, MQ_SIZE>
Get the status queue to add or remove status messages.
Sourcepub fn get_context(&mut self) -> DmxReceiverContext<'_>
pub fn get_context(&mut self) -> DmxReceiverContext<'_>
Gets a context object that contains references to the current internal state of some of the parameters.
Sourcepub fn handle_rdm_request<HandlerError>(
&mut self,
request: RdmRequestData,
handler: &mut dyn RdmResponderHandlerFunc<Error = HandlerError>,
) -> Result<RdmAnswer, HandlerError>
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.