[gnome-bluetooth/wip/hadess/lib-changes: 11/18] 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: 11/18] lib: Add default-adapter-address property
- Date: Mon, 29 Nov 2021 15:36:14 +0000 (UTC)
commit b07f40b38af97469b17a3418a128b246b8ded35f
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 26b548b5..64a10285 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 {
@@ -1063,6 +1064,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;
@@ -1192,6 +1197,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]