dbus가있는 초보자이며 bash dbus-send 명령으로 블루투스 스캔을 수행하려고합니다. 나는이 줄을 사용하십시오dbus를 통해 블루투스 검색을 어떻게 수행합니까?
$dbus-send --system --type=method_call --dest=org.bluez --print-reply /org/bluez/hci0 org.bluez.Adapter1.StartDiscovery
을하지만 발견은 DBUS 모니터에서
내가 볼 ... 시작하지 :
method call time=1511273024.833459 sender=:1.55 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method return time=1511273024.921444 sender=org.freedesktop.DBus -> destination=:1.55 serial=1 reply_serial=1
string ":1.55"
signal time=1511273024.923719 sender=org.freedesktop.DBus -> destination=(null destination) serial=101 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.55"
string ""
string ":1.55"
signal time=1511273024.926411 sender=org.freedesktop.DBus -> destination=:1.55 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.55"
method call time=1511273024.927109 sender=:1.55 -> destination=org.bluez serial=2 path=/org/bluez/hci0; interface=org.bluez.Adapter1; member=StartDiscovery
method call time=1511273024.927628 sender=:1.1 -> destination=org.freedesktop.DBus serial=69 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
string "type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.55'"
method return time=1511273024.928272 sender=org.freedesktop.DBus -> destination=:1.1 serial=43 reply_serial=69
method return time=1511273024.928729 sender=:1.1 -> destination=:1.55 serial=70 reply_serial=2
signal time=1511273024.929236 sender=org.freedesktop.DBus -> destination=:1.55 serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.55"
signal time=1511273024.929945 sender=org.freedesktop.DBus -> destination=(null destination) serial=44 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.55"
string ":1.55"
string ""
method call time=1511273024.930956 sender=:1.1 -> destination=org.freedesktop.DBus serial=71 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
string "type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.55'"
method return time=1511273024.931635 sender=org.freedesktop.DBus -> destination=:1.1 serial=45 reply_serial=71
signal time=1511273024.932142 sender=:1.1 -> destination=(null destination) serial=72 path=/org/bluez/hci0; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.bluez.Adapter1"
array [
dict entry(
string "Discovering"
variant boolean false
)
]
array [
]
내가 블루투스 검색을 수행 할 수 있습니다 scan on
와 bluetoothctl
를 사용하는 경우. 나는 bluetoothctl 도구와 bash 사이의 dbus 메시지를 비교하려고했습니다. 내가 bash는 DBUS를 사용할 때 나는
다른 DBUS 방법이 작동합니다 .... 항상 나를 호기심 RemoveMatch
다음 NameOwnerChanged
신호를 많이 수신 (ListNames
, GetManagedObjects
, Connect
, RemoveDevice
) 저도 같은 문제로이 게시물을 본 : How to use dbus-send to call org.bluez.Adapter1.StartDiscovery?
그러나 나는 "살아있는 어댑터에 D-Bus 프록시 개체를 유지하는 방법을 모른다."
리드가 있습니까? 내가 작업
: DBUS - 데몬 1.10.10, Bluez 시간에 5.41
감사