#[non_exhaustive]pub enum Check {
Checksum,
Crc16,
HpCrc,
}Expand description
The block check a transfer uses.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Checksum
One byte: the sum of the data bytes mod 256. The only mode the 48G series knows.
Crc16
Two bytes, high byte first: CRC-16 with polynomial #1021, MSB first, initial value 0 (“CRC-16/XMODEM”). Not the Kermit type-3 check, which is LSB first (#8408 reflected, i.e. #1081 per nibble).
HpCrc
HP’s own mode, requested with D: two bytes, high byte first, of the
CRC-16 the Saturn hardware and Kermit’s type-3 check use (polynomial
#1081 per nibble, LSB first, initial value 0, i.e. “CRC-16/KERMIT”).
The 49G’s XRECV asks for it first (three Ds, then NAK) and
accepts 1k and 128-byte blocks with it; verified on the emulated 49G.
Implementations§
Source§impl Check
impl Check
Trait Implementations§
impl Copy for Check
impl Eq for Check
impl StructuralPartialEq for Check
Auto Trait Implementations§
impl Forget for Check
impl Freeze for Check
impl Move for Check
impl RefUnwindSafe for Check
impl Send for Check
impl Sync for Check
impl Unpin for Check
impl UnsafeUnpin for Check
impl UnwindSafe for Check
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more