Python bindings for ftdi_read_data() broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libftdi (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Regarding the Python bindings for libftdi, binary package python-ftdi 0.20-1 on precise, built from source package libftdi.
I is not possible to use the Python bindings for function ftdi_read_data().
Here is the C function description from the upstream documentation [1]:
int ftdi_read_data (
struct ftdi_context * ftdi,
unsigned char * buf,
int size)
Parameters:
ftdi pointer to ftdi_context
buf Buffer to store data in
size Size of the buffer
Return values:
-666: USB device unavailable
<0: error code from libusb_
0: no data was available
>0: number of bytes read
All my attempts to use the Python binding of this function failed.
Example:
ReadData = ctypes.c_char * readCount
readData = ReadData()
actualReadCount = ftdi.ftdi_
Gives exception:
I am quite sure that there is no way to use it correctly.
The usage examples in the source package leave out the read function.
[1] http://
Missing exception:
TypeError: in method 'ftdi_read_data', argument 2 of type 'unsigned char *'