/[rdesktop]/sourceforge.net/trunk/rdesktop/serial.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/serial.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 795 by stargo, Wed Nov 3 13:56:52 2004 UTC revision 865 by stargo, Tue Mar 15 11:25:50 2005 UTC
# Line 3  Line 3 
3  #include <termios.h>  #include <termios.h>
4  #include <strings.h>  #include <strings.h>
5  #include <sys/ioctl.h>  #include <sys/ioctl.h>
6    
7    #ifdef HAVE_SYS_MODEM_H
8    #include <sys/modem.h>
9    #endif
10    #ifdef HAVE_SYS_FILIO_H
11    #include <sys/filio.h>
12    #endif
13    #ifdef HAVE_SYS_STRTIO_H
14    #include <sys/strtio.h>
15    #endif
16    
17  #include "rdesktop.h"  #include "rdesktop.h"
18    
19  #ifdef WITH_DEBUG_SERIAL  #ifdef WITH_DEBUG_SERIAL
# Line 66  Line 77 
77  #define SERIAL_PURGE_RXCLEAR 0x00000008  #define SERIAL_PURGE_RXCLEAR 0x00000008
78    
79  /* SERIAL_WAIT_ON_MASK */  /* SERIAL_WAIT_ON_MASK */
80  #define SERIAL_EV_RXCHAR           0x0001       // Any Character received  #define SERIAL_EV_RXCHAR           0x0001       /* Any Character received */
81  #define SERIAL_EV_RXFLAG           0x0002       // Received certain character  #define SERIAL_EV_RXFLAG           0x0002       /* Received certain character */
82  #define SERIAL_EV_TXEMPTY          0x0004       // Transmitt Queue Empty  #define SERIAL_EV_TXEMPTY          0x0004       /* Transmitt Queue Empty */
83  #define SERIAL_EV_CTS              0x0008       // CTS changed state  #define SERIAL_EV_CTS              0x0008       /* CTS changed state */
84  #define SERIAL_EV_DSR              0x0010       // DSR changed state  #define SERIAL_EV_DSR              0x0010       /* DSR changed state */
85  #define SERIAL_EV_RLSD             0x0020       // RLSD changed state  #define SERIAL_EV_RLSD             0x0020       /* RLSD changed state */
86  #define SERIAL_EV_BREAK            0x0040       // BREAK received  #define SERIAL_EV_BREAK            0x0040       /* BREAK received */
87  #define SERIAL_EV_ERR              0x0080       // Line status error occurred  #define SERIAL_EV_ERR              0x0080       /* Line status error occurred */
88  #define SERIAL_EV_RING             0x0100       // Ring signal detected  #define SERIAL_EV_RING             0x0100       /* Ring signal detected */
89  #define SERIAL_EV_PERR             0x0200       // Printer error occured  #define SERIAL_EV_PERR             0x0200       /* Printer error occured */
90  #define SERIAL_EV_RX80FULL         0x0400       // Receive buffer is 80 percent full  #define SERIAL_EV_RX80FULL         0x0400       /* Receive buffer is 80 percent full */
91  #define SERIAL_EV_EVENT1           0x0800       // Provider specific event 1  #define SERIAL_EV_EVENT1           0x0800       /* Provider specific event 1 */
92  #define SERIAL_EV_EVENT2           0x1000       // Provider specific event 2  #define SERIAL_EV_EVENT2           0x1000       /* Provider specific event 2 */
93    
94  /* Modem Status */  /* Modem Status */
95  #define SERIAL_MS_DTR 0x01  #define SERIAL_MS_DTR 0x01
# Line 110  Line 121 
121    
122  /* FIONREAD should really do the same thing as TIOCINQ, where it is  /* FIONREAD should really do the same thing as TIOCINQ, where it is
123   * not available */   * not available */
124  #ifndef TIOCINQ  #if !defined(TIOCINQ) && defined(FIONREAD)
 #include <sys/filio.h>  
