You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having trouble with ObjectMapper not automatically discovering paths with interfaces added using sdbusplus/async. Here is example code:
using namespace sdbusplus::aserver::xyz::openbmc_project;
struct DBusSensor : public association::Definitions<DBusSensor>,
public sensor::Value<DBusSensor>,
public state::decorator::Availability<DBusSensor>,
public state::decorator::OperationalStatus<DBusSensor> {
DBusSensor(sdbusplus::async::context& ctx, const char* sensor_path,
const char* associated_path)
: association::Definitions<DBusSensor>(ctx, sensor_path),
sensor::Value<DBusSensor>(ctx, sensor_path),
state::decorator::Availability<DBusSensor>(ctx, sensor_path),
state::decorator::OperationalStatus<DBusSensor>(ctx, sensor_path) {
value(0);
min_value(std::numeric_limits<int8_t>::min());
max_value(std::numeric_limits<int8_t>::max());
functional(true);
available(true);
using value_type = decltype(associations());
associations(value_type{{"chassis", "all_sensors", associated_path}});
}
};
Am I doing something wrong? Do I have to manually call emit_added()? I couldn't find it being invoked anywhere. This does feel like a regression compared to the asio API.
As a workaround I hacked sdbusplus/server/object.hpp to be compatible async::context:
Correct, the current code for async does not do any automatic signal processing. I've had some complaints about how it was done in the previously sync implementation and I didn't want to put too much in place until I had some time to think more deeply about it. I don't want to put something in place and get tied to a method that doesn't really work.
What I'm thinking I'll likely need to do is to add some information to the async-context that keeps track if a service name has been requested. We don't actually want signals to be sent prior to a service name being allocated and they deceptively get dropped anyhow.
Just to be clear, this will probably get resolved in the next few months. We can leave this open if you want something to track the improvement against.
I've been having trouble with
ObjectMapper
not automatically discovering paths with interfaces added usingsdbusplus/async
. Here is example code:Am I doing something wrong? Do I have to manually call
emit_added()
? I couldn't find it being invoked anywhere. This does feel like a regression compared to theasio
API.As a workaround I hacked
sdbusplus/server/object.hpp
to be compatibleasync::context
:And my new
DBusSensor
is now:The text was updated successfully, but these errors were encountered: