本文介绍了窗10物联网蓝牙LE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我买了重新连接的问题我BLE装置。

I got an issue with reconnection to my BLE device.

塞纳里奥的作品
  - BLE设备未配对
  - 皮靴子,开始我的应用程序,发现是该BLE装置,对和连接,接收数据
  - 引导Pi和启动我的应用程序,它不会对作为其已经配对,它连接罚款和接收数据

Senario that works - BLE Device is not paired - Pi boots and start my App, find's the BLE device, pair and connect, receiving data - Boot Pi and start my App, it will not pair as its already paired, it connects fine and receiving data.

塞纳里奥不起作用
  - BLE设备未配对,也对,都无所谓
  - 如果我的BLE设备断开因断电或超出范围并得到供电或回到范围内的PI将重新连接,并抛出:
在mscorlib.ni.dll'System.Exception的'
有指定的登录会话的用户会话密钥。 (异常来自HRESULT:0x80070572)

Senario that does not work - BLE Device is not pair or pair, does not matter - If my BLE device disconnect due to power loss or out of range and gets powered up or back in range the Pi will reconnect and throw:'System.Exception' in mscorlib.ni.dllThere is no user session key for the specified logon session. (Exception from HRESULT: 0x80070572)

如果我试图重新启动皮,同样的消息时,我尝试执行抛出:等待_readCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue.Notify);

If I try to reboot the Pi, the same message is thrown when I try to execute: await _readCharacteristic.WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue.Notify);

这是工作的唯一的事情是,如果我每次断开时解除配对的装置。

The only thing that works is if I unpair the device every time it disconnect.

这是同一个问题,这个家伙有:<一href=\"https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b98d77f2-bf5e-45fc-9495-1c444b54450e/uw$p$pconnecting-to-a-ble-csac-device-causes-exception?forum=wpdevelop\">https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b98d77f2-bf5e-45fc-9495-1c444b54450e/uw$p$pconnecting-to-a-ble-csac-device-causes-exception?forum=wpdevelop

This is the same issue that this guy has: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b98d77f2-bf5e-45fc-9495-1c444b54450e/uwpreconnecting-to-a-ble-csac-device-causes-exception?forum=wpdevelop

也许还有人在这里已经看到了同样的问题,解决它?

Maybe there is anyone here that has seen the same issue and solved it ?

感谢

推荐答案

原因您收到此特定错误是几乎可以肯定的是,BLE装置本身不存储,它是在配对过程中协商的结合信息。对于要重新使用的现有BLE配对,该装置必须保持其为未来的通信会话伙伴的接合。

The reason for this particular error you are receiving is almost certainly that the BLE device itself is not storing the bonding information that is negotiated during the pairing process. For an existing BLE pairing to be re-used, the device must retain the bonding with its partner for future communication sessions.

开发有时可以解决他们的(非Windows)的PC或手机应用此设备缺陷由具有PC或移动应用程序删除任何previous配对与已保留设备,每一次协商一个新的配对它看到蓝牙设备。这可能是因为许多蓝牙设备有一个静态PIN码,需要配对没有互动,并保持在开放配对模式。因此,应用程序在创建每个通信新设备配对。在Mac BLE API需要配对和未配对没有用户的交互。

Developers can sometimes work around this device shortcoming in their (non-Windows) PC or phone application by having the PC or Mobile app delete any previous pairings with the device already retained, and negotiate a new pairing each time it sees the Bluetooth device. This is possible because many Bluetooth devices have a static PIN, require no interaction for pairing, and remain in open pairing mode. So the app creates a new device pairing upon each communication. The Mac BLE API requires no user interaction for pairing and un-pairing as well.

但这种方法是在Windows API BLE不可行的,因为不像常规的蓝牙,蓝牙低功耗API两者的配对,和未配对的礼仪之邦期间需要用户交互。用户必须同意每一个配对,而且必须同意每一个未配对。这使得这种解决方法解决方案从Windows上的UX的角度来看一个非首发。我的猜测是BLE设备制造商不存储的结合。

But this solution is unworkable under Windows BLE API, because unlike regular Bluetooth, the Bluetooth Low Energy API requires user interaction during both the pairing, and un-pairing "ceremonies". The user must agree to every pairing, and must agree to every un-pairing. This makes this workaround solution a non-starter from a UX standpoint on Windows. My guess is the BLE device manufacturer isn't storing the bonding.

我们遇到了这样的情况我们开发我们自己的BLE司机用我们自己的BLE板说话。我们不得不重新做运行我们的BLE装置,因为虽然它会在Mac OS和Android的合作与上面介绍的方法,对微软UWP提供的BLE API需要配对仪式用户交互的固件。这似乎做的事情,反正以正确的方式。

We ran into such a situation ourselves developing our own BLE driver to speak with our own BLE board; we had to re-do the firmware running our BLE device because while it would work under Mac OS and Android with the method described above, the BLE API available on the Microsoft UWP requires user interaction during the pairing ceremony. This seems the right way to do things, anyway.

这篇关于窗10物联网蓝牙LE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 14:13