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 12-13-2012, 01:03 AM   #1
linxquest
LQ Newbie
 
Registered: Dec 2012
Posts: 6

Rep: Reputation: Disabled
How to implement read() for the following conditioin


I am writing an athread for receiving data from a source which is transmitting 200 bytes of data at a baud rate of 1200 for every 200ms, I am receiving with baud rate of 115200, my thread can get control at any point of time, so how can i sense the 1st byte of the 200 byte transmission?

Last edited by linxquest; 12-13-2012 at 01:22 AM.
 
Old 12-13-2012, 02:36 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
In what context? PC or spec hw? If PC: Linux, DOS, Windows, etc? If linux: kernel-space or user-space?
 
Old 12-13-2012, 02:55 AM   #3
linxquest
LQ Newbie
 
Registered: Dec 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
I am writing program in linux fedora version 11, thanks for the interest!
 
Old 12-13-2012, 03:27 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Are you using a char special device like /dev/ttyS0? Or direct port-io?
 
Old 12-13-2012, 04:59 AM   #5
linxquest
LQ Newbie
 
Registered: Dec 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hi nevemTeve....'m accesing data through serial port...
 
Old 12-13-2012, 06:13 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Guessed so much. Could you answer my previous question: Are you using a char special device like /dev/ttyS0? Or direct port-io?

If you don't really know what this means, please read this first:
http://www.tldp.org/HOWTO/Serial-Programming-HOWTO/

Last edited by NevemTeve; 12-13-2012 at 06:19 AM. Reason: link added
 
  


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
How to implement read-only, shared /usr mountpoint? pigsa Linux - General 3 07-17-2009 03:25 AM
How to implement this process kishore_jasthi Linux - Newbie 1 02-21-2008 03:19 PM
best way to implement syslog slug420 Linux - General 2 03-21-2007 01:23 PM
Shell implement in c SatYr_84 Programming 8 10-06-2005 12:44 AM
I am trying implement sleep in read system call problem sbharsha Programming 1 09-18-2005 11:48 PM

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

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