Bluez5:入口配对完成时的事件
BlueZ5: Event when inbound pairing is complete
我正在编写一个C 的应用程序,该应用程序管理嵌入式设备的蓝牙连接。我通过Linux下的D-Bus与Bluez5交谈。
作为实施入站配对的第一步,我做了以下操作:
- 通过AgentManager1接口注册" NoinputNoOutput"代理
- 通过Adapter1接口在和可发现和可发现的超时及时设置对超时以及可发现的时间
现在,我需要一个事件,告诉我一个新设备已经配对,因此我可以信任并接受SPP连接。但是我在规格中找不到这样的事件(https://git.kernel.org/pub/pub/scm/bluetooth/bluez.git/tree/doc(。
有这样的事件吗?看来它是 bluetoothctl 发出的消息,例如
[新的]设备44:55:66:11:22:33 foo bar
一旦设备配对...
有人可以告诉我我必须听哪个事件吗?
还是我必须进行调查?我认为 bluetoothctl 民意调查的反应很快。
从这里
布尔连接[readonly]
指示远程设备当前是否已连接。 属性变的信号表示此状态的变化。
添加了新设备后,将互动信号在接口= org.freedesktop.dbus.objectManager上广播。请参阅下面使用DBU-Monitor捕获的信号。检查已连接的属性。
signal time=1558128293.155096 sender=:1.2 -> destination=(null destination) serial=65 path=/; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesAdded
object path "/org/bluez/hci0/dev_F0_D7_AA_AA_0C_41"
array [
dict entry(
string "org.freedesktop.DBus.Introspectable"
array [
]
)
dict entry(
string "org.bluez.Device1"
array [
dict entry(
string "Address"
variant string "F0:D7:AA:AA:0C:41"
)
dict entry(
string "Name"
variant string "Moto"
)
dict entry(
string "Alias"
variant string "Moto"
)
dict entry(
string "Class"
variant uint32 5898764
)
dict entry(
string "Icon"
variant string "phone"
)
dict entry(
string "Paired"
variant boolean false
)
dict entry(
string "Trusted"
variant boolean false
)
dict entry(
string "Blocked"
variant boolean false
)
dict entry(
string "LegacyPairing"
variant boolean false
)
dict entry(
string "Connected"
variant boolean true
)
dict entry(
string "UUIDs"
variant array [
]
)
dict entry(
string "Adapter"
variant object path "/org/bluez/hci0"
)
]
)
dict entry(
string "org.freedesktop.DBus.Properties"
array [
]
)
]
如果已经添加了设备,则您在接口= org.freedesktop.dbus.properties上获得属性变的信号。请参阅下面的捕获,其登录与断开连接,但上面可以帮助您在连接设备时接收信号。
signal time=1558128303.204016 sender=:1.2 -> destination=(null destination) serial=71 path=/org/bluez/hci0/dev_F0_D7_AA_AA_0C_41; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.Device1"
array [
dict entry(
string "Connected"
variant boolean false
)
]
array [
]
相关文章:
- 当服务中的事件被触发时,如何将响应从服务发送回客户端?
- 选择排序时交换函数调用的数量和完成的交换次数是否相同?
- Qt:事件过滤器在显示 QCompleter 时不接收按键
- glfw 的基本设置会导致与 emscripten 生成的 js 文件中的事件侦听器有关的运行时错误
- Bluez5:入口配对完成时的事件
- 恒定表达式在完成时起作用,而不是单个功能
- 使用write()方法在Embedded IWebBrowser2中完成DocumentComplete事件
- QProgressDialog栏在完成时重置为零
- 读取 ppm p6 图像完成时出现问题.C++
- 当类对象完成时,是否为 C++ 类的数据成员动态分配的内存会释放
- 要求在应用程序启动之前完成特定事件
- 在生产者完成时通知消费者的优雅方式
- Visual Studio 2015在构建完成时冻结
- 如何在工作线程完成时安全地终止它们?
- 我如何在没有点击或发送者或任何东西的情况下完成一个事件
- 只在前一个线程完成时创建一个新线程
- 当上一个槽已经写入并且还没有完成时,阻止一个槽执行一个方法
- 如何在字符串读取完成时停止c++的recv() ?
- 当子进程完成时调用函数
- 当在一个新进程中完成时,fread给出BadPtr