I am reading the data from serial using read system call. It seems that this call is reading only one byte though it given how many bytes to read
bytes_read = read(fp, buffer, 20);
I don't know how much bytes the sender will send. If I know, then I would read that many times. I suspect that, while reading in to serial second bytes didn't arrived, so that it is coming out. Due to this I want to implement timeout. read call should wait for that much of time, read all the bytes till that timeout. I want experts to help me in this.