Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 144211 Details for
Bug 220498
Driver for Prolific PL2303 chipset doesn't support RI serial line.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
USB to Serial adapter status line test program.
adapter_test.c (text/plain), 2.45 KB, created by
Charles Sullivan
on 2006-12-21 19:53:56 UTC
(
hide
)
Description:
USB to Serial adapter status line test program.
Filename:
MIME Type:
Creator:
Charles Sullivan
Created:
2006-12-21 19:53:56 UTC
Size:
2.45 KB
patch
obsolete
>#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <sys/types.h> >#include <sys/stat.h> >#include <fcntl.h> >#include <sys/ioctl.h> >#include <unistd.h> > > >int main ( int argc, char *argv[] ) >{ > int fd, j, k, drive; > int status, saved; > char cmdline[80]; > > static struct { > char *name; > int pin; > int tiocm; > } inpin[4] = { > { "RI ", 9, TIOCM_RI }, > { "CD ", 1, TIOCM_CD }, > { "DSR", 6, TIOCM_DSR }, > { "CTS", 8, TIOCM_CTS }, > }, outpin[2] = { > { "DTR", 4, TIOCM_DTR }, > { "RTS", 7, TIOCM_RTS }, > }; > > enum {DTR, RTS}; > > drive = DTR; > > if ( argc != 2 ) { > fprintf(stderr, "Usage: %s serial_port\n", argv[0]); > return 1; > } > > /* Set up reasonable port parameters */ > sprintf(cmdline, "stty -F %s 4800 cs8 raw cread clocal -parenb -cstopb -echo", argv[1]); > if ( system(cmdline) < 0 ) { > fprintf(stderr, "system() failed with stty on port %s\n", argv[1]); > return 1; > } > usleep(100000); > > /* Open the port */ > if ( (fd = open(argv[1], O_RDWR | O_NONBLOCK)) < 0 ) { > fprintf(stderr, "Unable to open port %s\n", argv[1]); > return 1; > } > > if ( ioctl(fd, TIOCMGET, &status) < 0 ) { > fprintf(stderr, > "Status lines are not supported by the serial port hardware.\n"); > return 1; > } > > saved = status; > > printf("Jumpered pin %2d to", outpin[drive].pin); > for ( k = 0; k < 4; k++ ) > printf(" %2d", inpin[k].pin); > printf("\n"); > > printf("Status Line: %-3s => ", outpin[drive].name); > for ( k = 0; k < 4; k++ ) > printf(" %-3s", inpin[k].name); > printf("\n --- --- --- --- ---\n"); > > > for ( j = 0; j < 2; j++ ) { > status &= ~(outpin[drive].tiocm); > ioctl(fd, TIOCMSET, &status); > usleep(100000); > > ioctl(fd, TIOCMGET, &status); > > printf(" %3s => ", > ((status & outpin[drive].tiocm) ? "SET" : "clr")); > for ( k = 0; k < 4; k++ ) { > printf(" %3s ", > ((status & inpin[k].tiocm) ? "SET" : "clr")); > } > printf("\n"); > > status |= outpin[drive].tiocm; > ioctl(fd, TIOCMSET, &status); > usleep(100000); > > ioctl(fd, TIOCMGET, &status); > > printf(" %3s => ", > ((status & outpin[drive].tiocm) ? "SET" : "clr")); > for ( k = 0; k < 4; k++ ) { > printf(" %3s ", > ((status & inpin[k].tiocm) ? "SET" : "clr")); > } > printf("\n"); > } > printf("\n"); > > ioctl(fd, TIOCMSET, &saved); > > return 0; >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 220498
: 144211