125  #define TIOCINQ FIONREAD  #define TIOCINQ FIONREAD
126  #endif  #endif
127    #if !defined(TIOCOUTQ) && defined(FIONWRITE)
128    #define TIOCOUTQ FIONWRITE
129    #endif
130    
131  extern RDPDR_DEVICE g_rdpdr_device[];  extern RDPDR_DEVICE g_rdpdr_device[];
132    
# Line 385  set_termios(SERIAL_DEVICE * pser_inf, NT Line 398  set_termios(SERIAL_DEVICE * pser_inf, NT
398                          break;                          break;
399          }          }
400    
401  #if 0  #ifdef CBAUD
402            ptermios->c_cflag &= ~CBAUD;
403            ptermios->c_cflag |= speed;
404    #else
405          /* on systems with separate ispeed and ospeed, we can remember the speed          /* on systems with separate ispeed and ospeed, we can remember the speed
406             in ispeed while changing DTR with ospeed */             in ispeed while changing DTR with ospeed */
407          cfsetispeed(pser_inf->ptermios, speed);          cfsetispeed(pser_inf->ptermios, speed);
408          cfsetospeed(pser_inf->ptermios, pser_inf->dtr ? speed : 0);          cfsetospeed(pser_inf->ptermios, pser_inf->dtr ? speed : 0);
409  #endif  #endif
410    
         ptermios->c_cflag &= ~CBAUD;  
         ptermios->c_cflag |= speed;  
   
