Anybody knows how to set the parity with the controlTransfer in Android?
I can’t find the explanation of this method’s parameters anywhere – just some generic info in the ref.
One example I found says:
conn.controlTransfer(0x40, 0x04, 0x0008, 0, null, 0, 0); //data bit 8, parity none, stop bit 1, tx off
But I need to change the parity. Anybody has an idea?
Many thanks!
You can define the combination of bits to create your own configuration (parity, stop bit & data bit).
1st parameter – 0x40 – request to set or get control data
2nd parameter – 0x04 – type of data to be set or get
Third parameter – 0x0008 – data bit 8, parity none, stop bit 1, tx off – Is the actual data to be passed.
The third parameter is a 16 bit data which can be formed from the constants defined below:
For baud rate :
Please refer the below links for more details:
http://read.pudn.com/downloads181/sourcecode/embed/842049/usb/serial/ftdi_sio.h__.htm
http://www.mev.co.uk/pages/Support/USB-Baud-Spoof.html