LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 02-09-2012, 10:17 AM   #16
Ninaeve
LQ Newbie
 
Registered: Jan 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Question prompt messed up


@ theNbomr: Thanks!
Actually I setted also VTIME!=0 so after a while the program stops reading the port.

ANother question:
After using my silly program I have the prompt messed up, like

xxx/home>
xxx/home>
xxx/home>

if I press enter and I don't see what I write!
Maybe it's because of the program code?

Quote:
tcsetattr(STDOUT_FILENO,TCSANOW, &stdio);
tcsetattr(STDOUT_FILENO, TCSAFLUSH, &stdio);
tcsetattr(fd, TCSANOW, &options);
fcntl(fd, F_SETFL, 0);
Otherwise how can I time-out the reading in c?
Thanks in advance to anyone that will help me.
Best Regards
Ninaeve
 
Old 02-09-2012, 10:31 AM   #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
To time out a read, you need to set VMIN=0, and and VTIME=non-zero. See the link I posted for all of the details.

I have no idea how your program can be affecting your prompt, unless it is outputting escape-sequence characters that the terminal is interpreting as some kind of cursor control or otherwise affecting the terminal.

--- rod.

Attention to mods: Using Chrome browser gives me a response when posting: 'This forum requires that you wait 3 seconds between posts. Please try again in 3 seconds.'. Then when I re-submit, I get a double-post that I cannot edit.
 
Old 02-09-2012, 10:57 AM   #18
Ninaeve
LQ Newbie
 
Registered: Jan 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
@theNbomr: thanks again!
To time out a read, I understood you can also set VMIN=non-zero, and and VTIME=non-zero: you time-out when you have read VMIN characters or if in VTIME you din't read any.
It is correct?
Ok,if so it could be a problem if the communication is dropped at 0<characters<VMIN ...


I will look again for possible outputting escape-sequence characters (sob and ^__^ ''')
but THANK you very much
Ninaeve
 
  


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
[SOLVED] how to retrieve lost data on a usb stick zenofronia Linux - General 14 07-28-2013 08:49 PM
Retrieve data from a USB port Ninaeve Programming 2 01-30-2012 12:30 PM
USB data got corrupt- How to retrieve? babi Linux - Newbie 3 01-09-2012 07:54 AM
Best way to retrieve data baldurpet Linux - Software 3 12-25-2008 12:48 AM
Very urgent! Need to retrieve some data! Help bikov_k General 2 10-16-2004 06:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 02:18 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