/* Adapter.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from Adapter.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: nil; tab-width: 4 -*-*/
/*-
 * Copyright (c) 2016 elementary LLC.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Authored by: Corentin Noël <corentin@elementary.io>
 */

#include "bluetooth.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

typedef GDBusProxy BluetoothServicesAdapterProxy;
typedef GDBusProxyClass BluetoothServicesAdapterProxyClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
typedef struct _BluetoothServicesAdapterStartDiscoveryReadyData BluetoothServicesAdapterStartDiscoveryReadyData;
typedef struct _BluetoothServicesAdapterStopDiscoveryReadyData BluetoothServicesAdapterStopDiscoveryReadyData;

struct _BluetoothServicesAdapterStartDiscoveryReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _BluetoothServicesAdapterStopDiscoveryReadyData {
	GDBusMethodInvocation* _invocation_;
};

static GType bluetooth_services_adapter_get_type_once (void);
static void bluetooth_services_adapter_proxy_g_signal (GDBusProxy* proxy,
                                                const gchar* sender_name,
                                                const gchar* signal_name,
                                                GVariant* parameters);
static void bluetooth_services_adapter_proxy_remove_device (BluetoothServicesAdapter* self,
                                                     const char* device,
                                                     GError** error);
static void bluetooth_services_adapter_proxy_set_discovery_filter (BluetoothServicesAdapter* self,
                                                            GHashTable* properties,
                                                            GError** error);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void bluetooth_services_adapter_proxy_start_discovery_async (BluetoothServicesAdapter* self,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);
static void bluetooth_services_adapter_proxy_start_discovery_finish (BluetoothServicesAdapter* self,
                                                              GAsyncResult* _res_,
                                                              GError** error);
