History log of /openbmc/sdbusplus/example/get-all-properties.cpp (Results 1 – 14 of 14)
Revision Date Author Comments
# 06f265f6 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

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

show more ...


# 6db88387 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

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

show more ...


# d2149044 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

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

show more ...


# b65dc1c6 07-Mar-2023 Ed Tanous <edtanous@google.com>

Use more specific includes

We shouldn't be including all of asio, just the parts we need.

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


# 760e66a8 05-Jan-2023 Ed Tanous <edtanous@google.com>

Remove unused variable

Clang correctly notes that ioc is private and unused. Remove it.

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


# ae47928b 03-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 ...


# 1a25a10d 29-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 ...


# c8447d52 05-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 ...


# 90fab6bb 18-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 ...


# 6adfe948 21-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 ...


# 95874d93 19-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 ...


# 8fc06397 28-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 ...


# 807419d3 28-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 ...


# 09b88f26 02-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 ...