내가 파이썬 사용하여 특정 (대부분)이 BlueZ MediaPlayer1 인터페이스의 특성에 액세스 할 수없는 것 읽어BlueZ (5.43) MediaPlayer1 특성 (파이썬)
dbus.Dictionary({dbus.String(u'Device'): dbus.ObjectPath('/org/bluez/hci0/dev_78_6A_89_FA_1C_95', variant_level=1), dbus.String(u'Position'): dbus.UInt32(0L, variant_level=1)}, signature=dbus.Signature('sv'))
API (https://kernel.googlesource.com/pub/scm/bluetooth/bluez/+/5.43/doc/media-api.txt)와 내성에 따르면 더 많은 속성을 사용할 수 있습니다.
dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/hci0/dev_78_6A_89_FA_1C_95/player0 org.freedesktop.DBus.Introspectable.Introspect
반환 :
내성적 쿼리 방법이 잘 작동
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect"><arg name="xml" type="s" direction="out"/></method>
</interface>
<interface name="org.bluez.MediaPlayer1">
<method name="Play"></method>
<method name="Pause"></method>
<method name="Stop"></method>
<method name="Next"></method>
<method name="Previous"></method>
<method name="FastForward"></method>
<method name="Rewind"></method>
<property name="Name" type="s" access="read"></property>
<property name="Type" type="s" access="read"></property>
<property name="Subtype" type="s" access="read"></property>
<property name="Position" type="u" access="read"></property>
<property name="Status" type="s" access="read"></property>
<property name="Equalizer" type="s" access="readwrite"></property>
<property name="Repeat" type="s" access="readwrite"></property>
<property name="Shuffle" type="s" access="readwrite"></property>
<property name="Scan" type="s" access="readwrite"></property>
<property name="Track" type="a{sv}" access="read"></property>
<property name="Device" type="o" access="read"></property>
<property name="Browsable" type="b" access="read"></property>
<property name="Searchable" type="b" access="read"></property>
<property name="Playlist" type="o" access="read"></property>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get"><arg name="interface" type="s" direction="in"/><arg name="name" type="s" direction="in"/><arg name="value" type="v" direction="out"/></method>
<method name="Set"><arg name="interface" type="s" direction="in"/><arg name="name" type="s" direction="in"/><arg name="value" type="v" direction="in"/></method>
<method name="GetAll"><arg name="interface" type="s" direction="in"/><arg name="properties" type="a{sv}" direction="out"/></method>
<signal name="PropertiesChanged"><arg name="interface" type="s"/><arg name="changed_properties" type="a{sv}"/><arg name="invalidated_properties" type="as"/></signal>
</interface>
</node>
, 그러나 나는 또한 셔플 설정과 같은 물건을 액세스하고 사전 객체를 추적하는 기대했다. 호스트 (Raspberry Pi Zero W)가 거기에서 음악을 재생하는 Android 휴대 전화에 연결됩니다.
예, Windows 10 시스템에서 재생할 때 몇 가지 설정이 추가로 제공됩니다. 어떤 플레이어 애플리케이션을 대상에서 사용 하느냐는 중요하지 않습니다. 애플리케이션간에 전환해도 사용 가능한 속성은 변경되지 않습니다. – svenema