G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
if (result == NULL) {
BT_ERR("Failed to get device ID address");
+
+ ret = BLUETOOTH_ERROR_INTERNAL;
if (error != NULL) {
+ g_dbus_error_strip_remote_error(error);
BT_ERR("Error occured in Proxy call [%s]", error->message);
+ if (g_strcmp0(error->message, "Does Not Exist") == 0)
+ ret = BLUETOOTH_ERROR_NOT_PAIRED;
g_error_free(error);
}
g_object_unref(device_proxy);
- return BLUETOOTH_ERROR_INTERNAL;
+ return ret;
}
g_variant_get(result , "(&s)", &idaddress);
- if (idaddress == NULL) {
- BT_ERR("No paired device");
- ret = BLUETOOTH_ERROR_NOT_PAIRED;
- } else {
- DBG_SECURE("ID Address : %s", idaddress);
- _bt_convert_addr_string_to_type(id_address->addr, idaddress);
- }
+
+ DBG_SECURE("ID Address : %s", idaddress);
+ _bt_convert_addr_string_to_type(id_address->addr, idaddress);
g_variant_unref(result);
g_object_unref(device_proxy);