We have been using DM365 DVR RDK and recently have the needs to take keyboard inputs at the end of system bring-up messages as shown below:
(more messages above this point....)
DRV:PLAY blockSize = 1024,sampleRate = 8000
DRV:REC blockSize = 8192,sampleRate = 8000
DRV:PLAY blockSize = 1024,sampleRate = 8000
MCVIP: TVP5158 set audio volume[8] for channel[0]
MCVIP: Start DONE !!!
The problem is, whether I use C code (in av_capture/application/dvr/dm365dvr/src/main.c file) or C++ code (in uimain.cxx file) to implement 'wait for keyboard input" such as the following, it never worked:
scanf(" %c",&key);
putchar(key);
puts("\nWe are ending code...\n");
The execution of program did not stop for keyboard input and went ahead to print the following messages by "putchar" and "puts":
DRV:PLAY blockSize = 1024,sampleRate = 8000
DRV:REC blockSize = 8192,sampleRate = 8000
DRV:PLAY blockSize = 1024,sampleRate = 8000
MCVIP: TVP5158 set audio volume[8] for channel[0]
MCVIP: Start DONE !!!
@
We are ending code...
At the end of "MCVIP: Start DONE !!!", the system shows "login:" prompt. If I log in as "root" and it will take me to shell prompt and if I have a simple program with the above three lines of code, the program will wait for keyboard input as expected when executed from shell prompt.
It seems to me that the keyboard function is disabled till it exits to shell prompt? or am I missing something?
Any help would be appreciated,
Thanks,