问题描述
我正在尝试将所有串行数据重定向到VxWorks中的进程。使用以下代码
I am trying to redirect all serial data to a process in VxWorks. Using the following code
fd = open("/tyCo/0", O_RDWR,0);
ioctl(fd, FIOSETOPTIONS, OPT_TERMINAL & ~OPT_7_BIT);
read(fd, line, 100);
提供正确的输入,除了不填充输入的第一个字符,而是将其打印到终端上。因此,如果我输入 Hello,则会打印出 H,并显示line = ello。如果我什么都没输入并按回车键,我会从VxWorks Shell收到提示。
gives the correct input, except the first character entered is not populated, but is printed to the terminal. So if I enter "Hello", "H" is printed out and line="ello". If I don't enter anything and hit the return key, I get a prompt from the VxWorks Shell.
我认为VxWorks Shell正在截获VxWorks Shell的第一个字母。数据。我的猜测是,我只需要将STDIO重定向到新进程,但是所有我发现该文档使用的是ioGlobalStdSet(),而ioGlobalStdSet()在VxWorks 6.4 RTP中不可用。如何重定向STDIO或从进程中杀死VxWorks Shell?
I think that the VxWorks Shell is intercepting the first letter of the data. My guess is that I have to redirect STDIO to the new process only, but all the documentation I've found on that says to use ioGlobalStdSet() which is unavailable in VxWorks 6.4 RTP. How can I either redirect STDIO or kill the VxWorks Shell from my process?
推荐答案
在VxWorks配置和编译过程中禁用Shell会删除问题永久存在。也可以在shell上输入exit来暂时将其禁用。
Disabling the shell during VxWorks configuration and compilation removed the problem permanently. It is also possible to enter exit at the shell to temporarily disable it.
这篇关于重定向VxWorks串行输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!