I am attempting to do some implementation using ctypes, I was
wondering how you declared ftdi_context in your code?
I have attempted the following:
from ctypes import *
ftdi = CDLL("libftdi.so")
ftdi_context = create_string_buffer(84) #worked out 84 by getting the
size of the array in c
the only problem is now when trying to get the ftdi chip id as follows:
#read chip id
if ftdi_context.type == ftdi.TYPE_2232H:
I get the error: 'c_char_Array_84' object has no attribute 'type'
This makes sense I think, but declaring ftdi_context as a struct in
ctypes seems difficult.
On 27 July 2010 10:27, Emmanuel Blot <eblot.ml@xxxxxxxxx> wrote:
> On Mon, Jul 26, 2010 at 11:43 AM, Vaughan Moss <vaughan@xxxxxxxxx> wrote:
> > If anyone could explain what happens below or could point me in the correct
> > direction I would greatly appreciate it.
> If it can help, we have a full project/product which is used to test
> our devices on the production lines that uses FTDI 4232H devices using
> JTAG and SPI MPSSE interfaces.
> It is written in pure Python, but does not use the _ftdi Python
> wrapper, but Ctypes.
> If you have some questions, let me know.
> Best Regards,
> libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
> To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx