serial port communication
I amtrying to send a set of specific strings thro my serial port...
The strings are sent to a device which returns them back .
I do this as follows
printf("number of bytes in in buffer is %d and out buffer is %d\n",
st5=serial_read (st2, op,size);
printf("\nnumber of bytes in reader buffer %d ",st5);
printf("\nRecieved word is %s\n",op);
It is important that my connection remain throughout . my out but for recieved string is
It seems like when I send a new write comman either the write buffer, read buffer or both do not get cleared( probably more importantly the write ause my device is not behaving)
How do I clear my buffer without having to cut my connetion....both file descriptors are rd,wr........and i tried tcdrain...doesnt work