将结构数据传递到Dbus

问题描述

我正在运行的进程具有一个采用结构的DBUS端点。这是使用qt和q-dbus开发的。

在dfeet中,我看到了端点方法的详细信息

setScreen (Struct of (Int32,Struct of (String),Boolean,Struct of (Int32,UInt32,Byte,Int32,String,String),String)) screenUi) ↦ (Boolean arg_0)

我试图弄清楚如何以这种格式发送一些样本数据。有指针吗?

enter image description here

我尝试通过以下方式使用dbus-send,但出现格式错误

    gdbus call --session --dest com.semanect.S8Displayd  --object-path /com/semanect/S8Displayd --method com.semanect.S8Displayd.SetScreen "(0,('JBN1'),true,(2,'','abc','def','ghi','mmm'),'mmm')"
Error: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method 'SetScreen' in interface 'com.semaconnect.S8Displayd' at object path '/com/semaconnect/S8Displayd' (signature 's')

使用d-feet内省法,我将方法dbus格式设置为

 '    <method name="setScreen">\n'
 '      <arg type="b" direction="out"/>\n'
 '      <arg name="screenUi" type="(i(s)b(iuybyisssssssss)(iuybyisssssssss))" '
 'direction="in"/>\n'
 '      <annotation name="org.qtproject.QtDBus.QtTypeName.In0" '
 'value="screen_ui_t"/>\n'
 '    </method>\n'

如果有人对如何使用它有建议/指针,我也愿意使用python

更新:

我能够使用dbus-send发送数据

gdbus call --session --dest com.semanect.S8Displayd  --object-path /com/semanect/S8Displayd --method com.semanect.S8Displayd.setScreen "(0,('JBN1',),'mmm','kkk'),'kkk'))"
(true,)

如何使用python脚本/ C程序执行此操作?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)