History log of /openbmc/sdbusplus/example/ (Results 51 – 75 of 111)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
f7944dcb05-Dec-2022 Patrick Williams <patrick@stwcx.xyz>

prettierrc: update config

Copy org-wide config from openbmc-build-scripts and reformat
accordingly.

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

prettierrc: update config

Copy org-wide config from openbmc-build-scripts and reformat
accordingly.

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

show more ...

ae47928b03-Jun-2022 Jonathan Doman <jonathan.doman@intel.com>

Clean up ASIO set-property callback code

This reverts commit ce62764d6c0a72ec88eb433e1afd05b751225971, which
introduced inconsistent semantics for the underlying ASIO set handler
functions. The "ext

Clean up ASIO set-property callback code

This reverts commit ce62764d6c0a72ec88eb433e1afd05b751225971, which
introduced inconsistent semantics for the underlying ASIO set handler
functions. The "external" `call` case expected the handler to return an
integer error code, while the "internal" `set` case expected the handler
to return a boolean status.

This also does a small refactor on the two similar `call` and `set`
functions to deduplicate, and adds ASIO.md to document the expected
semantics of the ASIO handlers.

The vast majority of user code in OpenBMC is still returning integers
from the callbacks (0/1/-1), but in most cases 0 was used to mean
failure, and 1 was used to mean success, so formalizing that the
callback should return a boolean value will not break things.

Tested: With accompanying dbus-sensors change
I05c41318954d5d1549752c5ef2c227f3f22a45d3, using steps in that commit
msg.

Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Change-Id: Ic3a36027fa95a77469439b296a1497634cfe030f

show more ...

3c242ba423-Sep-2022 Patrick Williams <patrick@stwcx.xyz>

async: context: simplify run function

Since we already have a `spawn` function to add async tasks,
get rid of the special "startup" task send to run. Instead
users should pass the start up work to

async: context: simplify run function

Since we already have a `spawn` function to add async tasks,
get rid of the special "startup" task send to run. Instead
users should pass the start up work to spawn and call run with
no parameters.

Eventually this will allow us to exit the run-loop for any and all
exceptions from the async context and potentially allow a caller
to re-enter the `run` loop after handling the child exception.

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

show more ...

73e278b516-Sep-2022 Patrick Williams <patrick@stwcx.xyz>

async: context: support stopping the context

Up until this point, the async::context would run forever and have
no way of exiting the process, which isn't very useful. Add some
support for stop con

async: context: support stopping the context

Up until this point, the async::context would run forever and have
no way of exiting the process, which isn't very useful. Add some
support for stop conditions so that we can ask the context to stop
and cleanly exit.

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

show more ...

290fa42729-Aug-2022 Patrick Williams <patrick@stwcx.xyz>

async: add match

Define a class which will register for a dbus signal match
and generate Senders that await new signals.

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

async: add match

Define a class which will register for a dbus signal match
and generate Senders that await new signals.

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

show more ...

10010b1928-Aug-2022 Patrick Williams <patrick@stwcx.xyz>

async: add client-object proxy

Add a class which acts as a client-side proxy to a object. The
proxy holds the object address (service, path, interface) and
creates Senders for standard dbus operati

async: add client-object proxy

Add a class which acts as a client-side proxy to a object. The
proxy holds the object address (service, path, interface) and
creates Senders for standard dbus operations: method-call,
get-property, set-property, get-all-properties. These Senders
can also be used in co-routine contexts (via co_await).

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

show more ...


/openbmc/sdbusplus/.clang-format
coroutine-example.cpp
meson.build
/openbmc/sdbusplus/include/sdbusplus/asio/connection.hpp
/openbmc/sdbusplus/include/sdbusplus/asio/object_server.hpp
/openbmc/sdbusplus/include/sdbusplus/async.hpp
/openbmc/sdbusplus/include/sdbusplus/async/callback.hpp
/openbmc/sdbusplus/include/sdbusplus/async/context.hpp
/openbmc/sdbusplus/include/sdbusplus/async/execution.hpp
/openbmc/sdbusplus/include/sdbusplus/async/proxy.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/__detail/__config.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/__detail/__intrusive_ptr.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/__detail/__intrusive_queue.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/__detail/__meta.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/__detail/__p2300.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/commit.info
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/concepts.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/coroutine.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/execution.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/functional.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/import
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/scope.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/stop_token.hpp
/openbmc/sdbusplus/include/sdbusplus/async/stdexec/task.hpp
/openbmc/sdbusplus/include/sdbusplus/async/task.hpp
/openbmc/sdbusplus/include/sdbusplus/message/native_types.hpp
/openbmc/sdbusplus/include/sdbusplus/server/object.hpp
/openbmc/sdbusplus/include/sdbusplus/server/transaction.hpp
/openbmc/sdbusplus/meson.build
/openbmc/sdbusplus/src/async/context.cpp
/openbmc/sdbusplus/src/server/transaction.cpp
/openbmc/sdbusplus/test/async/task.cpp
/openbmc/sdbusplus/test/meson.build
1a25a10d29-Sep-2022 Patrick Williams <patrick@stwcx.xyz>

