Home | Trees | Indices | Help |
|
---|
|
Represents raw (unstructured) data packets sent over the usb bus.
TransferBuffer
is a wrapper around the tuples used by PyUSB for communication. It has
convenience methods to read and write data from the underlying buffer.
See TransferBuffer.pack and TransferBuffer.unpack.
|
|||
|
__init__(self,
packet) Create a TransferBuffer from packet or an empty
buffer.
|
||
|
__add__(self,
tb) Return a TransferBuffer rather than a list as the sum |
||
|
__getslice__(self,
start,
end) Return a TransferBuffer rather than a list as the slice |
||
|
__str__(self) Return a string representation of this buffer. |
||
|
unpack(self,
fmt=DWORD,
start=0) Return decoded data from buffer. |
||
|
pack(self,
val,
fmt=DWORD,
start=0) Encode val and write it to buffer.
|
||
|
_normalize(self) Replace negative bytes in self by 256 + byte
|
||
Inherited from Inherited from |
|
|||
|
phex(cls,
num) Return the hex representation of num without the 0x prefix. |
|
|||
Inherited from |
|
packet or an empty
buffer.
|
|
|
Return a string representation of this buffer. Packets are represented as hex strings, in 2-byte pairs, ≤ 16 bytes to a line. An ASCII representation is included. For example:0700 0100 0000 0000 0000 0000 0c00 0000 ................ 0200 0000 0400 0000 4461 7461 ........Data
|
|
val and write it to buffer.
|
self by 256 + byte
|
Return the hex representation of num without the 0x prefix. If the hex representation is only 1 digit it is padded to the left with a zero. Used in TransferBuffer.__str__.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Wed Nov 8 17:34:12 2006 | http://epydoc.sourceforge.net |