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 7761833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:14:17+00:00 2026-06-01T14:14:17+00:00

My development target is a Linux computer that has two physical serial ports located

  • 0

My development target is a Linux computer that has two physical serial ports located at /dev/ttyS0 and /dev/ttyS1. I also expect /dev/ttyS2 and /dev/ttyS3 to be defined.

Using stty -f /dev/ttyS0 and S1 reports the configuration of the two serial ports and reports something menaing “doesn’t exist” for S2 and S3.

The hardware designers are talking about offering USB to Serial ports built onto the main board. They’ll be DB9 connectors on the outside and just circuitry – no USB connectors on the inside. The number of USB-to-serial connections is not guaranteed and I know enough to design for “many” instead of one.

So, in setting up my port server daemon, I need to be able to determine which ttyS’s and which ttyUSB’s are “real” and which aren’t. Will there ever be placeholdeer ttyUSB’s? What if one were to be “unplugged” (say it was, indeed, a real USB coupler on the inside of the PC)?

Is there a better approach than popen()ing stty and examining its output to determine the status of the serial ports? Is there a C API for stty?

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-01T14:14:18+00:00Added an answer on June 1, 2026 at 2:14 pm

    The “C-API” which stty uses is tcsetattr(3) and tcgetattr(3).

    For finding TTYs without opening the device you may look at this question:

    How to find all serial devices (ttyS, ttyUSB, ..) on Linux without opening them?

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

Sidebar

Related Questions

I want to build a shared library. GNU/Linux is the development and target platform.
Does anyone know of a good software development framework or similar that has the
svn 1.6.9 I have my development (dev) machine and a target testing machine (test)
I currently have a recently started project in development with a 2010 target date
Follow-up: Set up a development environment on Linux targeting Linux and Windows The project
I'm currently looking at developing a small client that has the ability to read
I have a question related to Eclipse PDE development. I'm using target definitions to
I want to target more of my Android development to tablets and I've learned
I've started the development of a windows application, which target windows 7 and vista
Starting the development of my android app,that uses Maps API, I didn't know that

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.