- unless (defined $fifo) { open($fifo,"< $fifofile"); }
- unless (defined $ttyS) { open($ttyS,"< $door_ttyS"); }
+ unless (defined $ttyusb) {
+ print "open usb\n";
+ sysopen($ttyusb, $door_ttyusb_dev, O_RDWR | O_NONBLOCK);
+ $ttyusb->autoflush(1);
+ my $termios = POSIX::Termios->new;
+ $termios->getattr(fileno $ttyusb);
+ $termios->setispeed( &POSIX::B9600 );
+ $termios->setospeed( &POSIX::B9600 );
+ #$termios->setcflag( $termios->getcflag & ~(&POSIX::PARENB | &POSIX::PARODD) & (~&POSIX::CSIZE | &POSIX::CS8));
+ $termios->setattr(fileno $ttyusb);
+ print "x\n";
+ }
+ unless (defined $fifo) {print "open fifo\n"; sysopen($fifo,$fifofile, O_RDONLY | O_NONBLOCK); print "x\n";}