Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8183849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:17:42+00:00 2026-06-07T01:17:42+00:00

Anybody knows how to set the parity with the controlTransfer in Android? I can’t

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:17:45+00:00Added an answer on June 7, 2026 at 1:17 am

    You can define the combination of bits to create your own configuration (parity, stop bit & data bit).

    conn.controlTransfer(0x40, 0x04, 0x0008, 0, null, 0, 0); 
    

    1st parameter – 0x40  – request to set or get control data

     #define FTDI_SIO_SET_DATA_REQUEST_TYPE  0x40
    

    2nd parameter – 0x04 – type of data to be set or get

    #define FTDI_SIO_RESET      0 /* Reset the port */
    #define FTDI_SIO_MODEM_CTRL     1 /* Set the modem control register */
    #define FTDI_SIO_SET_FLOW_CTRL  2 /* Set flow control register */
    #define FTDI_SIO_SET_BAUD_RATE  3 /* Set baud rate */
    #define FTDI_SIO_SET_DATA   4 /* Set the data characteristics of the port */
    #define FTDI_SIO_GET_MODEM_STATUS   5 /* Retrieve current value of modern status register */
    #define FTDI_SIO_SET_EVENT_CHAR 6 /* Set the event character */
    #define FTDI_SIO_SET_ERROR_CHAR 7 /* Set the error character */
    

    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:

    Bits 0 to 7   -- Number of data bits
    
    Bits 8 to 10  -- Parity
              0 = None
              1 = Odd
              2 = Even
              3 = Mark
              4 = Space
    Bits 11 to 13 -- Stop Bits
              0 = 1
              1 = 1.5
              2 = 2
    Bit 14
              1 = TX ON (break)
              0 = TX OFF (normal state)
    Bit15 -- Reserved
    
    
     #define FTDI_SIO_SET_DATA_REQUEST       FTDI_SIO_SET_DATA
    
     #define FTDI_SIO_SET_DATA_PARITY_NONE   (0x0 << 8)
     #define FTDI_SIO_SET_DATA_PARITY_ODD    (0x1 << 8)
     #define FTDI_SIO_SET_DATA_PARITY_EVEN   (0x2 << 8)
     #define FTDI_SIO_SET_DATA_PARITY_MARK   (0x3 << 8)
     #define FTDI_SIO_SET_DATA_PARITY_SPACE  (0x4 << 8)
     #define FTDI_SIO_SET_DATA_STOP_BITS_1   (0x0 << 11)
     #define FTDI_SIO_SET_DATA_STOP_BITS_15  (0x1 << 11)
     #define FTDI_SIO_SET_DATA_STOP_BITS_2   (0x2 << 11)
     #define FTDI_SIO_SET_BREAK              (0x1 << 14)
    

    For baud rate :

    * Value Baud Rate speed
    * 0×2710 300
    * 0×1388 600
    * 0x09C4 1200
    * 0x04E2 2400
    * 0×0271 4800
    * 0×4138 9600
    * 0x80D0 14400
    * 0x809C 19200
    * 0xC04E 38400
    * 0×0034 57600
    * 0x001A 115200
    * 0x000D 230400
    * 0×4006 460800
    * 0×8003 921600
    */
    

    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

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody knows why the android:nextFocusDown attibute stops working when we set the onClick
Does anybody knows how can I set margins to a custom dialog? I'm asking
Anybody knows how to get nic card name when I do ipconfig/all I can
Anybody knows good Linux XML parser library available, and how to set it up
Possible Duplicate: Can i set property of Textview like justify? I'm writing an android
Just curious if anybody knows what Ruby technique is used to accomplish the following
Does anybody knows if it is possible to set up admin user accounts so
Does anybody know how to set the title to the form viewer when showing
Does anybody know how to set the Identity of the Mobile Device Management (MDM)
Does anybody know how to programmatically set the text of a button? thing is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.