如何更改 BLE Windows UWP C++ 上的 MTU 大小和 PHY?

2024-01-02

我正在用 C ++ 创建一个 Windows 应用程序,它使用 BLE 连接到使用 Gatt 的设备,我遵循BLE Gatt Windows 文档 https://learn.microsoft.com/en-us/windows/uwp/devices-sensors/gatt-client。但是我遇到了一些问题,因为收到的信息量不足以建立稳定的连接,我在使用此函数为 Android 制作的另一个 API 中解决了这个问题BluetoothGatt.setPreferredPhy(int, int, int) https://developer.android.com/reference/android/bluetooth/BluetoothGatt#setPreferredPhy(int,%20int,%20int)具有这些值:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
    bluetoothGatt.setPreferredPhy(BluetoothDevice.PHY_LE_2M_MASK, BluetoothDevice.PHY_LE_2M_MASK, BluetoothDevice.PHY_OPTION_NO_PREFERRED);
}

和这个功能BluetoothGatt.requestConnectionPriority(int) https://developer.android.com/reference/android/bluetooth/BluetoothGatt#requestConnectionPriority(int)使用这些参数:

bluetoothGatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_HIGH);

他们都在 Android Gatt API 上列出了服务。

对于 Windows,我无法找到任何替代方案,增加数据包大小(MTU 和/或 PHY 层大小)并增加连接优先级的最佳方法是什么?


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何更改 BLE Windows UWP C++ 上的 MTU 大小和 PHY? 的相关文章

随机推荐