[gnome-bluetooth/wip/hadess/bluetooth-le-audio: 1/3] lib: Detect Bluetooth LE audio devices




commit 30f92603e4229a7e3fa0c029ffceb3dbfd9f4bd4
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Dec 2 12:39:25 2021 +0100

    lib: Detect Bluetooth LE audio devices
    
    Detect them from their appearance, which we then translate to icons.

 lib/bluetooth-utils.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/lib/bluetooth-utils.c b/lib/bluetooth-utils.c
index 669882f5..ead8b5c2 100644
--- a/lib/bluetooth-utils.c
+++ b/lib/bluetooth-utils.c
@@ -255,6 +255,20 @@ bluetooth_appearance_to_type (guint16 appearance)
                        return BLUETOOTH_TYPE_SCANNER;
                }
                break;
+       case 0x21:
+               return BLUETOOTH_TYPE_SPEAKERS;
+       case 0x25: /* Audio */
+               switch (appearance & 0x3f) {
+               case 0x01:
+               case 0x02:
+               case 0x04:
+                       return BLUETOOTH_TYPE_HEADSET;
+               case 0x03:
+                       return BLUETOOTH_TYPE_HEADPHONES;
+               default:
+                       return BLUETOOTH_TYPE_OTHER_AUDIO;
+               }
+               break;
        }
 
        return 0;


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