0

我有一个小程序可以在 Xamarin Forms 应用程序上发送 BluetoothLE 数据。

蓝牙设备是 Honeywell Dex 适配器。手持设备是运行 7.1.1 的 Honeywell CT60 我使用的端口嗅探器是 Device Monitoring Studio

我通过 DataCharacteristicChange 事件写入特征并接收数据。

这就是我获得写入特性的方式

WriteCharacteristic = gatt.GetService(DEX_SERVICE_SPP)
                        .GetCharacteristic(DEX_CHARACTERISTIC_DATAWRITE);

然后我这样做

gatt.SetCharacteristicNotification(WriteCharacteristic, true)

最后这个

BluetoothGattDescriptor descWrite = WriteCharacteristic.GetDescriptor(CLIENT_CHARACTERISTIC_CONFIG);

descWrite.SetValue(BluetoothGattDescriptor.EnableIndicationValue.ToArray()); gatt.WriteDescriptor(descWrite);

这是在设备 #1 上触发的事件,而不是在设备 #2 上触发的事件

public override void OnCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic)

在设备 #1 上,它可以工作,我发送 0x05 并返回 0x10 0x30。0x10 0x30 在 DataCharacteristicChanged 事件中处理。我在我拥有的端口嗅探器中也看到了它。

在与#1 相同的设备#2(相同的OS 7.1.1、升级等)上,相同的操作发送0x05,但我将0x10 0x30 发送到端口嗅探器,但它永远不会到达DataCharacteristicEvent设备#2。

我的问题有两个。有谁知道什么可能导致这种行为。我可以使用哪些工具来检测 2 个相同设备之间的配置差异。

谢谢

4

0 回答 0