简体   繁体   English

在Windows C中切换串行端口上的CD(RLSD)信号线

[英]Toggling the CD (RLSD) signal line on a serial port in Windows C

I am trying to set the Carrier Detect (Receive Line Signal Detect) pin on a serial port being controlled by my Windows application. 我正在尝试在Windows应用程序控制的串行端口上设置载波检测(接收线路信号检测)引脚。 I am already able to set the RTS line high using this function: 我已经可以使用以下功能将RTS线设置为高电平:

EscapeCommFunction(handle, SETRTS);

and then subsequently clear it by using: 然后使用以下命令清除它:

EscapeCommFunction(handle, CLRRTS);

I want to be able to do this exact same thing with the CD line, but no such SET/CLR flags exist for the EscapeCommFunction. 我希望能够对CD行执行完全相同的操作,但是EscapeCommFunction没有这样的SET / CLR标志。

The PC serial port was designed from the viewpoint of a terminal, not a modem. PC串行端口是从终端而非调制解调器的角度设计的。 The CD signal is an output from a modem and an input to a terminal. CD信号是调制解调器的输出,也是终端的输入。 Even if the port hardware allows you to change the direction (of which I'm skeptical) the standard interface would not be programmed that way. 即使端口硬件允许您更改方向(我对此表示怀疑),也不会以这种方式对标准接口进行编程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM