Dépôt historique de la libp7.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Thomas Touhey af5948d8ec Changed the logging system. 5 years ago
doc Added HTML generation, slightly clarified p7_sinit's manpage 5 years ago
include Changed the logging system. 5 years ago
src Changed the logging system. 5 years ago
tools Corrected serial management, made libg1m required. 5 years ago
.editorconfig Here, an editor configuration file. 5 years ago
.gitignore Added HTML generation, slightly clarified p7_sinit's manpage 5 years ago
AUTHORS.md Added commands to the server. 5 years ago
CONTRIBUTING.md Added some documents. 5 years ago
LICENSE.md To LGPL. 5 years ago
Makefile Reorganized a little, better comments in headers. 5 years ago
Makefile.msg Corrected quirks and added MS-Windows cross-compilation utilities 5 years ago
Makefile.vars Tried new things in headers. 5 years ago
PORTING.md Modified way streams are managed. 5 years ago
README.md Started integrating libg1m usage, reorganized. 5 years ago
TODO.md Updated TODO. 5 years ago
configure Corrected serial management, made libg1m required. 5 years ago


libp7 - Casio Communication Protocol 7.00 implementation


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, 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.


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 >= 4.0
gcc >= 4.9
binutils >= 2.25
asciidoc >= 8.6.9
gzip >= 1.6

Making and runtime dependencies

Name Version
libusb >= 1.0
libg1m >= 1.0


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.