93 lines
4.5 KiB
Markdown
93 lines
4.5 KiB
Markdown
|
# libp7 - Casio Communication Protocol 7.00 implementation
|
||
|
## Introduction
|
||
|
Protocol 7.00 (or "Protocol 7") is the communication protocol used by CASIO
|
||
|
FX calculators, between them and with a PC (serial and USB). It allows model
|
||
|
identification, file interaction (with main memory and flash/SD storage
|
||
|
devices), screenstreaming and OS updating.
|
||
|
|
||
|
This library, under [LGPL](https://www.gnu.org/licenses/lgpl-3.0.fr.html),
|
||
|
brings functions to send and receive packets, and packet flows
|
||
|
such as file getting/sending, remote file interaction (listing, copying,
|
||
|
deleting), filesystem optimization, screen receiving and OS Update-related
|
||
|
(backup, executable sending). No interaction with the main memory is
|
||
|
implemented yet.
|
||
|
|
||
|
Screen receiving is only supported for monochrome calculator as the format for
|
||
|
other calculators are yet to be known.
|
||
|
|
||
|
This library has two main parts: find the devices to communicate with, through
|
||
|
cross-platform streams (P7 streams, a superset of local streams, including libc
|
||
|
and libusb ones), and talk P7 with them.
|
||
|
|
||
|
This library require environment knowledges because of protocol failure. Those
|
||
|
are hardcoded; for each newly discovered environment (new calculator, ...),
|
||
|
entry must be added in the `src/core/devices.c` file, in the
|
||
|
`known_environments` list, using and updating command masks if necessary.
|
||
|
A precise environment listing is required to have a clean detection of what
|
||
|
commands and devices we can or cannot run so we don't have any surprise.
|
||
|
|
||
|
More on the [P7 homepage](https://p7.planet-casio.com/en.html).
|
||
|
|
||
|
## Prerequisites
|
||
|
Side note: the library might work with older versions of these dependencies,
|
||
|
I took these as a reference because these are the ones I work with.
|
||
|
|
||
|
### Making-only dependencies
|
||
|
| Name | Version |
|
||
|
| -------------------------------------------------- | -------- |
|
||
|
| [make](https://www.gnu.org/software/make/) | >= 4.0 |
|
||
|
| [gcc](https://gcc.gnu.org/) | >= 4.9 |
|
||
|
| [binutils](https://www.gnu.org/software/binutils/) | >= 2.25 |
|
||
|
| [asciidoc](http://asciidoc.org/) | >= 8.6.9 |
|
||
|
| [gzip](https://www.gnu.org/software/gzip/) | >= 1.6 |
|
||
|
|
||
|
### Making and runtime dependencies
|
||
|
| Name | Version |
|
||
|
| -------------------------------------------------- | -------- |
|
||
|
| [libusb](http://libusb.info/) | >= 1.0 |
|
||
|
|
||
|
## Configuring
|
||
|
First of all, the configure script has a help message where all of the
|
||
|
options are listed. The defaults should be appropriate for a native build,
|
||
|
just `./configure` if that's what you want to do, but you should read at
|
||
|
least the next paragraph.
|
||
|
|
||
|
If you're installing on or packaging for a GNU/Linux distribution, you might
|
||
|
want to install the `udev` rule to let the access to the direct calculator
|
||
|
connexions to normal users. As calculators can be connected as serial devices,
|
||
|
which are attributed to the `uucp` group (on Manjaro GNU/Linux), I chose to
|
||
|
attribute the `uucp` group to calculators plugged directly as USB. If you
|
||
|
agree with that, just add the `--udev` option to the configuration command
|
||
|
line; otherwise, make your own, or make nothing, I don't really care.
|
||
|
|
||
|
Building for the MS-Windows platform is supported, just use a `-mingw32`
|
||
|
target.
|
||
|
|
||
|
Also, building a static library, for both PC and embedded systems, is
|
||
|
supported : just use the `--static` option. If you want to build a static
|
||
|
library so that a cross-compiler that uses Microsoft Windows static library
|
||
|
formats, add the `--windows` option (notice that for a `-mingw32` target and
|
||
|
a dynamic library generation, this option is automatically added).
|
||
|
|
||
|
## Building and installing
|
||
|
Once configuring is done, just `make`.
|
||
|
To install, use `make install`.
|
||
|
|
||
|
To build and install only the lib, use `all-lib` and `install-lib`.
|
||
|
To build and install only the docs, use `all-doc` and `install-doc`.
|
||
|
|
||
|
If you ought to package this library, use the `DESTDIR` Makefile variable,
|
||
|
e.g. `make install DESTDIR=./package-root`. Do **not** use the `--root`
|
||
|
configure options for this, as configure tools (`libp7-config` and the
|
||
|
`pkg-config` configuration file) will add what's in the `--root` option value
|
||
|
but not in the `DESTDIR` option.
|
||
|
|
||
|
Other useful targets:
|
||
|
|
||
|
- `uninstall`, `uninstall-lib`, `uninstall-bin` `uninstall-doc`: will try to
|
||
|
uninstall using the current configuration;
|
||
|
- `mostlyclean`, `clean`, `clean-doc`, `mclean-lib`, `clean-lib`: remove
|
||
|
built files at different levels;
|
||
|
- `re`, `re-lib`, `re-doc`: regenerate built files at different levels
|
||
|
(clean and build) -- useful when configuration changes.
|