I am writing a vxworks task involving sending data thru serial port. Opening the serial port is successful. But when I am trying to set the baud rate of the port using ioctl() system call, it fails. I am giving the code below. can anyone please shed some light on it? The second function is failing always...
int f, status;
if (f = open("/tyCo/1", O_RDWR, 0) == ERROR)
{
printf("error opening serial port; exiting...");
return 1;
}
if (status = ioctl(f, FIOBAUDRATE, 2400) == ERROR)
{
printf("ioctl error; exiting...");
return 1;
}