# ======================================================================== # Linux capture and parse utilities for SILENT HAWK III MODEL 1284 # written by David Paschal (david_paschal@hp.com, paschal@rcsis.com) # ======================================================================== # Copyright (C) 2000-2002 Hewlett-Packard Company # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # is provided AS IS, WITHOUT ANY WARRANTY; without even the implied # warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, and # NON-INFRINGEMENT. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, # MA 02111-1307, USA. # ======================================================================== INTRODUCTION This is an alternative data capture and parse program for the "Silent Hawk III Model 1284" from JADtech Corp (http://www.jadtechcorp.com) which runs under Linux, has better data-parsing capabilities, and is Free and Open Source software. I wrote it mostly over the course of a long weekend in order to make more effective use of this product in my job, so it may or may not meet your needs, but of course under the GPL you're free to adapt it to suit your needs. :-) COMPILING To compile the software, just run "make". For parallel-port support, the files ExMgr.*, ioWrapper.*, and ParPort.* were leveraged from the HP OfficeJet Linux driver project (http://hpoj.sourceforge.net), with EPP software signalling support added. If "make" fails, then try building the hpoj software and hacking this Makefile using hpoj*/mlcd/Makefile as an example, possibly changing "-DPAR_PLATFORM_LINUX" to "-DPAR_PLATFORM_FREEBSD" (if you're running FreeBSD instead of Linux), or adding "ioWrapper.o" to "OBJS", if there's a compilation problem in "sys/io.h". INSTALLING You can optionally install the executables into /usr/local/bin by running "make install" as root. To install into a different directory, change the definition of INSTALLDIR in the Makefile. PARALLEL-PORT SUPPORT Although EPP signalling is used, it is all done in software, not hardware, so your parallel port should be set to bidirectional (BPP or PS/2) or ECP. You need to know the base address of your parallel port and the ECP-high base address if applicable. The default base address is 0x378, but other possibilities include 0x278 and 0x3BC. The default ECP-high base address is 0x400 above the low base address. CAPTURING DATA Log in as root and run the "sh3-capture" utility (compiled C++ program). If necessary, specify the "-base 0x" and/or "-basehigh 0x" command-line options to locate your parallel port. *** CAUTION: Be very careful to specify the correct I/O port addresses! Other optional command-line options include: - "-o " to specify the capture output file (default is "data.cap"). - "-skipbytes " to tell the analyzer how many data bytes to skip before it starts returning data (default is 0). sh3-capture tries to open the parallel port and probe for the analyzer. Once the data capture starts, you can take any of the following actions at any time: - Press to stop the trace. - Press alone to see how many bytes have been captured so far. - Enter a comment string to be embedded in the capture file. Since the analyzer doesn't report time deltas between events, you may find the comment-string feature to be useful. If your capture session encompasses several steps, such as establishing low-level communication to a device, probing high-level functionality of the device, and finally starting an operation on the device, then you can enter a comment before each step indicating what you're about to do (and what overall operation the following captured events correspond to). *** NOTE: If you embed comments, then the standard JADtech software will *** not be able to read your capture file. Assuming there are no embedded comments, binary files captured with my or with JADtech's software should be parseable with either my or JADtech's parsing software. NOTE: Currently, only "1284 mode (no nInit)" capture mode is supported. Other capture modes ("1284 mode with nInit", "host strobe" and the various "event" modes) are not currently supported by sh3-capture or sh3-parse. PARSING DATA Run the "sh3-parse" utility (a Perl script). Redirect standard input from the capture-data file. If desired, redirect standard output to a text file or pipe it to a pager utility such as "more" or "less". For example: $ cat data.cap | ./sh3-parse >data.txt $ cat data.cap | ./sh3-parse | less By default, sh3-parse uses a "cooked" mode where burst data transfers are aggregated together and listed as a side-by-side hexadecimal and ASCII dump. If you want to see a more raw event listing, then use the "-raw" command-line option. In "cooked" mode, aggregate forward data is preceeded with a line of ">" characters, and aggregate reverse data is preceeded with a line of "<" characters. Embedded comments, errors, and ECP/EPP channel/address commands are also delimited specially. There is no special parsing of HP MLC or IEEE 1284.4 packets. However, as a small convenience, sh3-parse by default puts a colon after the sixth byte in a hex dump, which is normally the boundary between the MLC/1284.4 header and data payload. Use the "-nohdr" or "-hdrlen " command-line options to disable this functionality or change the header length if you'd like.