“信号量超时期限已过";USB连接错误 [英] "The semaphore timeout period has expired" error for USB connection

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

问题描述

我收到此错误...

信号量超时期限已过.

在这条线上……

ThePorts.ActivePort1.Open();

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.

串行端口是连接蓝牙的 USB.

The serial port is a USB with a BlueTooth connected.

我认为这家伙遇到了一个非常相似的问题,但不是在 C# 中

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

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

尽我所能估计,我已经阅读了他的整个问题,以及由此产生的评论和答案,但我真的无法弄清楚是哪一个解决了他的问题,或者 C# 是否与他所经历的有很大不同.

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天全站免登陆