/[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 755 by stargo, Tue Aug 24 21:37:25 2004 UTC revision 757 by stargo, Wed Aug 25 00:43:48 2004 UTC
# Line 2  Line 2 
2  #include <fcntl.h>  #include <fcntl.h>
3  #include <termios.h>  #include <termios.h>
4  #include <strings.h>  #include <strings.h>
5    #include <sys/ioctl.h>
6  #include "rdesktop.h"  #include "rdesktop.h"
7    
8  #define FILE_DEVICE_SERIAL_PORT         0x1b  #define FILE_DEVICE_SERIAL_PORT         0x1b
# Line 73  Line 74 
74  #define SERIAL_EV_EVENT1           0x0800       // Provider specific event 1  #define SERIAL_EV_EVENT1           0x0800       // Provider specific event 1
75  #define SERIAL_EV_EVENT2           0x1000       // Provider specific event 2  #define SERIAL_EV_EVENT2           0x1000       // Provider specific event 2
76    
77    /* Modem Status */
78    #define SERIAL_MS_CTS 0x10
79    #define SERIAL_MS_DSR 0x20
80    #define SERIAL_MS_RNG 0x40
81    #define SERIAL_MS_CAR 0x80
82    
83  #ifndef CRTSCTS  #ifndef CRTSCTS
84  #define CRTSCTS 0  #define CRTSCTS 0
85  #endif  #endif
# Line 519  serial_device_control(HANDLE handle, uin Line 526  serial_device_control(HANDLE handle, uin
526  #if 0  #if 0
527          int flush_mask, purge_mask;          int flush_mask, purge_mask;
528  #endif  #endif
529          uint32 result;          uint32 result, modemstate;
530          uint8 immediate;          uint8 immediate;
531          SERIAL_DEVICE *pser_inf;          SERIAL_DEVICE *pser_inf;
532          struct termios *ptermios;          struct termios *ptermios;
# Line 611  serial_device_control(HANDLE handle, uin Line 618  serial_device_control(HANDLE handle, uin
618                          set_termios(pser_inf, handle);                          set_termios(pser_inf, handle);
619                          break;                          break;
620                  case SERIAL_GET_MODEMSTATUS:                  case SERIAL_GET_MODEMSTATUS:
621                          out_uint32_le(out, 0);  /* Errors */                          modemstate = 0;
622    #ifdef TIOCMGET
623                            ioctl(handle, TIOCMGET, &result);
624                            if (result & TIOCM_CTS)
625                                    modemstate |= SERIAL_MS_CTS;
626                            if (result & TIOCM_DSR)
627                                    modemstate |= SERIAL_MS_DSR;
628                            if (result & TIOCM_RNG)
629                                    modemstate |= SERIAL_MS_RNG;
630                            if (result & TIOCM_CAR)
631                                    modemstate |= SERIAL_MS_CAR;
632    #endif
633                            out_uint32_le(out, modemstate);
634                          break;                          break;
635                  case SERIAL_GET_COMMSTATUS:                  case SERIAL_GET_COMMSTATUS:
636                          out_uint32_le(out, 0);  /* Errors */                          out_uint32_le(out, 0);  /* Errors */

Legend:
Removed from v.755  
changed lines
  Added in v.757

  ViewVC Help
Powered by ViewVC 1.1.26