LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-09-2009, 03:37 AM   #16
jeroends
LQ Newbie
 
Registered: Nov 2009
Posts: 8

Original Poster
Rep: Reputation: 0

ok
did some new test ...
The only thing I'm sure of is the story with stty thus I putted the following in the code:
Code:
	   if((system("/bin/stty -F /dev/ttyACM0 9600"))<0){
		  printf("error: cannot set port"); // 
		  exit(-1);
	  }
not the most propper way but for now it helps me out and it keeps working calling the program with crontab every miniute to have a little temperature logger (code a bit different).

I've studied the source code of stty, used the same way as it opens the fd, it morely "reopens" it so I used the same way included playing with the nonblocking options --> no result, exactly the same result.

Next I've played with the O_ASYNC option (running stty first). A little difference ... With the option setted, nothing receives anymore, with the option explicity cleared, same result.

So for now, it works but only with the piece of code running stty.

An other thing came up rebooting the server this morning, after rebooting the interface doesn't get recognized automaticly, only after unplugging and replugging it 's all back in place.

Anything to get that part working? (the auto reconnect on booting)
 
Old 11-09-2009, 02:51 PM   #17
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
Does stty make any ioctl() calls? That would be the thing that would be likely to affect the driver and/or interface. I would look especially at anything that is done irrespective of commanline arguments, since you say it doesn't seem to matter what arguments you feed it.
--- rod.
 
  


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
set baudrate to 256000 within termios.h agostain Linux - Hardware 3 01-02-2009 07:56 AM
Assistance With Termios Settings Please Peatmoss Linux - Newbie 3 06-01-2008 09:54 PM
managing termios for ser ports DavidHB Linux - Software 2 09-21-2006 07:37 AM
problem with serial port in loopback mode .. (termios) mta Programming 1 06-06-2006 11:56 AM
Figuring out a 'c_oflag'(man termios) that will help in stdout supression. Tarts Programming 13 08-11-2003 09:04 AM

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

All times are GMT -5. The time now is 07:05 PM.

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