“信号灯超时时间段已到期”。 USB连接错误 [英] "The semaphore timeout period has expired" error for USB connection

查看:147
本文介绍了“信号灯超时时间段已到期”。 USB连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到此错误...


信号灯超时时间已过期。


在此行...


ThePorts.ActivePort1.Open();


...但是我只是偶尔得到它。当它发生时,它会一遍又一遍地发生。然后问题消失了好几个小时或几天,然后又回来了。



串行端口是连接了蓝牙的USB。



我认为这个人有一个非常相似的问题,但在C#中没有。

使用usbser.sys在SerialPort.Open/DeviceIoControl/GetcommState上冻结



据我所估计,我已经阅读了他的全部问题,以及所得到的评论和答案,但我真的无法弄清楚哪个人解决了他的问题,或者如果C#与他所经历的明显不同。



感谢无知的帮助。这是实际发生的代码。

  public static void Open_ActivePortWeWillUse(String Drone_StringNameFromUser)
{
SerialPort TempSerialPort =新的SerialPort(Drone_StringNameFromUser,(int)SerialPortSpeed);

ThePorts.ActivePort1 = TempSerialPort;

ThePorts.ActivePort1.DataBits = 8;
ThePorts.ActivePort1.Parity = Parity.None;
ThePorts.ActivePort1.StopBits = StopBits.One;

ThePorts.ActivePort1.DataReceived + =新的SerialDataReceivedEventHandler(OurBackGroundSerialPortReceiver);

ThePorts.ActivePort1.Open(); //有时错误在这里
}


解决方案

如果您有网络延迟或互联网或本地网络问题,也可能会出现此错误。对方连接失败的桥接连接也可能是罪魁祸首。


I'm getting this error...

The semaphore timeout period has expired.

On this line...

ThePorts.ActivePort1.Open();

...but I only get it from time to time. When it happens, it happens over and over again. Then the problem goes away, for hours or days, then it comes back.

The serial port is a USB with a BlueTooth connected.

I think this guy was having a very similar problem, but not in C#

Freeze on SerialPort.Open / DeviceIoControl / GetcommState with usbser.sys

As best I can estimate, I have read his entire problem, and the resulting comments, and the answer, but I really can't figure out which one fixed his problem, or if C# is significantly different from what he was experiencing.

Thanks for any help for the clueless. This is the actual code where it's happening.

public static void Open_ActivePortWeWillUse(String Drone_StringNameFromUser)
{
    SerialPort TempSerialPort = new SerialPort(Drone_StringNameFromUser, (int) SerialPortSpeed);

    ThePorts.ActivePort1 = TempSerialPort;

    ThePorts.ActivePort1.DataBits = 8;
    ThePorts.ActivePort1.Parity = Parity.None;
    ThePorts.ActivePort1.StopBits = StopBits.One;

    ThePorts.ActivePort1.DataReceived += new SerialDataReceivedEventHandler(OurBackGroundSerialPortReceiver);

    ThePorts.ActivePort1.Open();  // "Sometimes" Error hits here
}

解决方案

This error could also appear if you are having network latency or internet or local network problems. Bridged connections that have a failing counterpart may be the culprit as well.

这篇关于“信号灯超时时间段已到期”。 USB连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