Skip to main content

Model

Enum Model 

Source
pub enum Model {
    Hp48Sx,
    Hp48Gx,
    Hp49G,
    Hp38G,
    Hp39G,
    Unknown,
}
Expand description

Calculator model, as far as the ROM version text tells.

Variants§

§

Hp48Sx

HP 48S/SX: no VERSION command, no XModem.

§

Hp48Gx

HP 48G/GX: HP48-x, Copyright HP 1993; XModem with checksum only.

§

Hp49G

HP 49G: XModem with checksum, HP’s CRC (D) and 1k blocks.

§

Hp38G

HP 38G: no Kermit server; it is the Kermit client of a PC “disk drive”, asking for HP38DIR.CUR first, and has no XModem (wiki: protocols/aplet-transfer).

§

Hp39G

HP 39G and HP 40G, which run the same ROM and look the same on the wire: as the 38G with HP39DIR.CUR, and XModem for binary aplets (“HP39/40 (Wire)”: 128-byte blocks, checksum).

§

Unknown

Anything else.

Implementations§

Source§

impl Model

Source

pub fn from_version(version: Option<&str>) -> Model

The model from the VERSION text (Calculator::version): None is the 48S/SX, which lacks the command; the 48G/GX says HP48-R, Copyright HP 1993; the 49G says HP49-C Revision #1.18 (ROM 1.x) or HP48-C Revision #2.15 (2.x) and is told apart by its copyright year (1999 or later) or an HP49.

Source

pub fn from_directory_file(name: &[u8]) -> Option<Model>

The model that asks a “disk drive” for directory file name: HP38DIR. (the 38G) or HP39DIR. (the 39G or 40G) and anything after, in any case; None for other names.

Source

pub fn name(self) -> &'static str

Display name, e.g. HP 48G/GX.

Source

pub fn has_xmodem(self) -> bool

Whether the model has XModem: XRECV/XSEND on the 48G/GX and 49G, “HP39/40 (Wire)” for aplets on the 39G and 40G (unknown models are given the benefit of the doubt).

Source

pub fn drives_transfers(self) -> bool

Whether the calculator drives every transfer as the Kermit client of a “disk drive” (the 38G, 39G and 40G), instead of running a Kermit server the computer drives.

Trait Implementations§

Source§

impl Clone for Model

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Model

Source§

impl Debug for Model

Source§

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

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

impl Eq for Model

Source§

impl PartialEq for Model

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Model

Auto Trait Implementations§

§

impl Forget for Model

§

impl Freeze for Model

§

impl Move for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnsafeUnpin for Model

§

impl UnwindSafe for Model

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.