Enum SerialMessage

Source
pub enum SerialMessage {
Show 24 variants ListPorts, AvailablePorts(Vec<String>), SetPort(String), SetBauds(BaudRate), SetCharSize(CharSize), SetParity(Parity), SetStopBits(StopBits), SetFlowControl(FlowControl), SetTimeout(Duration), Connect, Disconnect, Send(Vec<u8>), DataSent(Vec<u8>), Receive(Vec<u8>), NoResponse, GetStatus, Status(Status), GetConnectionStatus, Connected(bool), SetMode(Mode), Mode(Mode), Error(SerialInterfaceError), Ping, Pong,
}

Variants§

§

ListPorts

Request: Lists available serial ports. Handled in ‘Stop’ mode. Response: Triggers AvailablePorts message with port list.

§

AvailablePorts(Vec<String>)

Response: Provides a list of available serial ports. Type: Vec representing port names.

§

SetPort(String)

Request: Sets the serial port to be used. Type: String representing the port path. Handled in ‘Stop’ mode. Affects settings for subsequent Connect commands.

§

SetBauds(BaudRate)

Request: Sets the baud rate for the serial communication. Type: BaudRate. Handled in ‘Stop’ mode. Updates baud rate settings for the serial interface.

§

SetCharSize(CharSize)

Request: Sets the character size for the serial communication. Type: CharSize. Handled in ‘Stop’ mode. Updates character size settings for the serial interface.

§

SetParity(Parity)

Request: Sets the parity for the serial communication. Type: Parity. Handled in ‘Stop’ mode. Updates parity settings for the serial interface.

§

SetStopBits(StopBits)

Request: Sets the stop bits for the serial communication. Type: StopBits. Handled in ‘Stop’ mode. Updates stop bits settings for the serial interface.

§

SetFlowControl(FlowControl)

Request: Sets the flow control for the serial communication. Type: FlowControl. Handled in ‘Stop’ mode. Updates flow control settings for the serial interface.

§

SetTimeout(Duration)

Request: Sets the timeout for the serial communication. Type: Duration. Handled in all modes. Updates timeout settings for the serial interface.

§

Connect

Request: Establishes a connection using the current serial port settings. Handled in ‘Stop’ mode. Response: Connected(true) on success, or an Error message on failure.

§

Disconnect

Request: Disconnects the current serial connection. Handled in all modes. Response: Connected(false) after disconnection.

§

Send(Vec<u8>)

Request: Sends data over the serial connection. Type: Vec representing the data to be sent. Handled when mode is not ‘Stop’. Response: DataSent with the sent data upon successful transmission.

§

DataSent(Vec<u8>)

Response: Indicates that data has been sent over the serial connection. Type: Vec representing the sent data.

§

Receive(Vec<u8>)

Response: Indicates received data over the serial connection. Type: Vec representing the received data.

§

NoResponse

Response: Indicates that data has been sent over the serial connection but no response from the peer.

§

GetStatus

Request: Retrieves the current status of the serial interface. Response: Status with the current status of the interface.

§

Status(Status)

Response: Indicates the current status of the serial interface. Type: Status enum.

§

GetConnectionStatus

Request: Retrieves the current connection status of the serial interface. Response: Connected indicating whether the interface is connected.

§

Connected(bool)

Response: Indicates the current connection status of the serial interface. Type: bool indicating connection status.

§

SetMode(Mode)

Request: Sets the operating mode of the SerialInterface. Type: Mode enum. Changes the operating mode of the interface.

§

Mode(Mode)

Response: Indicates the current operating mode of the SerialInterface. Type: Mode enum.

§

Error(SerialInterfaceError)

Response: Represents an error within the SerialInterface. Type: SIError enum.

§

Ping

Request: Ping message for connection testing. Response: Generates a Pong message in response.

§

Pong

Response: Pong message as a response to a Ping.

Trait Implementations§

Source§

impl Clone for SerialMessage

Source§

fn clone(&self) -> SerialMessage

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SerialMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.