-
-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
一个莫名其妙的问题 #22
Comments
我好像找到原因了,在我的初始化串口中有如下代码 open返回false,然后,getLastError返回0 . |
open函数的getLastError返回值有问题 能调试一下定位具体问题吗 |
2个问题: //我的初始化串口部分,串口号是控件变量CString portName , 而波特率是控件变量 int m_SerialPortBaudRate
} |
好的 我测试一下 |
最后一个参数停止位应该是itas109::StopBits(0)。
|
Describe the bug
A clear and concise description of what the bug is.
我的的WIN10系统没有这个问题,我朋友的WIN7系统出现一个莫名其妙的问题,MFC程序,COM1串口,在用writedata发送后,断点执行时也能看到说发送了多少字节,这个字节数也是正确的,问题是,硬件没有收到数据,我之后会启动一个mfc的计时器settimer,作用是休息若干时间去执行接收数据的操作,我是设置串口同步的,程序会在这个settimer处卡死,卡死期间,在任务管理器中显示unknown,更奇怪的是,解决方式其实很简单,比如用Demo中的例子打开这个串口,然后关闭这个串口,程序就可以正常了。
我很奇怪,理论上,writedata是调用winapi发送的数据吧,收到发送字节后,应该是发送了才是吧,但为什么没有发送?这个计时器为什么会被串口卡死?我调用的是MFC的实例方法,而不是winapi,理论上应该跟串口无关。请问有解决方向吗?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: