LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 12-12-2011, 12:32 AM   #1
bharathi.onchip
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Rep: Reputation: Disabled
Unhappy Serial: Write timeout for write operation in Linux


Hi all,

I am writing an application to send/receive a bulk data from serial port.
I am able to receive the data that I mentioned in chunks of a page, i.e., 4KB, for each read call.
Like wise, as I know it is only possible to write a page of data at a time.
But in my case I can able to write only 1KB at a time.
Even if I write some data <=1KB immediate after writing 1KB of data I am getting error "Resource temporarily unavailable".
From this I come to know that the delay between two subsequent write operations is not sufficient.
So I kept 100ms delay for each write operation. Then I can able to send as much of data I want.
But it is not a good way of keeping delay.
Is there any other way of keeping timeout for serial write as VMIN and VTIME for serial read .

Thanks in advance.


Regards,
Bharathi.
 
Old 12-13-2011, 12:08 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,398
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Is it possible that your host and/or the peer host have enabled flow control, and that the flow control stops the data for long enough that the write() times out? This would be consistent with the use of delays to throttle transmission of data. If the peer host cannot accept data at any faster rate, then timing out on writes makes sense. At some level, you have to respect the limiting factor, and not simply cache writes ad infinitum.

--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Need help to write script for crontab Hdd operation kapz Slackware 7 01-05-2011 08:42 AM
[SOLVED] Write udev rule to change harddisk timeout EricTRA Linux - Virtualization and Cloud 9 06-11-2010 07:55 AM
read/write,write/write lock with smbclient fails swatidas11 Linux - Networking 1 03-10-2010 01:27 PM
TO write to a serial port payu21 Linux - Newbie 1 05-24-2009 10:23 AM

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

All times are GMT -5. The time now is 11:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration