[gnome-bluetooth/wip/hadess/lib-changes: 20/24] lib: Add default-adapter-address property
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/lib-changes: 20/24] lib: Add default-adapter-address property
- Date: Fri, 26 Nov 2021 15:29:56 +0000 (UTC)
commit f80c843ed0758e77385d6d9955e5ee6fae84c79a
Author: Bastien Nocera <hadess hadess net>
Date: Fri Nov 26 10:33:40 2021 +0100
lib: Add default-adapter-address property
lib/bluetooth-client.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index f0cc1dd3..0a251483 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -72,7 +72,8 @@ enum {
PROP_DEFAULT_ADAPTER,
PROP_DEFAULT_ADAPTER_POWERED,
PROP_DEFAULT_ADAPTER_SETUP_MODE,
- PROP_DEFAULT_ADAPTER_NAME
+ PROP_DEFAULT_ADAPTER_NAME,
+ PROP_DEFAULT_ADAPTER_ADDRESS
};
enum {
@@ -1060,6 +1061,10 @@ bluetooth_client_get_property (GObject *object,
g_value_set_boolean (value, client->default_adapter ?
adapter1_get_discovering (client->default_adapter) : FALSE);
break;
+ case PROP_DEFAULT_ADAPTER_ADDRESS:
+ g_value_set_string (value, client->default_adapter ?
+ adapter1_get_address (client->default_adapter) : NULL);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
break;
@@ -1172,6 +1177,15 @@ static void bluetooth_client_class_init(BluetoothClientClass *klass)
g_param_spec_string ("default-adapter-name", NULL,
"The human readable name of the default
adapter",
NULL, G_PARAM_READABLE));
+ /**
+ * BluetoothClient:default-adapter-address:
+ *
+ * The address of the default Bluetooth adapter or %NULL.
+ */
+ g_object_class_install_property (object_class, PROP_DEFAULT_ADAPTER_ADDRESS,
+ g_param_spec_string ("default-adapter-address", NULL,
+ "The address of the default adapter",
+ NULL, G_PARAM_READABLE));
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]