Updates to Assignment 1 Skeleton


The assignment 1 skeleton recently incurred breaking changes that likely impact your code. The following is a list of changes with explanations on how to handle them properly:

  • The Xmodem::read_byte() method signature in xmodem changed.

    The method now takes an abort_on_can parameter:

    /// Reads a single byte from the inner I/O stream. If `abort_on_can` is `true`,
    /// an error of `ConnectionAborted` is returned if the read byte is `CAN`.
    fn read_byte(&mut self, abort_on_can: bool) -> io::Result<u8>
    

    To handle this change, you will need to modify any calls to read_byte in your code. You should also read the updated docstrings for expect_byte and expect_byte_or_cancel and ensure that your code properly fulfills them.

  • A progress indication callback can be passed in to xmodem.

    The Xmodem structure has a new field, progress, that refers to a function that should be called by your read_packet and write_packet methods. The purpose of the new field is to allow clients of the xmodem library to be notified about the progress of a file transfer. The docstrings for these methods have been updated to reflect usage of the progress field.

    We’ve also amended the assignment text related to the ttywrite utility to suggest using the new progress functionality in your ttywrite implementation. The text includes an example of how to do so.

  • Added tests for xmodem corner-cases.

    New tests were added to the xmodem library that should help catch corner-cases and more errors. The aim is to make it more likely that your library is correct if it passes the tests.

  • Fixed parsing of -t, --timeout parameter in ttywrite.

    Due to structopt#30, the timeout command-line argument was being parsed incorrectly. This has been fixed in the latest updates as well as upstream in structopt#48. There is nothing you have to do as a result of this change.

After commiting your changes, run git pull in your assignment 1 skeleton repository to pull in these changes.