网上下的wince下的串口控件,只能输出不能接收!在线等!
下面是程序源码,计算机发送数据,wince根本就接受不到数据,而wince科研发送数据,计算机能够正常接收!调试发现if (ComStat.cbInQue > 0) 这个条件总是不满足,所以根本没有进行readfile操作,希望大家能够帮助!还有一点是,读串口操作是在主程序中按照启动线程来操作的!
if (ComStat.cbInQue > 0)
{
OVERLAPPED ovlCommPort = new OVERLAPPED();
int BytesRead = 0;
ReadFile(hComm, commRead, NumBytes, ref BytesRead, ref ovlCommPort);
//ReadFile(hComm, commRead, NumBytes, ref BytesRead,0);
return BytesRead;
}
else
{
//MessageBox.Show("Buff中没有数据");
return 0;
}
if (ComStat.cbInQue > 0)
{
OVERLAPPED ovlCommPort = new OVERLAPPED();
int BytesRead = 0;
ReadFile(hComm, commRead, NumBytes, ref BytesRead, ref ovlCommPort);
//ReadFile(hComm, commRead, NumBytes, ref BytesRead,0);
return BytesRead;
}
else
{
//MessageBox.Show("Buff中没有数据");
return 0;
}
...全文
相关推荐
基于evc的wince串口接收发送 源代码
基于evc的wince串口接收发送的程序和源代码,适用于初级接触串口编写的人
WinCE串口API函数.zip_WINCE串口编程_wince 串口_串口 WINCE
WINCE串口编程相关API,主要针对WINCE串口编程特性进行说明,有需要的可以参考,
WINCE下的串口助手
很好用的wince下的串口调试助手 希望能被大家喜欢 基于arm开发板在wince系统下开发的朋友们需要串口调试的可用它
基于evc的wince串口接收发送程序
基于evc的wince串口接收发送程序,适用于evc++4.0
WinCE下的串口类CeSerial
应用于WinCE操作系统下的串口类,包括串口的打开和关闭,以及发送和接收数据


