History log of /openbmc/sdbusplus/include/ (Results 251 – 271 of 271)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
e659436d10-Oct-2020 Patrick Williams <patrick@stwcx.xyz>

server/interface: simplify property_changed

The previous property_changed implementation created a dynamic vector to
hold two elements. Switch to std::array to simplify the code and
compiled functi

server/interface: simplify property_changed

The previous property_changed implementation created a dynamic vector to
hold two elements. Switch to std::array to simplify the code and
compiled function size.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ia2960fdd8b979ce9ccf661b013618de8d28f5e89

show more ...

1d35f91a09-Oct-2020 Patrick Williams <patrick@stwcx.xyz>

sdbus++: create server support functions

Reduce the complexity of the generated bindings by taking the
common patterns and moving them to support template functions.
This has the side-effect of a sm

sdbus++: create server support functions

Reduce the complexity of the generated bindings by taking the
common patterns and moving them to support template functions.
This has the side-effect of a small space savings a library
of generated bindings.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I55d6de0aa8773a68f1a23b1301056ea3435dbbc9

show more ...

eb4bd72417-Dec-2020 Ed Tanous <edtanous@google.com>

Add filename() and parent_path() methods to object_path

In practice, one very common operation done on a dbus path is to get the
final member name in the dbus path, to use as unique IDs, or to pass

Add filename() and parent_path() methods to object_path

In practice, one very common operation done on a dbus path is to get the
final member name in the dbus path, to use as unique IDs, or to pass
items to public interfaces. This tends to lead to something like:

size_t pos = object_path.str.rfind('/');
if(pos == std::string::npos){
// handle error
}
pos++;
if (pos >= object_path.str.size()){
// handle error
}

std::string name = object_path.str.substr(pos);

As an aside, what I've written above is one of several "right" ways to
do it, and is among many other wrong ways that I've seen people try to
check in. The goal of this patchset is to add the above code as a
method within object_path, to help people to use it, and to avoid using
object_path.str, which ideally would be a private member of that class.

Functionally, accomplishing the above this requires splitting
string_wrapper into two separate classes, as we continue to need the
string_wrapper instance to handle the signature type, but filename() and
parent_path() on signature are non-sensical. Therefore, this splits the
functionality into string_wrapper and string_path_wrapper, each of which
no longer need to be a template, given there is only one use. We could
also get rid of the using, and move these classes out of details, but
that seemed better reserved for a later patch.

Tested:
Unit tests written and passing.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I242d1965875ba1fe76a32fd78e381e90796706fc

show more ...

4f65175118-Dec-2020 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

fixed issue which prevented to use setProperty with reference types

Tested:
aligned example/register-property to use reference types, executed and
verified that example is working after change

fixed issue which prevented to use setProperty with reference types

Tested:
aligned example/register-property to use reference types, executed and
verified that example is working after change

Change-Id: I9999bae5f1cc2bb520f74527bd5b7eae8fa1af35
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>

show more ...

0c76546f15-Dec-2020 Vernon Mauery <vernon.mauery@linux.intel.com>

exit read_wait async loop on error

fixes: https://github.com/openbmc/sdbusplus/issues/56

If read_wait's callback is passed an error, it should not
schedule another read, it should quit.

Tested: ca

exit read_wait async loop on error

fixes: https://github.com/openbmc/sdbusplus/issues/56

If read_wait's callback is passed an error, it should not
schedule another read, it should quit.

Tested: calls to io.quit() will successfully exit the read loop

Change-Id: If97efd1dc0ae57658d44a5ce86422ac24adaabb8
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

e4f21dfb05-Nov-2020 Waqar Hameed <waqarh@axis.com>

message: Declare getters as const member functions

This allows const message objects to call the getters.

Signed-off-by: Waqar Hameed <waqarh@axis.com>
Change-Id: I15b9fd69d114495e8c29cf310db1188e6

message: Declare getters as const member functions

This allows const message objects to call the getters.

Signed-off-by: Waqar Hameed <waqarh@axis.com>
Change-Id: I15b9fd69d114495e8c29cf310db1188e6579fffe

show more ...

8fc0639728-Sep-2020 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

