Windows Phone 8.1蓝牙LE问题 [英] Windows Phone 8.1 Bluetooth LE Issue

查看:82
本文介绍了Windows Phone 8.1蓝牙LE问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