[PD-cvs] externals/iem/comport/comport comport.c,1.1.1.1,1.2

Winfried Ritsch ritsch at users.sourceforge.net
Wed Apr 13 17:52:46 CEST 2005


Update of /cvsroot/pure-data/externals/iem/comport/comport
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18353

Modified Files:
	comport.c 
Log Message:
Dont fail if no serial device, but dont open.

Index: comport.c
===================================================================
RCS file: /cvsroot/pure-data/externals/iem/comport/comport/comport.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** comport.c	12 Apr 2005 09:14:50 -0000	1.1.1.1
--- comport.c	13 Apr 2005 15:52:43 -0000	1.2
***************
*** 753,760 ****
    fd = open_serial(com_nr,&test);
  
-   if(fd == INVALID_HANDLE_VALUE ){
-     /* postings in open routine */
-     return 0;
-   }
  
    /* Now  nothing really bad could happen so we create the class */
--- 753,756 ----
***************
*** 762,774 ****
    x = (t_comport *)pd_new(comport_class);
  
!   x->comport = com_nr;
!   x->baud = test.baud;
!   x->comhandle = fd;           /* holds the comport handle */
  
  #ifdef NT
- 
    memcpy(&(test.dcb_old),&(x->dcb_old),sizeof(DCB));    // save the old com config 
    memcpy(&(test.dcb),&(x->dcb),sizeof(DCB));       // for the new com config 
- 
  #else  
    /* save the old com and new com config */
--- 758,775 ----
    x = (t_comport *)pd_new(comport_class);
  
!   if(fd == INVALID_HANDLE_VALUE ){
!     /* postings in open routine */
!     x->comport = com_nr;
!     x->baud = test.baud;
!     x->comhandle = fd;           /* holds the comport handle */
!   }
!   else {
!     x->comport = com_nr;
!     x->baud = test.baud;
!     x->comhandle = fd;           /* holds the comport handle */
  
  #ifdef NT
    memcpy(&(test.dcb_old),&(x->dcb_old),sizeof(DCB));    // save the old com config 
    memcpy(&(test.dcb),&(x->dcb),sizeof(DCB));       // for the new com config 
  #else  
    /* save the old com and new com config */
***************
*** 776,779 ****
--- 777,781 ----
    bcopy(&(test.com_termio),&(x->com_termio),sizeof(struct termios));       
  #endif
+   }
  
    x->rxerrors = 0;             /* holds the rx line errors */
***************
*** 786,790 ****
  
    clock_delay(x->x_clock, x->x_deltime);
! 
    return x;
  }
--- 788,792 ----
  
    clock_delay(x->x_clock, x->x_deltime);
!   
    return x;
  }
***************
*** 944,953 ****
    /*
      class_addbang(comport_class, comport_bang
!   */
! 
!   
    class_addmethod(comport_class, (t_method)comport_baud, gensym("baud"), 
! 		  A_FLOAT, 0);
!   
    
    class_addmethod(comport_class, (t_method)comport_bits, gensym("bits"), 
--- 946,952 ----
    /*
      class_addbang(comport_class, comport_bang
!   */  
    class_addmethod(comport_class, (t_method)comport_baud, gensym("baud"), 
! 		  A_FLOAT, 0); 
    
    class_addmethod(comport_class, (t_method)comport_bits, gensym("bits"), 





More information about the Pd-cvs mailing list