DBus Bluez5取消配对()

2024-06-26 00:03:05 发布

您现在位置:Python中文网/ 问答频道 /正文

当我将设备与bt适配器配对时,会出现一个新的debus对象路径,其形式为:/org/bluez/${bt_device}/dev_${mac}。检查org.bluez.Device1在这个对象上有一个名为:CancelPairing()的方法。在

调用此方法返回:g-io-error-quark: GDBus.Error:org.bluez.Error.DoesNotExist: Does Not Exist

我尝试通过pydbus使用bluez5dbusapi在python中对设备和bt对进行分解。你能帮我实现这个目标吗?:)


Tags: 对象方法orgdev路径devicemacerror
2条回答

bluez Device API documentation描述了CancelPairing方法。它不是用来删除已完成的现有配对。它用于:

cancel a pairing operation initiated by the Pair method

关键词是“操作”。也就是说,如果您开始配对,然后决定不完成它,您可以调用CancelPairing。在

不管出于什么原因,没有不匹配的dbusapi。要删除配对,应使用Adapter1.RemoveDeviceAPI删除整个设备,如文档所述here

相关问题 更多 >