[gnome-bluetooth] lib: Add separate string for Bluetooth LE services



commit f5fae22865a781204d56d6c6adfcbac3867bae9b
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jan 20 12:19:44 2022 +0100

    lib: Add separate string for Bluetooth LE services

 lib/bluetooth-client.c          | 1 +
 lib/bluetooth-settings-widget.c | 3 ++-
 lib/bluetooth-utils.c           | 5 ++++-
 3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index d2e2195c..cf7ae67c 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -92,6 +92,7 @@ static const char *connectable_uuids[] = {
        "Handsfree",
        "HandsfreeAudioGateway",
        "HumanInterfaceDeviceService",
+       "Human Interface Device",
 };
 
 G_DEFINE_TYPE(BluetoothClient, bluetooth_client, G_TYPE_OBJECT)
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c
index 68023ea5..e6ae7233 100644
--- a/lib/bluetooth-settings-widget.c
+++ b/lib/bluetooth-settings-widget.c
@@ -790,7 +790,8 @@ authorize_service_callback (GDBusMethodInvocation *invocation,
                return;
        }
 
-       if (g_strcmp0 (bluetooth_uuid_to_string (uuid), "HumanInterfaceDeviceService") != 0) {
+       if (g_strcmp0 (bluetooth_uuid_to_string (uuid), "HumanInterfaceDeviceService") != 0 &&
+           g_strcmp0 (bluetooth_uuid_to_string (uuid), "Human Interface Device") != 0) {
                g_autofree char *msg = NULL;
                msg = g_strdup_printf ("Rejecting service auth (%s) for %s: not HID",
                                       uuid, g_dbus_proxy_get_object_path (device));
diff --git a/lib/bluetooth-utils.c b/lib/bluetooth-utils.c
index 0394acfb..aafbbf08 100644
--- a/lib/bluetooth-utils.c
+++ b/lib/bluetooth-utils.c
@@ -362,7 +362,6 @@ uuid16_to_string (guint uuid16, const char *uuid)
        case BLUETOOTH_UUID_HFP_AG:
                return "HandsfreeAudioGateway";
        case BLUETOOTH_UUID_HID:
-       case 0x1812:
                return "HumanInterfaceDeviceService";
        case BLUETOOTH_UUID_SAP:
                return "SIM_Access";
@@ -383,6 +382,10 @@ uuid16_to_string (guint uuid16, const char *uuid)
                return "SEMC HLA";
        case 0x8e771401:
                return "SEMC Watch Phone";
+       case BLUETOOTH_LE_UUID_BATTERY:
+               return "Battery";
+       case BLUETOOTH_LE_UUID_HUMAN_INTERFACE_DEVICE:
+               return "Human Interface Device";
        default:
                g_debug ("Unhandled UUID %s (0x%x)", uuid, uuid16);
                return NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]