Struct xmodem::Xmodem [] [src]

pub struct Xmodem {
    pub max_errors: u32,
    pub pad_byte: u8,
    pub block_length: BlockLength,
    // some fields omitted
}

Configuration for the XMODEM transfer.

Fields

The number of errors that can occur before the communication is considered a failure. Errors include unexpected bytes and timeouts waiting for bytes.

The byte used to pad the last block. XMODEM can only send blocks of a certain size, so if the message is not a multiple of that size the last block needs to be padded.

The length of each block. There are only two options: 128-byte blocks (standard XMODEM) or 1024-byte blocks (XMODEM-1k).

Methods

impl Xmodem
[src]

Creates the XMODEM config with default parameters.

Starts the XMODEM transmission.

dev should be the serial communication channel (e.g. the serial device). stream should be the message to send (e.g. a file).

Timeouts

This method has no way of setting the timeout of dev, so it's up to the caller to set the timeout of the device before calling this method. Timeouts on receiving bytes will be counted against max_errors, but timeouts on transmitting bytes will be considered a fatal error.

Trait Implementations

impl Copy for Xmodem
[src]

impl Clone for Xmodem
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Xmodem
[src]

Formats the value using the given formatter.