Serial port programming in Linux
问题 I want to use RS232 port on the board to communicate with a PC. I understand that I can use "dev/ttyS0" for that purpose. I can open and write data to PC by using write() function. But the problem is I can't read from "dev/ttyS0". Every time I use read function, I get "Resource temporarily unavailable". Can u guys tell me how to solve this problem? Here is my code: #include <stdio.h> #include <string.h> #include <fcntl.h> #include <termios.h> #include <unistd.h> int main() { int n = 0, fd = 0