0
votes

I'm making a Xamarin Forms project for Android & IOS and wanting to be able to use the FTDI D2XX API. There are NuGet packages for D2XX here and here. I have also tried to integrate the Android implementation discussed here. I am quite new to C# and Xamarin, but fairly experienced with Android development. I have managed to add the FTD2XX_NET file as an Assembly file in the project as in the attached image. But I get the exception shown below when I try and access the DLL using FTDI newDevice = new FTDI(); as suggested in example 3 here. Any help would be much appreciated.

Assembly File Location:

Assemblies file location

Exception:

exception

1
the nuget packages you linked to are over 6 years old, and the C# examples appear to be for WindowsCE devices. The Android page hasn't been updated in 2 years. If they have a viable Android library, you can generate a Xamarin binding for it - docs.microsoft.com/en-us/xamarin/android/platform/… - Jason
also, please do NOT post code or errors as images - Jason

1 Answers

1
votes

You can download the latest FTD2XX_Net dll from official FTDI site here. The latest version is 1.1.0 so both nuget packages you mentioned are outdated because they are version 1.0.14.

As an alternative to the dll, and I think that will be interesing for your case, you can directly include the source of the .Net wrapper. It can be downloaded here. Using the sources for debugging has the advantage that you gain more insight in whats happening when errors occure. You also directly get compiler errors when parts of the ftdi warpper implementation cannot be compiled for mono.

Addidtionally you have to ensure that the ftdi driver is installed at all. FTD2XX_Net is just a wrapper around the native ftdi driver.