add a new yaml interface definition

Patrick Williams patrick at stwcx.xyz
Wed Jan 6 01:10:41 AEDT 2021


On Tue, Jan 05, 2021 at 12:42:40AM +0000, Mahesh Kurapati wrote:
> Hello Patrick, 
> 
> Thank you.  Updating the meson fixed the issue, and I see the cpp, and hpp files generated. 
> 
> ixia at ubuntu:~/git/development/openbmc/build/fender/tmp/work/arm1176jzs-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0+git999-r1/phosphor-dbus-interfaces-1.0+git999/gen/xyz/openbmc_project/Control/Alarm$ ls
> client.hpp  server.cpp  server.hpp
> 
> I have two more follow-up questions on how I include this code in my server: 
> 1.  Does the libsdbusplus.so contain the methods that I defined in the Alarm.interface.yaml file?  I thought it would.  But, I don't see build time stamp changed for it.  I thought, all I need to do is include the header file in my server code, and link the server with libsdbusplus.so.  

libsdbusplus.so does not because that comes from sdbusplus repo.
libphosphor_dbus.so does because that comes from P-D-I repo.

You should link with both libsdbusplus and libphosphor_dbus.

If you're using Meson or CMake as your build you shouldn't need to directly
add "-l" flags, because the package dependency will do it for you.
Yocto will want you to link against the versioned so files, so if you're
trying to hand-write makefiles you're probably going to have problems
with Yocto integration.

> 2.  I see that in the example/Calculator_server.cpp file, both the generated cpp, and herder files are included.  While the corresponding server and header are not included in the x86_power_control.cpp server.  I see that in x86 server code, namespace is referred again.  Is that the reason why they are not included?  
The authors of x86-power-control decided not to use the generated code
and instead hand-wrote their interfaces using the Boost::ASIO support in
sdbusplus.

I see the code using 'sdbusplus::' namespace elements which come from
the sdbusplus library but I don't see them using any of the
'sdbusplus::<TLD>' namespaces being used (ex. sdbusplus::xyz::openbmc_project)
which are the ones generated from YAML using sdbus++.

-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20210105/ee9334e8/attachment.sig>


More information about the openbmc mailing list