static void bluetooth_services_adapter_proxy_stop_discovery_async (BluetoothServicesAdapter* self,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static void bluetooth_services_adapter_proxy_stop_discovery_finish (BluetoothServicesAdapter* self,
                                                             GAsyncResult* _res_,
                                                             GError** error);
static gchar** bluetooth_services_adapter_dbus_proxy_get_UUIDs (BluetoothServicesAdapter* self,
                                                         gint* result_length1);
static gboolean bluetooth_services_adapter_dbus_proxy_get_discoverable (BluetoothServicesAdapter* self);
static void bluetooth_services_adapter_dbus_proxy_set_discoverable (BluetoothServicesAdapter* self,
                                                             gboolean value);
static gboolean bluetooth_services_adapter_dbus_proxy_get_discovering (BluetoothServicesAdapter* self);
static gboolean bluetooth_services_adapter_dbus_proxy_get_pairable (BluetoothServicesAdapter* self);
static void bluetooth_services_adapter_dbus_proxy_set_pairable (BluetoothServicesAdapter* self,
                                                         gboolean value);
static gboolean bluetooth_services_adapter_dbus_proxy_get_powered (BluetoothServicesAdapter* self);
static void bluetooth_services_adapter_dbus_proxy_set_powered (BluetoothServicesAdapter* self,
                                                        gboolean value);
static gchar* bluetooth_services_adapter_dbus_proxy_get_address (BluetoothServicesAdapter* self);
static gchar* bluetooth_services_adapter_dbus_proxy_get_alias (BluetoothServicesAdapter* self);
static void bluetooth_services_adapter_dbus_proxy_set_alias (BluetoothServicesAdapter* self,
                                                      const gchar* value);
static gchar* bluetooth_services_adapter_dbus_proxy_get_modalias (BluetoothServicesAdapter* self);
static gchar* bluetooth_services_adapter_dbus_proxy_get_name (BluetoothServicesAdapter* self);
static guint bluetooth_services_adapter_dbus_proxy_get_class (BluetoothServicesAdapter* self);
static guint bluetooth_services_adapter_dbus_proxy_get_discoverable_timeout (BluetoothServicesAdapter* self);
static guint bluetooth_services_adapter_dbus_proxy_get_pairable_timeout (BluetoothServicesAdapter* self);
static void bluetooth_services_adapter_proxy_bluetooth_services_adapter_interface_init (BluetoothServicesAdapterIface* iface);
static void _dbus_bluetooth_services_adapter_remove_device (BluetoothServicesAdapter* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation);
static void _dbus_bluetooth_services_adapter_set_discovery_filter (BluetoothServicesAdapter* self,
                                                            GVariant* _parameters_,
                                                            GDBusMethodInvocation* invocation);
static void _dbus_bluetooth_services_adapter_start_discovery (BluetoothServicesAdapter* self,
                                                       GVariant* _parameters_,
                                                       GDBusMethodInvocation* invocation);
static void _dbus_bluetooth_services_adapter_start_discovery_ready (GObject * source_object,
                                                             GAsyncResult * _res_,
                                                             gpointer _user_data_);
static void _dbus_bluetooth_services_adapter_stop_discovery (BluetoothServicesAdapter* self,
                                                      GVariant* _parameters_,
                                                      GDBusMethodInvocation* invocation);
static void _dbus_bluetooth_services_adapter_stop_discovery_ready (GObject * source_object,
                                                            GAsyncResult * _res_,
                                                            gpointer _user_data_);
static void bluetooth_services_adapter_dbus_interface_method_call (GDBusConnection* connection,
                                                            const gchar* sender,
                                                            const gchar* object_path,
                                                            const gchar* interface_name,
                                                            const gchar* method_name,
                                                            GVariant* parameters,
                                                            GDBusMethodInvocation* invocation,
                                                            gpointer user_data);
static GVariant* bluetooth_services_adapter_dbus_interface_get_property (GDBusConnection* connection,
                                                                  const gchar* sender,
                                                                  const gchar* object_path,
                                                                  const gchar* interface_name,
                                                                  const gchar* property_name,
                                                                  GError** error,
                                                                  gpointer user_data);
static GVariant* _dbus_bluetooth_services_adapter_get_UUIDs (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_discoverable (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_discovering (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_pairable (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_powered (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_address (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_alias (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_modalias (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_name (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_class (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_discoverable_timeout (BluetoothServicesAdapter* self);
static GVariant* _dbus_bluetooth_services_adapter_get_pairable_timeout (BluetoothServicesAdapter* self);
static gboolean bluetooth_services_adapter_dbus_interface_set_property (GDBusConnection* connection,
                                                                 const gchar* sender,
                                                                 const gchar* object_path,
                                                                 const gchar* interface_name,
                                                                 const gchar* property_name,
                                                                 GVariant* value,
                                                                 GError** error,
                                                                 gpointer user_data);
static void _dbus_bluetooth_services_adapter_set_discoverable (BluetoothServicesAdapter* self,
                                                        GVariant* _value);
static void _dbus_bluetooth_services_adapter_set_pairable (BluetoothServicesAdapter* self,
                                                    GVariant* _value);
static void _dbus_bluetooth_services_adapter_set_powered (BluetoothServicesAdapter* self,
                                                   GVariant* _value);
static void _dbus_bluetooth_services_adapter_set_alias (BluetoothServicesAdapter* self,
                                                 GVariant* _value);
static void _bluetooth_services_adapter_unregister_object (gpointer user_data);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static const GDBusArgInfo _bluetooth_services_adapter_dbus_arg_info_remove_device_device = {-1, "device", "o", NULL};
static const GDBusArgInfo * const _bluetooth_services_adapter_dbus_arg_info_remove_device_in[] = {&_bluetooth_services_adapter_dbus_arg_info_remove_device_device, NULL};
static const GDBusArgInfo * const _bluetooth_services_adapter_dbus_arg_info_remove_device_out[] = {NULL};
static const GDBusMethodInfo _bluetooth_services_adapter_dbus_method_info_remove_device = {-1, "RemoveDevice", (GDBusArgInfo **) (&_bluetooth_services_adapter_dbus_arg_info_remove_device_in), (GDBusArgInfo **) (&_bluetooth_services_adapter_dbus_arg_info_remove_device_out), NULL};
static const GDBusArgInfo _bluetooth_services_adapter_dbus_arg_info_set_discovery_filter_properties = {-1, "properties", "a{sv}", NULL};
static const GDBusArgInfo * const _bluetooth_services_adapter_dbus_arg_info_set_discovery_filter_in[] = {&_bluetooth_services_adapter_dbus_arg_info_set_discovery_filter_properties, NULL};
static const GDBusArgInfo * const _bluetooth_services_adapter_dbus_arg_info_set_discovery_filter_out[] = {NULL};
static const GDBusMethodInfo _bluetooth_services_adapter_dbus_method_info_set_discovery_filter = {-1, "SetDiscoveryFilter", (GDBusArgInfo **) (&_bluetooth_services_adapter_dbus_arg_info_set_discovery_filter_in), (GDBusArgInfo **) (&_bluetooth_services_adapter_dbus_arg_info_set_discovery_filter_out), NULL};
static const GDBusArgInfo * const _bluetooth_services_adapter_dbus_arg_info_start_discovery_in[] = {NULL};
static const GDBusArgInfo * const _bluetooth_services_adapter_dbus_arg_info_start_discovery_out[] = {NULL};
static const GDBusMethodInfo _bluetooth_services_adapter_dbus_method_info_start_discovery = {-1, "StartDiscovery", (GDBusArgInfo **) (&_bluetooth_services_adapter_dbus_arg_info_start_discovery_in), (GDBusArgInfo **) (&_bluetooth_services_adapter_dbus_arg_info_start_discovery_out), NULL};
static const GDBusArgInfo * const _bluetooth_services_adapter_dbus_arg_info_stop_discovery_in[] = {NULL};
static const GDBusArgInfo * const _bluetooth_services_adapter_dbus_arg_info_stop_discovery_out[] = {NULL};
static const GDBusMethodInfo _bluetooth_services_adapter_dbus_method_info_stop_discovery = {-1, "StopDiscovery", (GDBusArgInfo **) (&_bluetooth_services_adapter_dbus_arg_info_stop_discovery_in), (GDBusArgInfo **) (&_bluetooth_services_adapter_dbus_arg_info_stop_discovery_out), NULL};
static const GDBusMethodInfo * const _bluetooth_services_adapter_dbus_method_info[] = {&_bluetooth_services_adapter_dbus_method_info_remove_device, &_bluetooth_services_adapter_dbus_method_info_set_discovery_filter, &_bluetooth_services_adapter_dbus_method_info_start_discovery, &_bluetooth_services_adapter_dbus_method_info_stop_discovery, NULL};
static const GDBusSignalInfo * const _bluetooth_services_adapter_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_UUIDs = {-1, "UUIDs", "as", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_discoverable = {-1, "Discoverable", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_discovering = {-1, "Discovering", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_pairable = {-1, "Pairable", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_powered = {-1, "Powered", "b", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_address = {-1, "Address", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_alias = {-1, "Alias", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE | G_DBUS_PROPERTY_INFO_FLAGS_WRITABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_modalias = {-1, "Modalias", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_name = {-1, "Name", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_class = {-1, "Class", "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_discoverable_timeout = {-1, "DiscoverableTimeout", "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo _bluetooth_services_adapter_dbus_property_info_pairable_timeout = {-1, "PairableTimeout", "u", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _bluetooth_services_adapter_dbus_property_info[] = {&_bluetooth_services_adapter_dbus_property_info_UUIDs, &_bluetooth_services_adapter_dbus_property_info_discoverable, &_bluetooth_services_adapter_dbus_property_info_discovering, &_bluetooth_services_adapter_dbus_property_info_pairable, &_bluetooth_services_adapter_dbus_property_info_powered, &_bluetooth_services_adapter_dbus_property_info_address, &_bluetooth_services_adapter_dbus_property_info_alias, &_bluetooth_services_adapter_dbus_property_info_modalias, &_bluetooth_services_adapter_dbus_property_info_name, &_bluetooth_services_adapter_dbus_property_info_class, &_bluetooth_services_adapter_dbus_property_info_discoverable_timeout, &_bluetooth_services_adapter_dbus_property_info_pairable_timeout, NULL};
static const GDBusInterfaceInfo _bluetooth_services_adapter_dbus_interface_info = {-1, "org.bluez.Adapter1", (GDBusMethodInfo **) (&_bluetooth_services_adapter_dbus_method_info), (GDBusSignalInfo **) (&_bluetooth_services_adapter_dbus_signal_info), (GDBusPropertyInfo **) (&_bluetooth_services_adapter_dbus_property_info), NULL};
static const GDBusInterfaceVTable _bluetooth_services_adapter_dbus_interface_vtable = {bluetooth_services_adapter_dbus_interface_method_call, bluetooth_services_adapter_dbus_interface_get_property, bluetooth_services_adapter_dbus_interface_set_property};

void
bluetooth_services_adapter_remove_device (BluetoothServicesAdapter* self,
                                          const char* device,
                                          GError** error)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->remove_device) {
		_iface_->remove_device (self, device, error);
	}
}

void
bluetooth_services_adapter_set_discovery_filter (BluetoothServicesAdapter* self,
                                                 GHashTable* properties,
                                                 GError** error)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->set_discovery_filter) {
		_iface_->set_discovery_filter (self, properties, error);
	}
}

void
bluetooth_services_adapter_start_discovery (BluetoothServicesAdapter* self,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	BluetoothServicesAdapterIface* _iface_;
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->start_discovery) {
		_iface_->start_discovery (self, _callback_, _user_data_);
	}
}

void
bluetooth_services_adapter_start_discovery_finish (BluetoothServicesAdapter* self,
                                                   GAsyncResult* _res_,
                                                   GError** error)
{
	BluetoothServicesAdapterIface* _iface_;
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->start_discovery_finish) {
		_iface_->start_discovery_finish (self, _res_, error);
	}
}

void
bluetooth_services_adapter_stop_discovery (BluetoothServicesAdapter* self,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	BluetoothServicesAdapterIface* _iface_;
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->stop_discovery) {
		_iface_->stop_discovery (self, _callback_, _user_data_);
	}
}

void
bluetooth_services_adapter_stop_discovery_finish (BluetoothServicesAdapter* self,
                                                  GAsyncResult* _res_,
                                                  GError** error)
{
	BluetoothServicesAdapterIface* _iface_;
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->stop_discovery_finish) {
		_iface_->stop_discovery_finish (self, _res_, error);
	}
}

gchar**
bluetooth_services_adapter_get_UUIDs (BluetoothServicesAdapter* self,
                                      gint* result_length1)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_UUIDs) {
		return _iface_->get_UUIDs (self, result_length1);
	}
	return NULL;
}

gboolean
bluetooth_services_adapter_get_discoverable (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_discoverable) {
		return _iface_->get_discoverable (self);
	}
	return FALSE;
}

void
bluetooth_services_adapter_set_discoverable (BluetoothServicesAdapter* self,
                                             gboolean value)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->set_discoverable) {
		_iface_->set_discoverable (self, value);
	}
}

gboolean
bluetooth_services_adapter_get_discovering (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_discovering) {
		return _iface_->get_discovering (self);
	}
	return FALSE;
}

gboolean
bluetooth_services_adapter_get_pairable (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_pairable) {
		return _iface_->get_pairable (self);
	}
	return FALSE;
}

void
bluetooth_services_adapter_set_pairable (BluetoothServicesAdapter* self,
                                         gboolean value)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->set_pairable) {
		_iface_->set_pairable (self, value);
	}
}

gboolean
bluetooth_services_adapter_get_powered (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, FALSE);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_powered) {
		return _iface_->get_powered (self);
	}
	return FALSE;
}

void
bluetooth_services_adapter_set_powered (BluetoothServicesAdapter* self,
                                        gboolean value)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->set_powered) {
		_iface_->set_powered (self, value);
	}
}

gchar*
bluetooth_services_adapter_get_address (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_address) {
		return _iface_->get_address (self);
	}
	return NULL;
}

gchar*
bluetooth_services_adapter_get_alias (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_alias) {
		return _iface_->get_alias (self);
	}
	return NULL;
}

void
bluetooth_services_adapter_set_alias (BluetoothServicesAdapter* self,
                                      const gchar* value)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->set_alias) {
		_iface_->set_alias (self, value);
	}
}

gchar*
bluetooth_services_adapter_get_modalias (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_modalias) {
		return _iface_->get_modalias (self);
	}
	return NULL;
}

gchar*
bluetooth_services_adapter_get_name (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_name) {
		return _iface_->get_name (self);
	}
	return NULL;
}

guint
bluetooth_services_adapter_get_class (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, 0U);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_class) {
		return _iface_->get_class (self);
	}
	return 0U;
}

guint
bluetooth_services_adapter_get_discoverable_timeout (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, 0U);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_discoverable_timeout) {
		return _iface_->get_discoverable_timeout (self);
	}
	return 0U;
}

guint
bluetooth_services_adapter_get_pairable_timeout (BluetoothServicesAdapter* self)
{
	BluetoothServicesAdapterIface* _iface_;
	g_return_val_if_fail (self != NULL, 0U);
	_iface_ = BLUETOOTH_SERVICES_ADAPTER_GET_INTERFACE (self);
	if (_iface_->get_pairable_timeout) {
		return _iface_->get_pairable_timeout (self);
	}
	return 0U;
}

