/[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 588 by n-ki, Thu Jan 29 11:47:14 2004 UTC revision 592 by n-ki, Fri Jan 30 14:10:32 2004 UTC
# Line 399  serial_create(uint32 device_id, uint32 a Line 399  serial_create(uint32 device_id, uint32 a
399    
400          tcsetattr(serial_fd, TCSANOW, ptermios);          tcsetattr(serial_fd, TCSANOW, ptermios);
401  */  */
402    
403          *handle = serial_fd;          *handle = serial_fd;
404    
405            /* all read and writes should be non blocking */
406            if (fcntl(*handle, F_SETFL, O_NONBLOCK) == -1)
407                    perror("fcntl");
408    
409          return STATUS_SUCCESS;          return STATUS_SUCCESS;
410  }  }
411    
# Line 418  serial_read(HANDLE handle, uint8 * data, Line 424  serial_read(HANDLE handle, uint8 * data,
424          SERIAL_DEVICE *pser_inf;          SERIAL_DEVICE *pser_inf;
425          struct termios *ptermios;          struct termios *ptermios;
426    
427  //      timeout = 90;          timeout = 90;
428          pser_inf = get_serial_info(handle);          pser_inf = get_serial_info(handle);
429          ptermios = pser_inf->ptermios;          ptermios = pser_inf->ptermios;
430    
 #if 0  
431          // Set timeouts kind of like the windows serial timeout parameters. Multiply timeout          // Set timeouts kind of like the windows serial timeout parameters. Multiply timeout
432          // with requested read size          // with requested read size
433          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)
# Line 450  serial_read(HANDLE handle, uint8 * data, Line 455  serial_read(HANDLE handle, uint8 * data,
455                  ptermios->c_cc[VMIN] = 1;                  ptermios->c_cc[VMIN] = 1;
456          }          }
457          tcsetattr(handle, TCSANOW, ptermios);          tcsetattr(handle, TCSANOW, ptermios);
458  #endif  
459    
460          *result = read(handle, data, length);          *result = read(handle, data, length);
461    
462          return STATUS_SUCCESS;          return STATUS_SUCCESS;
463  }  }
464    

Legend:
Removed from v.588  
changed lines
  Added in v.592

  ViewVC Help
Powered by ViewVC 1.1.26