411          ptermios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CSIZE | CRTSCTS);          ptermios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CSIZE | CRTSCTS);
412          switch (pser_inf->stop_bits)          switch (pser_inf->stop_bits)
413          {          {
# Line 490  serial_enum_devices(uint32 * id, char *o Line 503  serial_enum_devices(uint32 * id, char *o
503          char *pos2;          char *pos2;
504          int count = 0;          int count = 0;
505    
506          // skip the first colon          /* skip the first colon */
507          optarg++;          optarg++;
508          while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)          while ((pos = next_arg(optarg, ',')) && *id < RDPDR_MAX_DEVICES)
509          {          {
510                  // Init data structures for device                  /* Init data structures for device */
511                  pser_inf = (SERIAL_DEVICE *) xmalloc(sizeof(SERIAL_DEVICE));                  pser_inf = (SERIAL_DEVICE *) xmalloc(sizeof(SERIAL_DEVICE));
512                  pser_inf->ptermios = (struct termios *) xmalloc(sizeof(struct termios));                  pser_inf->ptermios = (struct termios *) xmalloc(sizeof(struct termios));
513                  memset(pser_inf->ptermios, 0, sizeof(struct termios));                  memset(pser_inf->ptermios, 0, sizeof(struct termios));
# Line 510  serial_enum_devices(uint32 * id, char *o Line 523  serial_enum_devices(uint32 * id, char *o
523                  strcpy(g_rdpdr_device[*id].local_path, pos2);                  strcpy(g_rdpdr_device[*id].local_path, pos2);
524                  printf("SERIAL %s to %s\n", g_rdpdr_device[*id].name,                  printf("SERIAL %s to %s\n", g_rdpdr_device[*id].name,
525                         g_rdpdr_device[*id].local_path);                         g_rdpdr_device[*id].local_path);
526                  // set device type                  /* set device type */
527                  g_rdpdr_device[*id].device_type = DEVICE_TYPE_SERIAL;                  g_rdpdr_device[*id].device_type = DEVICE_TYPE_SERIAL;
528                  g_rdpdr_device[*id].pdevice_data = (void *) pser_inf;                  g_rdpdr_device[*id].pdevice_data = (void *) pser_inf;
529                  count++;                  count++;
# Line 546  serial_create(uint32 device_id, uint32 a Line 559  serial_create(uint32 device_id, uint32 a
559                  return STATUS_ACCESS_DENIED;                  return STATUS_ACCESS_DENIED;
560          }          }
561    
562          // Store handle for later use          /* Store handle for later use */
563          g_rdpdr_device[device_id].handle = serial_fd;          g_rdpdr_device[device_id].handle = serial_fd;
564    
565          /* some sane information */          /* some sane information */
# Line 555  serial_create(uint32 device_id, uint32 a Line 568  serial_create(uint32 device_id, uint32 a
568          pser_inf->ptermios->c_iflag &=          pser_inf->ptermios->c_iflag &=
569                  ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);                  ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);
570          pser_inf->ptermios->c_oflag &= ~OPOST;          pser_inf->ptermios->c_oflag &= ~OPOST;
571          pser_inf->ptermios->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN | XCASE);          pser_inf->ptermios->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
572          pser_inf->ptermios->c_cflag &= ~(CSIZE | PARENB);          pser_inf->ptermios->c_cflag &= ~(CSIZE | PARENB);
573          pser_inf->ptermios->c_cflag |= CS8;          pser_inf->ptermios->c_cflag |= CS8;
574    
# Line 605  serial_read(NTHANDLE handle, uint8 * dat Line 618  serial_read(NTHANDLE handle, uint8 * dat
618          pser_inf = get_serial_info(handle);          pser_inf = get_serial_info(handle);
619          ptermios = pser_inf->ptermios;          ptermios = pser_inf->ptermios;
620    
621          // Set timeouts kind of like the windows serial timeout parameters. Multiply timeout          /* Set timeouts kind of like the windows serial timeout parameters. Multiply timeout
622          // with requested read size             with requested read size */
623          if (pser_inf->read_total_timeout_multiplier | pser_inf->read_total_timeout_constant)          if (pser_inf->read_total_timeout_multiplier | pser_inf->read_total_timeout_constant)
624          {          {
625                  timeout =                  timeout =
# Line 618  serial_read(NTHANDLE handle, uint8 * dat Line 631  serial_read(NTHANDLE handle, uint8 * dat
631                  timeout = (pser_inf->read_interval_timeout * length + 99) / 100;                  timeout = (pser_inf->read_interval_timeout * length + 99) / 100;
632          }          }
633    
634          // If a timeout is set, do a blocking read, which times out after some time.          /* If a timeout is set, do a blocking read, which times out after some time.
635          // It will make rdesktop less responsive, but it will improve serial performance, by not             It will make rdesktop less responsive, but it will improve serial performance, by not
636          // reading one character at a time.             reading one character at a time. */
637          if (timeout == 0)          if (timeout == 0)
638          {          {
639                  ptermios->c_cc[VTIME] = 0;                  ptermios->c_cc[VTIME] = 0;
# Line 633  serial_read(NTHANDLE handle, uint8 * dat Line 646  serial_read(NTHANDLE handle, uint8 * dat
646          }          }
647          tcsetattr(handle, TCSANOW, ptermios);          tcsetattr(handle, TCSANOW, ptermios);
648    
649  #ifdef WITH_DEBUG_SERIAL  #if defined(WITH_DEBUG_SERIAL) && defined(TIOCINQ)
650          ioctl(handle, TIOCINQ, &bytes_inqueue);          ioctl(handle, TIOCINQ, &bytes_inqueue);
651          DEBUG_SERIAL(("serial_read inqueue: %d expected %d\n", bytes_inqueue, length));          DEBUG_SERIAL(("serial_read inqueue: %d expected %d\n", bytes_inqueue, length));
652  #endif  #endif
# Line 690  serial_device_control(NTHANDLE handle, u Line 703  serial_device_control(NTHANDLE handle, u
703                  case SERIAL_SET_BAUD_RATE:                  case SERIAL_SET_BAUD_RATE:
704                          in_uint32_le(in, pser_inf->baud_rate);                          in_uint32_le(in, pser_inf->baud_rate);
705                          set_termios(pser_inf, handle);                          set_termios(pser_inf, handle);
706                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_BAUD_RATE %d\n", pser_inf->baud_rate));                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_BAUD_RATE %d\n",
707                                          pser_inf->baud_rate));
708                          break;                          break;
709                  case SERIAL_GET_BAUD_RATE:                  case SERIAL_GET_BAUD_RATE:
710                          out_uint32_le(out, pser_inf->baud_rate);                          out_uint32_le(out, pser_inf->baud_rate);
711                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_BAUD_RATE %d\n", pser_inf->baud_rate));                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_BAUD_RATE %d\n",
712                                          pser_inf->baud_rate));
713                          break;                          break;
714                  case SERIAL_SET_QUEUE_SIZE:                  case SERIAL_SET_QUEUE_SIZE:
715                          in_uint32_le(in, pser_inf->queue_in_size);                          in_uint32_le(in, pser_inf->queue_in_size);
716                          in_uint32_le(in, pser_inf->queue_out_size);                          in_uint32_le(in, pser_inf->queue_out_size);
717                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_QUEUE_SIZE in %d out %d\n",                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_QUEUE_SIZE in %d out %d\n",
718                              pser_inf->queue_in_size, pser_inf->queue_out_size));                                        pser_inf->queue_in_size, pser_inf->queue_out_size));
719                          break;                          break;
720                  case SERIAL_SET_LINE_CONTROL:                  case SERIAL_SET_LINE_CONTROL:
721                          in_uint8(in, pser_inf->stop_bits);                          in_uint8(in, pser_inf->stop_bits);
722                          in_uint8(in, pser_inf->parity);                          in_uint8(in, pser_inf->parity);
723                          in_uint8(in, pser_inf->word_length);                          in_uint8(in, pser_inf->word_length);
724                          set_termios(pser_inf, handle);                          set_termios(pser_inf, handle);
725                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_LINE_CONTROL stop %d parity %d word %d\n",                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_LINE_CONTROL stop %d parity %d word %d\n", pser_inf->stop_bits, pser_inf->parity, pser_inf->word_length));
                             pser_inf->stop_bits, pser_inf->parity, pser_inf->word_length));  
