I want to write application to interface with micro-controller with Linux PC through serial communication. I am able to write the read and write using basic C code using open, read and write function call. But I am not able to understand how to write and read simultaneously.

If do any sample code or logic then please update me.



Have you looked at select()?

You can open a file descriptor for the tty device, then start the select() call asking for read, write, and exception results, and the select() will return to your calling code when the fd has data to read or is ready to be written to, or a timeout has occurred.

man select

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.