libftdi Archives

Subject: Re: libftdi - Python SWIG & unsigned char *

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Chris Zeh <chris.w.zeh@xxxxxxxxx>
Date: Mon, 02 May 2011 19:22:53 +0200
Hello Chris,

On 04/27/2011 05:34 AM, Chris Zeh wrote:
> Sorry it took me awhile getting around to posting this, but here is
> the patch to get the ftdi_read_pins function working in Python:
> 
> chris@ubuntu:~/Desktop/libftdi$ git diff
> diff --git a/bindings/ftdi.i b/bindings/ftdi.i
> index 1fc2a59..ab33d4c 100644
> --- a/bindings/ftdi.i
> +++ b/bindings/ftdi.i
> @@ -3,8 +3,11 @@
>  %include "typemaps.i"
>  %include "cpointer.i"
>  %pointer_functions(unsigned int, uintp);
> +%pointer_functions(unsigned char *, ucharp);
> +%pointer_functions(char *, charp);
> 
>  %typemap(in) unsigned char* = char*;
> +
>  %ignore ftdi_write_data_async;
>  %ignore ftdi_async_complete;
> 
> 
> I'm far from an expert in SWIG, but this appears to be working nicely.

Well, your patch just made it in the git tree of libftdi 0.x
and libftdi 1.x. I have no idea about swig, too. As you wrote
it's working with this change, so it can't be that bad ;)

Cheers,
Thomas

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread