Struct BaudRateChangeRequest

Source
#[repr(C)]
pub struct BaudRateChangeRequest { /* private fields */ }
Expand description

Setting Baud Rate (Optional)

An optional feature available on selected versions of firmware is the ability to perform a “Fast Serial Download”. To support this feature, the serial port settings need to be adjusted prior to downloading packets. The serial port settings shall be reverted back to the original values after the last packet has been acknowledged by the device.

STXLENCTRLDATA0ETXCHK
0x020x060x5nbaud0x03zz
Data0Description
0x01Baud Rate 9600; Data Bits 8, Parity None; Stop Bit 0ne
0x02Baud Rate 19,200; Data Bits 8, Parity None; Stop Bit 0ne
0x03Baud Rate 38,400; Data Bits 8, Parity None; Stop Bit 0ne
0x04Baud Rate 115,200; Data Bits 8, Parity None; Stop Bit 0ne
OtherReserved

Warning If the device firmware does not support the fast serial download feature, the device will not respond to the baud rate change request. This means the host will be required to perform the download using the original algorithm.

Implementations§

Source§

impl BaudRateChangeRequest

Source

pub fn new() -> Self

Creates a new BaudRateChangeRequest message.

Source

pub fn baud_rate(&self) -> BaudRate

Gets the BaudRate for the BaudRateChangeRequest.

Source

pub fn set_baud_rate(&mut self, baud_rate: BaudRate)

Sets the BaudRate for the BaudRateChangeRequest.

Trait Implementations§

Source§

impl Clone for BaudRateChangeRequest

Source§

fn clone(&self) -> BaudRateChangeRequest

Returns a duplicate 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 BaudRateChangeRequest

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for BaudRateChangeRequest

Source§

fn default() -> BaudRateChangeRequest

Returns the “default value” for a type. Read more
Source§

impl Display for BaudRateChangeRequest

Source§

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

Formats the value using the given formatter. Read more
Source§

impl MessageOps for BaudRateChangeRequest

Source§

fn buf(&self) -> &[u8]

Get a reference to the message buffer.
Source§

fn buf_mut(&mut self) -> &mut [u8]

Get a mutable reference to the message buffer.
Source§

fn init(&mut self)

Initialize common message fields
Source§

fn len(&self) -> usize

Get the length of the entire message.
Source§

fn is_empty(&self) -> bool

Gets whether the message buffer is empty (all zeros)
Source§

fn data_len(&self) -> usize

Get the length of data bytes.
Source§

fn etx_index(&self) -> usize

Get the ETX index.
Source§

fn chk_index(&self) -> usize

Get the checksum index.
Source§

fn acknak(&self) -> AckNak

Get the ACKNAK control field.
Source§

fn set_acknak(&mut self, acknak: AckNak)

Set the ACKNAK control field.
Source§

fn switch_acknak(&mut self)

Switches the current ACKNAK control field value.
Source§

fn device_type(&self) -> DeviceType

Get the device type control field.
Source§

fn set_device_type(&mut self, device_type: DeviceType)

Set the device type control field
Source§

fn message_type(&self) -> MessageType

Get the message type control field
Source§

fn set_message_type(&mut self, message_type: MessageType)

Set the message type control field
Source§

fn checksum(&self) -> u8

Get the current checksum value Read more
Source§

fn checksum_bytes(&self) -> &[u8]

Source§

fn calculate_checksum(&mut self) -> u8

Calculate the message checksum
Source§

fn validate_checksum(&self) -> Result<()>

Validate the message checksum Read more
Source§

fn as_bytes(&mut self) -> &[u8]

Get the message as a byte buffer Read more
Source§

fn as_bytes_mut(&mut self) -> &mut [u8]

Get a mutable reference to the byte buffer
Source§

fn as_bytes_unchecked(&self) -> &[u8]

Get the message as a byte buffer Read more
Source§

fn from_buf(&mut self, buf: &[u8]) -> Result<()>

Deserializes a message type from a byte buffer. Read more
Source§

impl PartialEq for BaudRateChangeRequest

Source§

fn eq(&self, other: &BaudRateChangeRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for BaudRateChangeRequest

Source§

impl StructuralPartialEq for BaudRateChangeRequest

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.