static void
bluetooth_services_adapter_default_init (BluetoothServicesAdapterIface * iface,
                                         gpointer iface_data)
{
}

static GType
bluetooth_services_adapter_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BluetoothServicesAdapterIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) bluetooth_services_adapter_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType bluetooth_services_adapter_type_id;
	bluetooth_services_adapter_type_id = g_type_register_static (G_TYPE_INTERFACE, "BluetoothServicesAdapter", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (bluetooth_services_adapter_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (bluetooth_services_adapter_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) bluetooth_services_adapter_proxy_get_type);
	g_type_set_qdata (bluetooth_services_adapter_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.bluez.Adapter1");
	g_type_set_qdata (bluetooth_services_adapter_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_bluetooth_services_adapter_dbus_interface_info));
	g_type_set_qdata (bluetooth_services_adapter_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) bluetooth_services_adapter_register_object);
	return bluetooth_services_adapter_type_id;
}

GType
bluetooth_services_adapter_get_type (void)
{
	static volatile gsize bluetooth_services_adapter_type_id__once = 0;
	if (g_once_init_enter (&bluetooth_services_adapter_type_id__once)) {
		GType bluetooth_services_adapter_type_id;
		bluetooth_services_adapter_type_id = bluetooth_services_adapter_get_type_once ();
		g_once_init_leave (&bluetooth_services_adapter_type_id__once, bluetooth_services_adapter_type_id);
	}
	return bluetooth_services_adapter_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (BluetoothServicesAdapterProxy, bluetooth_services_adapter_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (BLUETOOTH_SERVICES_TYPE_ADAPTER, bluetooth_services_adapter_proxy_bluetooth_services_adapter_interface_init) )
static void
bluetooth_services_adapter_proxy_class_init (BluetoothServicesAdapterProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = bluetooth_services_adapter_proxy_g_signal;
}

static void
bluetooth_services_adapter_proxy_g_signal (GDBusProxy* proxy,
                                           const gchar* sender_name,
                                           const gchar* signal_name,
                                           GVariant* parameters)
{
}

static void
bluetooth_services_adapter_proxy_init (BluetoothServicesAdapterProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_bluetooth_services_adapter_dbus_interface_info));
}

