debrouxl / tilibs

TILP (formerly GtkTiLink) can transfer data between Texas Instruments graphing calculators and a computer. It works with all link cables (parallel, serial, Black/Gray/Silver/Direct Link) and it supports the TI-Z80 series (73..86), the TI-eZ80 series (83PCE, 84+CE), the TI-68k series (89, 92, 92+, V200, 89T) and the Nspire series (Nspire Clickpad / Touchpad / CX, both CAS and non-CAS)
http://lpg.ticalc.org/prj_tilp
67 stars 22 forks source link

libticables: rework packet logging and dissection #12

Open debrouxl opened 7 years ago

debrouxl commented 7 years ago

The direction-less, nondelimited raw hex data logger dump, reparsed from text in order to dissect protocols (twice when CABLE_USB was used: an attempt to dissect both DUSB and NSP is made, never mind the fact that only one of them is valid in > 99% of cases), is, uh, strongly disappointing. What's more, it's not new that there is some dissection code in both libticables and libticalcs, with some near-duplication of information:

All of that needs a good refactor and improvement. Before thinking of APIs, let's discuss about goals and high-level implementation ideas.

Goals:

Implementation ideas:

The way to expose callbacks to the user is TBD for some of the callbacks. As mentioned above, callbacks should return a value to allow filtering / chaining.

test_ticalcs_2's ability to perform dissection of single packets from given hex strings was implemented in the meantime. Does it make sense to additionally specify packet direction ?