asio: Added method add_unique_interface to object_server

Add_unique_interface returns unique_ptr instead of shared_ptr.
When shared_ptr is used call to object_server::remove_interface
is needed, whe

asio: Added method add_unique_interface to object_server

Add_unique_interface returns unique_ptr instead of shared_ptr.
When shared_ptr is used call to object_server::remove_interface
is needed, when unique_ptr is used interface is removed when
goes out of scope.

Tested:
- Changed two of the examples to use this method
- All other tests are still passing after this change

Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I490acafdaf0cd62419a0540adbb846c393c3939f

show more ...

4690d88c08-Oct-2020 Patrick Williams <patrick@stwcx.xyz>

sdbus++: handle duplicate generated variant types

4ac7e56e8e18202fad3b2734346c6d4c7a6957fc added support for 'size_t'
and 'ssize_t' types to sdbus++. On some architectures these collide
with '[u]in

sdbus++: handle duplicate generated variant types

4ac7e56e8e18202fad3b2734346c6d4c7a6957fc added support for 'size_t'
and 'ssize_t' types to sdbus++. On some architectures these collide
with '[u]int32_t' or '[u]int64_t' types and so may not be added to a
combined variant (ie. variant<uint32_t, size_t> will fail to compile
on some architectures). The generated bindings in sdbus++ need a
variant from the set of all properties for some of the constructor
forms.

Create a template type which will formulate a non-duplicative type set
from which a variant can be constructed and modify the sdbus++ generator
to use this variant type instead of std::variant directly. Added test
cases here to cover this condition for 'size' and 'ssize' sdbus++ types.

It is possible this could have been resolved in the generator itself,
but then the generator would have needed to know which architecture the
generated bindings were going to be compiled for. This would have made
the header files incompatible between x86-64 and arm32. I chose instead
to keep the header files consistent across all architectures and let the
compiler make the type decision.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I7db5ad2c32d86d37d920a1801cdabfcaeda89489

show more ...

807419d328-Sep-2020 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

asio: Added utility functions getProperty and setProperty

Tested:
- Modified one of the examples to use this utility instead
- All other tests are still passing after this change

Change-Id: I32

asio: Added utility functions getProperty and setProperty

Tested:
- Modified one of the examples to use this utility instead
- All other tests are still passing after this change

Change-Id: I3237e281915c7edf931e3326b88bd24714ee8ecb
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>

show more ...

09b88f2602-Sep-2020 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

Added utility functions getAllProperties and unpackProperties

Tested:
- Added example to verify that functions work correctly
- Added new unit tests that are passing
- All other tests are stil

Added utility functions getAllProperties and unpackProperties

Tested:
- Added example to verify that functions work correctly
- Added new unit tests that are passing
- All other tests are still passing after this change
- Added handling of new type (std::monostate) which can
be used as first type in variant to represent that none
of the other types was matched

Change-Id: Ic8e7c8d3116d64b94be37147ae8a80ebb5d3811d
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>

show more ...

992ab24a09-Sep-2020 Wludzik, Jozef <jozef.wludzik@intel.com>

Remove regex match pattern from object_server

Removed regex from object_server to avoid crash on std::regex_match
function when input string is very long. It is known bug in gcc that
std::regex cras

Remove regex match pattern from object_server

Removed regex from object_server to avoid crash on std::regex_match
function when input string is very long. It is known bug in gcc that
std::regex crashes with stack overflow when matching long lines.
Removed verifying path and interface from add_interface method because
both are verified in sd_bus_add_object_vtable function.
Checking return code of sd_bus_add_object_vtable is covered in
017a19da5f67a74daedf4d63111569902d4764e6 commit thanks to Waqar Hameed
<waqarh@axis.com>.

Tested:
- Added new path longer than 1024 signs with success
- Verified if add_interface return invalid argument on invalid path
and interface

Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
Change-Id: I11481fa724f04ae441e5d247a120882b272b3b6e

show more ...

dbfb967911-Sep-2020 Patrick Williams <patrick@stwcx.xyz>

native_types: add != comparison for string_wrapper

