关于WINFROM做蓝牙通信的问题。大神来帮帮忙

zhangshiyu011 2016-07-10 07:42:20
公司要做一个Winfrom的系统实现与医疗设备的对接,收集设备中数据。通信协议是蓝牙虚拟串口,设备每次测量完毕后蓝牙会主动回连上位机,查了资料蓝牙用的InTheHand.Net.Personal.dll,目前是用BluetoothListener监听蓝牙接入,发现有蓝牙接入之后打开相应端口进行数据交互,之前在带有内置蓝牙模块的笔记本上一直没有问题,但是把程序放到插有外接蓝牙适配器的台式机上,就没反应了,监听不到蓝牙回连,求大神帮帮忙啊。贴上代码:

private void ReceiveData()
{
try
{
Guid mGUID = Guid.Parse("00001101-0000-1000-8000-00805F9B34FB");//这里这个mGUID也请各位帮忙解释一下,这里是从网上Copy过来的一直不太理解
bluetoothListener = new BluetoothListener(mGUID);
bluetoothListener.Start();
bluetoothClient = bluetoothListener.AcceptBluetoothClient();
isConnected = true;
if (bluetoothClient.RemoteMachineName != "PM102049")//验证设备名称
{
isConnected = false;
bluetoothListener.Stop();
bluetoothClient.Client.Close();
bluetoothClient.Close();
ReceiveData();
return;
}
bluetoothListener.Stop();
bluetoothClient.Client.Close();
bluetoothClient.Close();

}
catch (Exception)
{
isConnected = false;
}
if (isConnected)
{
GetHeartRateData();//设备通信方法
}
}
...全文
280 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
小小勇007 2017-12-26
  • 打赏
  • 举报
回复
我们也要用到和楼主类似的功能,不会啊,蓝牙蓝牙,要命了
巴士上的邂逅 2016-07-11
  • 打赏
  • 举报
回复
看了看链接中http://www.cnblogs.com/freeliver54/archive/2011/12/14/2287078.html “00001101-0000-1000-8000-00805F9B34FB”是蓝牙串口服务的uuid。 是不是外接蓝牙适配器需要安装驱动,并且要有相应的服务打开?
zhangshiyu011 2016-07-11
  • 打赏
  • 举报
回复
没人吗??求大神帮忙啊。

110,566

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