static void
bluetooth_services_adapter_proxy_remove_device (BluetoothServicesAdapter* self,
                                                const char* device,
                                                GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.bluez.Adapter1", "RemoveDevice");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_object_path (device));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
bluetooth_services_adapter_proxy_set_discovery_filter (BluetoothServicesAdapter* self,
                                                       GHashTable* properties,
                                                       GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GVariantBuilder _tmp32_;
	GHashTableIter _tmp33_;
	gpointer _tmp34_;
	gpointer _tmp35_;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.bluez.Adapter1", "SetDiscoveryFilter");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_hash_table_iter_init (&_tmp33_, properties);
	g_variant_builder_init (&_tmp32_, G_VARIANT_TYPE ("a{sv}"));
	while (g_hash_table_iter_next (&_tmp33_, &_tmp34_, &_tmp35_)) {
		gchar* _key;
		GVariant* _value;
		_key = (gchar*) _tmp34_;
		_value = (GVariant*) _tmp35_;
		g_variant_builder_add (&_tmp32_, "{?*}", g_variant_new_string (_key), g_variant_new_variant (_value));
	}
	g_variant_builder_add_value (&_arguments_builder, g_variant_builder_end (&_tmp32_));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
bluetooth_services_adapter_proxy_start_discovery_async (BluetoothServicesAdapter* self,
                                                        GAsyncReadyCallback _callback_,
                                                        gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.bluez.Adapter1", "StartDiscovery");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
bluetooth_services_adapter_proxy_start_discovery_finish (BluetoothServicesAdapter* self,
                                                         GAsyncResult* _res_,
                                                         GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
bluetooth_services_adapter_proxy_stop_discovery_async (BluetoothServicesAdapter* self,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.bluez.Adapter1", "StopDiscovery");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
bluetooth_services_adapter_proxy_stop_discovery_finish (BluetoothServicesAdapter* self,
                                                        GAsyncResult* _res_,
                                                        GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static gchar**
bluetooth_services_adapter_dbus_proxy_get_UUIDs (BluetoothServicesAdapter* self,
                                                 gint* result_length1)
{
	GVariant *_inner_reply;
	gchar** _result;
	gint _result_length1;
	gchar** _tmp36_;
	gint _tmp36__length;
	gint _tmp36__size;
	gint _tmp36__length1;
	GVariantIter _tmp37_;
	GVariant* _tmp38_;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "UUIDs");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("UUIDs"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result_length1 = 0;
	_tmp36_ = g_new (gchar*, 5);
	_tmp36__length = 0;
	_tmp36__size = 4;
	_tmp36__length1 = 0;
	g_variant_iter_init (&_tmp37_, _inner_reply);
	for (; (_tmp38_ = g_variant_iter_next_value (&_tmp37_)) != NULL; _tmp36__length1++) {
		if (_tmp36__size == _tmp36__length) {
			_tmp36__size = 2 * _tmp36__size;
			_tmp36_ = g_renew (gchar*, _tmp36_, _tmp36__size + 1);
		}
		_tmp36_[_tmp36__length++] = g_variant_dup_string (_tmp38_, NULL);
		g_variant_unref (_tmp38_);
	}
	_result_length1 = _tmp36__length1;
	_tmp36_[_tmp36__length] = NULL;
	_result = _tmp36_;
	*result_length1 = _result_length1;
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
bluetooth_services_adapter_dbus_proxy_get_discoverable (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Discoverable");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Discoverable"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp39_ = FALSE;
			return _tmp39_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
bluetooth_services_adapter_dbus_proxy_set_discoverable (BluetoothServicesAdapter* self,
                                                        gboolean value)
{
	GVariant *_arguments;
	GVariant *_reply;
	GVariantBuilder _arguments_builder;
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Discoverable"));
	g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (value));
	g_variant_builder_close (&_arguments_builder);
	_arguments = g_variant_builder_end (&_arguments_builder);
	_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
	if (!_reply) {
		return;
	}
	g_variant_unref (_reply);
}

static gboolean
bluetooth_services_adapter_dbus_proxy_get_discovering (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Discovering");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Discovering"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp40_ = FALSE;
			return _tmp40_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static gboolean
bluetooth_services_adapter_dbus_proxy_get_pairable (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Pairable");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Pairable"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp41_ = FALSE;
			return _tmp41_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
bluetooth_services_adapter_dbus_proxy_set_pairable (BluetoothServicesAdapter* self,
                                                    gboolean value)
{
	GVariant *_arguments;
	GVariant *_reply;
	GVariantBuilder _arguments_builder;
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Pairable"));
	g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (value));
	g_variant_builder_close (&_arguments_builder);
	_arguments = g_variant_builder_end (&_arguments_builder);
	_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
	if (!_reply) {
		return;
	}
	g_variant_unref (_reply);
}

static gboolean
bluetooth_services_adapter_dbus_proxy_get_powered (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	gboolean _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Powered");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Powered"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			gboolean _tmp42_ = FALSE;
			return _tmp42_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_boolean (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
bluetooth_services_adapter_dbus_proxy_set_powered (BluetoothServicesAdapter* self,
                                                   gboolean value)
{
	GVariant *_arguments;
	GVariant *_reply;
	GVariantBuilder _arguments_builder;
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Powered"));
	g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (value));
	g_variant_builder_close (&_arguments_builder);
	_arguments = g_variant_builder_end (&_arguments_builder);
	_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
	if (!_reply) {
		return;
	}
	g_variant_unref (_reply);
}

static gchar*
bluetooth_services_adapter_dbus_proxy_get_address (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Address");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Address"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static gchar*
bluetooth_services_adapter_dbus_proxy_get_alias (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Alias");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Alias"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
bluetooth_services_adapter_dbus_proxy_set_alias (BluetoothServicesAdapter* self,
                                                 const gchar* value)
{
	GVariant *_arguments;
	GVariant *_reply;
	GVariantBuilder _arguments_builder;
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Alias"));
	g_variant_builder_open (&_arguments_builder, G_VARIANT_TYPE_VARIANT);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (value));
	g_variant_builder_close (&_arguments_builder);
	_arguments = g_variant_builder_end (&_arguments_builder);
	_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Set", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
	if (!_reply) {
		return;
	}
	g_variant_unref (_reply);
}

static gchar*
bluetooth_services_adapter_dbus_proxy_get_modalias (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Modalias");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Modalias"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static gchar*
bluetooth_services_adapter_dbus_proxy_get_name (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Name");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Name"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static guint
bluetooth_services_adapter_dbus_proxy_get_class (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	guint _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "Class");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("Class"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			guint _tmp43_ = 0U;
			return _tmp43_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_uint32 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static guint
bluetooth_services_adapter_dbus_proxy_get_discoverable_timeout (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	guint _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "DiscoverableTimeout");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("DiscoverableTimeout"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			guint _tmp44_ = 0U;
			return _tmp44_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_uint32 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static guint
bluetooth_services_adapter_dbus_proxy_get_pairable_timeout (BluetoothServicesAdapter* self)
{
	GVariant *_inner_reply;
	guint _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "PairableTimeout");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.bluez.Adapter1"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("PairableTimeout"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			guint _tmp45_ = 0U;
			return _tmp45_;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_get_uint32 (_inner_reply);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
bluetooth_services_adapter_proxy_bluetooth_services_adapter_interface_init (BluetoothServicesAdapterIface* iface)
{
	iface->remove_device = bluetooth_services_adapter_proxy_remove_device;
	iface->set_discovery_filter = bluetooth_services_adapter_proxy_set_discovery_filter;
	iface->start_discovery = bluetooth_services_adapter_proxy_start_discovery_async;
	iface->start_discovery_finish = bluetooth_services_adapter_proxy_start_discovery_finish;
	iface->stop_discovery = bluetooth_services_adapter_proxy_stop_discovery_async;
	iface->stop_discovery_finish = bluetooth_services_adapter_proxy_stop_discovery_finish;
	iface->get_UUIDs = bluetooth_services_adapter_dbus_proxy_get_UUIDs;
	iface->get_discoverable = bluetooth_services_adapter_dbus_proxy_get_discoverable;
	iface->set_discoverable = bluetooth_services_adapter_dbus_proxy_set_discoverable;
	iface->get_discovering = bluetooth_services_adapter_dbus_proxy_get_discovering;
	iface->get_pairable = bluetooth_services_adapter_dbus_proxy_get_pairable;
	iface->set_pairable = bluetooth_services_adapter_dbus_proxy_set_pairable;
	iface->get_powered = bluetooth_services_adapter_dbus_proxy_get_powered;
	iface->set_powered = bluetooth_services_adapter_dbus_proxy_set_powered;
	iface->get_address = bluetooth_services_adapter_dbus_proxy_get_address;
	iface->get_alias = bluetooth_services_adapter_dbus_proxy_get_alias;
	iface->set_alias = bluetooth_services_adapter_dbus_proxy_set_alias;
	iface->get_modalias = bluetooth_services_adapter_dbus_proxy_get_modalias;
	iface->get_name = bluetooth_services_adapter_dbus_proxy_get_name;
	iface->get_class = bluetooth_services_adapter_dbus_proxy_get_class;
	iface->get_discoverable_timeout = bluetooth_services_adapter_dbus_proxy_get_discoverable_timeout;
	iface->get_pairable_timeout = bluetooth_services_adapter_dbus_proxy_get_pairable_timeout;
}

static void
_dbus_bluetooth_services_adapter_remove_device (BluetoothServicesAdapter* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	char* device = NULL;
	GVariant* _tmp46_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp46_ = g_variant_iter_next_value (&_arguments_iter);
	device = g_variant_dup_string (_tmp46_, NULL);
	g_variant_unref (_tmp46_);
	bluetooth_services_adapter_remove_device (self, device, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_free0 (device);
	;
}

static void
_dbus_bluetooth_services_adapter_set_discovery_filter (BluetoothServicesAdapter* self,
                                                       GVariant* _parameters_,
                                                       GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	GHashTable* properties = NULL;
	GVariant* _tmp47_;
	GHashTable* _tmp48_;
	GVariantIter _tmp49_;
	GVariant* _tmp50_;
	GVariant* _tmp51_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp47_ = g_variant_iter_next_value (&_arguments_iter);
	_tmp48_ = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_variant_unref);
	g_variant_iter_init (&_tmp49_, _tmp47_);
	while (g_variant_iter_loop (&_tmp49_, "{?*}", &_tmp50_, &_tmp51_)) {
		g_hash_table_insert (_tmp48_, g_variant_dup_string (_tmp50_, NULL), g_variant_get_variant (_tmp51_));
	}
	properties = _tmp48_;
	g_variant_unref (_tmp47_);
	bluetooth_services_adapter_set_discovery_filter (self, properties, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	_g_hash_table_unref0 (properties);
	;
}

static void
_dbus_bluetooth_services_adapter_start_discovery (BluetoothServicesAdapter* self,
                                                  GVariant* _parameters_,
                                                  GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	BluetoothServicesAdapterStartDiscoveryReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (BluetoothServicesAdapterStartDiscoveryReadyData);
	_ready_data->_invocation_ = invocation;
	bluetooth_services_adapter_start_discovery (self, (GAsyncReadyCallback) _dbus_bluetooth_services_adapter_start_discovery_ready, _ready_data);
}

static void
_dbus_bluetooth_services_adapter_start_discovery_ready (GObject * source_object,
                                                        GAsyncResult * _res_,
                                                        gpointer _user_data_)
{
	BluetoothServicesAdapterStartDiscoveryReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	bluetooth_services_adapter_start_discovery_finish ((BluetoothServicesAdapter*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (BluetoothServicesAdapterStartDiscoveryReadyData, _ready_data);
}

static void
_dbus_bluetooth_services_adapter_stop_discovery (BluetoothServicesAdapter* self,
                                                 GVariant* _parameters_,
                                                 GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	BluetoothServicesAdapterStopDiscoveryReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (BluetoothServicesAdapterStopDiscoveryReadyData);
	_ready_data->_invocation_ = invocation;
	bluetooth_services_adapter_stop_discovery (self, (GAsyncReadyCallback) _dbus_bluetooth_services_adapter_stop_discovery_ready, _ready_data);
}

static void
_dbus_bluetooth_services_adapter_stop_discovery_ready (GObject * source_object,
                                                       GAsyncResult * _res_,
                                                       gpointer _user_data_)
{
	BluetoothServicesAdapterStopDiscoveryReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	bluetooth_services_adapter_stop_discovery_finish ((BluetoothServicesAdapter*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (BluetoothServicesAdapterStopDiscoveryReadyData, _ready_data);
}

static void
bluetooth_services_adapter_dbus_interface_method_call (GDBusConnection* connection,
                                                       const gchar* sender,
                                                       const gchar* object_path,
                                                       const gchar* interface_name,
                                                       const gchar* method_name,
                                                       GVariant* parameters,
                                                       GDBusMethodInvocation* invocation,
                                                       gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "RemoveDevice") == 0) {
		_dbus_bluetooth_services_adapter_remove_device (object, parameters, invocation);
	} else if (strcmp (method_name, "SetDiscoveryFilter") == 0) {
		_dbus_bluetooth_services_adapter_set_discovery_filter (object, parameters, invocation);
	} else if (strcmp (method_name, "StartDiscovery") == 0) {
		_dbus_bluetooth_services_adapter_start_discovery (object, parameters, invocation);
	} else if (strcmp (method_name, "StopDiscovery") == 0) {
		_dbus_bluetooth_services_adapter_stop_discovery (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_bluetooth_services_adapter_get_UUIDs (BluetoothServicesAdapter* self)
{
	gchar** result;
	gint result_length1 = 0;
	GVariant* _reply;
	gchar** _tmp52_;
	GVariantBuilder _tmp53_;
	gint _tmp54_;
	result = bluetooth_services_adapter_get_UUIDs (self, &result_length1);
	_tmp52_ = result;
	g_variant_builder_init (&_tmp53_, G_VARIANT_TYPE ("as"));
	for (_tmp54_ = 0; _tmp54_ < result_length1; _tmp54_++) {
		g_variant_builder_add_value (&_tmp53_, g_variant_new_string (*_tmp52_));
		_tmp52_++;
	}
	_reply = g_variant_builder_end (&_tmp53_);
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_discoverable (BluetoothServicesAdapter* self)
{
	gboolean result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_discoverable (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_discovering (BluetoothServicesAdapter* self)
{
	gboolean result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_discovering (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_pairable (BluetoothServicesAdapter* self)
{
	gboolean result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_pairable (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_powered (BluetoothServicesAdapter* self)
{
	gboolean result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_powered (self);
	_reply = g_variant_new_boolean (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_address (BluetoothServicesAdapter* self)
{
	gchar* result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_address (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_alias (BluetoothServicesAdapter* self)
{
	gchar* result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_alias (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_modalias (BluetoothServicesAdapter* self)
{
	gchar* result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_modalias (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_name (BluetoothServicesAdapter* self)
{
	gchar* result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_name (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_class (BluetoothServicesAdapter* self)
{
	guint result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_class (self);
	_reply = g_variant_new_uint32 (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_discoverable_timeout (BluetoothServicesAdapter* self)
{
	guint result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_discoverable_timeout (self);
	_reply = g_variant_new_uint32 (result);
	return _reply;
}

static GVariant*
_dbus_bluetooth_services_adapter_get_pairable_timeout (BluetoothServicesAdapter* self)
{
	guint result;
	GVariant* _reply;
	result = bluetooth_services_adapter_get_pairable_timeout (self);
	_reply = g_variant_new_uint32 (result);
	return _reply;
}

static GVariant*
bluetooth_services_adapter_dbus_interface_get_property (GDBusConnection* connection,
                                                        const gchar* sender,
                                                        const gchar* object_path,
                                                        const gchar* interface_name,
                                                        const gchar* property_name,
                                                        GError** error,
                                                        gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "UUIDs") == 0) {
		return _dbus_bluetooth_services_adapter_get_UUIDs (object);
	} else if (strcmp (property_name, "Discoverable") == 0) {
		return _dbus_bluetooth_services_adapter_get_discoverable (object);
	} else if (strcmp (property_name, "Discovering") == 0) {
		return _dbus_bluetooth_services_adapter_get_discovering (object);
	} else if (strcmp (property_name, "Pairable") == 0) {
		return _dbus_bluetooth_services_adapter_get_pairable (object);
	} else if (strcmp (property_name, "Powered") == 0) {
		return _dbus_bluetooth_services_adapter_get_powered (object);
	} else if (strcmp (property_name, "Address") == 0) {
		return _dbus_bluetooth_services_adapter_get_address (object);
	} else if (strcmp (property_name, "Alias") == 0) {
		return _dbus_bluetooth_services_adapter_get_alias (object);
	} else if (strcmp (property_name, "Modalias") == 0) {
		return _dbus_bluetooth_services_adapter_get_modalias (object);
	} else if (strcmp (property_name, "Name") == 0) {
		return _dbus_bluetooth_services_adapter_get_name (object);
	} else if (strcmp (property_name, "Class") == 0) {
		return _dbus_bluetooth_services_adapter_get_class (object);
	} else if (strcmp (property_name, "DiscoverableTimeout") == 0) {
		return _dbus_bluetooth_services_adapter_get_discoverable_timeout (object);
	} else if (strcmp (property_name, "PairableTimeout") == 0) {
		return _dbus_bluetooth_services_adapter_get_pairable_timeout (object);
	}
	return NULL;
}

static void
_dbus_bluetooth_services_adapter_set_discoverable (BluetoothServicesAdapter* self,
                                                   GVariant* _value)
{
	gboolean value = FALSE;
	value = g_variant_get_boolean (_value);
	bluetooth_services_adapter_set_discoverable (self, value);
}

static void
_dbus_bluetooth_services_adapter_set_pairable (BluetoothServicesAdapter* self,
                                               GVariant* _value)
{
	gboolean value = FALSE;
	value = g_variant_get_boolean (_value);
	bluetooth_services_adapter_set_pairable (self, value);
}

static void
_dbus_bluetooth_services_adapter_set_powered (BluetoothServicesAdapter* self,
                                              GVariant* _value)
{
	gboolean value = FALSE;
	value = g_variant_get_boolean (_value);
	bluetooth_services_adapter_set_powered (self, value);
}

static void
_dbus_bluetooth_services_adapter_set_alias (BluetoothServicesAdapter* self,
                                            GVariant* _value)
{
	gchar* value = NULL;
	value = g_variant_dup_string (_value, NULL);
	bluetooth_services_adapter_set_alias (self, value);
	_g_free0 (value);
}

static gboolean
bluetooth_services_adapter_dbus_interface_set_property (GDBusConnection* connection,
                                                        const gchar* sender,
                                                        const gchar* object_path,
                                                        const gchar* interface_name,
                                                        const gchar* property_name,
                                                        GVariant* value,
                                                        GError** error,
                                                        gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "Discoverable") == 0) {
		_dbus_bluetooth_services_adapter_set_discoverable (object, value);
		return TRUE;
	} else if (strcmp (property_name, "Pairable") == 0) {
		_dbus_bluetooth_services_adapter_set_pairable (object, value);
		return TRUE;
	} else if (strcmp (property_name, "Powered") == 0) {
		_dbus_bluetooth_services_adapter_set_powered (object, value);
		return TRUE;
	} else if (strcmp (property_name, "Alias") == 0) {
		_dbus_bluetooth_services_adapter_set_alias (object, value);
		return TRUE;
	}
	return FALSE;
}

guint
bluetooth_services_adapter_register_object (gpointer object,
                                            GDBusConnection* connection,
                                            const gchar* path,
                                            GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_bluetooth_services_adapter_dbus_interface_info), &_bluetooth_services_adapter_dbus_interface_vtable, data, _bluetooth_services_adapter_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_bluetooth_services_adapter_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

