Howdy,

     I am not sure if the following problem is due to my
misunderstanding but probably it does.  I am trying to use the belkin
usb to serial converter.  But it does not seem to work.  I have been
using the following code 

void init_term_dev(int fd) {
        
        struct termios term;
                                
        //Init the terminal device to
        //correct baud rate
                                        
        term.c_cflag = 0;
        term.c_cflag = CREAD | CS8 | B9600 | CRTSCTS;
        term.c_iflag = 0;
        term.c_oflag = 0;
        term.c_lflag = 0;       

        tcflush(fd, TCIFLUSH);
                
        if(tcsetattr(fd, TCSANOW, &term) < 0)
                perror("problem setting ttyUSB0 attributes");

        }

int main(int argc, char* argv[]) {

        int fd_p = open("/dev/ttyUSB0", O_RDWR, 0);

        char buf[10];

        init_term_dev(fd_p);
                                
        write(fd_p, "/B 2", 5);

        close(fd_p);

        return 0;

}

However even if this code reflects some fundamental misunderstanding of
UNIX serial programming the command echo "Howdy" > /dev/ttyUSB0 does not work either.

By does not work I mean I cannot read these characters off another
serial port connected via null-modem cable.  In the logs I get the
following messages

Oct 27 12:34:42 local kernel: usbserial.c: serial_open
Oct 27 12:34:42 local kernel: belkin_sa.c: belkin_sa_open port 0
Oct 27 12:34:42 local kernel: usbserial.c: serial_ioctl - port 0, cmd 0x540b
Oct 27 12:34:42 local kernel: belkin_sa.c: belkin_sa_ioctl arg not supported - 0x540b
Oct 27 12:34:42 local kernel: usbserial.c: serial_ioctl - port 0, cmd 0x5402
Oct 27 12:34:42 local kernel: belkin_sa.c: belkin_sa_ioctl arg not supported - 0x5402
Oct 27 12:34:42 local kernel: usbserial.c: serial_set_termios - port 0
Oct 27 12:34:42 local kernel: usbserial.c: serial_ioctl - port 0, cmd 0x5401
Oct 27 12:34:42 local kernel: belkin_sa.c: belkin_sa_ioctl arg not supported - 0x5401
Oct 27 12:34:42 local kernel: usbserial.c: serial_write - port 0, 5 byte(s)
Oct 27 12:34:42 local kernel: usbserial.c: generic_write - port 0
Oct 27 12:34:42 local kernel: usbserial.c: generic_write - length = 5, data = 2f 42 20 
32 0d 
Oct 27 12:34:42 local kernel: usbserial.c: serial_close - port 0
Oct 27 12:34:42 local kernel: belkin_sa.c: belkin_sa_close port 0
Oct 27 12:34:42 local kernel: usbserial.c: generic_write_bulk_callback - port 0
Oct 27 12:34:42 local kernel: usbserial.c: generic_write_bulk_callback - nonzero write 
bulk status received: -2
Oct 27 12:34:42 local kernel: usbserial.c: generic_read_bulk_callback - port 0
Oct 27 12:34:42 local kernel: usbserial.c: generic_read_bulk_callback - nonzero read 
bulk status received: -2

After running the code above.  So obviously one of my commands are
incorrect and I am generating an -ENOENT error.  However if I just echo
a command to the device I get the same errors minus the cmd not
supported part.  So my question is obvious...What is wrong here?

I am using the 2.4.18 kernel with debian woody.  I appreciate the help

Fred

        
-- 
Markets can remain irrational longer than you can remain solvent
                                        -John Maynard Keynes

For a copy of my pgp public ket visit
URL: http://norby.dyndns.org:8080

Attachment: msg05216/pgp00000.pgp
Description: PGP signature

Reply via email to