[python-win32] python-win32 Digest, Vol 57, Issue 14

Tony Cappellini cappy2112 at gmail.com
Thu Dec 13 07:31:32 CET 2007


Message: 4
Date: Wed, 12 Dec 2007 21:41:15 +0100
From: Sebastian Friebe <basti at benkers-rock.de>
Subject: Re: [python-win32] USB access using win32file.deviceIOcontrol
To: Python-Win32 List <python-win32 at python.org>
Message-ID: <1517516963.20071212214115 at benkers-rock.de>
Content-Type: text/plain; charset=us-ascii

Tim Roberts wrote:
TR> That's fundamentally correct.  How are you creating the
TR> SCSI_PASS_THROUGH structure in "byte_list"?  Are you sure it is 42
TR> bytes?  Are you setting all the fields correctly?  How are you setting
TR> the DataBuffer pointer?  Have you set the Length field correctly?

Don't forget the data direction variable. That's equally as important.
You'll light up your screen blue as the day, if you get
a driver which isn't robust.

Test unit read does not transfer any data so the data transfer length
should be zero, in the CDB and the data direction must variable must
be set to whatever indicates no data transfer.

>>cdbLength = 16
I would think the CDB should be set to 6, since test unit ready is a
6-buye command, but if 16 worked in your C++ example, tha should be
fine here too.

>>But I don't have an idea at all, how to port it to Python.
Tim mentioned the struct module, and I would agree, but there may be other ways.


 class SCSI_PASS_THROUGH_DIRECT(object):
>>But again, I don't know how to handle the buffer pointers inside the
structure.
Nor do  I. You may have to call a DLL from Python to pass a pointer to
the SCSI pass thru layer.

There may be a way to do this with ctypes though.


More information about the python-win32 mailing list