Home | Trees | Indices | Help |
|
---|
|
Contains the logic for performing various tasks on the reader.
The implemented tasks are:list
method.
|
|||
|
safe(func) Decorator that wraps a call to func to ensure that
exceptions are handled correctly.
|
||
| __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_write(self,
data,
packet_size=0x1000) Send data to device via a bulk transfer. |
||
|
_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
|
||
|
get_device_information(*args,
**kwargs) Ask device for device information. |
||
|
path_properties(*args,
**kwargs) Send command asking device for properties of path .
|
||
|
get_file(*args,
**kwargs) Read the file at path on the device and write it to outfile. |
||
|
list(*args,
**kwargs) Return a listing of path. |
||
|
available_space(*args,
**kwargs) Get free space available on the mountpoints: |
||
|
_exists(self,
path) Return (True, FileProperties) if path exists or (False, None) otherwise |
||
|
touch(*args,
**kwargs) Create a file at path |
||
| put_file(*args, **kwargs) | ||
| del_file(*args, **kwargs) | ||
| mkdir(*args, **kwargs) | ||
|
rm(*args,
**kwargs) Delete path from device if it is a file or an empty directory |
||
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 = 1356 SONY Vendor Id |
||
|
PRS500_PRODUCT_ID = 667 Product Id for the PRS-500 |
||
|
PRS500_INTERFACE_ID = 0 The interface we use to talk to the device |
||
|
PRS500_BULK_IN_EP = 129 Endpoint for Bulk reads |
||
|
PRS500_BULK_OUT_EP = 2 Endpoint for Bulk writes |
|
|||
Inherited from |
|
Decorator that wraps a call to As a convenience, False . An usb.USBError will cause
the library to release control of the USB interface via a call to close.
|
|
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
FileProperties.
|
Read the file at path on the device and write it to outfile. For the
logic see
|
|
|
|
|
|
|
|
|
|
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 Wed Nov 8 17:34:09 2006 | http://epydoc.sourceforge.net |