FT311D ftdi android chip

marcomilazzo

Member
Licensed User
Longtime User
Hi
I'm trying to use the ft311d android chip.
I got response from the chip but i don't know how to send and receive
Anybody is truing to use the same chip?
ciao Marc


Dim UsbAcc() As UsbAccessory
UsbAcc = manager.GetAccessories
For i= 0 To UsbAcc.Length - 1
Log( i & " accessorio " & UsbAcc(i))
Next
Log (UsbAcc(0).Description)
Log (UsbAcc(0).Manufacturer)
Log (UsbAcc(0).Model)
Log (UsbAcc(0).Serial)
Log (UsbAcc(0).Uri)
Log (UsbAcc(0).Version)
 

marcomilazzo

Member
Licensed User
Longtime User
FT311D ftdi android chip

unfortunately it's not that simple for me !!

i'm comunicating with the chip and i have permission but i can't send anything!
i get an error event when trying to send


Dim UsbAcc() As UsbAccessory
UsbAcc = manager.GetAccessories
For i= 0 To UsbAcc.Length - 1
Log( i & " accessorio " & UsbAcc(i))
Next
Log (UsbAcc(0).Description)
Log (UsbAcc(0).Manufacturer)
Log (UsbAcc(0).Model)
Log (UsbAcc(0).Serial)
Log (UsbAcc(0).Uri)
Log (UsbAcc(0).Version)
' -------------------------------------------
If manager.HasAccessoryPermission(UsbAcc(0)) = False Then
manager.RequestAccessoryPermission(UsbAcc(0))
Log("richiesta permesso")
Else
Log("ha permesso")
End If
Log("connetti")
manager.OpenAccessory(UsbAcc (0))

AStreams.InitializePrefix(UsbAcc(0).InputStream, False, UsbAcc(0).OutputStream, "AStreams")
bStreams.Initialize(UsbAcc(0).InputStream, UsbAcc(0).OutputStream, "bStreams"

Sub Button2_Click
Dim UsbAcc() As UsbAccessory
UsbAcc = manager.GetAccessories

If AStreams.IsInitialized = False Then Return
Log("1111")
Dim sNewLine As String
sNewLine ="1234567890abcdefghi"
Dim buffer() As Byte
buffer = sNewLine.GetBytes("UTF8")
AStreams.Write (buffer)
bStreams.Write (buffer)

sout.WriteBytes (buffer , 1, 6)
sout.Flush ' send to serial port


End Sub
 
Upvote 0

marcomilazzo

Member
Licensed User
Longtime User
there were only tries!

can you please give me an example of reading and writing the Accessory streams ?

thank's a lot
marco
 
Upvote 0

marcomilazzo

Member
Licensed User
Longtime User
now i get:


write failed ENODEV(no such device)
code:
UsbAcc(0).OutputStream.WriteBytes (buffer ,1,5 )
UsbAcc(0).OutputStream.Flush
 
Upvote 0

tman

Member
Licensed User
Longtime User
Upvote 0
Top