LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-01-2010, 04:18 PM   #1
golmschenk
Member
 
Registered: Nov 2009
Posts: 144

Rep: Reputation: 15
C - Serial Port Won't Open


I'm using C serial in a program to open and use a serial port but the port won't open for one reason or another. The program successfully runs on a different computer and when using RealTerm: Serial Capture Program, I can connect through the serial port with the same settings as I'm attempting through my c code. Anyone have any idea why it might be failing? I know this is still pretty vague, so let me know if there's other things I can tell you that might help to finding a solution. Thanks!
 
Old 09-01-2010, 07:11 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Show us some code (use [CODE ] tags, please), and the details of the serial port (ls -l /dev/ttyXXX).
--- rod.
 
Old 09-01-2010, 07:34 PM   #3
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by golmschenk View Post
... I know this is still pretty vague, so let me know if there's other things I can tell you that might help to finding a solution. Thanks!
What's the OS ?
 
Old 09-01-2010, 08:10 PM   #4
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
try switching to a non-blocking on open and then switch it back to blocking (if you are using it in blocking mode) after it opens
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Port Access Denied using open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY); morty346 Programming 11 01-02-2011 05:23 PM
Allow user to open serial port/change settings? funkymunky Linux - General 1 07-30-2009 12:29 PM
Serial Port Access Denied using open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY); morty346 Linux - Newbie 4 02-11-2009 08:13 AM
Serial Port HowTo (Cannot open /dev/ttyS0) chun-mee Linux - Hardware 2 07-14-2006 05:35 PM
serial port stays open after app. closes MuLaZ Linux - Hardware 3 12-31-2005 01:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration