summaryrefslogtreecommitdiffstats
path: root/src/monitor/monitor_sbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/monitor/monitor_sbus.c')
-rw-r--r--src/monitor/monitor_sbus.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/monitor/monitor_sbus.c b/src/monitor/monitor_sbus.c
index d60a087e5..eedb60b3b 100644
--- a/src/monitor/monitor_sbus.c
+++ b/src/monitor/monitor_sbus.c
@@ -109,13 +109,9 @@ done:
int monitor_common_send_id(struct sbus_connection *conn,
const char *name, uint16_t version)
{
- DBusPendingCall *pending_reply;
- DBusConnection *dbus_conn;
DBusMessage *msg;
dbus_bool_t ret;
- dbus_conn = sbus_get_connection(conn);
-
/* create the message */
msg = dbus_message_new_method_call(NULL,
MON_SRV_PATH,
@@ -137,24 +133,9 @@ int monitor_common_send_id(struct sbus_connection *conn,
return EIO;
}
- ret = dbus_connection_send_with_reply(dbus_conn, msg, &pending_reply,
- 30000 /* TODO: set timeout */);
- if (!ret || !pending_reply) {
- /*
- * Critical Failure
- * We can't communicate on this connection
- * We'll drop it using the default destructor.
- */
- DEBUG(0, ("D-BUS send failed.\n"));
- dbus_message_unref(msg);
- return EIO;
- }
-
- /* Set up the reply handler */
- dbus_pending_call_set_notify(pending_reply, id_callback, NULL, NULL);
- dbus_message_unref(msg);
-
- return EOK;
+ return sbus_conn_send(conn, msg, 3000,
+ id_callback,
+ NULL, NULL);
}
int monitor_common_pong(DBusMessage *message,