clang-format: update whitespace penalty

clang-format-15 seems to end up with a slightly different whitespace
break than clang-format-14 did. Tweak the PenaltyBreakAssignment
to favor not breaking a

clang-format: update whitespace penalty

clang-format-15 seems to end up with a slightly different whitespace
break than clang-format-14 did. Tweak the PenaltyBreakAssignment
to favor not breaking as often, which allows the two to be more
consistent.

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

show more ...

ce8d16d907-Sep-2022 Willam A. Kennington III <wak@google.com>

treewide: Leverage sdbus++-gen-meson

This makes us more consistent with other projects instead of writing
meson builds for sdbus++ by hand.

Change-Id: I38b69bc67b6a3d80cda1b508a76e106a50d8ab93
Sign

treewide: Leverage sdbus++-gen-meson

This makes us more consistent with other projects instead of writing
meson builds for sdbus++ by hand.

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

show more ...

293c8a2602-Sep-2022 William A. Kennington III <wak@google.com>

sdbus++: Fix meson dependency generation

All of the generated meson files optionally look for sdbus++ sources
that can be plumbed in to allow changes to the generator code to
correctly trigger rebui

sdbus++: Fix meson dependency generation

All of the generated meson files optionally look for sdbus++ sources
that can be plumbed in to allow changes to the generator code to
correctly trigger rebuilds.

This will require adding a new variable prior to generated sources,
`sdbusplusplus_depfiles`. You can convert previous meson defitions with
the follwing.

```
sdbusplus_dep = dependency('sdbusplus')
sdbusplusplus_prog = find_program('sdbus++', native: true)
sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson', native: true)
sdbusplusplus_depfiles = files()
if sdbusplus_dep.type_name() == 'internal'
sdbusplusplus_depfiles = subproject('sdbusplus').get_variable('sdbusplusplus_depfiles')
endif
```

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

show more ...

25e2a09431-Aug-2022 Nan Zhou <nanzhoumails@gmail.com>

bus: utility to process messages in infinite loop

This change introduces a simple function for synchronous DBus servers to
start listening to incoming requests and run forever.

This can avoid dupli

bus: utility to process messages in infinite loop

This change introduces a simple function for synchronous DBus servers to
start listening to incoming requests and run forever.

This can avoid duplicate while loops in server codes across repos.

Please see the following change for context.
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-user-manager/+/56843

Tested: the calculator server unit test passed.

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I1b6485869527e938c429c035a0551ec4dbb36c99

show more ...

9cde21ff29-Aug-2022 Patrick Williams <patrick@stwcx.xyz>

message: add unpack method

Add an unpack method that allows reading from the message as
r-values. This simplifies the pattern:

```
foo f{};
bar b{};
msg.read(f,b);

// Can now be w

message: add unpack method

Add an unpack method that allows reading from the message as
r-values. This simplifies the pattern:

```
foo f{};
bar b{};
msg.read(f,b);

// Can now be written as...

