76f07322 | 03-Apr-2019 |
William A. Kennington III <wak@google.com> |
sdbus++: Allow server.hpp files to have extra generated includes
This allows for a future change that adds includes to the generated server.hpp file that it needs for enum definitions.
Change-Id: I
sdbus++: Allow server.hpp files to have extra generated includes
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 <wak@google.com>
show more ...
|
3cf374ed | 03-Apr-2019 |
William A. Kennington III <wak@google.com> |
sdbus++: Fix mako include substitution for signals
This allows the signal generator to emit include directives
Change-Id: I47a13102491116772c31b57ca58824fda3612938 Signed-off-by: William A. Kenning
sdbus++: Fix mako include substitution for signals
This allows the signal generator to emit include directives
Change-Id: I47a13102491116772c31b57ca58824fda3612938 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
f0dd3b5a | 07-Feb-2019 |
Matthew Barth <msbarth@us.ibm.com> |
Support default string values
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-
Support default string values
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 <msbarth@us.ibm.com>
show more ...
|
4d741897 | 13-Jan-2019 |
Lei YU <mine260309@gmail.com> |
Revert "Revert "Fix incorrect defaultValue in generated server.hpp""
This reverts commit 8192be92b9bf50450eb309a8798b3895bfdae471.
The commit "Fix incorrect defaultValue in generated server.hpp" re
Revert "Revert "Fix incorrect defaultValue in generated server.hpp""
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 <mine260309@gmail.com>
show more ...
|
596a223c | 05-Oct-2018 |
Waqar Hameed <waqarh@axis.com> |
Add support for Unix file descriptors
Change-Id: I2d1402c38b7b8b39cee42f959a0421b24a80e45d Signed-off-by: Waqar Hameed <waqarh@axis.com> |
8192be92 | 08-Jan-2019 |
Andrew Geissler <geissonator@yahoo.com> |
Revert "Fix incorrect defaultValue in generated server.hpp"
This reverts commit 14269fbcc15fd0e764f672de144d44e8ee26dd78.
This caused the following compile failure in phosphor-dbus-interfaces: 16:5
Revert "Fix incorrect defaultValue in generated server.hpp"
This reverts commit 14269fbcc15fd0e764f672de144d44e8ee26dd78.
This caused the following compile failure in phosphor-dbus-interfaces: 16:52:02 make[1]: Entering directory '/phosphor-dbus-interfaces-99b5aaa499c2f1a71a031051136744ad1e7df869' 16:52:02 CXX libphosphor_dbus_la-libphosphor_dbus.lo 16:52:05 In file included from libphosphor_dbus.cpp:16151:0: 16:52:05 ./xyz/openbmc_project/User/Ldap/Config/server.hpp:195:53: error: expected unqualified-id before numeric constant 16:52:05 SearchScope _lDAPSearchScope = SearchScope::0; 16:52:05 ^ 16:52:05 make[1]: *** [libphosphor_dbus_la-libphosphor_dbus.lo] Error 1 16:52:08 make: *** [all] Error 2
Change-Id: Ie4c2f99d08b96845da86634ad73b9c8af56b656c Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
show more ...
|
14269fbc | 04-Jan-2019 |
Lei YU <mine260309@gmail.com> |
Fix incorrect defaultValue in generated server.hpp
In property.py, the defaultValue is got from yaml and it could be string, bool, or numeric.
In case of bool, the value becomes True/False, and whe
Fix incorrect defaultValue in generated server.hpp
In property.py, the defaultValue is got from yaml and it could be string, bool, or numeric.
In case of bool, the value becomes True/False, and when it is rendered in C++ code, the code will not compile due to C++ expects true/false instead.
And in server.hpp template, it checks "if p.defaultValue", and if the default value is "false" or 0, p.defaultValue becomes False, so the generated C++ code will not have default value.
For example, a var defined in yaml has below default value:
default: true default: false default: 0
will be rendered in C++ code as:
var = True; var{}; var{};
This commit fixes the issue by converting defaultValue from True/False to true/false string, and check if by "if p.defaultValue is not None".
Tested: Verify the above exmaple will generate valid C++ code as below: var = true; var = false; var = 0;
Change-Id: I65c9f5222aa2d7b53299a53ff63d33bd6d073b95 Signed-off-by: Lei YU <mine260309@gmail.com>
show more ...
|
fba332ba | 11-Oct-2018 |
William A. Kennington III <wak@google.com> |
Use return value from sd_bus_error_set*
The return value from sd_bus_error_set is always a negative error value mapping to the provided name. We should use this value instead of always returning -EI
Use return value from sd_bus_error_set*
The return value from sd_bus_error_set is always a negative error value mapping to the provided name. We should use this value instead of always returning -EINVAL.
Change-Id: I102c7a0b306db873d44e9c1b7cbd9cc146ffe29c Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
7a2ff91c | 11-Oct-2018 |
William A. Kennington III <wak@google.com> |
Fix invalid uses of sd_bus_error_set_const
sd_bus_error_set_const takes pointers to c-style strings as arguments which populate its name and message. This function does not take any ownership of the
Fix invalid uses of sd_bus_error_set_const
sd_bus_error_set_const takes pointers to c-style strings as arguments which populate its name and message. This function does not take any ownership of the name or message, requiring the to live beyond the lifetime of the error. Since we are destroying the error object as soon as we leave the catch blocks, we are destroying the strings passed to the sd_bus_error. This violates the lifetime guarantee.
Instead, use the sd_bus_error_set method which copies the strings. We know that the callers of these callbacks free the errors by inspecting the libsystemd code.
Tested: Run through unit tests which still pass
Change-Id: Ifa1533fc4c41db070f5bf2901581e9f5680cabfc Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
b641d103 | 05-Sep-2018 |
Lei YU <mine260309@gmail.com> |
Handle invalid enum value in convertForMessage()
The function convertForMessage() takes an enum class as input, and it assume the enum value is valid and does not check the return value of std::find
Handle invalid enum value in convertForMessage()
The function convertForMessage() takes an enum class as input, and it assume the enum value is valid and does not check the return value of std::find_if().
If user deliberately passes an invalid enum value, it causes undefined behavior.
Handle this case by checking the return value and throw std::invalid_argument if the input argument is invalid.
Tested: Verify the unit test in phosphor-time-manager passed; without the fix, the test fails when -flto is enabled.
Change-Id: I3874eaeb44b8e89469690a21090005d299d0f4b1 Signed-off-by: Lei YU <mine260309@gmail.com>
show more ...
|
69425eb7 | 17-Aug-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
property: Add support for const (read-only) values
There is already support for setting a property as const (see vtable.hpp and corresponding test cases). Implement this in the generated code by add
property: Add support for const (read-only) values
There is already support for setting a property as const (see vtable.hpp and corresponding test cases). Implement this in the generated code by adding support for a new yaml flag.
Closes openbmc/openbmc#2028
Tested: Added the const flag to the Software Priority property, and changing the value via REST and busctl would fail with "org.freedesktop.DBus.Error.PropertyReadOnly", but the code update app was able to set its value.
Change-Id: I8534753233080366503fd4f1a0c224c2946e8764 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
261fe753 | 18-Jun-2018 |
Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com> |
Support to skip property changed signal
PropertyChanged signals are sent out, even before InterfacesAdded signals (if deferSignal is set to true in Object) are sent. This patch provides an option, t
Support to skip property changed signal
PropertyChanged signals are sent out, even before InterfacesAdded signals (if deferSignal is set to true in Object) are sent. This patch provides an option, to skip sending out PropertiesChanged signal for proper initialization sequence.
Change-Id: I1678d80cc382fce420dda9f0dd9413d43c1c711d Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
show more ...
|
75a2e253 | 06-Jun-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
property: Add errors support
Add errors support for properties.
Closes openbmc/openbmc#1641
Tested: Verified that when an interface threw a defined property error, the generated code caught it and
property: Add errors support
Add errors support for properties.
Closes openbmc/openbmc#1641
Tested: Verified that when an interface threw a defined property error, the generated code caught it and returned an error to the REST call.
Change-Id: I8cb8c77995026f12e373291822e4e0a623a84d81 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
ee6ac694 | 06-Jun-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
property: Move property template to its own file
Move the template that generates the property-related code to its own file out of the interface.mako file so that it's easier/cleaner to add addition
property: Move property template to its own file
Move the template that generates the property-related code to its own file out of the interface.mako file so that it's easier/cleaner to add additional features to the property template such as error handling.
Tested: Verified the generated code for the example Calculator remained the same.
Change-Id: Idee37d4b1db6701ffc22de84a7a7ea07a2006d61 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
263712fe | 16-Apr-2018 |
Patrick Venture <venture@google.com> |
sdbusplus:: dbus-interfaces generated use inteface
The generated dbus-interface server objects now pass their sd-bus library calls through whatever interface was provided in the sdbusplus::bus::bus
sdbusplus:: dbus-interfaces generated use inteface
The generated dbus-interface server objects now pass their sd-bus library calls through whatever interface was provided in the sdbusplus::bus::bus they received.
Change-Id: Ib57a0f7c87c3cad9920cb4427b833cc66932afa2 Signed-off-by: Patrick Venture <venture@google.com>
show more ...
|
f7509067 | 23-Mar-2018 |
James Feist <james.feist@linux.intel.com> |
Allow property called 'name' in interface
Currently if a property named 'name' is added, it collides with the parameter name. Rename the parameter to _name so this won't happen.
Tested: Added a pro
Allow property called 'name' in interface
Currently if a property named 'name' is added, it collides with the parameter name. Rename the parameter to _name so this won't happen.
Tested: Added a property named name to interface and bitbake phosphor-dbus-interfaces Change-Id: Iee685612276e1bf2515bcb32c41e21487f344471 Signed-off-by: James Feist <james.feist@linux.intel.com>
show more ...
|
5f9874f2 | 25-Oct-2017 |
Gunnar Mills <gmills@us.ibm.com> |
Spelling fix in interface.mako.server.hpp
Change-Id: I5a69ad0e55e3907d3764d0398738902f167b976f Signed-off-by: Gunnar Mills <gmills@us.ibm.com> |
7bfb70ac | 03-Jul-2017 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: move default directory
With example moved to the root directory and there being an explicit makefile for the example calculator application, there is no need to have sdbus++ default to 'exa
sdbus++: move default directory
With example moved to the root directory and there being an explicit makefile for the example calculator application, there is no need to have sdbus++ default to 'example'.
Change-Id: I2a20883d7ea88b56e1bd073ef395c236215a4132 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
8eb1b85a | 03-Jul-2017 |
Patrick Williams <patrick@stwcx.xyz> |
example: move schema to top-level dir
Change-Id: Icb6a6ca266181e9b401eec64dbbada8b7e334229 Signed-off-by: Patrick Williams <patrick@stwcx.xyz> |
93c246cf | 16-Jun-2017 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: increase constness in convert[enum]FromString
Change-Id: I884ed42a53e30c9209b45e74f6317ec19bb344b4 Signed-off-by: Patrick Williams <patrick@stwcx.xyz> |
dadf83ae | 01-Mar-2017 |
Adriana Kobylak <anoo@us.ibm.com> |
Copy the tools directory from source to build directory
The python setup script looks for the needed mako templates in source directory (srcdir). But if the sdbusplus repository is built through bit
Copy the tools directory from source to build directory
The python setup script looks for the needed mako templates in source directory (srcdir). But if the sdbusplus repository is built through bitbake, the mako templates that are auto-generated are created in the build directory (builddir).
Copy all the needed files to the builddir, specify update=1 to preserve any built file from being overwritten. This allows for support of out of tree builds.
Change-Id: Icb6090df5ea083b4b5f1bc1c5b320d40f57596e0 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
c3231059 | 03-Mar-2017 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: automatically add 'Error' to error dbus paths
Change-Id: I83d51e9aaa165e646ce711cc8bc551f010edc448 Signed-off-by: Patrick Williams <patrick@stwcx.xyz> |
fd43ef73 | 12-Feb-2017 |
Adriana Kobylak <anoo@linux.vnet.ibm.com> |
Disable transaction id support by default
Allow the transaction id support to be enabled via configure options. In the code, ifdef the code based if transaction support is desired.
Change-Id: I9869
Disable transaction id support by default
Allow the transaction id support to be enabled via configure options. In the code, ifdef the code based if transaction support is desired.
Change-Id: I98695268397f437b6fe14621f820fbcaecb45b7a Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
dfa19092 | 02-Feb-2017 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: Add server method for get-property
Add a method to the server bindings that gets properties by looking up the name from a string.
Change-Id: I304504ba20d6747afba27cd08f79bcc564c34a46 Signe
sdbus++: Add server method for get-property
Add a method to the server bindings that gets properties by looking up the name from a string.
Change-Id: I304504ba20d6747afba27cd08f79bcc564c34a46 Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
4d47bf0a | 01-Feb-2017 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: Add server constructor from property-map
Add a constructor that takes a map of property-names to values and initializes all properties in the map with those values.
Change-Id: Id0eaa2ec43a
sdbus++: Add server constructor from property-map
Add a constructor that takes a map of property-names to values and initializes all properties in the map with those values.
Change-Id: Id0eaa2ec43aed490719d12537e75c1278d290013 Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|