mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
spa: bluez: add send_with_reply() dbus helper
This function sends a DBusMessage on a DBusConnection and sets the reply callback of the resulting DBusPendingCall, as well as properly cancelling the pending call if anything fails.
This commit is contained in:
parent
6e581deb91
commit
b52d590936
7 changed files with 64 additions and 96 deletions
|
|
@ -82,8 +82,9 @@ static int update_battery_percentage(struct impl *this)
|
|||
DBUS_TYPE_INVALID);
|
||||
dbus_message_set_auto_start(m, false);
|
||||
|
||||
dbus_connection_send_with_reply(this->conn, m, &this->pending_get_call, -1);
|
||||
dbus_pending_call_set_notify(this->pending_get_call, upower_get_percentage_properties_reply, this, NULL);
|
||||
this->pending_get_call = send_with_reply(this->conn, m, upower_get_percentage_properties_reply, this);
|
||||
if (!this->pending_get_call)
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue