d731d263 | 17-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: create event classes
Generate an equivalent amount of exception class as the `errors.yaml` supported and convert the examples to use it.
Tested:
``` ‣ Type=error Endian=l Flags=
sdbus++: events: create event classes
Generate an equivalent amount of exception class as the `errors.yaml` supported and convert the examples to use it.
Tested:
``` ‣ Type=error Endian=l Flags=1 Version=1 Cookie=9 ReplyCookie=2 Timestamp="Tue 2024-09-17 18:21:35.649674 UTC" Sender=:1.2489 Destination=:1.2495 ErrorName=net.poettering.Calculator.DivisionByZero ErrorMessage="Attempted to divide by zero." UniqueName=:1.2489 MESSAGE "s" { STRING "Attempted to divide by zero."; }; ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I4b2671838639d1e8be1ccdf655b699a98b9c2116
show more ...
|
88c6a823 | 10-Sep-2024 |
Lei YU <yulei.sh@bytedance.com> |
message: Fix unpack void type
The template unpack<void> is deduced as one argument instead of 0, and results in below compile error: ``` error: variable or field ‘r’ declared void error: return-stat
message: Fix unpack void type
The template unpack<void> is deduced as one argument instead of 0, and results in below compile error: ``` error: variable or field ‘r’ declared void error: return-statement with a value, in function returning ‘void’ [-fpermissive] ```
Fix this by checking void if `sizeof...(Args) == 1` and return void. Also add a unit test case to make sure the code compiles.
Change-Id: I74cca180783645496863393be37215f1d6f4ca02 Signed-off-by: Lei YU <yulei.sh@bytedance.com>
show more ...
|
6ea10e04 | 02-Sep-2024 |
Lei YU <yulei.sh@bytedance.com> |
asio: Fix read into tuple response
Some DBus methods return multiple elements, e.g. `org.freedesktop.resolve1` has a method `ResolveHostname` that returns the result type `a(iiay)st`, which could no
asio: Fix read into tuple response
Some DBus methods return multiple elements, e.g. `org.freedesktop.resolve1` has a method `ResolveHostname` that returns the result type `a(iiay)st`, which could not be "read()" directly as a tuple.
The code was using a tuple to represent the multiple elements, and use `r.read(responseData)` that would result in "Invalid Argument" error.
Fix it by `message::unpack` API to correctly read the response and unpack the multiple elements into the tuple.
Change-Id: I83eb83abf0b079ebf94c1a51a40640533ab04a9f Signed-off-by: Lei YU <yulei.sh@bytedance.com>
show more ...
|
8d40adad | 22-Aug-2024 |
Igor Kononenko <i.kononenko.e@gmail.com> |
transaction: fix -Wconversion c++ warning
Building sdbusplus by meson subproject as a part of external project contains compile warning which can be interpreted as compile error (if external project
transaction: fix -Wconversion c++ warning
Building sdbusplus by meson subproject as a part of external project contains compile warning which can be interpreted as compile error (if external project defines both `-Werror` and `-Wconversion`)
Changing the `Transaction::time` property type to the appropriate `std::time_t` will solve the issue.
Change-Id: I9ab42472ff361aab9487c73d7804531151986e4c Signed-off-by: Igor Kononenko <i.kononenko.e@gmail.com>
show more ...
|
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 ...
|
5cee9157 | 30-Jul-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest commit
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I52e2ff4ea33617fb055981000ce3c2f40faab43e |
3d00e145 | 30-Jul-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: ignore unused parameter warning
Upstream stdexec continues to add unused parameter warnings that are reported by GCC -Wall. Add pragmas to squelch them so that we don't need to keep chasin
stdexec: ignore unused parameter warning
Upstream stdexec continues to add unused parameter warnings that are reported by GCC -Wall. Add pragmas to squelch them so that we don't need to keep chasing these.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia93113bb2136db365a112d69758b2d1fd61d3a24
show more ...
|
03b2c26c | 03-Jun-2024 |
Ed Tanous <etanous@nvidia.com> |
Use asio object_server without boost::coroutine
We already support this flag in asio::connection and other places, where it's used to avoid compatibility issues with boost coroutine v1, which is a p
Use asio object_server without boost::coroutine
We already support this flag in asio::connection and other places, where it's used to avoid compatibility issues with boost coroutine v1, which is a package that isn't widely used, and requires explicitly built libraries (coroutine and context).
This commit supports the same flag in ASIO object server, for things like dbus-sensors, which doesn't make use of asio coroutines.
Change-Id: I75deec77f4434e671fe5028cad14fd9998cf9b40 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
3baa3045 | 17-Jun-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://githu
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://github.com/codespell-project/codespell
Change-Id: Iab32afe9e86f7f4c18984ad2c7717d7cbfd422bb Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
1a39b64f | 12-Apr-2024 |
Patrick Williams <patrick@stwcx.xyz> |
message: handle vector<bool>
Attempting to create a vector of bools resulted in the following compile error: ``` usr/include/sdbusplus/message/append.hpp:272:9: error: cannot bind non-const lvalue r
message: handle vector<bool>
Attempting to create a vector of bools resulted in the following compile error: ``` usr/include/sdbusplus/message/append.hpp:272:9: error: cannot bind non-const lvalue reference of type 'std::_Bit_reference&' to an rvalue of type 'std::_Bit_iterator::reference' ```
Most range-for operations for containers operate on a reference to the value in the container, but `vector<bool>` has a "proxy" due to the bit-wise optimization required by the standard. Switching from `auto&` to `auto&&` allows the proxy to be used (an r-value reference) while also working for the non-proxy case (since `auto&&` will collapse to an l-value reference).
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ic96a156f29fb9429529080f4319548d91ac0ce41
show more ...
|
6e675883 | 05-Apr-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to later commit
Later commits in stdexec have some compile issues. Update to the latest one without compile issues, in order to see if a linker issue reported by another developer i
stdexec: update to later commit
Later commits in stdexec have some compile issues. Update to the latest one without compile issues, in order to see if a linker issue reported by another developer is resolved.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I99bb6ee9c383c3cb66a35b23f02a6a0ced102b49
show more ...
|
e12a23cc | 22-Feb-2024 |
Ed Tanous <ed@tanous.net> |
Make code compile on clang-18
To do this requires fixing some minor warnings around templates.
stdexec uses variables of the form __foo to denote variables that aren't used. This throws some warni
Make code compile on clang-18
To do this requires fixing some minor warnings around templates.
stdexec uses variables of the form __foo to denote variables that aren't used. This throws some warnings when trying to compile with clang.
Update the meson file to ignore those warnings when we detect clang.
With this change, and clang-18, code now compiles.
Change-Id: I72bc0ab7a818b7913831749b6246f54e7b092e0b Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
8723a542 | 12-Feb-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest commit
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I56cac3d5d7cc00d6efd7c9df62bc134e291a81a3 |
c53fe51c | 06-Feb-2024 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: add request_name method
One area we did a poor job on in the older sync interfaces was signals. Signals should only be emitted when a name is requested, but we didn't have a way to t
async: context: add request_name method
One area we did a poor job on in the older sync interfaces was signals. Signals should only be emitted when a name is requested, but we didn't have a way to track that. Add a `request_name` method on the async context so we can track if a name has been requested in the context (for later use by signal enhancements).
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0abea30e3825d41dedd44de86b8b8bca4edbaf9c
show more ...
|
f2594aa5 | 30-Jan-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
match: Add interfaces{Added,Removed}AtPath()
The signature of the InterfacesAdded and InterfacesRemoved signals is as follows[1]:
``` org.freedesktop.DBus.ObjectManager.InterfacesAdded (OBJPATH obj
match: Add interfaces{Added,Removed}AtPath()
The signature of the InterfacesAdded and InterfacesRemoved signals is as follows[1]:
``` org.freedesktop.DBus.ObjectManager.InterfacesAdded (OBJPATH object_path, ARRAY of DICT_ENTRY<STRING,ARRAY of DICT_ENTRY<STRING,VARIANT>> interfaces_and_properties); org.freedesktop.DBus.ObjectManager.InterfacesRemoved (OBJPATH object_path, ARRAY<STRING> interfaces); ```
The object path of interest forms the first argument of the signal's message body, which is distinct the path specified in the signal's message header. However, the implementation of sdbusplus::bus::match::rules::interfaces{Added,Removed}() match on the header's object path. In the case of these signals, the header path is set to the path of the ObjectManager instance that emitted the signal. This generally results in a failure to deliver signals expected by the callers.
Add new functions `interfacesAddedAtPath()` and `interfacesRemovedAtPath()` that provide matches that are constrained with `argNpath(0, p)`. These align with the signal signature specified above. Use of `argNpath()`` allows the caller to specify whether they wish to match signals from a specific object or a subtree of objects.
Callers of interfacesAdded() providing a path will be migrated on a case-by-case basis.
[1] https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces
Change-Id: Ie2f5125d45eb2dfe500d181016ccc968dd856b77 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|
f1d999b5 | 24-Jan-2024 |
Patrick Williams <patrick@stwcx.xyz> |
async: client: add preserve function and fix proxy
Add a method to "preserve" a client so that the string's captured can live beyond a scope. Fix the proxy preserve function.
Signed-off-by: Patric
async: client: add preserve function and fix proxy
Add a method to "preserve" a client so that the string's captured can live beyond a scope. Fix the proxy preserve function.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I28f32513f482b6d8752766af0368f837e365607a
show more ...
|
1f7438aa | 23-Jan-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest commit
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6b64c4f7181d4aa298e3b863c39c04b551caa442 |
517b8743 | 19-Jan-2024 |
Patrick Williams <patrick@stwcx.xyz> |
timer: remove deprecated phosphor namespace
All known uses of the phosphor::Timer have been removed from the codebase so we can remove this alias.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz
timer: remove deprecated phosphor namespace
All known uses of the phosphor::Timer have been removed from the codebase so we can remove this alias.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I894bd3d340a0812254e9c092f3734b3c208bfb2e
show more ...
|
5828bccf | 18-Jan-2024 |
Patrick Williams <patrick@stwcx.xyz> |
bus: fix message conflicting definitions
If `sdbusplus/message.hpp` is included before `sdbusplus/bus.hpp`, we end up with a compile failure as follows:
``` ../subprojects/sdbusplus/include/sdbuspl
bus: fix message conflicting definitions
If `sdbusplus/message.hpp` is included before `sdbusplus/bus.hpp`, we end up with a compile failure as follows:
``` ../subprojects/sdbusplus/include/sdbusplus/bus.hpp:660:13: error: no declaration matches ‘auto sdbusplus::message::message::get_bus() const’ 660 | inline auto message_t::get_bus() const | ^~~~~~~~~ In file included from ../utils/dbus.hpp:3, from ../cmd/power-state.cpp:1: ../subprojects/sdbusplus/include/sdbusplus/message.hpp:188:17: note: candidate is: ‘auto sdbusplus::message::message::get_bus() const’ 188 | inline auto get_bus() const; | ^~~~~~~ ../subprojects/sdbusplus/include/sdbusplus/message.hpp:70:7: note: ‘class sdbusplus::message::message’ defined here 70 | class message : private sdbusplus::slot::details::slot_friend | ^~~~~~~ ```
Fix this by being more explicit about the types rather than relying on auto in a forward declaration.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I627a7901933d73aeec87f20b65605e4b04951758
show more ...
|
52d23e8a | 13-Jan-2024 |
Patrick Williams <patrick@stwcx.xyz> |
async: match: fix duplicate symbol definitions
The `match::next` is a non-template function defined in a header file, which can lead to duplicate symbols. Mark it as inline to avoid duplicate symbo
async: match: fix duplicate symbol definitions
The `match::next` is a non-template function defined in a header file, which can lead to duplicate symbols. Mark it as inline to avoid duplicate symbol errors.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: If196ecca660e340ba0c66b1ed3913748fdcbec0f
show more ...
|
ac329c5a | 03-Jan-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest commit
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ica6de68697329c2aad3a030a7ffb45bdb6a30f11 |
5951d80d | 10-Jan-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: use 17.0.6
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ibf2fa18fff0291b3cfc1dd2d50ce327c0d7e3d2f |
4059635f | 15-Dec-2023 |
Patrick Williams <patrick@stwcx.xyz> |
bus: clarify the different new-bus wrappers
There was some misunderstanding of the purpose of the 'default' bus and a previous editor left a big warning on the non-default functions. This warning w
bus: clarify the different new-bus wrappers
There was some misunderstanding of the purpose of the 'default' bus and a previous editor left a big warning on the non-default functions. This warning was not necessary and using the non-default bus might be appropriate in many cases. Remove the warning and leave documentation to better qualify what the purpose of these functions is.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I82b2208ba0742ba10c6baee16ab868b3eea50002
show more ...
|
2bf0bb29 | 05-Dec-2023 |
Patrick Williams <patrick@stwcx.xyz> |
timer: deprecate phosphor namespace
"phosphor" is a namespace used in some OpenBMC repositories but has only one usage in sdbusplus and the class is not very OpenBMC-specific.
Move the Timer class
timer: deprecate phosphor namespace
"phosphor" is a namespace used in some OpenBMC repositories but has only one usage in sdbusplus and the class is not very OpenBMC-specific.
Move the Timer class into the sdbusplus namespace and mark 'phosphor::Timer' as a deprecated alias.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia8c79a25755c9a2c4dc6f92bf1de8100622ef313
show more ...
|
4c2d73dd | 01-Dec-2023 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest commit
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I14eba410c2d60e3bf90e25c28e9dfad547241927 |