Hi,
I am trying to use this device with my linux box
(2.4.19).
i selected this hub (over serial port) becuase of high
baudrate it can support.
now my problem here is, i do not know how to configure
(program) various settings using linux/C, like
Hardware Flow Control, Baudrate, parity, start/Stop
bits.
i set those in my serial port sniffer program using
termios struct and tcsetattr., i am not sure whether
same can be used to set multiple ports of this hub.
and how to verify that, device accepted the settings.
my program //
BAUD = B921600;
DATABITS = CS8;
STOPBITS = 0;
PARITYON = 0;
PARITY = 0;
//open the device(com port) to be non-blocking
(read will return immediately)
sscanf(argv[1],"%s",devicename);
fd = open(devicename, O_RDWR | O_NOCTTY |
O_NONBLOCK);
if (fd < 0) {
perror(devicename);
exit(-1);
}
//install the serial handler before making the
device asynchronous
saio.sa_handler = signal_handler_IO;
sigemptyset(&saio.sa_mask); //saio.sa_mask =
0;
saio.sa_flags = 0;
saio.sa_restorer = NULL;
sigaction(SIGIO,&saio,NULL);
// allow the process to receive SIGIO
fcntl(fd, F_SETOWN, getpid());
// Make the file descriptor asynchronous (the
manual page says only
// O_APPEND and O_NONBLOCK, will work with
F_SETFL...)
fcntl(fd, F_SETFL, FASYNC);
tcgetattr(fd,&oldtio); // save current port
settings
// set new port settings for canonical input
processing
newtio.c_cflag = BAUD | CRTSCTS | DATABITS |
STOPBITS | PARITYON | PARITY | CLOCAL | CREAD;
newtio.c_iflag = IGNPAR;
newtio.c_oflag = 0;
newtio.c_lflag = 0; //ICANON;
newtio.c_cc[VMIN]=1;
newtio.c_cc[VTIME]=0;
tcflush(fd, TCIFLUSH);
tcsetattr(fd,TCSANOW,&newtio);
i appreciate any help on this.
Thanks
Abinash
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users