I am using the WICED SDK 3.3.1.
I need to be able to poll the serial input at stdin and not stop if nothing is present. I can't use getchar() because it hangs waiting for the next character. There is no kbhit() function that I can find like Windows has. I also tried incorporating POSIX-compliant code for implementing the equivalent of kbhit():
FD_SET(0, &rdset); // 0 is the file descriptor for stdin
timeout.tv_sec = 0;
timeout.tv_usec = 0;
return select(1, &rdset, NULL, NULL, &timeout); // 1 is one more than highest descriptor to check (0)
but I need a select() function which I also cannot find in the library.
Has anyone implemented this on this platform yet.
You need to build your own low level routine using the basic uart functions. Stdio support in the sdk is for basic debugging use only. Refer to the console app for similar usage. But for generic support using the low level read and write uart is necessary.