title: How to communicate with an Arduino over its serial interface in C++ on Linux?
body: <p>I have an RFID reader connected to an Arduino board. I'd like to connect to it over its serial interface, and whenever the RFID reader omits a signal ( when it has read an (RF)ID ), I'd like to retrieve it in my C++ program.</p>
  
  <p>I already have the code for simply printing the RFID to serial from the Arduino.</p>
  
  <p>What I don't know, is <em>how to read it from C++</em> in Linux ?</p>
  
  <p>I have looked at <strong>libserial</strong>, which looks straightforward. However, how can I <em>have the C++ program react to a signal and then read the RFID</em>, instead of listening continously? Is this necessary?</p>
  
  <p>EDIT: In most examples I have read, the (c++) program sends input, and recieves output. I just want to listen and recieve output from the Arduino.</p>