If a 'type: path' is added to a sdbus++ interface YAML file, the
resulting code does not compile due to a missing != comparison
operator for string

native_types: add != comparison for string_wrapper

If a 'type: path' is added to a sdbus++ interface YAML file, the
resulting code does not compile due to a missing != comparison
operator for string_wrapper. Add it and enhance the test case to
cover.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iaa661a15e58a99e4e816c391152926e9af1a8339

show more ...

2be0e17327-Jul-2020 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

Added flags parameter to register_property method

- flags parameter is set by default to vtable::property_::emits_change
- with this change user can set parameter to vtable::property_::none
to avo

Added flags parameter to register_property method

- flags parameter is set by default to vtable::property_::emits_change
- with this change user can set parameter to vtable::property_::none
to avoid sending property change signal for greater performance
- added example/register-property.cpp with example application
which uses new functions

Tested:
- run openbmc tests with this change, no regression detected
- tested that default behaviour (property_::emits_change) is working as intended
- tested that properties still signal change when emit_change flag is used
- tested that properties doesn't signal change when no emit_change flag is used
- tested that const flag is passed and handled corretly
- verified that performance of application increases when emit_change flag turned off

Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: If6187cf076b8e05a5211c83797374a3be94da0c9

show more ...

38ab5ecf17-Aug-2020 Ed Tanous <ed@tanous.net>

Refine include headers

sdbusplus #includes all of asio.hpp, which causes every single consumer
compile all of asio, just to throw it away afterward. This is wasteful.

This commit changes sdbusplus

Refine include headers

sdbusplus #includes all of asio.hpp, which causes every single consumer
compile all of asio, just to throw it away afterward. This is wasteful.

This commit changes sdbusplus to only include the components that it
uses, and (hopefully) decrease the overall project compile times by a
bit.

This commit requires:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-net-ipmid/+/35718
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/35719
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-objmgr/+/35720

Before the project as a whole will build.

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Id6372de936cd2562ff3c96f19f632ccfaa21c14e

show more ...

72f24b0714-Jul-2020 Vernon Mauery <vernon.mauery@linux.intel.com>

fix interface and path patterns to match D-Bus specification

The old regex checks did not account for all the requirements,
namely empty paths and two-part names.

Tested: This rejects poorly-named

fix interface and path patterns to match D-Bus specification

The old regex checks did not account for all the requirements,
namely empty paths and two-part names.

Tested: This rejects poorly-named interfaces and paths as expected.
Tested interfaces:
""
"xyz.openbmc_project.some-interface"
"xyz.openbmc_project.some/interface"
"bob"
Tested paths:
""
"/xyz/openbmc_project/some-interface"
"/xyz/openbmc_project/some.interface"
"xyz/openbmc_project/some/interface"
"bob"

Change-Id: I3d8979c9eb19680c66a5031efd334a574f8f7be3
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>

show more ...

0f19c87226-Jun-2020 Zhikui Ren <zhikui.ren@intel.com>

Add new_signal and extend set_property methods to dbus_interface

new_signal exports the same member function of sdbusplus::server::interface

extend set_property to be able to return true only when

Add new_signal and extend set_property methods to dbus_interface

new_signal exports the same member function of sdbusplus::server::interface

extend set_property to be able to return true only when the property value
is changed. default behavior remains unchanged - returns true when property
is updated successfully, value may be same or changed.

With these two functions, dbus_interface can broadcast new signal when
a property is changed. This allows a customized message to be sent
when a property changes.

Tested:
Build test code to use the two new method to create and send new_signal when
a property is changed.

Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: I1815885bc77aad2c526b402f1386d4914479e738

show more ...

f534ba0425-Jun-2020 William A. Kennington III <wak@google.com>

message: Add method_error creation from exception

We currently only support creating methods from a unix errno and
description. This allows us to create error return messages directly
from sdbusplus

message: Add method_error creation from exception

We currently only support creating methods from a unix errno and
description. This allows us to create error return messages directly
from sdbusplus exceptions that internally provide the required name and
description.

Change-Id: I4db91b191e13ba78e7796312d018d3d08d2c8aed
Signed-off-by: William A. Kennington III <wak@google.com>

