Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Aug 1998 11:09:39 -0600 (MDT)
From:      "Kenneth D. Merry" <ken@plutotech.com>
To:        Lars.Koeller@post.uni-bielefeld.de (Lars =?iso-8859-1?Q?K=F6ller?=)
Cc:        freebsd-scsi@FreeBSD.ORG, gibbs@FreeBSD.ORG, ken@plutotech.com
Subject:   Re: Parse sense data with camcontrol into shell variable!
Message-ID:  <199808251709.LAA15177@panzer.plutotech.com>
In-Reply-To: <199808250703.HAA14327@mitch.hrz.uni-bielefeld.de> from =?ISO-8859-1?Q?Lars_K=F6ller?= at "Aug 25, 98 09:03:59 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Lars Köller wrote...
> --------
> 
> Hallo experts!
> 
> I just rewrite a ADIC DAT AutoLoader script from scsi to chio! The 
> problem is to get the sense data (19 bytes) from the changer. The 
> chio command is not able to solve this problem.
> 
> However, I need only byte number 19 from the sense data, cause it 
> contains data about an open doors of the changer etc.
> 
> How can I parse the data with camcontrol into a shell variable. 
> Request sense data command is "03 ....", so it should look like
> 
>   camcontrol -n ch -c "03 0 0 0 13 0" -O .......

Hmm, try something like this:

camcontrol -n ch -u 0 -c "03 00 00 00 64 00" -I 64 "s18 b8"

Or perhaps:

camcontrol -n ch -u 0 -c "03 00 00 00 64 00" -I 64 "s18 i1"

The "s" argument tells it to skip that many bytes.  The 'b' argument tells
it to print out that many bits.  The 'i' argument tells it to print the
data as an n-byte integer.  (where 1 <= n <= 4)

A few hints/notes about command parsing in camcontrol:

	- -I is equivalent to -i in scsi(8)
	- -O is equivalent to -o in scsi(8)
	- unlike scsi(8), you can't specify arguments to the CDB.  i.e. you
	  can't do stuff like:

	  camcontrol -n da -u 0 -c "v 00 00 00 00 00" 0

	  This is because I didn't figure out exactly how I wanted to do
	  the argument parsing when I first wrote the buffer parsing code,
	  and I haven't had time to work on it since.  It isn't a very big
	  deal, though...it's generally easy enough to just fill out the
	  CDB.  Arguments are supported for -I and -O, however.
	- camcontrol doesn't yet support reading data from stdin (for -O)
	  or writing data to stdout (for -I)

Ken
-- 
Kenneth Merry
ken@plutotech.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808251709.LAA15177>