oFSerial
The behavier of oFSerial and comport object on Pd is different.
oFSerial::available returns the number of bytes, and readByte returns byte itself only when the received message contains \n (ascii 13), which is highly problematic for high speed raw byte sending.
Presumably this is caused by the flags of serial fucntions.
in comport:
—–
new->c_cflag |= (CREAD | CLOCAL);
/* always nocanonical, this means raw i/o no terminal */
new->c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
/* no post processing */
new->c_oflag &= ~OPOST;
——
in ofSerial
——
oflag O_RDWR | O_NOCITY | O_NONBLOCK
cflag CLOCAL | CREAD | CS8
cflag &= ~(PARENB | CSTOPB | CSIZE)
——
The problem is ofSerial does not canonical mode by
&= ~ICANON
so without sending \n or other special character, the front ends holds the data and not release them to the receiver app.
http://man7.org/linux/man-pages/man3/termios.3.html
Comments are Disabled