[gnome-bluetooth/wip/hadess/add-speakers] lib: Add speaker type




commit c9a513a6338f673bc26c2aa995f657048173be1e
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 3 12:00:16 2021 +0100

    lib: Add speaker type
    
    Closes: #77

 lib/bluetooth-enums.h | 4 +++-
 lib/bluetooth-utils.c | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/lib/bluetooth-enums.h b/lib/bluetooth-enums.h
index b54ad361..3c8b72c3 100644
--- a/lib/bluetooth-enums.h
+++ b/lib/bluetooth-enums.h
@@ -79,6 +79,7 @@ typedef enum {
  * @BLUETOOTH_TYPE_DISPLAY: a display
  * @BLUETOOTH_TYPE_WEARABLE: a wearable computer
  * @BLUETOOTH_TYPE_TOY: a toy or game
+ * @BLUETOOTH_TYPE_SPEAKERS: audio speaker or speakers
  *
  * The type of a Bluetooth device. See also %BLUETOOTH_TYPE_INPUT and %BLUETOOTH_TYPE_AUDIO
  **/
@@ -102,7 +103,8 @@ typedef enum {
        BLUETOOTH_TYPE_SCANNER          = 1 << 16,
        BLUETOOTH_TYPE_DISPLAY          = 1 << 17,
        BLUETOOTH_TYPE_WEARABLE         = 1 << 18,
-       BLUETOOTH_TYPE_TOY              = 1 << 19
+       BLUETOOTH_TYPE_TOY              = 1 << 19,
+       BLUETOOTH_TYPE_SPEAKERS         = 1 << 20,
 } BluetoothType;
 
 #define _BLUETOOTH_TYPE_NUM_TYPES 20
diff --git a/lib/bluetooth-utils.c b/lib/bluetooth-utils.c
index 201e479e..09504893 100644
--- a/lib/bluetooth-utils.c
+++ b/lib/bluetooth-utils.c
@@ -185,6 +185,8 @@ bluetooth_class_to_type (guint32 class)
                case 0x01:
                case 0x02:
                        return BLUETOOTH_TYPE_HEADSET;
+               case 0x05:
+                       return BLUETOOTH_TYPE_SPEAKERS;
                case 0x06:
                        return BLUETOOTH_TYPE_HEADPHONES;
                case 0x0b: /* VCR */


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