- The mimeLoadType() function didn't handle the
3-argument contains() function.
- The LoadPPDs() function in the scheduler didn't
- properly set the alloc_ppds variable or handle
- a PPD database containing 0 printers.
- - The scheduler FindAvailablePrinter() function
- didn't use the same queuing logic as the
- CheckJobs() function. This caused classes to
- stall if a remote printer was always busy.
+ properly set the alloc_ppds variable or handle a PPD
+ database containing 0 printers.
+ - The scheduler FindAvailablePrinter() function didn't
+ use the same queuing logic as the CheckJobs()
+ function. This caused classes to stall if a remote
+ printer was always busy.
- Jobs are now assigned to printers in a class
- round-robin style. This should prevent the
- first server in the class from bearing the
- brunt of the jobs.
- - The scheduler's LoadAllJobs() function didn't
- always restore remote printers for queued jobs
- on startup.
+ round-robin style. This should prevent the first
+ server in the class from bearing the brunt of the
+ jobs.
+ - The scheduler's LoadAllJobs() function didn't always
+ restore remote printers for queued jobs on startup.
+ - The serial backend didn't support the higher baud
+ rates with the old termios interface. It now supports
+ 57600 and 115200 baud.
+ - The serial backend now supports different types of
+ flow control; previously it ignored the flow=XYZ
+ option in the device URI.
+ - The serial backend now supports DTR/DSR flow control,
+ which is popular on dot-matrix printers (access with
+ "flow=dtrdsr" in the device URI)
CHANGES IN CUPS v1.1.4
/*
- * "$Id: serial.c,v 1.19 2000/10/13 01:04:36 mike Exp $"
+ * "$Id: serial.c,v 1.20 2000/11/10 15:53:39 mike Exp $"
*
* Serial port backend for the Common UNIX Printing System (CUPS).
*
# endif /* !INV_EPP_ECP_PLP */
#endif /* __sgi */
+#ifndef CRTSCTS
+# ifdef CNEW_RTSCTS
+# define CRTSCTS CNEW_RTSCTS
+# else
+# define CRTSCTS 0
+# endif /* CNEW_RTSCTS */
+#endif /* !CRTSCTS */
+
/*
* Local functions...
int wbytes; /* Number of bytes written */
size_t nbytes, /* Number of bytes read */
tbytes; /* Total number of bytes written */
+ int dtrdsr; /* Do dtr/dsr flow control? */
+ int bufsize; /* Size of output buffer for writes */
char buffer[8192], /* Output buffer */
*bufptr; /* Pointer into buffer */
struct termios opts; /* Parallel port options */
opts.c_lflag &= ~(ICANON | ECHO | ISIG); /* Raw mode */
+ bufsize = 480; /* 9600 baud / 10 bits/char / 2Hz */
+ dtrdsr = 0; /* No dtr/dsr flow control */
+
if (options != NULL)
while (*options)
{
* Set the baud rate...
*/
+ bufsize = atoi(value) / 20;
+
#if B19200 == 19200
cfsetispeed(&opts, atoi(value));
cfsetospeed(&opts, atoi(value));
cfsetispeed(&opts, B38400);
cfsetospeed(&opts, B38400);
break;
+#ifdef B57600
+ case 57600 :
+ cfsetispeed(&opts, B57600);
+ cfsetospeed(&opts, B57600);
+ break;
+#endif /* B57600 */
+#ifdef B115200
+ case 115200 :
+ cfsetispeed(&opts, B115200);
+ cfsetospeed(&opts, B115200);
+ break;
+#endif /* B115200 */
default :
fprintf(stderr, "WARNING: Unsupported baud rate %s!\n", value);
break;
else if (strcasecmp(value, "none") == 0)
opts.c_cflag &= ~PARENB;
}
+ else if (strcasecmp(name, "flow") == 0)
+ {
+ /*
+ * Set flow control...
+ */
+
+ if (strcasecmp(value, "none") == 0)
+ {
+ opts.c_iflag &= ~(IXON | IXOFF | IXANY);
+ opts.c_cflag &= ~CRTSCTS;
+ }
+ else if (strcasecmp(value, "soft") == 0)
+ {
+ opts.c_iflag |= IXON | IXOFF | IXANY;
+ opts.c_cflag &= ~CRTSCTS;
+ }
+ else if (strcasecmp(value, "hard") == 0 ||
+ strcasecmp(value, "rtscts") == 0)
+ {
+ opts.c_iflag &= ~(IXON | IXOFF | IXANY);
+ opts.c_cflag |= CRTSCTS;
+ }
+ else if (strcasecmp(value, "dtrdsr") == 0)
+ {
+ opts.c_iflag &= ~(IXON | IXOFF | IXANY);
+ opts.c_cflag &= ~CRTSCTS;
+
+ dtrdsr = 1;
+ }
+ }
}
tcsetattr(fd, TCSANOW, &opts);
* Finally, send the print file...
*/
+ if (bufsize > sizeof(buffer))
+ bufsize = sizeof(buffer);
+
while (copies > 0)
{
copies --;
rewind(fp);
}
+ if (dtrdsr)
+ {
+ /*
+ * Check the port and sleep until DSR is set...
+ */
+
+ int status;
+
+
+ if (!ioctl(fd, TIOCMGET, &status))
+ if (!(status & TIOCM_DSR))
+ {
+ /*
+ * Wait for DSR to go high...
+ */
+
+ fputs("DEBUG: DSR is low; waiting for device...\n", stderr);
+
+ do
+ {
+ sleep(1);
+ if (ioctl(fd, TIOCMGET, &status))
+ break;
+ }
+ while (!(status & TIOCM_DSR));
+
+ fputs("DEBUG: DSR is high; writing to device...\n", stderr);
+ }
+ }
+
tbytes = 0;
- while ((nbytes = fread(buffer, 1, sizeof(buffer), fp)) > 0)
+ while ((nbytes = fread(buffer, 1, bufsize, fp)) > 0)
{
/*
* Write the print data to the printer...
/*
- * End of "$Id: serial.c,v 1.19 2000/10/13 01:04:36 mike Exp $".
+ * End of "$Id: serial.c,v 1.20 2000/11/10 15:53:39 mike Exp $".
*/