Shodanex NDI Polaris Spectra (baud 1.2mbps) Linux. , (/dev/ttyUSB0) B38400,
int port = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NONBLOCK);
tcgetattr(port,&g_initialAtt);
newAtt=g_initialAtt;
newAtt.c_cflag = B38400 | CS8 | CLOCAL | CREAD;
cfmakeraw(&newAtt);
tcsetattr(port,TCSANOW,&newAtt);
:
if(ioctl(port, TIOCGSERIAL, &sstruct) < 0){
printf("Error: could not get comm ioctl\n");
exit(0);
}
sstruct.custom_divisor = custDiv;
//sstruct.flags &= 0xffff ^ ASYNC_SPD_MASK; NO! makes read fail.
sstruct.flags |= ASYNC_SPD_CUST;
if(ioctl(port, TIOCSSERIAL, &sstruct) < 0){
printf("Error: could not set custom comm baud divisor\n");
exit(0);
}