Home/Support/Support Forum/SOLVED: read from stdin non-block
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

SOLVED: read from stdin non-block

0 votes
Hello,

I'm not able to read from stdin non-blocking.

If I use:
length = fread(buffer, 1, 10, stdin);
My code hangs until buffer is full.

If I use:
serEopen(115200);
serEdatabits(PARAM_8BIT);
serEparity(PARAM_NOPARITY | PARAM_1STOP);
serXrdFlush(SER_PORT_E);

length = serXread(SER_PORT_E, buffer, 10, 0);

printf stops working.... I use printf many times in my code.

Can somebody help me? Thanks in advance.
Martin
asked May 31, 2016 in Rabbit Software by Martin.work New to the Community (4 points)
edited Jun 1, 2016 by Martin.work

Please log in or register to answer this question.

1 Answer

0 votes
Hello,

I made a mistake. The second way is working if you set the debug serial output to PortE

#define STDIO_DEBUG_SERIAL SEDR

So I don't need help anymore.


Martin
answered Jun 1, 2016 by Martin.work New to the Community (4 points)
...