diff options
Diffstat (limited to 'plugins/bluetooth.c')
-rw-r--r-- | plugins/bluetooth.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index 8ca9f5f4..161ae4ba 100644 --- a/plugins/bluetooth.c +++ b/plugins/bluetooth.c @@ -267,19 +267,16 @@ static void device_properties_cb(DBusPendingCall *call, gpointer user_data) const char *device_addr = NULL; const char *alias = NULL; struct bluetooth_profile *profile; + struct DBusError derr; reply = dbus_pending_call_steal_reply(call); - if (dbus_message_is_error(reply, DBUS_ERROR_SERVICE_UNKNOWN)) { - DBG("Bluetooth daemon is apparently not available."); - goto done; - } - - if (dbus_message_get_type(reply) == DBUS_MESSAGE_TYPE_ERROR) { - if (!dbus_message_is_error(reply, DBUS_ERROR_UNKNOWN_METHOD)) - ofono_info("Error from GetProperties reply: %s", - dbus_message_get_error_name(reply)); + dbus_error_init(&derr); + if (dbus_set_error_from_message(&derr, reply)) { + ofono_error("Device.GetProperties replied an error: %s, %s", + derr.name, derr.message); + dbus_error_free(&derr); goto done; } @@ -397,14 +394,19 @@ static void adapter_properties_cb(DBusPendingCall *call, gpointer user_data) { const char *path = user_data; DBusMessage *reply; + DBusError derr; GSList *device_list = NULL; GSList *l; const char *addr; reply = dbus_pending_call_steal_reply(call); - if (dbus_message_is_error(reply, DBUS_ERROR_SERVICE_UNKNOWN)) { - DBG("Bluetooth daemon is apparently not available."); + dbus_error_init(&derr); + + if (dbus_set_error_from_message(&derr, reply)) { + ofono_error("Adapter.GetProperties replied an error: %s, %s", + derr.name, derr.message); + dbus_error_free(&derr); goto done; } @@ -717,11 +719,16 @@ static void parse_adapters(DBusMessageIter *array, gpointer user_data) static void manager_properties_cb(DBusPendingCall *call, gpointer user_data) { DBusMessage *reply; + DBusError derr; reply = dbus_pending_call_steal_reply(call); - if (dbus_message_is_error(reply, DBUS_ERROR_SERVICE_UNKNOWN)) { - DBG("Bluetooth daemon is apparently not available."); + dbus_error_init(&derr); + + if (dbus_set_error_from_message(&derr, reply)) { + ofono_error("Manager.GetProperties() replied an error: %s, %s", + derr.name, derr.message); + dbus_error_free(&derr); goto done; } |