ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Please ask the moderators to move your post to the "Programming" sub-forum, and read the information linked to by the BB code link below the reply box so you can post your code inside a code block. That preserves the code formatting and makes it easier to read.
I think you did not get my problem let me explain you once again..
I am trying to write and read data from uart (serial port), where I am able write data successfully but while reading data once I hit enter key or
carriage return only I able to see data on hyper-terminal... other wise no data is displayed on hyper terminal...
so my intention to receive data as we type character not only after hitting enter key..
I still don't understand your problem exactly. From what I understand, your program runs on linux and, for now, communicates with a windows machine where you run hyper-terminal. In hyperterm you don't see anything from your program when you start your program till you press <enter> in hyperterm. Is that indeed your problem?
If that is your problem, do you start hyperterm before you start your program?
If not, your program has already send the data '#09,R$' so you have to press <enter> before it will send it again as your read is blocking the loop.
If yes, sounds like a hyperterm configuration and at this stage I can't help you with that (as I don't have a hyperterm available at this moment).
Your program does send the data immediately (and works from that perspective); I have confirmed this using minicom under Ubuntu using pseudo terminals.
You can configure minicom to use /dev/ptyp0 (and correct baudrate/parity settings etc) and your program to use /dev/ttyp0. Note that the names of the pseudo terminal pairs might depend on your OS.
PS I also don't know if you can configure hyperterm to send a character at the moment that you type it. I also don't know if this is possible in minicom (still trying).
Last edited by Wim Sturkenboom; 07-10-2010 at 05:01 AM.
Reason: Added PS
Thanks for your mail. I actually has arm 9 board and it starts and bootups from serial and I have connected arm9 serial port to windows hyper-terminal. But I develope compile application in fedora (linux) machine and download this file to arm9 board through windows hyperterminal. by sftp...
I think this is very clear now... (I am not using minicom any whrere)...
as u said in your mail once I run the application I get #09,R$ (since hyper terminal is already connected) but while reading data I am facing the problem (I want to receive data any time, it sholud not block the application)
not by waiting for number of charcter, any no of character should be received....
Your read is fine. The problem is that hyperterm more than likely uses buffered IO in its current configuration and will only send once you have pressed <enter>. So you must look in the hyperterm documentation if you can change that behaviour.
In non-canonical mode input is available immediately (without the user
having to type a line-delimiter character), and line editing is dis‐
abled. The settings of MIN (c_cc[VMIN]) and TIME (c_cc[VTIME]) deter‐
mine the circumstances in which a read(2) completes; there are four
So don't use ICANON might do the trick
Last edited by Wim Sturkenboom; 07-10-2010 at 07:34 AM.