I have a C++ based project on a Raspberry Pi. I need to extend my framework to read data from Arduino micro via USB port.
Unfortunately, I cannot move my entire framework to the Arduino Sketch since the project is huge. Are there some independent (portable) libraries that can help the Raspberry Pi communicate to the Arduino Micro?
I can’t figure out what you want to do or why you think you need a library. Why can’t your RPi talk to an Arduino over a Serial connection? That is very straightforward.
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.
The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino communication.
You can send data in a compatible format with code like this (or the equivalent in any other programming language)
Serial.print('<'); // start marker
Serial.print(','); // comma separator
Serial.println('>'); // end marker
This Python - Arduino demo may also give you some ideas. It should not be difficult to convert the Python code to C++