Search code examples
ckernelwindows-cedeviceiocontrol

How to read data form WinCE 5.0 's Debug Serial port?


In my project, I need to input some command into my WinCE device through the debug Serial Port. But I found that I can only use "printf" or "RETAILMSG" to output my debug info but I can't simply call "scanf" to get the data of debug Serial Port.

By look up the MSDN, I have found a function named "OEMReadDebugByte". It is a KERNEL function of WinCE, but when I try to call this function in my WinCE application, the Platform Builder post "error LNK2019: unresolved external symbol OEMReadDebugByte referenced in function wmain"

Can I use insert a case in the KernelIoControl? How ? Which file define the "KernelIoControl"?

Or... there are any solutions else?

Thanks a lot!!!

Thank you!


Solution

  • This function is meant to be used in the bootloader to read input from the user to set-up bot mode, network configuration etc. It's not used by the kernel. Serial is used for debug output and there is no easy way to change this. What you may do is to implement an application that provide a serial console and change your BSP removing serial debug and changing it to a system that sends this information to the application (using shared memory or something like this) that then outputs it on the serial port console. Implementing it will require some knowledge of the OAL and BSP structure and features.