| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
Initialize the transaction id in the code generated by the sdbusplus tool.
Generate a unique value if the transaction id has not been
initialized and a caller requests it. This is the scenario for
clients that have not made a dbus call yet and create journal
entries.
Change-Id: Ia7b926fd3f83963fac01fbd1ce4cdd59d2224008
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
| |
Implement the transaction id variable in a .C file and
create an sdbusplus library with it.
Create interfaces to set/get the transaction id.
Change-Id: Id1df415d9cc05e4b96817c7a05c1be7052d05c65
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
| |
Create a README file to describe the transaction id.
Hash specialization to create a unique transaction id
by combining the hash values of the dbus bus name and
message cookie.
Change-Id: Ida52774857a7ed2cca9364da15f84a30d2c3af06
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add comparison operators to allow string_wrappers
to be implicity converted to strings for comparisons to
cut down on casting and/or str member access.
Do not allow std::string to be impliclitly converted
to object_path to avoid a temporary string copy.
Change-Id: I2e45a4fc3ee07d1df55f6fab2cfa35da205c150e
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
| |
Don't invoke sd_bus_emit_object_removed unless sd_bus_emit_object_added
was invoked at object creation time.
Fixes openbmc/openbmc#971
Change-Id: Ib3b92af3a2c03b86008f0b4f36906a367786af45
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
| |
The message cookie will be used to generate a unique hash id.
Change-Id: Iffb30a287659aa633b399fb1b2efaa450bf66240
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
| |
The dbus bus unique name will be used for generating a unique hash id.
Change-Id: I275acdcc89ce7e459e87dfdca2b395ba7fa00f05
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are cases of calling the message constructor where the
ownership of the raw pointer is transfered and others where it
is duplicated. The ownership-transfer use-cases are likely all
embedded within sdbusplus itself and the ownership-duplicate
cases tend to be done by external users. This causes the current
API to be bug-prone as it requires something like:
sdbusplus::message::message(sd_bus_message_ref(m));
Change the conversion constructor to not require the external _ref
call and instead add a new constructor that bypasses the ref.
Thus, the calling conventions now look like this:
Ownership-duplicate:
sdbusplus::message::message(m); // calls _ref.
Ownership-transfer:
sdbusplus::message::message(m, std::false_type()); // no _ref.
Resolves openbmc/openbmc#950.
Change-Id: Ia1ae527c4d1235b1625368cfffeb4ed495457768
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
| |
Allow object_path and signatures to be used in std::vector,
std::map, and std::unordered_map.
Change-Id: Ieb592aa518bfae08da393632a1dd0ed0dd684c7a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I6075a6a52553d0dc7dca6abc3442282f91fb5d44
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: Iafc2f26a10f0c5c84805e1d28bea8f17eaadc03c
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I44d5195eba14c17f38cf2bf2b09eb071d54f59d8
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I7cb1563af3375f2a8b22c78ac59f7e69f176933f
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I1ca54ecc5d4033c41738bd224399f80b95094430
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The expectation is that --enable-libsdbusplus is default, but the
configure script had it default in some conditions and not default
in others. As a result, if you left off --enable-libsdbusplus, C++14
support was not enabled.
Fix this by making sure all conditions based on configure flags use
the same logic rather then checking against 'yes' in some cases and
'no' in others.
Change-Id: Ic658047c97aa266456c717fa605a4f4741fe94a7
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I099744bed79e75da77e72167594c6ca14ef32209
Signed-off-by: Christian Andersen <c.andersen@kostal.com>
|
|
|
|
|
| |
Change-Id: I3efcfb0575cdfecb86f72368f34d4d33d9e00318
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some words are reserved in C++, so they cannot be used as function
or variable names. If a YAML file specifies these we must come up
with an alternative name for the generated C++ function. Do this
by adding underscore characters to the generated name.
Fixes openbmc/sdbusplus#10.
Change-Id: I992caafb02fe71ea6ac2cf3c555a9956e4ba616a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: Ib353e19793bda85815826f7b835fd6f3c5d8e908
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The fix to openbmc/sdbusplus#4 broke the generation of enums, because
enums are currently not directly parsed by the cpp type conversion.
This also means that there is additional work required to support enums
nested into containers.
Fixes openbmc/sdbusplus#8
Change-Id: I4f206fa899d84128bc7463d54c5b83e40e28d61f
Signed-off-by: Christian Andersen <c.andersen@kostal.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The type array contructed by YAML is difficult to process recursively.
So the type array gets preprocessed and converted to a recursive data
structure.
Fixes openbmc/sdbusplus#4
Change-Id: Ife8a47d9b6babd75835f496702ca5899ac6e18c3
Signed-off-by: Christian Andersen <c.andersen@kostal.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The generated server bindings register 'this' with sdbus, so
if a move is allowed then the object pointer left with sdbus
no longer exists. Disallow 'move' operations to prevent this.
Fixes openbmc/sdbusplus#6.
Change-Id: I470b1372042d21ce14ad0cd9bc1af68e7394bcb9
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
| |
In general we avoided hard-coded dbus characters and use
type-deducation and sdbus constants. Fix boolean support
to not hard-code 'b', but instead use type-deducation like
the std::string support did.
Change-Id: I8bbfebf60a0f6f33dc9d13b2ff3368ce7ca86285
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sdbus requires dbus-boolean to be passed as 'int' and not 'bool'.
Modify message append / read functions to ensure this requirement
is met.
See man-page for sd_bus_message_append_basic, SD_BUS_TYPE_BOOLEAN.
Fixes openbmc/sdbusplus#7.
Change-Id: Id020f1a8598f034551d30a0561c50cb1ab5d752d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
| |
Added test-cases for false r-value reference and l-values,
in addition to existing false value.
Change-Id: I36952f06d84f9da157a618fbe093a8ca63662ceb
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
| |
The return value of the call should be the sdbusplus-wrapped message and not the low-level sd-bus message.
Change-Id: Ifb9dc90ffd5032590c5669710897befd4bd1f743
Signed-off-by: Christian Andersen <c.andersen@kostal.com>
|
|
|
|
|
|
|
|
|
|
|
| |
A method with 0 returns could result in incorrectly generated
code due to a mistake that looked at the param-count instead
of the return-count.
Fixes openbmc/sdbusplus#3.
Change-Id: Ifbbd89ab8c8dcfee60c18446f30446b052992f3f
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
| |
Removed leading spaces that were leaving trailing spaces in generated
files.
Change-Id: I99927e7b8fe3762cf0cc28d113e02eae2fcd4db3
Signed-off-by: Abhishek Pandit <abhishekpandit@google.com>
|
|
|
|
|
|
|
| |
Added instructions for using sdbus++.
Change-Id: Ibdd89f6971e05f16797ee04a2eeb1c4fc6a8676b
Signed-off-by: Abhishek Pandit <abhishekpandit@google.com>
|
|
|
|
|
| |
Change-Id: Ic98c5cb0d04013c8cf7164ae417da82b3ab515ff
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I4230d5ebc7d2a470d9ae2d3bb03a9918a29ba919
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
| |
Perform final type conversion using 'convert*' functions to change
between dbus strings and C++ enumerations for methods, properties,
and signals.
Change-Id: I22e8fd424eeecac176c64fcc3e7a5d3caf05804a
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: Ied31a6c11188fe3d0c909edb5c4bde3e337d96b3
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I138d468cc5e16241b450108eedf79c4a4c317d87
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some C++ types, such as enumerations, need some conversion
before they can be added to a message. Provide a global
utility which passes a C++ reference unchanged, which can
be used in all server-bindings.
Specific C++ types that need conversion will provide their
own override of this in their own namespace/class.
"Argument dependent lookup" rules will allow the override to
be used where appropriate.
Change-Id: I0e9f64974ea12093c1b67f28847da4696fa85f61
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
| |
Current generation emits for enumerations:
Enum property = EnumValue
Fix this to be:
Enum property = Enum::EnumValue
Change-Id: Iae1e8e4ad73bf8623ed9f3b2d3ec57803c7f18bd
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an enumeration is used in the bindings, the type of
it depends on the context. We use 'string' types to send
the enumeration across the dbus, so we need to use 'string'
types when doing message operations. We use the real enum
type when calling binding functions, so we need to specify
that in prototypes.
Change-Id: I31ab137b0c751d8a2bdec1c417a60455690ce103
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I6d02574942b38adbe2dc537f5279721cde2c8bc7
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: Iafdf4c30e312b0ef7faeea3e3a7379f1868a61dc
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I8b62aea7094e6e8e12d39e1341ebd07fc547b12b
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The property set/get and method callback functions are
suppose to return 1 or true to sdbus, otherwise the callbacks
are treated as unhandled. Since the generated callbacks all
populate the response message correctly, the result is that the
client receives two messages but the 2nd (an error) is silently
ignored by clients because it is a duplicate message. Clean this
up, which reduces needless activity on the dbus.
Change-Id: I39699e498b0d113ec9819670a92e44e8108c88db
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
| |
Use both 'name' and 'description' for exceptions. All sdbusplus
exceptions now have a 'name()' and 'description()' method which
give the dbus error name and a human-readable description
respectively. The standard 'what' is now '<name>: <description>'.
Change-Id: Ic6cdb88350c07589cbfbf233e84a575632383af6
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Old:
Error identifier: com.example.Interface.LogicError
Exception class: com::example::Interface::common::LogicError
New:
Error identifier: com.example.Interface.Error.LogicError
Exception class: com::example::Interface::Error::LogicError
Change-Id: I866046f4a0514f5bce40bdef46a218060d107765
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the generated code was assuming C++ names, but the example
(Calculator.interface.yaml) used an arbitrary name ('integer'). This
commit defines a consistent typename scheme and validates it when
interfaces are generated.
Use English typenames from the DBus protocol in interface files
rather than the C++ name or a single-letter DBus name. Use
square-bracket ([]) to identify sub-types for containers.
Examples: 'int64', 'path', 'array[dict[string, byte]]'
Change-Id: I38abe84c9cd3d5f839968349d2d3cfa0b8796cd0
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: Id313bb05c7cb910b7669046cffac668bf04af11d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
|
|
|
|
|
| |
internal_exception will be used for sdbusplus-generated errors.
These errors could be thrown by any sdbusplus call and therefore
by any generated server binding. Define this class to differentiate
between binding-defined errors and sdbusplus-defined errors.
Change-Id: I725729c8e874b638cde8ce72289b87ed807d27c1
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I63ea5ea07ab4efb0da21ee10de7fe9db429c1ffd
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
| |
Change-Id: I6e1beb1da2b5c3c3ea612b9aa688ea037d6173e6
|
|
|
|
|
| |
Change-Id: I73361b6f9b48b32a206d1e6d3e52ff46195b3cbc
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|
|
|
|
|
| |
Change-Id: I576ac6fdbca5ca7d186040c36abac1f0a5dc73cb
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
|