726                          break;                          break;
727                  case SERIAL_GET_LINE_CONTROL:                  case SERIAL_GET_LINE_CONTROL:
728                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_LINE_CONTROL\n"));                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_LINE_CONTROL\n"));
# Line 751  serial_device_control(NTHANDLE handle, u Line 765  serial_device_control(NTHANDLE handle, u
765                          in_uint32_le(in, pser_inf->onlimit);                          in_uint32_le(in, pser_inf->onlimit);
766                          in_uint32_le(in, pser_inf->offlimit);                          in_uint32_le(in, pser_inf->offlimit);
767                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_HANDFLOW %x %x %x %x\n",                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_HANDFLOW %x %x %x %x\n",
768                              pser_inf->control, pser_inf->xonoff, pser_inf->onlimit,                                        pser_inf->control, pser_inf->xonoff, pser_inf->onlimit,
769                              pser_inf->onlimit));                                        pser_inf->onlimit));
770                          set_termios(pser_inf, handle);                          set_termios(pser_inf, handle);
771                          break;                          break;
772                  case SERIAL_SET_TIMEOUTS:                  case SERIAL_SET_TIMEOUTS:
# Line 762  serial_device_control(NTHANDLE handle, u Line 776  serial_device_control(NTHANDLE handle, u
776                          in_uint32(in, pser_inf->write_total_timeout_multiplier);                          in_uint32(in, pser_inf->write_total_timeout_multiplier);
777                          in_uint32(in, pser_inf->write_total_timeout_constant);                          in_uint32(in, pser_inf->write_total_timeout_constant);
778                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_TIMEOUTS read timeout %d %d %d\n",                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_TIMEOUTS read timeout %d %d %d\n",
779                              pser_inf->read_interval_timeout,                                        pser_inf->read_interval_timeout,
780                              pser_inf->read_total_timeout_multiplier,                                        pser_inf->read_total_timeout_multiplier,
781                              pser_inf->read_total_timeout_constant));                                        pser_inf->read_total_timeout_constant));
782                          break;                          break;
783                  case SERIAL_GET_TIMEOUTS:                  case SERIAL_GET_TIMEOUTS:
784                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_TIMEOUTS read timeout %d %d %d\n",                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_TIMEOUTS read timeout %d %d %d\n",
785                              pser_inf->read_interval_timeout,                                        pser_inf->read_interval_timeout,
786                              pser_inf->read_total_timeout_multiplier,                                        pser_inf->read_total_timeout_multiplier,
787                              pser_inf->read_total_timeout_constant));                                        pser_inf->read_total_timeout_constant));
788    
789                          out_uint32(out, pser_inf->read_interval_timeout);                          out_uint32(out, pser_inf->read_interval_timeout);
790                          out_uint32(out, pser_inf->read_total_timeout_multiplier);                          out_uint32(out, pser_inf->read_total_timeout_multiplier);
# Line 779  serial_device_control(NTHANDLE handle, u Line 793  serial_device_control(NTHANDLE handle, u
793                          out_uint32(out, pser_inf->write_total_timeout_constant);                          out_uint32(out, pser_inf->write_total_timeout_constant);
794                          break;                          break;
795                  case SERIAL_GET_WAIT_MASK:                  case SERIAL_GET_WAIT_MASK:
796                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_WAIT_MASK %X\n", pser_inf->wait_mask);                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_WAIT_MASK %X\n",
797                          out_uint32(out, pser_inf->wait_mask));                                        pser_inf->wait_mask));
798                            out_uint32(out, pser_inf->wait_mask);
799                          break;                          break;
800                  case SERIAL_SET_WAIT_MASK:                  case SERIAL_SET_WAIT_MASK:
801                          in_uint32(in, pser_inf->wait_mask);                          in_uint32(in, pser_inf->wait_mask);
802                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_WAIT_MASK %X\n", pser_inf->wait_mask));                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_WAIT_MASK %X\n",
803                                          pser_inf->wait_mask));
804                          break;                          break;
805                  case SERIAL_SET_DTR:                  case SERIAL_SET_DTR:
806                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_DTR\n"));                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_SET_DTR\n"));
# Line 839  serial_device_control(NTHANDLE handle, u Line 855  serial_device_control(NTHANDLE handle, u
855                          out_uint32_le(out, 0);  /* Hold reasons */                          out_uint32_le(out, 0);  /* Hold reasons */
856    
857                          result = 0;                          result = 0;
858    #ifdef TIOCINQ
859                          ioctl(handle, TIOCINQ, &result);                          ioctl(handle, TIOCINQ, &result);
860    #endif
861                          out_uint32_le(out, result);     /* Amount in in queue */                          out_uint32_le(out, result);     /* Amount in in queue */
862                          if (result)                          if (result)
863                                  DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS in queue %d\n", result));                                  DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS in queue %d\n",
864                                                  result));
865    
866                          result = 0;                          result = 0;
867    #ifdef TIOCOUTQ
868                          ioctl(handle, TIOCOUTQ, &result);                          ioctl(handle, TIOCOUTQ, &result);
869    #endif
870                          out_uint32_le(out, result);     /* Amount in out queue */                          out_uint32_le(out, result);     /* Amount in out queue */
871                          if (result)                          if (result)
872                                  DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS out queue %d\n", result));                                  DEBUG_SERIAL(("serial_ioctl -> SERIAL_GET_COMMSTATUS out queue %d\n", result));
# Line 869  serial_device_control(NTHANDLE handle, u Line 890  serial_device_control(NTHANDLE handle, u
890                                  rdpdr_abort_io(handle, 3, STATUS_CANCELLED);                                  rdpdr_abort_io(handle, 3, STATUS_CANCELLED);
891                          break;                          break;
892                  case SERIAL_WAIT_ON_MASK:                  case SERIAL_WAIT_ON_MASK:
893                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_WAIT_ON_MASK %X\n", pser_inf->wait_mask));                          DEBUG_SERIAL(("serial_ioctl -> SERIAL_WAIT_ON_MASK %X\n",
894                                          pser_inf->wait_mask));
895                          pser_inf->event_pending = 1;                          pser_inf->event_pending = 1;
896                          if (serial_get_event(handle, &result))                          if (serial_get_event(handle, &result))
897                          {                          {
# Line 917  serial_get_event(NTHANDLE handle, uint32 Line 939  serial_get_event(NTHANDLE handle, uint32
939          if (index < 0)          if (index < 0)
940                  return False;                  return False;
941    
942    #ifdef TIOCINQ
943          pser_inf = (SERIAL_DEVICE *) g_rdpdr_device[index].pdevice_data;          pser_inf = (SERIAL_DEVICE *) g_rdpdr_device[index].pdevice_data;
944    
   
945          ioctl(handle, TIOCINQ, &bytes);          ioctl(handle, TIOCINQ, &bytes);
946    
947          if (bytes > 0)          if (bytes > 0)
# Line 955  serial_get_event(NTHANDLE handle, uint32 Line 977  serial_get_event(NTHANDLE handle, uint32
977          {          {
978                  pser_inf->event_rlsd = 0;                  pser_inf->event_rlsd = 0;
979          }          }
980    #endif
981    
982    #ifdef TIOCOUTQ
983          ioctl(handle, TIOCOUTQ, &bytes);          ioctl(handle, TIOCOUTQ, &bytes);
984          if ((bytes == 0)          if ((bytes == 0)
985              && (pser_inf->event_txempty > 0) && (pser_inf->wait_mask & SERIAL_EV_TXEMPTY))              && (pser_inf->event_txempty > 0) && (pser_inf->wait_mask & SERIAL_EV_TXEMPTY))
# Line 967  serial_get_event(NTHANDLE handle, uint32 Line 990  serial_get_event(NTHANDLE handle, uint32
990                  ret = True;                  ret = True;
991          }          }
992          pser_inf->event_txempty = bytes;          pser_inf->event_txempty = bytes;
993    #endif
994    
995          ioctl(handle, TIOCMGET, &bytes);          ioctl(handle, TIOCMGET, &bytes);
996          if ((bytes & TIOCM_DSR) != pser_inf->event_dsr)          if ((bytes & TIOCM_DSR) != pser_inf->event_dsr)
# Line 975  serial_get_event(NTHANDLE handle, uint32 Line 998  serial_get_event(NTHANDLE handle, uint32
998                  pser_inf->event_dsr = bytes & TIOCM_DSR;                  pser_inf->event_dsr = bytes & TIOCM_DSR;
999                  if (pser_inf->wait_mask & SERIAL_EV_DSR)                  if (pser_inf->wait_mask & SERIAL_EV_DSR)
1000                  {                  {
1001                          DEBUG_SERIAL(("event -> SERIAL_EV_DSR %s\n", (bytes & TIOCM_DSR) ? "ON" : "OFF"));                          DEBUG_SERIAL(("event -> SERIAL_EV_DSR %s\n",
1002                                          (bytes & TIOCM_DSR) ? "ON" : "OFF"));
1003                          *result |= SERIAL_EV_DSR;                          *result |= SERIAL_EV_DSR;
1004                          ret = True;                          ret = True;
1005                  }                  }
# Line 986  serial_get_event(NTHANDLE handle, uint32 Line 1010  serial_get_event(NTHANDLE handle, uint32
1010                  pser_inf->event_cts = bytes & TIOCM_CTS;                  pser_inf->event_cts = bytes & TIOCM_CTS;
1011                  if (pser_inf->wait_mask & SERIAL_EV_CTS)                  if (pser_inf->wait_mask & SERIAL_EV_CTS)
1012                  {                  {
1013                          DEBUG_SERIAL((" EVENT-> SERIAL_EV_CTS %s\n", (bytes & TIOCM_CTS) ? "ON" : "OFF"));                          DEBUG_SERIAL((" EVENT-> SERIAL_EV_CTS %s\n",
1014                                          (bytes & TIOCM_CTS) ? "ON" : "OFF"));
1015                          *result |= SERIAL_EV_CTS;                          *result |= SERIAL_EV_CTS;
1016                          ret = True;                          ret = True;
1017                  }                  }

Legend:
Removed from v.795  
changed lines
  Added in v.865

  ViewVC Help
Powered by ViewVC 1.1.26