I am trying to read from a TTY, say ttyp2.
Writing to it is no problem; I do an fp=fopen(“dev/ttyp2”, “w”) and then fprintf(fp, “foo”) ).
Using cat /dev/ttyp2 also works and shows me the “foo” that has been written to TTY2.
But I am not able to read from the TTY with a C-Function. I tried to use fopen("/dev/ttyp2", “r”) and then fread, fgets, fgetc and so on.
Does anybody know how to do it?