show more ...

b98bdc6f16-Jun-2020 Patrick Williams <patrick@stwcx.xyz>

sdbus++: add support for 'set'

Add 'set' as a supported type to `sdbus++` and set as `std::set`.
The use of ordered-set is to match 'dict' as `std::map` and because
'struct' is `std::tuple`, which h

sdbus++: add support for 'set'

Add 'set' as a supported type to `sdbus++` and set as `std::set`.
The use of ordered-set is to match 'dict' as `std::map` and because
'struct' is `std::tuple`, which has `operator<=>` but not `std::hash`.
This ensures better compatiblilty with possible property type choices
by users.

Also, add a few test cases to ensure `std::set` and `std::unordered_set`
are well-covered.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I59605db1b22d54f783d807eda1e1ec1f9eb6792f

show more ...

fb0366b509-Jun-2020 Patrick Williams <patrick@stwcx.xyz>

asio: object_server: remove invalid root interface

Right now a trivial snippet of code will throw an exception:
```
boost::asio::io_service io;
auto systemBus = std::make_shared<sdbusplus::a

asio: object_server: remove invalid root interface

Right now a trivial snippet of code will throw an exception:
```
boost::asio::io_service io;
auto systemBus = std::make_shared<sdbusplus::asio::connection>(io);

systemBus->request_name(this_name);
sdbusplus::asio::object_server objectServer(systemBus);
```

In commit 017a19da, code was added to detect the return code from
`sd_bus_add_object_vtable` and turn it into an exception. It turns out
that our existing `asio::object_server` is triggering this exception
itself.

I traced the issue down to the empty-named interface being added into
the / path by `asio::object_server`:
```
auto root = add_interface("/", "");
```

Empty interface names are invalid and thus this gives us an error from
`sd_bus_add_object_vtable`. I cannot tell the history or rationale on
this code, because it has been around from the beginning, but I suspect
at one point if we didn't have _some_ object we also did not get an
`ObjectManager` interface. I deleted this code now and confirmed we do
still get an `ObjectManager`.

```
$ busctl --user tree xyz.openbmc_project.sdbusplus.test.Aio
Only root object discovered.
$ busctl --user introspect xyz.openbmc_project.sdbusplus.test.Aio / |
grep interface
org.freedesktop.DBus.Introspectable interface - - -
org.freedesktop.DBus.ObjectManager interface - - -
org.freedesktop.DBus.Peer interface - - -
org.freedesktop.DBus.Properties interface - - -
```

Since we still get an `ObjectManager` and this code likely hasn't worked
for quite a while, but was silently ignoring the error from sd-bus, I
think we are safe to remove it.

Reported-by: Andrew Geissler <geissonator@yahoo.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I989ae218a882bc2e45594cb380d318e6a8f0f17e

show more ...

da0b3f1327-Mar-2020 Konrad Sztyber <konrad.sztyber@intel.com>

sdbusplus: settable timeout value for async_method_call

Added extra method, asio::connection::async_method_call_timed allowing
the user to specify the value of the timeout to be used for that call
(

sdbusplus: settable timeout value for async_method_call

Added extra method, asio::connection::async_method_call_timed allowing
the user to specify the value of the timeout to be used for that call
(in microseconds). Using 0 as the timeout results in using the default
value, which is equivalent to calling asio::connection::async_method_call.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Id79772e46a77f62af5b39ec341648e34af6aaf99

show more ...

7f66425404-Jun-2020 Patrick Williams <patrick@stwcx.xyz>

build: split source and header directories

Split the headers and source to simplify the install_header
directive such that we no longer need to specify cpp files
to exclude in the install_header cal

build: split source and header directories

Split the headers and source to simplify the install_header
directive such that we no longer need to specify cpp files
to exclude in the install_header call.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iac4c38f95e690aa8ef8ecf87b032f55a1a31409c

show more ...


/openbmc/sdbusplus/.clang-format
/openbmc/sdbusplus/.gitignore
/openbmc/sdbusplus/LICENSE
/openbmc/sdbusplus/MAINTAINERS
/openbmc/sdbusplus/README.md
/openbmc/sdbusplus/docs/error.md
/openbmc/sdbusplus/docs/interface.md
/openbmc/sdbusplus/example/asio-example.cpp
/openbmc/sdbusplus/example/calculator-server.cpp
/openbmc/sdbusplus/example/list-users.cpp
/openbmc/sdbusplus/example/meson.build
/openbmc/sdbusplus/example/net/poettering/Calculator.errors.yaml
/openbmc/sdbusplus/example/net/poettering/Calculator.interface.yaml
sdbusplus/asio/connection.hpp
sdbusplus/asio/detail/async_send_handler.hpp
sdbusplus/asio/object_server.hpp
sdbusplus/asio/sd_event.hpp
sdbusplus/bus.hpp
sdbusplus/bus/match.hpp
sdbusplus/exception.hpp
sdbusplus/message.hpp
sdbusplus/message/append.hpp
sdbusplus/message/native_types.hpp
sdbusplus/message/read.hpp
sdbusplus/message/types.hpp
sdbusplus/sdbus.hpp
sdbusplus/server.hpp
sdbusplus/server/README.md
sdbusplus/server/bindings.hpp
sdbusplus/server/interface.hpp
sdbusplus/server/manager.hpp
sdbusplus/server/object.hpp
sdbusplus/server/transaction.hpp
sdbusplus/slot.hpp
sdbusplus/test/sdbus_mock.hpp
sdbusplus/timer.hpp
sdbusplus/utility/container_traits.hpp
sdbusplus/utility/read_into_tuple.hpp
sdbusplus/utility/tuple_to_array.hpp
sdbusplus/utility/type_traits.hpp
sdbusplus/vtable.hpp
/openbmc/sdbusplus/meson.build
/openbmc/sdbusplus/src/exception.cpp
/openbmc/sdbusplus/src/sdbus.cpp
/openbmc/sdbusplus/src/server/transaction.cpp
/openbmc/sdbusplus/test/bus/list_names.cpp
/openbmc/sdbusplus/test/bus/match.cpp
/openbmc/sdbusplus/test/exception/sdbus_error.cpp
/openbmc/sdbusplus/test/meson.build
/openbmc/sdbusplus/test/message/append.cpp
/openbmc/sdbusplus/test/message/native_types.cpp
/openbmc/sdbusplus/test/message/read.cpp
/openbmc/sdbusplus/test/message/types.cpp
/openbmc/sdbusplus/test/server/Test.interface.yaml
/openbmc/sdbusplus/test/server/object.cpp
/openbmc/sdbusplus/test/timer.cpp
/openbmc/sdbusplus/test/utility/tuple_to_array.cpp
/openbmc/sdbusplus/test/utility/type_traits.cpp
/openbmc/sdbusplus/test/valgrind.supp
/openbmc/sdbusplus/test/vtable/vtable.cpp
/openbmc/sdbusplus/test/vtable/vtable_c.c
/openbmc/sdbusplus/tools/meson.build
/openbmc/sdbusplus/tools/sdbus++
/openbmc/sdbusplus/tools/sdbus++-gendir
/openbmc/sdbusplus/tools/sdbusplus/__init__.py
/openbmc/sdbusplus/tools/sdbusplus/enum.py
/openbmc/sdbusplus/tools/sdbusplus/error.py
/openbmc/sdbusplus/tools/sdbusplus/interface.py
/openbmc/sdbusplus/tools/sdbusplus/method.py
/openbmc/sdbusplus/tools/sdbusplus/namedelement.py
/openbmc/sdbusplus/tools/sdbusplus/property.py
/openbmc/sdbusplus/tools/sdbusplus/renderer.py
/openbmc/sdbusplus/tools/sdbusplus/signal.py
/openbmc/sdbusplus/tools/sdbusplus/templates/error.cpp.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/error.hpp.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/error.md.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/interface.client.hpp.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/interface.md.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/interface.server.cpp.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/interface.server.hpp.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/method.md.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/method.prototype.hpp.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/property.md.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/property.prototype.hpp.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/signal.md.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/signal.prototype.hpp.mako
/openbmc/sdbusplus/tools/setup.py

1...<<11