I don't see anything in your C code to set "raw" mode, so that side may be sitting there waiting for a line terminator...
As an experiment, try "stty raw; ./myprog; stty cooked"
(that's what I usually do when I need a quick C program to read data from a microcontroller. Looking up all the (varied) tcsetattr/ioctl stuff is too much work...
(also: "stty raw; ./myprog </dev/tty.ACM0; stty cooked" saves even more work!)
I don't understand what you mean. Could you suggest me how i can fix it?
westfw:
I don't see anything in your C code to set "raw" mode, so that side may be sitting there waiting for a line terminator...
As an experiment, try "stty raw; ./myprog; stty cooked"
(that's what I usually do when I need a quick C program to read data from a microcontroller. Looking up all the (varied) tcsetattr/ioctl stuff is too much work...
(also: "stty raw; ./myprog </dev/tty.ACM0; stty cooked" saves even more work!)
I need that everythings works with only C code, so i have to read four bytes from arduino that in this case contains 1, 2, 3, 4.