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

  • SEARCH
  • Home
  • 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 6651685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:02:27+00:00 2026-05-26T01:02:27+00:00

I am trying to setup a serial port on centos but can’t get it

  • 0

I am trying to setup a serial port on centos but can’t get it to work. this is the code that I’m having trouble with.

tcgetattr(idComDev[i], &options); // get current settings

    printw("default baudrate is %d ", cfgetispeed(&options));

    cfsetispeed(&options, B115200); // set baud rate
    cfsetospeed(&options, B115200); // set baud rate

tcsetattr(idComDev[i], TCSANOW, &options);// save the settings

    printw("Seg %d = COM%hd at %d Baudrate",i,CommNo[i], cfgetispeed(&options));

The out put from this is: Default baud rate is 4098 Seg0 = COM1 at 4098 Baudrate.

Why is it at 4098? I can’t find this baudrate anywhere.

If I set the baud rate to 1800 it says it is at 10. If I set it to 9600 it says it is at 13.

I have done some research and found that suposidly the hardware cannot support this high a baud rate but I have a Java program on the same computer commutating with the same device that I am trying to connect to. So I know this cannot be that case.

Does anyone know what is going on and how to fix it?

  • 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-05-26T01:02:28+00:00Added an answer on May 26, 2026 at 1:02 am

    B115200 is a macro, and expands to 0x1002. That’s a combination of two bits: 0x1000 signals that it’s a non-standard rate (as you discovered) and 0x2 is the second non-standard rate (B57600 is 0x1001, the first non-standard rate).

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

Sidebar

Related Questions

I can't seem to get the follow code right. This is a basic program
I'm trying to write a C++ MFC application that uses the serial port (e.g.
I'm trying setup a subset of boost and get it properly compiled using bjam,
After trying to setup my site for Google Webmaster Tools I found that my
I'm trying to setup CruiseControl.net at the moment. So far it works nice, but
I am trying to use a Serial Port to interface with a camera. Now,
I'm trying to talk to a home made card over a serial port, and
I'm trying setup a map that displays different pin colors depending on the type/class
I'm trying setup costum storege. Looks like all is ok. But there is the
When trying to setup a lock (pessimistic), with the following code: em.lock(controlnumbers, LockModeType.WRITE); em.refresh(controlnumbers);

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.