How to interrupt loop/process using terminal input in C++ on a Linux application -


I am writing a Linux command line application that eventually leads to data acquisition from a piece of hardware. The nature of data acquisition is that it will feed data to the program continuously at some defined data rate. Once the user enters the RxData (Receive the loop), we want to stop receiving no command from the terminal to close it. I think the problem is that while using the getchar () the loop keeps every move of the loop as this program will expect the user to enter the input. Am I wrong in this behavior?

On one note, I know that when you work with an embedded device, you can simply see a register that the buffer has increased or not, to determine that Does buffer read or not? I do not have a luxury on Linux application (or what?). Does such a thing work (let's call it making available), which I can run, check why the data is in the input, and then my program is prompted to stop receiving data?

I just can not use the signet because I signal the hardware to prevent data acquisition as well as add headers to the recorded data. There should be an indication to stop the acquisition.

In Linux (or any other Unix flavor), you can see whether 2 (or more) ) The data available on file descriptors, sockets or anything else can be read may be select (this is the reason that this system call exists ... )

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -