我制作了下面的示例 xml,需要一些帮助来形成 dbus-send 命令来设置/获取属性“状态”。我知道如何调用方法,但无法使用 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>
Run Code Online (Sandbox Code Playgroud) 所以基本上我正在编写以下步骤来创建基于 dbus 的应用程序。1. g_bus_watch_name(出现特定服务的回调) 2. g_signal_connect 附加到服务提供的某些信号。g_signal_connect(proxy,"xyz", G_CALLBACK(回调), NULL);
我希望“回调”在特定线程上下文中运行。
任何提示将不胜感激