简体   繁体   English

在Bluez中创建dbus接口

[英]Creation of dbus interfaces in Bluez

A question regarding the creation of dbus interfaces such as 有关创建dbus接口的问题,例如

org.bluez.Audio, org.bluez.AudioSource org.bluez.Audio,org.bluez.AudioSource

appearing on d-feet debugger. 出现在d脚调试器上。

Does the host running Bluez(For eg. Laptop) create an interface org.bluez.AudioSource for a remote device behaving as a Bluetooth A2DP source? 运行Bluez(例如,笔记本电脑)的主机是否为作为蓝牙A2DP源的远程设备创建org.bluez.AudioSource接口?

So similarly how to create an org.bluez.AudioSink interface on any bluetooth phone for example to make it behave as an A2DP receiver? 因此,类似地,如何在任何蓝牙电话上创建org.bluez.AudioSink接口,例如使其表现为A2DP接收器? In that case should the host(for eg. Laptop) create an AudioSink interface for interacting with the bluez on the phone side? 在那种情况下,主机(例如笔记本电脑)是否应该创建一个AudioSink接口,以便与电话端的bluez进行交互?

in C to create A2DP connection u can use these parameters 在C中创建A2DP连接u您可以使用这些参数

DBusMessage *msg;   
msg = dbus_message_new_method_call("org.bluez",btadrr_path,"org.bluez.AudioSource","Connect");

here btaddre_path is my bluetooth device path which is already paired... 这里btaddre_path是我的蓝牙设备路径,已经配对了...

in Python 在Python中

manager = dbus.Interface(bus.get_object("org.bluez", "/"), "org.bluez.Manager")

adapter = dbus.Interface(bus.get_object("org.bluez", manager.DefaultAdapter()), "org.bluez.Adapter");

audiosrc = dbus.Interface(bus.get_object("org.bluez", adapter.FindDevice(bdaddr)), "org.bluez.AudioSource");

audiosrc.Connect()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM