You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Windows系统中通过C#使用蓝牙HCI层实现设备控制

在Windows系统中用C#操作蓝牙HCI层,解决Arendi.Bluetooth.Hci库命令超时问题

我正在开发一款控制蓝牙设备的WinUI3应用,需要实现设备的连接与断开功能,但WinUI3提供的标准蓝牙API满足不了需求。了解到可以通过蓝牙架构中的HCI层发送命令来实现,于是尝试使用Arendi.Bluetooth.Hci库操作HCI层,但获取适配器后执行任何命令都会抛出超时异常。

我使用的代码如下:

var adapter = AdapterFactory.CreateHciAdapter("COM1", new HciAdapterOptions
{
    UartBaudrate = 9600,
    UartParity = Parity.None
});

执行命令时抛出的异常信息:

Command (OGF:0x03/OCF:0x003) failed with response timeout

请问有没有人知道如何在Windows系统中用C#正确操作蓝牙HCI层?或者如何解决这个超时异常的问题?

内容的提问来源于stack exchange,提问作者Valentin Maschenko

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 02:20:54