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
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: VecDataSent
with the sent data upon successful transmission.
DataSent(Vec<u8>)
Response: Indicates that data has been sent over the serial connection.
Type: Vec
Receive(Vec<u8>)
Response: Indicates received data over the serial connection.
Type: Vec
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
impl Clone for SerialMessage
Source§fn clone(&self) -> SerialMessage
fn clone(&self) -> SerialMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more