Android Question Problem using Java Object Library

kenten123

Member
Licensed User
Longtime User
I'm trying to create a USB interface to an FTDI FT245R device. I have the Java Object library working with some methods of the device but one has me stumped. The device API is

9.20 setBitMode
Definition:
public boolean setBitMode(byte mask, byte bitMode)

using result = FTdev.RunMethodJO("setBitMode", Array(0,0))

gives the error java.lang.RuntimeException: Method: setBitMode not matched.

Seems it should be straightforward passing two values but alas...

Thanks in advance for any help. Ken
 

stevel05

Expert
Licensed User
Longtime User
By passing Array(0,0) you are passing ints to the routine, when bytes are required. Hence the not matched message.

Dim a variable as byte, then pass that:

B4X:
Dim B As Byte = 0
result = FTdev.RunMethodJO("setBitMode", Array(B,B))
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…