Post Reply 
libhpcalcs: portable (Windows / MacOS X / Linux) connectivity kit library
12-30-2014, 11:23 AM
Post: #76
RE: libhpcalcs: portable (Windows / MacOS X / Linux) connectivity kit library
Quote:One more thing I just noticed (you probably already know this, but might be interesting for other readers): When transferring a .hppgrm file to the calculator, the Prime seems to expect a raw text file without any headers. A lot of programs available on the Internet for download (e.g. on hpcalc.org) have the binary headers in the hpprgm files, which must be stripped before transferring such a program to the Prime with your tool.
Heh. I also started making some code for skipping the leading binary metadata, more than 6 months ago, but never finished it either Smile
The leading metadata is made of blocks prefixed with their size in bytes.

Attached is my local patchset on top of the master branch:
* patch in proper shape (in master2 branch) for adding tentative IDs and types for .hpappnote/.hpappprgm files;
* incorrect patch for communicating with the computer version of the Prime (mostly works, pretty useful for debugging under Wine; it leaves the connection in an improper state, requiring Prime computer software restarts), the computer version of the 39gII (works somewhat less properly), and real 39gII calculators (tested by Marcus Von Cube, doesn't work);
* unfinished patch which probably doesn't compile for splitting backup parsing, so that upon packet loss, a subset of the data can be salvaged by the library clients if so they wish, instead of returning nothing but an error to clients;
* unfinished patch which definitely doesn't compile, for skipping the leading binary metadata. The goal was to loop over the (size, data) blocks until the size bytes contain a value over the file's size, which would indicate that the text data was found. The UTF-16LE BOM skipping code needs to run after that.

There are at least two useful things that I didn't port over from libti* in the beginning, to keep matters simpler, but which are there in libti* for a good reason and should migrate to any well-behaved communication library (though with a different implementation) at some point:
* port IDs, which are used in libti* for computer-side emulators <-> real calculators communication, or e.g. TILP <-> emulator communication. I've never fully dug into how they work in libti*/tilp;
* progress bar information, though the libti* mechanism is over-complex.


Attached File(s)
.zip  libhpcalcs_unfinished_patches_20141230.zip (Size: 13.74 KB / Downloads: 8)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: libhpcalcs: portable (Windows / MacOS X / Linux) connectivity kit library - debrouxl - 12-30-2014 11:23 AM



User(s) browsing this thread: 1 Guest(s)