【问题标题】:Bluetooth LE event handler quit without exception windows phone 8.1蓝牙 LE 事件处理程序无异常退出 windows phone 8.1
【发布时间】:2014-10-28 18:28:05
【问题描述】:

我正在 wp8.1 运行时应用程序上做一个蓝牙 LE 应用程序。 我已经注册了一个值更改事件来监听新数据的到来。

heartRateMeasurementCharacteristic.ValueChanged += heartRateMeasurement_DataChanged;

private void heartRateMeasurement_DataChanged(GattCharacteristic sender, GattValueChangedEventArgs args)
{
  //do things
}

一段时间后,该事件不再触发,并且 rpgram 不抛出异常(我检查了运行时、内存等)。我该如何调试呢?是否有可能事件线程没有任何异常?

在BLE设备不断发送信号的情况下。

【问题讨论】:

  • 在通知停止之前成功运行多长时间?您如何知道 BLE 设备实际上正在继续传输该特征的通知消息?您是否使用其他客户端测试过此设备?
  • @PeterDuniho 嘿,感谢您的回复,我检测到 BLE 正在继续发送信息。我现在怀疑的事情可能是编码失败 // 做某事,并导致侦听器线程死了,但奇怪的是没有异常抛出,这给我没有暗示后面发生了什么.

标签: c# .net bluetooth windows-phone-8.1 bluetooth-lowenergy


【解决方案1】:

这是一个旧帖子,但答案是将 heartRateMeasurementCharacteristic 设置为全局变量。

【讨论】:

    猜你喜欢
    • 2015-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多