1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! HP calculator layer on top of `kermit-proto` and `xmodem-proto`:
//! transports, the Kermit and XModem driver loops, server commands, the HP
//! object format and GROBs.
//!
//! # Two faces, one protocol core
//!
//! The protocol logic (Kermit session, calculator operations, XModem) never
//! reads a clock, sleeps or touches a port. It runs behind either face:
//!
//! - **Blocking**: [`Calculator`], [`Session`], [`XmodemSession`] and
//! [`XservSession`] over a
//! [`transport::Transport`] (serial port, TCP, the in-process Saturnus
//! emulator, memory), with the system clock. This is what the satx CLI
//! uses.
//! - **Sans-I/O**: [`Machine`] is fed bytes and the caller's time and hands
//! out bytes to write, progress events and the [`Reply`] of each
//! [`Op`]. Nothing blocks, so it runs where bytes arrive by callback: a
//! browser with Web Serial on `wasm32-unknown-unknown`, an event loop, a
//! GUI thread. See [`machine`] for the calling convention and a host loop.
//!
//! # Features
//!
//! - `native` (default): serial ports (`serialport`) and TCP, opened by
//! [`transport::open`].
//! - `saturnus` (opt-in; satx turns it on): the Saturnus emulator
//! in-process (`saturnus://[MODEL@]ROM` addresses), through
//! `saturnus-core` and `saturnus-drive`.
//!
//! Without either the crate does no OS I/O and builds for
//! `wasm32-unknown-unknown`:
//! `satx-core = { version = "0.2", default-features = false }`. There the
//! blocking face ([`Calculator`], [`Session`], [`XmodemSession`],
//! `transport::MemoryTransport`, `transport::drain`) is left out: it
//! sleeps and blocks, which that target cannot.
//!
//! The clock type is [`time::Instant`]: `std::time::Instant` on native
//! targets, `web_time::Instant` on wasm32.
//!
//! # Modules
//!
//! - [`machine`]: the sans-I/O face ([`Machine`], [`Op`], [`Reply`],
//! [`Progress`]).
//! - [`transport`]: blocking links ([`transport::open`]).
//! - [`session`]: drives a [`kermit_proto::Client`] ([`Session`]).
//! - [`calc`]: what a user does with a calculator: list, get, put, run host
//! commands, PICT, backup and restore ([`Calculator`]).
//! - [`reply`]: parsers for the server's text replies (`G D` listings and the
//! stack text returned for a `C` host command).
//! - [`object`]: `HPHP48-x` / `HPHP49-x` binary files, prologs, object
//! length walk, `%%HP:` ASCII headers.
//! - [`names`]: variable names to file names and back (`NAME.hp`,
//! `NAME.txt`, `%XX` for what a file system refuses), and what a file
//! holds ([`names::FileKind`]).
//! - [`grob`]: GROB decoding and PNG export.
//! - [`charset`]: the HP character set and its ASCII trigraphs.
//! - [`xmodem`]: XModem transfers with `XRECV`/`XSEND` started on the
//! calculator ([`XmodemSession`]).
//! - [`xserv`]: XSERV (49g+/50g, the 49G): framing, the detection probe and
//! a client ([`XservSession`]); tested on a real 49G and the emulated one.
//! - `filer` (not on wasm32): the HP 100LX/200LX palmtops' Filer server
//! over a transport, on `filer-proto` (`Palmtop`).
//!
//! Wiki references (calculator-knowledgebase,
//! <https://github.com/ractive/calculator-knowledgebase>): `protocols/server-commands`,
//! `protocols/hp-object-format`, `protocols/iopar`, `hardware/uart`,
//! `protocols/xmodem-hp`, `protocols/xserv`, `protocols/filer-hplx`.
// Blocking, like `Calculator`: not in the wasm32 build, where
// `filer_proto::Session` itself is the face.
/// The clock types of the whole crate: those of
/// [`kermit_proto::time`] (`std::time` on native targets, `web_time` on
/// wasm32, where `std::time::Instant::now()` panics).
// The blocking face waits by sleeping or by blocking reads, which
// wasm32-unknown-unknown cannot do (`std::thread::sleep` panics there): it
// is left out of that build, where `Machine` is the face.
pub use Calculator;
pub use ;
pub use ;
pub use filer_proto;
pub use ;
pub use Options;
pub use Session;
pub use XmodemOptions;
pub use XmodemSession;
pub use xmodem_proto;
pub use XservOptions;
pub use XservSession;