Re: usb-serial: tcgetattr, tcsetattr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greg

> I didn't see anything obvious, but I just realized, have you tried this
> with any other usb to serial device to see if the same thing happens
> there or not?
I tried using the pl2303.c. I observer the same behavior, i.e. tcgetattr results
in a call to ioctl with 0x5401() as command (TCGETS). 
Does it mean that the mistake is in my testing program ?

Here the code snippet opening the USB serial device and the calling tcgetattr.

void *TxThread(void *threadid)
{
	long tid;
	tid = (long)threadid;
	int fdtx;
	struct termios oldtermios,newtermios;
	int retval;
	
	printf("TxThread, thread #%ld!\n", tid);
	
	// open device 
	fdtx = open( deviceFileName, O_RDWR );
	if (fdtx < 0)
	{
		CONSOLE("Could not open device '%s'(%d)", deviceFileName,fdtx);
		retval = EDEVICE;
		goto tx_exit;
	}
	
	CONSOLE("Device '%s' (%d)  opened\n",deviceFileName,fdtx);
	
	tcgetattr(fdtx,&oldtermios); /* save current port settings */

....

Tilman


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux