<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sdbusplus/tools, branch master</title>
<subtitle>OpenBMC systemd DBUS binding API sources</subtitle>
<id>https://git.raptorcs.com/git/sdbusplus/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/sdbusplus/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/'/>
<updated>2020-02-13T06:49:15+00:00</updated>
<entry>
<title>Emit adding/removing interfaces for object server</title>
<updated>2020-02-13T06:49:15+00:00</updated>
<author>
<name>Lei YU</name>
<email>mine260309@gmail.com</email>
</author>
<published>2019-09-20T09:38:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=e57c38e9dd64e0a5bc12bac5b6d3199c7baa9595'/>
<id>urn:sha1:e57c38e9dd64e0a5bc12bac5b6d3199c7baa9595</id>
<content type='text'>
The object server currently either creats the objects and interfaces, or
defer the signal by not adding objects.

In practice, we have situations that the code would like to add
interfaces to an existing object, and it's not supported, or needs
tricky code to workaround.
Exmaples:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-bmc-code-mgmt/+/5820
https://gerrit.openbmc-project.xyz/c/openbmc/openpower-pnor-code-mgmt/+/5346

This commit adds the support by:
1. Adding emit_added() in interface.hpp and the generated server.hpp
2. Adding a enum class in object's constructor to indicate which action
   to do, to create the object, or adding the interface, or defer signal
   as before.

So the user of object&lt;&gt; could pass `action::emit_interface_added` to the
constructor to tell the object server *only* emit interface added to
DBus, without emitting object added.
The previous code stays the same behavior:
* If `true` is passed in object's constructor, it defers emitting object
  added signal;
* If no extra parameter is passed in object's constructor, it emits
  object added signal as before.

Tested: 1. Make sure the openbmc builds fine with
        https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-logging/+/25089
        because phosphor-logging uses its own server.hpp for interface, the
        above patch removes that.
        2. Manually write a small service to verify the interfaces are
        added and removed by using the `emit_interface_added` action.
        3. Added the unit test cases for object.hpp to check the
        ctor/dtor with different actions.

Signed-off-by: Lei YU &lt;mine260309@gmail.com&gt;
Change-Id: I178c5bed3c9ff39ee2ac8d143fbe9131b0753dfa
</content>
</entry>
<entry>
<title>sdbus++: interface: fix indent of enum-string fn</title>
<updated>2020-02-11T02:49:21+00:00</updated>
<author>
<name>Patrick Williams</name>
<email>patrick@stwcx.xyz</email>
</author>
<published>2020-01-24T20:56:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=5e001779718673aa50637958b362e5c5ca8359e5'/>
<id>urn:sha1:5e001779718673aa50637958b362e5c5ca8359e5</id>
<content type='text'>
The convert&lt;enum&gt;FromString functions were indented incorrectly
relative to the rest of the class.

Signed-off-by: Patrick Williams &lt;patrick@stwcx.xyz&gt;
Change-Id: Iabe9d30c33c8707bf2bf4c6a697e3d27d0a3000b
</content>
</entry>
<entry>
<title>Make interface string public</title>
<updated>2020-02-04T06:57:31+00:00</updated>
<author>
<name>Lei YU</name>
<email>mine260309@gmail.com</email>
</author>
<published>2020-02-03T06:13:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=14db20f044be9faba00e41214d4aa8765b43b355'/>
<id>urn:sha1:14db20f044be9faba00e41214d4aa8765b43b355</id>
<content type='text'>
The interface string was private, and the users of sdbusplus have to
define their own strings for the D-Bus interfaces.
By making the interface string public, users do not have to define their
own and the generated string could be used instead.

E.g. one could directly use "Calculator::interface" instead of
"net.poettering.Calculator" in the example.

Signed-off-by: Lei YU &lt;mine260309@gmail.com&gt;
Change-Id: I0846d4e0609c8588d81e8a19bdd69fd79df83848
</content>
</entry>
<entry>
<title>sdbus++: Fix construction of objects with flags</title>
<updated>2019-05-23T18:42:34+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2019-05-17T21:16:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=66ef099b5a77315bb531300dfcc81a53867cd5fa'/>
<id>urn:sha1:66ef099b5a77315bb531300dfcc81a53867cd5fa</id>
<content type='text'>
Objects don't take kwargs for their constructors so don't call the
object constructor with kwargs

```
| Traceback (most recent call last):
|   File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/bin/sdbus++", line 50, in &lt;module&gt;
|     main()
|   File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/bin/sdbus++", line 45, in main
|     instance = valid_types[args.typeName].load(args.item, args.rootdir)
|   File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/interface.py", line 21, in load
|     return Interface(**y)
|   File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/interface.py", line 25, in __init__
|     [Property(**p) for p in kwargs.pop('properties', [])]
|   File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/property.py", line 12, in __init__
|     super(Property, self).__init__(**kwargs)
|   File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/namedelement.py", line 8, in __init__
|     super(NamedElement, self).__init__(**kwargs)
|   File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/renderer.py", line 3, in __init__
|     super(Renderer, self).__init__(**kwargs)
| TypeError: object.__init__() takes no parameters
```

Fixes openbmc/sdbusplus#30

Tested:
    Ran with some locally modified properties marked as const. Verified
    that the generated code marks those as const and removes their
    setter

Change-Id: I94965add8588a8a3168662e00ef2502276440ee5
Signed-off-by: William A. Kennington III &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>std::variant: Remove uses of the variant_ns</title>
<updated>2019-04-05T22:14:52+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2018-11-26T17:50:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=4274c117dd2866ac60508f438e7427f99dee6be4'/>
<id>urn:sha1:4274c117dd2866ac60508f438e7427f99dee6be4</id>
<content type='text'>
Now that we are using std::variant we should reference it directly
instead of using our own namespace alias.

Tested:
    Built and ran through unit tests.

Change-Id: Ic3fd62ea74cf808b85ad7b7ffcce8c0a0bfb125d
Signed-off-by: William A. Kennington III &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>sdbus++: Generate includes for enum references</title>
<updated>2019-04-04T06:49:43+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2019-04-04T03:41:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=8515eae7adcb9811ba271d05d82f66d48b1df082'/>
<id>urn:sha1:8515eae7adcb9811ba271d05d82f66d48b1df082</id>
<content type='text'>
It is common for enums to be shared across different dbus definitions.
This change adds the functionality to automatically generate the correct
includes for the server.hpp files.

Change-Id: Ic5b8df55b58479d18dd4aee20ead9c05b867b968
Signed-off-by: William A. Kennington III &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>sdbus++: Allow server.hpp files to have extra generated includes</title>
<updated>2019-04-04T03:43:17+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2019-04-04T03:41:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=76f07322361e5289c914e8289d1d986b0864bc94'/>
<id>urn:sha1:76f07322361e5289c914e8289d1d986b0864bc94</id>
<content type='text'>
This allows for a future change that adds includes to the generated
server.hpp file that it needs for enum definitions.

Change-Id: Id8ecd03a8cc1155cc9032840f38bf5ccb28d40c0
Signed-off-by: William A. Kennington III &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>sdbus++: Fix mako include substitution for signals</title>
<updated>2019-04-04T03:43:17+00:00</updated>
<author>
<name>William A. Kennington III</name>
<email>wak@google.com</email>
</author>
<published>2019-04-04T03:40:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=3cf374edeba12ac21eb1f9666e95712e50ac7872'/>
<id>urn:sha1:3cf374edeba12ac21eb1f9666e95712e50ac7872</id>
<content type='text'>
This allows the signal generator to emit include directives

Change-Id: I47a13102491116772c31b57ca58824fda3612938
Signed-off-by: William A. Kennington III &lt;wak@google.com&gt;
</content>
</entry>
<entry>
<title>Support default string values</title>
<updated>2019-02-07T18:21:28+00:00</updated>
<author>
<name>Matthew Barth</name>
<email>msbarth@us.ibm.com</email>
</author>
<published>2019-02-07T17:08:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=f0dd3b5a3c6c54b4f38844b573e3f157f8064088'/>
<id>urn:sha1:f0dd3b5a3c6c54b4f38844b573e3f157f8064088</id>
<content type='text'>
For properties of type string, allow a default value to be set for the
property on the interface. This provides the ability to have a default
value to an intended free-form string instead of using enumerated
values.

Tested:
    Verified generated interface object initializes a string property
to a default value
    Only properties of type string with a default defined are initialized
with the given default value as a string

Change-Id: I1e75dff1c26a4a872e9e3e7959106470c32c9be7
Signed-off-by: Matthew Barth &lt;msbarth@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>Revert "Revert "Fix incorrect defaultValue in generated server.hpp""</title>
<updated>2019-01-17T01:46:50+00:00</updated>
<author>
<name>Lei YU</name>
<email>mine260309@gmail.com</email>
</author>
<published>2019-01-14T01:59:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/sdbusplus/commit/?id=4d741897f5190720b3cede8da0db9c7f749aa358'/>
<id>urn:sha1:4d741897f5190720b3cede8da0db9c7f749aa358</id>
<content type='text'>
This reverts commit 8192be92b9bf50450eb309a8798b3895bfdae471.

The commit "Fix incorrect defaultValue in generated server.hpp" revealed
an issue in phosphor-dbus-interfaces that causes the build error, and it
was reverted temporarily.

The issue is fixed in phosphor-dbus-interface, so we could add it back.

Change-Id: I1700ff1ede5f0eedc11fc324f649ea4f2e76edf5
Signed-off-by: Lei YU &lt;mine260309@gmail.com&gt;
</content>
</entry>
</feed>
