Windows Phone 8.1蓝牙LE问题 [英] Windows Phone 8.1 Bluetooth LE Issue
问题描述
Hello Everyone,
我有蓝牙LE设备,并编写了一个与之互动的应用程序。它通常工作正常,但经过一段时间(不到一分钟)后,"特征值改变"了。事件停止射击。我知道设备继续发送数据,
并且问题不会发生在我拥有的另一台(非WP)设备上。我有改变的唯一指示是VS有一个条目"线程0x17c0已退出代码0(0x0)。"。线程位置每次都会明显改变,但退出代码永远不会是
。这不会导致错误跳闸。应用程序继续正常运行,但特性更改的事件处理程序永远不会再次触发。如果没有办法阻止这种情况,至少有一种方法可以检测到它,所以我可以
重置连接吗?
var tempService = currentDevice.GetGattService(new Guid(" 00002220-0000-1000-8000-00805f9b34fb"));
var charA = tempService.GetCharacteristics(new Guid(" 00002221-0000-1000-8000-00805F9B34FB"))。First();
await charA.WriteClientCharacteristicConfigurationDescriptorAsync(Windows.Devices.Bluetooth.GenericAttributeProfile.GattClientCharacteristicConfigurationDescriptorValue.Notify);
charA.ValueChanged + = charA_ValueChanged;
感谢您提供任何帮助,
杰克
错误的论坛?
Hello Everyone,
I have a Bluetooth LE device, and have written an app to interact with it. It usually works fine, but after a period of time (less than a minute), the "Characteristic Value Changed" event stops firing. I know that the device continues to send data, and the issue doesn't happen with another (non WP) device I have. The only indication I have that something changed is that VS has an entry for "The thread 0x17c0 has exited with code 0 (0x0).". The thread location obviously changes each time but the exit code never does. This doesn't cause an error to trip. The app continues to function normally, but the event handler for a change in characteristic never fires again. If there is no way to prevent this, is there at least a way to detect it so I can reset the connection?
var tempService = currentDevice.GetGattService(new Guid("00002220-0000-1000-8000-00805f9b34fb")); var charA = tempService.GetCharacteristics(new Guid("00002221-0000-1000-8000-00805F9B34FB")).First(); await charA.WriteClientCharacteristicConfigurationDescriptorAsync(Windows.Devices.Bluetooth.GenericAttributeProfile.GattClientCharacteristicConfigurationDescriptorValue.Notify); charA.ValueChanged += charA_ValueChanged;
Thanks for any help you can give,
Jake
Wrong forum?
这篇关于Windows Phone 8.1蓝牙LE问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!