【发布时间】:2020-07-18 13:10:08
【问题描述】:
我使用 Raspberry Pi 作为 BLE 外设和 nRF Connect 工具作为 BLE 客户端。在 Raspberry Pi 中,我正在运行 Bluez 测试文件夹中给出的 Simple Agent Test Program、Advertisement Program 和 Gatt Server Program。
通过 nRF 连接工具,我首先绑定设备并连接设备。我已附上该进程的 dbus 日志。
- 绑定时,日志显示以下内容
signal time=1595076323.849939 sender=:1.15 -> destination=(null destination) serial=863 path=/org/bluez/hci0/dev_04_C8_07_BC_23_7A; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.Device1"
array [
dict entry(
string "Connected"
variant boolean true
)
]
array [
]
method call time=1595076324.986873 sender=:1.15 -> destination=:1.79 serial=864 path=/test/agent; interface=org.bluez.Agent1; member=RequestConfirmation
object path "/org/bluez/hci0/dev_04_C8_07_BC_23_7A"
uint32 243301
-
连接时,日志显示如下:
signal time=1595076345.854856 sender=:1.15 -> destination=(null destination) serial=868 path=/; interface=org.freedesktop.DBus.ObjectManager; member=InterfacesAdded object path "/org/bluez/hci0/dev_7A_5D_49_4F_ED_08" array [ dict entry( string "org.freedesktop.DBus.Introspectable" array [ ] ) dict entry( string "org.bluez.Device1" array [ dict entry( string "Address" variant string "7A:5D:49:4F:ED:08" ) dict entry( string "AddressType" variant string "random" ) dict entry( string "Alias" variant string "7A-5D-49-4F-ED-08" ) 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 "ServicesResolved" variant boolean false ) ] ) dict entry( string "org.freedesktop.DBus.Properties" array [ ] ) ]
我对以下内容感到困惑:
-
虽然绑定和连接路径不同:
/org/bluez/hci0/dev_04_C8_07_BC_23_7A和/org/bluez/hci0/dev_7A_5D_49_4F_ED_08。这是否意味着,对于 Rasperry Pi,设备在绑定和连接时看起来不同? -
如果已绑定,那么在连接时 Paired 和 Trusted 字段是否不应该为 True(从日志中不是)?
-
在尝试读取加密特征时,绑定被删除并且连接也被断开。
【问题讨论】:
标签: bluetooth-lowenergy bluez raspberry-pi4