pub struct ControllinoMessage {
pub data: [u8; 8],
}Expand description
Data structure for the message to be sent to Controllino
Fields§
§data: [u8; 8]represents the raw message transferred via serial port
Implementations§
Source§impl ControllinoMessage
impl ControllinoMessage
Sourcepub fn new(content: ControllinoMessageContent) -> ControllinoMessage
pub fn new(content: ControllinoMessageContent) -> ControllinoMessage
Creates a new ControllinoMessage from ControllinoMessageContent.
This crucial function takes the structured message content, converts its fields
into a raw 8-byte array ([u8; 8]) suitable for serial transmission, and
calculates and embeds the necessary checksums into the data array.
The resulting ControllinoMessage is ready to be sent directly to the Controllino hardware.
§Arguments
content- TheControllinoMessageContentstruct containing the command, ID, and payload (e.g., pulse duration) to be packed into the message.
§Returns
A new ControllinoMessage struct with its data field populated, including checksums.
Trait Implementations§
Source§impl Debug for ControllinoMessage
impl Debug for ControllinoMessage
Source§impl Display for ControllinoMessage
impl Display for ControllinoMessage
Source§impl PartialEq for ControllinoMessage
impl PartialEq for ControllinoMessage
impl StructuralPartialEq for ControllinoMessage
Auto Trait Implementations§
impl Freeze for ControllinoMessage
impl RefUnwindSafe for ControllinoMessage
impl Send for ControllinoMessage
impl Sync for ControllinoMessage
impl Unpin for ControllinoMessage
impl UnwindSafe for ControllinoMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more