forked from Kistler-Group/sdbus-cpp
Add API to set signal destination (#168)
With this patch it is possible to create unicast signals.
This commit is contained in:
@ -215,6 +215,7 @@ namespace sdbus {
|
||||
|
||||
public:
|
||||
Signal() = default;
|
||||
void setDestination(const std::string& destination);
|
||||
void send() const;
|
||||
};
|
||||
|
||||
|
@ -818,6 +818,12 @@ void Signal::send() const
|
||||
SDBUS_THROW_ERROR_IF(r < 0, "Failed to emit signal", -r);
|
||||
}
|
||||
|
||||
void Signal::setDestination(const std::string& destination)
|
||||
{
|
||||
auto r = sd_bus_message_set_destination((sd_bus_message*)msg_, destination.c_str());
|
||||
SDBUS_THROW_ERROR_IF(r < 0, "Failed to set signal destination", -r);
|
||||
}
|
||||
|
||||
PlainMessage createPlainMessage()
|
||||
{
|
||||
static auto connection = internal::createConnection();
|
||||
|
Reference in New Issue
Block a user