Raw mode

Hi,

How is it possible to switch the console to raw mode inside my program ?
I’ve tried an alternate solution switching the console in raw mode
using : stty +raw, but inside my program my ‘read’ function exit
immediatly after the first character, I want three characters.
fd = open ("/dev/ttyp0", O_RDWR);
read (fd, buffer, 3);
What’s wrong ? and how to select raw mode ?
Thanks,
AR

That’s the way raw mode works. To get more than one character at a time,
you would have to type really fast under the default timing options for a
tty device like that. Try for example hitting a key that sends more than
one byte, such as a function key.

dB

“SECMATNT” <NOSPAMinfo.secmat@wanadoo.fr> wrote in message
news:afpqou$r9a$1@inn.qnx.com

Hi,

How is it possible to switch the console to raw mode inside my program ?
I’ve tried an alternate solution switching the console in raw mode
using : stty +raw, but inside my program my ‘read’ function exit
immediatly after the first character, I want three characters.
fd = open ("/dev/ttyp0", O_RDWR);
read (fd, buffer, 3);
What’s wrong ? and how to select raw mode ?
Thanks,
AR

Thanks,
And how is it possible to switch to raw mode when edit mode
inside my program (for example devctl ? ) instead of
running the stty command before running my program.
Best Regards,
AR

David Bacon <dbacon@qnx.com> a écrit dans le message :
afv8bd$2r5$1@inn.qnx.com

That’s the way raw mode works. To get more than one character at a time,
you would have to type really fast under the default timing options for
a
tty device like that. Try for example hitting a key that sends more than
one byte, such as a function key.

dB

“SECMATNT” <> NOSPAMinfo.secmat@wanadoo.fr> > wrote in message
news:afpqou$r9a$> 1@inn.qnx.com> …
Hi,

How is it possible to switch the console to raw mode inside my program ?
I’ve tried an alternate solution switching the console in raw mode
using : stty +raw, but inside my program my ‘read’ function exit
immediatly after the first character, I want three characters.
fd = open ("/dev/ttyp0", O_RDWR);
read (fd, buffer, 3);
What’s wrong ? and how to select raw mode ?
Thanks,
AR
\

There’s a nice example of how to do that on the tcsetattr() documentation
page. (Or you could just invoke the stty command from within your program
using “system”.)

dB

“SECMATNT” <NOSPAMinfo.secmat@wanadoo.fr> wrote in message
news:ag0r7r$6kr$1@inn.qnx.com

Thanks,
And how is it possible to switch to raw mode when edit mode
inside my program (for example devctl ? ) instead of
running the stty command before running my program.
Best Regards,
AR

David Bacon <> dbacon@qnx.com> > a écrit dans le message :
afv8bd$2r5$> 1@inn.qnx.com> …
That’s the way raw mode works. To get more than one character at a
time,
you would have to type really fast under the default timing options
for
a
tty device like that. Try for example hitting a key that sends more
than
one byte, such as a function key.

dB

“SECMATNT” <> NOSPAMinfo.secmat@wanadoo.fr> > wrote in message
news:afpqou$r9a$> 1@inn.qnx.com> …
Hi,

How is it possible to switch the console to raw mode inside my program
?
I’ve tried an alternate solution switching the console in raw mode
using : stty +raw, but inside my program my ‘read’ function exit
immediatly after the first character, I want three characters.
fd = open ("/dev/ttyp0", O_RDWR);
read (fd, buffer, 3);
What’s wrong ? and how to select raw mode ?
Thanks,
AR


\

That works fine,
Thanks,
AR

David Bacon <dbacon@qnx.com> a écrit dans le message :
ag1lhs$qjm$1@inn.qnx.com

There’s a nice example of how to do that on the tcsetattr() documentation
page. (Or you could just invoke the stty command from within your program
using “system”.)

dB

“SECMATNT” <> NOSPAMinfo.secmat@wanadoo.fr> > wrote in message
news:ag0r7r$6kr$> 1@inn.qnx.com> …
Thanks,
And how is it possible to switch to raw mode when edit mode
inside my program (for example devctl ? ) instead of
running the stty command before running my program.
Best Regards,
AR

David Bacon <> dbacon@qnx.com> > a écrit dans le message :
afv8bd$2r5$> 1@inn.qnx.com> …
That’s the way raw mode works. To get more than one character at a
time,
you would have to type really fast under the default timing options
for
a
tty device like that. Try for example hitting a key that sends more
than
one byte, such as a function key.

dB

“SECMATNT” <> NOSPAMinfo.secmat@wanadoo.fr> > wrote in message
news:afpqou$r9a$> 1@inn.qnx.com> …
Hi,

How is it possible to switch the console to raw mode inside my
program
?
I’ve tried an alternate solution switching the console in raw mode
using : stty +raw, but inside my program my ‘read’ function exit
immediatly after the first character, I want three characters.
fd = open ("/dev/ttyp0", O_RDWR);
read (fd, buffer, 3);
What’s wrong ? and how to select raw mode ?
Thanks,
AR




\