auto [f, b] = msg.unpack<foo, bar>();
```

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

show more ...

c8447d5205-Jan-2022 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

added support for optionals in unpackProperties

- Added support for optionals
- Added support for pointers
- Removed support for moving data from input container
- Removed support for container type

added support for optionals in unpackProperties

- Added support for optionals
- Added support for pointers
- Removed support for moving data from input container
- Removed support for container types other than std::vector

Tested:
- Unit tests are passing
- Examples which use unpackProperties are working correctly

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

show more ...

9f11c97914-Mar-2022 Patrick Williams <patrick@stwcx.xyz>

format: copy configs from phosphor-dbus-interfaces and reformat

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

e944507f12-Mar-2022 Patrick Williams <patrick@stwcx.xyz>

yaml: format with prettier

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

90fab6bb18-Feb-2022 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

Add new overload to register_property_r/rw

New overload doesn't take initial property values as parameter, instead
getter function result is used to set stored reference value. This
approach prevent

Add new overload to register_property_r/rw

New overload doesn't take initial property values as parameter, instead
getter function result is used to set stored reference value. This
approach prevents situation when initial value can be different than
value returned by getter function which can cause signals to missbehave.

Tested:
- Changed examples register-property.cpp and get-all-properties.cpp to
use new overload. Examples are working as before.

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

show more ...

6adfe94821-Dec-2021 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

Simplified code examples

- renamed variables to be less confusing
- removed wrapper for properties
- added example usage of sdbusplus::unpackPropertiesNoThrow

Tested:
- Console output from both exa

Simplified code examples

- renamed variables to be less confusing
- removed wrapper for properties
- added example usage of sdbusplus::unpackPropertiesNoThrow

Tested:
- Console output from both examples is the same
- Both examples still return error code 0 after Ctl+C

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

show more ...

0f282c4819-Nov-2021 Patrick Williams <patrick@stwcx.xyz>

bus: shorten bus type

Create an alias `sdbusplus::bus_t` to `sdbusplus::bus::bus` to reduce
duplication.

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

bus: shorten bus type

Create an alias `sdbusplus::bus_t` to `sdbusplus::bus::bus` to reduce
duplication.

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

show more ...

10d7aa1219-Nov-2021 Patrick Williams <patrick@stwcx.xyz>

message: shorten message type

Create an alias `sdbusplus::message_t` to `sdbusplus::message::message`
to reduce duplication.

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

message: shorten message type

Create an alias `sdbusplus::message_t` to `sdbusplus::message::message`
to reduce duplication.

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

show more ...

b466765406-Oct-2021 Patrick Williams <patrick@stwcx.xyz>

catch exceptions as const

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


/openbmc/sdbusplus/docs/error.md
/openbmc/sdbusplus/docs/interface.md
asio-example.cpp
/openbmc/sdbusplus/include/sdbusplus/asio/connection.hpp
/openbmc/sdbusplus/include/sdbusplus/asio/object_server.hpp
/openbmc/sdbusplus/include/sdbusplus/bus.hpp
/openbmc/sdbusplus/include/sdbusplus/bus/match.hpp
/openbmc/sdbusplus/include/sdbusplus/exception.hpp
/openbmc/sdbusplus/include/sdbusplus/message.hpp
/openbmc/sdbusplus/include/sdbusplus/message/append.hpp
/openbmc/sdbusplus/include/sdbusplus/message/native_types.hpp
/openbmc/sdbusplus/include/sdbusplus/message/read.hpp
/openbmc/sdbusplus/include/sdbusplus/message/types.hpp
/openbmc/sdbusplus/include/sdbusplus/sdbuspp_support/server.hpp
/openbmc/sdbusplus/include/sdbusplus/server.hpp
/openbmc/sdbusplus/include/sdbusplus/utility/container_traits.hpp
/openbmc/sdbusplus/include/sdbusplus/utility/dedup_variant.hpp
/openbmc/sdbusplus/include/sdbusplus/utility/type_traits.hpp
/openbmc/sdbusplus/meson.build
/openbmc/sdbusplus/src/exception.cpp
/openbmc/sdbusplus/src/message/native_types.cpp
/openbmc/sdbusplus/test/meson.build
/openbmc/sdbusplus/test/server/Test.interface.yaml
/openbmc/sdbusplus/test/server/message_variant.cpp
/openbmc/sdbusplus/test/utility/type_traits.cpp
/openbmc/sdbusplus/tools/sdbusplus/error.py
/openbmc/sdbusplus/tools/sdbusplus/namedelement.py
/openbmc/sdbusplus/tools/sdbusplus/property.py
/openbmc/sdbusplus/tools/sdbusplus/templates/error.cpp.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/error.hpp.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.prototype.hpp.mako
/openbmc/sdbusplus/tools/sdbusplus/templates/property.prototype.hpp.mako
270f242c04-Jun-2021 William A. Kennington III <wak@google.com>

build: Propagate boost arguments as needed

This aligns sdbusplus_dep and the packageconfig to pass the needed
dependency information to utilize boost ASIO with the expected compiler
arguments.

Chan

build: Propagate boost arguments as needed

This aligns sdbusplus_dep and the packageconfig to pass the needed
dependency information to utilize boost ASIO with the expected compiler
arguments.

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

show more ...

95874d9319-Feb-2021 Ed Tanous <edtanous@google.com>

Standardize the asio helper methods

As a general rule, std::networking/asio methods take a single callback
handler. This is done intentionally, as it allows objects that cannot
be taken by referenc

Standardize the asio helper methods

As a general rule, std::networking/asio methods take a single callback
handler. This is done intentionally, as it allows objects that cannot
be taken by reference to be taken directly by move.

The latest helper methods for properties seems to have taken a
javascript style approach, with "onSuccess" and "onError" handlers.
This works fine in js, where everything is reference counted, but
doesn't work in all cases in c++.

As an strawman.

std::unique_ptr<Thing> myThing;
setProperty(......
[myThing{std::move(myThing)}](std::error_code){
... Use MyThing
},
[myThing{std::move(myThing)}](){
... Use mything
});

The above code doesn't work, as you can't move out of myThing twice.
Sure, you could make myThing a shared_ptr, but that's wasteful, and
defeats c++es policy of "you don't pay for what you don't use".

This commit changes the new handlers to use more standard prototypes
that accept a single callback, and return error codes on failure.

I was able to find only one usage of these methods in the codebase,
inside telemetry, with a single getProperty call. For that method, I
have left the old version of this method present, and marked it with the
c++17 [[deprecated]] flag, along with a note on what to do instead.
This is to avoid a hard binding between this patchset and
https://gerrit.openbmc-project.xyz/c/openbmc/telemetry/+/40878
which should allow them to be merged in whatever order we like.

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

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 ...

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 ...

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 ...

12345