Re: Issue with CDC driver when receiving the data character 0x1A

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

 



On 01/27/2011 08:34 AM, Toan Pham wrote:
I had this same problem 2 years ago when i was using the ACM_CDC
driver to interface with a uC using LUFA usb library.  As far as i can
remember,  I sniffed the data using usb_mon and saw that the data came
through; but somehow the character (13 ordinal) got filtered out
through usb serial, cdc or tty layer.  I wasn't sure the real cause,
and so I programmed the uC to add 48 to all transfer byte, and
subtract 48 on the host application.

It would be nice to know the root cause.

You need to put your tty (in this case /dev/ttyACM0) into raw mode, so that the tty layer doesn't process the input.

Do this from the command line with:
    stty -F /dev/ttyACM0 raw

or from inside your program with:
        #include <termios.h>
        #include <unistd.h>
        ...
        tcgetattr(fd, &term);
        cfmakeraw(&term);
        tcsetattr(fd, TCSANOW, &term);

See the termios man page for more details.

Alan.



--
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