summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow property called 'name' in interfaceJames Feist2018-04-102-8/+8
| | | | | | | | | | | 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>
* Spelling fixesGunnar Mills2018-04-086-7/+7
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: I6dcf76a74487d04d4568d55d08d1b07f627e5e74 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Allow reading and appending of more complex typesEd Tanous2018-03-077-81/+369
| | | | | | | | | | | | | | | | | | | | | This commit makes sdbusplus compatible with most containers that meet a few requirements. This includes: std::unordered_map std::array std::set boost::flat_set boost::flat_map Read requires a container to support emplace or emplace_back methods. Append requires a container to suport a const iterator Tested: The top level OpenBMC compiles properly, and the sdbusplus unit tests compile and pass, and unit tests have been updated with a few new types to ensure we see any breakages. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I5eb1cf7dc07bacc7aca62d87844794223ad4de80 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* clang-format: Set IndentWrappedFunctionNames to trueAdriana Kobylak2018-02-283-21/+21
| | | | | | | | | Change IndentWrappedFunctionNames to true in the .clang-format file to indent function definitions that don't fit in a single line. Change-Id: Icbd9284b6b5cfc97f094fbf3434b255aabfd0109 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* message: fix a bug exposed by gcc 6.3Brad Bishop2018-02-141-2/+2
| | | | | | | | | Do not return a reference from type_id_single. This causes odr use of tuple_type_id which results in link failures. Change-Id: I67fbefe7dca21666b551199dc62f4348aa8dc12d Tested: Successfully built an application under gcc 6.3 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Update repo to conform to openbmc code standardAndrew Geissler2018-02-0529-873/+1220
| | | | | Change-Id: If1d6b1f04514367cc544c2507a845b3e9d6d3435 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Makefile: Don't include transaction.hpp if enable_transaction=noWilliam A. Kennington III2018-01-241-1/+2
| | | | | Change-Id: I1f19ff55a04d44e0fcc1773fb0984067be1edf55 Signed-off-by: William A. Kennington III <wak@google.com>
* Add nameOwnerChanged match with given serviceMatthew Barth2017-11-141-0/+12
| | | | | | | | The nameOwnerChanged(const std::string& s) returns a match string for the NameOwnerChanged signal of the given service name 's'. Change-Id: I81162b2da67a336dd7b59d9e643a4c66004c6725 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
* Spelling fix in interface.mako.server.hppGunnar Mills2017-10-251-1/+1
| | | | | Change-Id: I5a69ad0e55e3907d3764d0398738902f167b976f Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* build: fix --disable-libsdbusplusPatrick Williams2017-07-181-1/+3
| | | | | | | | | Since the --disable-libsdbusplus doesn't build the libsdbusplus archive, we cannot link against it in example or test directories. Disable those sub-directories if libsdbusplus is disabled. Change-Id: I5a1441042d5b05f7bad9d840fea154270782bcbd Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* build: fix out of tree build in examplePatrick Williams2017-07-181-2/+13
| | | | | | | | | | | | | The following problems existed: * The sdbus++ output directory would not exist so invoke mkdir. * The directory for the example schema is not in . but in $(srcdir), so use -r directive to sdbus++ to set schema root accordingly. * The mako template files generated into the build tree, so pass sdbus++ the template path relative to $(top_builddir). Change-Id: I76f70ed832c7cf0ce2a7b8a8ec21672ebcea9c02 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* docs: document interface and error YAMLsPatrick Williams2017-07-173-22/+287
| | | | | | | Resolves openbmc/openbmc#477. Change-Id: I07392ae4712206753399b58650e4658ef769e558 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* example: add client API examplePatrick Williams2017-07-172-1/+35
| | | | | | | | Create a small application which calls org.freedesktop.login1 to display a list of the active users. Change-Id: I8d7879d98f6b89a9315aa0c71b928c50490dfedb Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* sdbus++: move default directoryPatrick Williams2017-07-172-7/+7
| | | | | | | | | 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>
* example: create calculator server appPatrick Williams2017-07-174-1/+118
| | | | | Change-Id: Ie2ad4ff00208056c48c0d596053b20b82f1fb3a1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* example: move schema to top-level dirPatrick Williams2017-07-032-0/+0
| | | | | Change-Id: Icb6a6ca266181e9b401eec64dbbada8b7e334229 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* match: Add additional convenience match rulesBrad Bishop2017-06-191-0/+26
| | | | | | | | | Add interfaces removed. Add properties changed. Add versions of above that take a path argument. Change-Id: I918365a25ca9a9b30c5087de08b4c90e2f15eca3 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* sdbus++: increase constness in convert[enum]FromStringPatrick Williams2017-06-162-2/+2
| | | | | Change-Id: I884ed42a53e30c9209b45e74f6317ec19bb344b4 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* match: add interfacesAdded rulePatrick Williams2017-05-301-0/+7
| | | | | Change-Id: I1849d54ca395e4cbaccb726118ec35bd0ec0c3ef Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* message: Add wrappers for sd_bus_get_xxxBrad Bishop2017-05-151-0/+45
| | | | | | | | | | At the moment only signal arguments are accessible in signal messages. Key information such as the path of the object emitting the signal are in the message headers, so provide access to those as well. Change-Id: I25bc18c21cd4c3d66cad4cf38235469d5092d364 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* match: add string constructorsPatrick Williams2017-05-022-3/+9
| | | | | Change-Id: Ifb6527c5bc686f65fea28679bc653f0509de4aec Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* match: add utilities for match-rulesPatrick Williams2017-05-022-8/+51
| | | | | Change-Id: I47a8c6044f7275994b124e90984cbd8dbef0f0ed Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* match: allow message callbacksPatrick Williams2017-05-012-2/+84
| | | | | | | | | | | The original match constructor only allowed sd_bus_message_handler_t functions, which does not allow for sdbusplus::message::message's to be passed in. Add a constructor that allows functions of the following type: void(*)(sdbusplus::message::message&) Change-Id: Idc006250777c5cc1a5fe48fc411da24339ca165e Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* build: use LDADD/LIBADDPatrick Williams2017-05-012-12/+13
| | | | | | | | | | | Rather than manipulate LDFLAGS directly, the correct way to pass additional linked-to libraries is via the LDADD and LIBADD variables for executables and libraries respectively. Convert all cases of -lfoo to LDADD/LIBADD. Change-Id: Id5fb8539b3fa875430f297de37ad0f3e4ecc3726 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* test: add test for bus::matchPatrick Williams2017-05-012-0/+55
| | | | | Change-Id: Ia45c659a6d88e8a688bcdc92a084a8edc7455ba8 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* test: convert message_native_types to gtestPatrick Williams2017-05-022-12/+29
| | | | | Change-Id: I8aa9e996505d3083ff5650c3fa5107d4143ff482 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* test: convert message_types to gtestPatrick Williams2017-05-022-21/+28
| | | | | Change-Id: Ifb5d2b9f4cb5c6700f5c0164466cc5289ee40a26 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* test: convert tuple_to_array to gtestPatrick Williams2017-05-022-7/+10
| | | | | Change-Id: Ie110fba8f1961ba0e1a46c670d98a2351a46d061 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* test: convert vtable to gtestPatrick Williams2017-05-022-7/+10
| | | | | Change-Id: Ic54957df1c8d08c5461b262628fd1cc5c27217d7 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* bus: add wrapper for sd_bus_list_namesPatrick Williams2017-05-023-0/+77
| | | | | Change-Id: I94467376e89cc813e270cbbe27b83c4415bb9d85 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* match: move to bus namespaceChristian Andersen2017-05-024-14/+23
| | | | | | | | | match directly works on the bus and may be used by servers as well as clients, so sdbusplus::bus seems better suited. Change-Id: If34ad209e83de58365bb64812d19d0bb92a2a1f0 Signed-off-by: Christian Andersen <c.andersen@kostal.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Add wrappers for emit_interfaces_added/removedBrad Bishop2017-04-271-0/+68
| | | | | | | | | | | | Wrappers for sd_bus_emit_object_added/remove already exist but these are not appropriate when adding a new interface to an already existing object, or removing an interface from an object yet other interfaces still remain. Change-Id: I89407bd56feb7d736e7225ee27a36eaf8bda169f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* exception: change org to xyzPatrick Williams2017-04-191-2/+2
| | | | | | | | | The InvalidEnumString has a DBus identifier as org instead of xyz. Since our domain name is openbmc-project.xyz, this should be xyz.openbmc_project. Change-Id: I6d2a83d3ba8c5d39c6176aa6a12aae607eb08a8c Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* bus: change constructor semanticsPatrick Williams2017-04-183-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the bus object had no semantics to recognize if it was the primary-holder of a sd_bus or a secondary one. On destruction, the object always called 'sd_bus_unref' and it was assumed that the sd-bus library would properly close the bus on last-unref. This turns out not to be true and lead to file-descriptor leaks. Change the constructor to mimic what is done in 'message': - When the constructor is called with a sd_bus*, the class becomes a secondary-holder and calls 'sd_bus_unref' on destruction, which is the old behavior. The class also calls 'sd_bus_ref' on construction, so this should no longer be done by callers. - When the constructor is called via the new_* functions (or by adding a std::false_type parameter), the class becomes a primary- holder and calls 'sd_bus_flush_close_unref' on destruction. Note: Current callers that use syntax like 'bus(sd_bus_ref(b))' will need to be updated to avoid a file-descriptor leak. Fixes openbmc/openbmc#1432. Change-Id: Ic0c582f8fbfd44775bcdaffa6a21518a0cd056b1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* exception: move InvalidEnumString functions to libraryPatrick Williams2017-04-183-15/+29
| | | | | Change-Id: Ic5020eddb48d22041a51a39bae2090f379aeaeb6 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Copy the tools directory from source to build directoryAdriana Kobylak2017-03-151-2/+11
| | | | | | | | | | | | | | 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>
* sdbusplus: automatically add 'Error' to error dbus pathsPatrick Williams2017-03-031-2/+2
| | | | | Change-Id: I83d51e9aaa165e646ce711cc8bc551f010edc448 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Disable transaction id support by defaultAdriana Kobylak2017-02-276-6/+27
| | | | | | | | | | 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>
* transaction: avoid recursive sdbus callsPatrick Williams2017-02-161-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | The server bindings for transactions use the bus unique_name to create a transaction ID. If the bus object is not in RUNNING state, the unique_name call causes, deep in sd-bus, a call into sd_bus_process to get the bus up and running since the unique_name is assigned by the dbus-daemon. When DBus objects are created there is a call to generate a signal for object/interface creation. In sd-bus this creates a message and calls back into the server bindings to read all of the properties of the interface. When the transaction ID is assigned, calling unique_name, this causes a recursive entry into sd_bus_process which asserts. The ideal solution would be to catch all C++ objects that might result in a recursive call like this and call unique_name before. This would currently be on slot, server/match, and server/interface and may be others in the future. Instead, I took a simple approach, which is to get the unique_name immediately after instantiating any bus-object. Fixes openbmc/openbmc#1072. Change-Id: I024fd2f46fd08c85317e102dfced88a11e18f9de Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* message-append: Add more string test casesPatrick Williams2017-02-151-4/+45
| | | | | | | Add cases uncovered by openbmc/openbmc#1025. Change-Id: I680b95b2127d50837dccd3ea1ff655fc1eb19ec9 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* message-append: char* passed to sd-bus as char**Patrick Williams2017-02-151-1/+20
| | | | | | | | | | | | | | If a call to message::append resulted in the templates generating a call to sd_bus_message_append_basic, all flavors of char* were being passed to sd_bus as char**. Fix by adding type-templates to distinguish between T and T* for the parameters to sd_bus_message_append_basic. Fixes openbmc/openbmc#1025. Change-Id: I2f3a204ae10803c677d1c3aecfa4d9eabc40b593 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* build: Use AX for pkg configBrad Bishop2017-02-112-1/+8
| | | | | | | | Use an autoconf archive macro for pkg config so autoconf can fill out Requires.private in sdbusplus.pc.in. Change-Id: I62fd658b813ecde437756aefcee91ba42a3a94b2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add wrappers for sd_bus object added/removedBrad Bishop2017-02-091-0/+26
| | | | | Change-Id: I5031f82b4ae702d17f22a88aad56733e2a662b21 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* bus: Add interface for sd-eventYi Li2017-02-091-0/+23
| | | | | | | | With these interfaces user can attach a sd-event event loop object with sdbusplus::bus::bus. Change-Id: I09dcc54e532162ae5e53d446772ab5bddaa4a0a4 Signed-off-by: Yi Li <adamliyi@msn.com>
* sdbus++: Add server method for get-propertyPatrick Williams2017-02-032-0/+19
| | | | | | | | | 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>
* sdbus++: Add server constructor from property-mapPatrick Williams2017-02-032-0/+22
| | | | | | | | | | 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>
* sdbus++: add server method for set-propertyPatrick Williams2017-02-033-1/+38
| | | | | | | | | Add a method to the server bindings that sets properties by looking up the name from a string. Change-Id: I7e9081b66dfeffd394155a574c2178a7cd039e2a Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* build: Generate package-config fileAdriana Kobylak2017-02-013-0/+16
| | | | | Change-Id: Id3fc546c7fabe34bc31c4030d2e196f6d7f39090 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* message: Add get bus functionAdriana Kobylak2017-02-012-0/+15
| | | | | | | | | Function to get the dbus bus from a dbus message. Forward declare it and implement it in bus.hpp so that the return type is sdbusplus::bus::bus. Change-Id: Ice55c8ce484ae1b575e762cc0d9e2826b4ba6504 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* transaction: Generate hash for when bus and msg are not initializedAdriana Kobylak2017-02-011-0/+25
| | | | | | | | This scenario applies for clients that want to create an error log and have not made a dbus call yet. Change-Id: I2702fc01bd66deba2606fad92314eeed8c277277 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
OpenPOWER on IntegriCloud