History log of /openbmc/phosphor-power/dbus_interfaces_finder.hpp (Results 1 – 4 of 4)
Revision Date Author Comments
# f5402197 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: I7b90380845efee6bf6a1fe342a793d71aa9ff181
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 8b098b97 05-Aug-2024 Shawn McCarney <shawnmm@us.ibm.com>

Add support for re-finding interfaces/system types

The DBusInterfacesFinder class simplifies the task of finding interface
instances on D-Bus. Similarly, the CompatibleSystemTypesFinder class
simpl

Add support for re-finding interfaces/system types

The DBusInterfacesFinder class simplifies the task of finding interface
instances on D-Bus. Similarly, the CompatibleSystemTypesFinder class
simplifies the task of finding the list of compatible system types for
the current system.

Both classes initially find the D-Bus objects that already exist at the
time the classes are constructed. They use InterfacesAdded listeners to
find new D-Bus objects that are created later.

This behavior handles most use cases. However, sometimes a caller may
not be receiving D-Bus signals, but they still need to find new D-Bus
objects that have been created. For example, the caller may be looping
within a timeout period waiting for a D-Bus object to be created.

To handle this use case, add `refind()` methods to both classes that
will re-find all matching D-Bus objects that now exist, including those
created since the classes were constructed.

Tested:
* DBusInterfacesFinder
* Verify finds all interface instances that exist at time class is
constructed
* None found
* Instances found
* Verify finds new interface instances via InterfacesAdded listener
* Verify refind() finds all interface instances, including those that
were created after the class was constructed.
* None found
* Instances found
* CompatibleSystemTypesFinder
* Verify finds all compatible system type lists that exist at time
class is constructed
* None found
* Lists found
* Verify finds new compatible system type lists via InterfacesAdded
listener
* Verify refind() finds all compatible system type lists, including
those that were created after the class was constructed.
* None found
* Lists found

Change-Id: I975b37524f687e6d2f3d4ff48abb5e4486a84bfe
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...


# 1838dbf9 05-Jun-2024 Shawn McCarney <shawnmm@us.ibm.com>

Move D-Bus finder class constructors

Three classes in this repository search for D-Bus interfaces and call
a callback when interfaces are found:
- DBusInterfacesFinder
- CompatibleSystemTypesFinder

Move D-Bus finder class constructors

Three classes in this repository search for D-Bus interfaces and call
a callback when interfaces are found:
- DBusInterfacesFinder
- CompatibleSystemTypesFinder
- DeviceFinder

The constructors of these three classes may immediately call the
callback. For this reason, these constructors should not be used in the
initialization list of constructors in other classes. Otherwise the
callback may be called before the other class is fully initialized,
leading to unpredictable behavior.

Move usage of these three constructors from initialization lists to
constructor bodies.

Tested:
+ CompatibleSystemTypesFinder
+ Test where compatible system types interface already exists on D-Bus
+ Verify callback is called immediately
+ Test where compatible system types interface does not already exist
on D-Bus
+ Verify callback is called later when interface is added
+ Verify callback is passed the correct data
+ DeviceFinder
+ Test where device interface already exists on D-Bus
+ Verify callback is called immediately
+ Test where device interface does not already exist on D-Bus
+ Verify callback is called later when interface is added
+ Verify callback is passed the correct data

Change-Id: If089f4720012d837b464137b5d3c8fba5dbdc335
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...


# 98f42947 24-May-2024 Shawn McCarney <shawnmm@us.ibm.com>

Create class for finding D-Bus interfaces

Create a class for finding instances of D-Bus interfaces. The class
finds existing instances using the ObjectMapper. It also finds new
instances using an

Create class for finding D-Bus interfaces

Create a class for finding instances of D-Bus interfaces. The class
finds existing instances using the ObjectMapper. It also finds new
instances using an InterfacesAdded listener.

Tested:
* See test plan at
https://gist.github.com/smccarney/67d7719f0cf9cea2d134b0796aa408da

Change-Id: Ia6fba9cb69ad73607dc971dd6d63ba2efecabe0d
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...