2010-07-06 12:03:16 ttyGS0 in raw mode
Nikolay Chokoev (IRELAND)
Message: 90966
Hi,
I try to send/get binary data trough USB Gadget Serial.
When I put it to raw mode:
fd_gs = open("/dev/ttyGS0", O_RDWR | O_NONBLOCK, 0);
if (fd_gs == -1) {
perror("ttyGS0 open");
exit(1);
}
if( tcgetattr(fd_gs, &t) < 0)
{
perror("tcgetattr");
return 1;
}
t.c_lflag &= ~(ICANON | ECHO);
t.c_cc[VMIN] = 0;
t.c_cc[VTIME] = 0;
tcsetattr(fd_gs, TCSANOW, &t);
I have no data received.
When I leave it in canonical mode it looks like it's working fine.
What's wrong with the setup? Can it operate in raw mode?
QuoteReplyEditDelete
2010-07-06 12:19:21 Re: ttyGS0 in raw mode
Mike Frysinger (UNITED STATES)
Message: 90970
if you dont set VMIN/VTIME, does it make a difference ?
you can also verify your settings by running `stty -F /dev/ttyGS0` from another console
QuoteReplyEditDelete
2010-07-06 12:36:05 Re: ttyGS0 in raw mode
Nikolay Chokoev (IRELAND)
Message: 90971
No diference if VMIN/VMAX are set or not.
The stty shows diference. After loading the program I have
'-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke'.
This is the output after the app is loaded:
speed 9600 baud;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-brkint -imaxbel
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
QuoteReplyEditDelete
2010-07-06 12:37:07 Re: ttyGS0 in raw mode
Nikolay Chokoev (IRELAND)
Message: 90972
..forgot, I've changed
t.c_lflag = 0;