| Home | Trees | Indices | Help |
|
|---|
|
|
Contains the logic for performing various tasks on the reader.
The implemented tasks are:list method.
|
|||
| __init__(self, log_packets=False) | ||
|
open(self) Claim an interface on the device for communication. |
||
|
close(self) Release device interface |
||
|
_send_command(self,
command,
response_type=<class 'libprs500.prstypes.Response'>,
timeout=100) Send command to device and return its response. |
||
|
_send_validated_command(self,
command,
cnumber=None,
response_type=<class 'libprs500.prstypes.Response'>,
timeout=100) Wrapper around _send_command that checks if the Response.rnumber == cnumber or command.number if
cnumber==None.
|
||
|
_bulk_read_packet(self,
data_type=<class 'libprs500.prstypes.Answer'>,
size=4096) Read in a data packet via a Bulk Read. |
||
|
_bulk_read(self,
bytes,
command_number=0x00,
packet_size=4096,
data_type=<class 'libprs500.prstypes.Answer'>) Read in bytes bytes via a bulk transfer in packets of
size ≤ packet_size
|
||
|
_test_bulk_reads(self) Carries out a test of bulk reading as part of session initialization. |
||
|
_start_session(self) Send the initialization sequence to the device. |
||
|
_end_session(self) Send the end session command to the device. |
||
|
_run_session(self,
*args) Wrapper that automatically calls _start_session and _end_session. |
||
|
_get_device_information(self,
args) Ask device for device information. |
||
|
get_device_information(self) Return (device name, device version, software version on device, mime type). |
||
|
_get_path_properties(self,
path) Send command asking device for properties of path.
|
||
|
get_file(self,
path,
outfile) Read the file at path on the device and write it to outfile. |
||
|
_get_file(self,
args) Fetch a file from the device and write it to an output stream. |
||
|
_list(self,
args) Ask the device to list a path. |
||
|
list(self,
path,
recurse=False) Return a listing of path. |
||
|
Inherited from |
|||
|
|||
|
_validate_response(cls,
res,
type=0x00,
number=0x00) Raise a ProtocolError if the type and number of res
is not the same as type and number.
|
||
|
|||
|
SONY_VENDOR_ID = 1356SONY Vendor Id |
||
|
PRS500_PRODUCT_ID = 667Product Id for the PRS-500 |
||
|
PRS500_INTERFACE_ID = 0The interface we use to talk to the device |
||
|
PRS500_BULK_IN_EP = 129Endpoint for Bulk reads |
||
|
PRS500_BULK_OUT_EP = 2Endpoint for Bulk writes |
||
|
|||
|
Inherited from |
|||
|
|||
|
res is
not the same as type and number.
|
|
|
|
Response.rnumber
== cnumber or command.number if cnumber==None. Also check that
Response.type == Command.type.
|
|
bytes bytes via a bulk transfer in packets of
size ≤ packet_size
|
|
|
|
|
|
|
path. Return
(Response, Answer).
|
|
Fetch a file from the device and write it to an output stream. The data is fetched in chunks of size ≤ 32K. Each chunk is make of packets of size ≤ 4K. See FileOpen, FileRead and FileClose for details on the command packets used.
|
|
Return a listing of path. See _list for the communication logic.
|
|
|||
SONY_VENDOR_IDSONY Vendor Id
|
PRS500_PRODUCT_IDProduct Id for the PRS-500
|
PRS500_INTERFACE_IDThe interface we use to talk to the device
|
PRS500_BULK_IN_EPEndpoint for Bulk reads
|
PRS500_BULK_OUT_EPEndpoint for Bulk writes
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0alpha3 on Mon Nov 6 20:50:46 2006 | http://epydoc.sourceforge.net |