我已经做了下面的示例xml,需要一些帮助来形成dbus-send命令来设置/获取属性"Status“。我知道如何调用方法,但不能使用dbus-send读/写属性。
xml:
<node>
<interface name="com.pgaur.GDBUS">
<method name="HelloWorld">
<arg name="greeting" direction="in" type="s"/>
<arg name="response" direction="out" type="s"/>
</method>
<signal name="Notification">
<arg name="roll_number" type="i"/>
<arg name="name" type="s"/>
</signal>
<property name="Status" type="u" access="readwrite"/>
</interface>
</node>发布于 2018-02-08 02:06:06
您可以使用下面的DBus - DBus命令获取/设置dbus接口的发送属性。将$BUS_NAME和$OBJECT_PATH替换为各自的名称。
获取属性:
dbus-send --system --dest=$BUS_NAME --print-reply $OBJECT_PATH \
org.freedesktop.DBus.Properties.Get string:com.pgaur.GDBUS string:Status设置属性:
dbus-send --system --dest=$BUS_NAME --print-reply $OBJECT_PATH \
org.freedesktop.DBus.Properties.Set string:com.pgaur.GDBUS string:Status variant:uint32:10您可以阅读DBus specification以了解有关DBus属性的更多信息。
发布于 2019-05-01 15:05:52
dbus-send --system --print-reply --type=method_call --dest=org.ofono /gemalto_0 org.ofono.Modem.SetProperty字符串:“Powered”变体:布尔值:false
https://stackoverflow.com/questions/48648952
复制相似问题