Creating fidl from DBUS introspection XML

900 views
Skip to first unread message

err...@gmail.com

unread,
Aug 17, 2014, 10:56:54 AM8/17/14
to franca-f...@googlegroups.com
HI!

I want to use systemd service, so I created xml introspection file with help of Introspect() method at dbus interface:

sudo dbus-send --system --print-reply --reply-timeout=2000 --type=method_call --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.DBus.Introspectable.Introspect > org.freedesktop.systemd1.xml

Then I edited this file to remove some redundant formatting info and got this:

<!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.systemd1.Manager">
<method name="GetUnit">
<arg name="name" type="s" direction="in"/>
<arg name="unit" type="o" direction="out"/>
</method>
<method name="GetUnitByPID">
<arg name="pid" type="u" direction="in"/>
<arg name="unit" type="o" direction="out"/>
</method>
<method name="LoadUnit">
<arg name="name" type="s" direction="in"/>
<arg name="unit" type="o" direction="out"/>
</method>
<method name="StartUnit">
<arg name="name" type="s" direction="in"/>
<arg name="mode" type="s" direction="in"/>
<arg name="job" type="o" direction="out"/>
</method>
...
...
etc

But when I try to convert it to fidl, I am getting an error:

Loading D-Bus Introspection XML file 'file:/home/ygurin/workspace/dbus_test/api/org.freedesktop.systemd1.xml' ...
Error during load of D-Bus Introspection XML file 'file:/home/ygurin/workspace/dbus_test/api/org.freedesktop.systemd1.xml'

What does parser want?

err...@gmail.com

unread,
Aug 17, 2014, 1:27:26 PM8/17/14
to franca-f...@googlegroups.com
ok, I found that adding this info to the first node partially solves the problem:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="introspect.xsd" name="org.freedesktop.systemd1"

but I still have problems with generating of arguments: if method has arguments, generator freezes.

I've tried to write a simple fidl and generated xml from it - it worked fine, but reversing generation from produced xml freezed generator. Is it general known issue?

Klaus Birken

unread,
Sep 13, 2014, 2:18:32 AM9/13/14
to franca-f...@googlegroups.com
Hi,

do you still experience problems when converting dbus xml files to Franca IDL? If yes, could you provide an example xml which does not work?

Regards,
Klaus

err...@gmail.com

unread,
Sep 19, 2014, 8:27:27 AM9/19/14
to franca-f...@googlegroups.com
Hi Klaus

For now I no longer need to generating of fidls from xml, but when I tried last time, it fails on every function argument what met in the xml.

But now I have other questions for you :)

1. Can I access system bus using Franca?
2. Is it possible to get known if attribute what I using on client side, was not assigned by value?
For example: server has some attribute; server starts but do not assign any value to it. Coud I know this on client side? I tried CallStatus, but it returns SUCCESS in any kind.
Why I need this - I have two components that starting one by one. When second component starts, it connects to the first and gets attribute value from it. But it can be situation when first component had not yet time to set it and value what second component readed will be incorrect. Offcourse this situation could be solved with additional "ready" methods, but, may be, this possibility was already integrated in the Franca?

PS: I use CommonAPI 2.1.5

prostetn...@gmail.com

unread,
Sep 22, 2015, 12:21:56 PM9/22/15
to Franca
Hi Klaus,

I've also tried to convert the introspection file got from the systemd and got the same error message. For converting I've used Franca 0.10.0.201507291433 installed from the YAMAICA update site. Using Eclipse Luna under a Ubuntu Linux VM. Is it possible to get any additional debug output outside Eclipse?

Thanks in advance & Regards
Markus

Klaus Birken

unread,
Sep 25, 2015, 6:07:52 AM9/25/15
to Franca
Hi,

as you found out later, the <node>-tag in the Introspection XML file needs two attributes:

1. xsi:noNamespaceSchemaLocation="introspect.xsd" - this is needed by the underlying XML parser. Not sure if I can fix this in the transformation or at least provide a better error message
2. name="TheNodeName" - this is currently required by the transformation (it will be converted to the package definition in the Franca file). I will add a better error message in the transformation for this.

If you add both attributes to the <node> tag, it should work.

Regards,
Klaus

Klaus Birken

unread,
Sep 25, 2015, 6:11:18 AM9/25/15
to Franca
Hi Markus,

I could reproduce the issue and posted the solution (add two xml attributes to the <node> tag) in a previous comment. Just one more remark: You might check the Eclipse logfile, which you can find in your Eclipse workspace directory as .metadata/.log. This will contain additional error messages from the transformation (mostly stack traces). But I will try to improve the console error messages from the transformation, nevertheless.

Regards,
Klaus

Klaus Birken

unread,
Sep 25, 2015, 6:28:08 AM9/25/15
to Franca
One remark regarding the questions regarding CommonAPI (system bus, attribute API behavior, ...). Pls direct those questions to the mailing lit geniv...@lists.genivi.org. CommonAPI related topics are discussed there.

Regards,
Klaus

Reply all
Reply to author
Forward
0 new messages