summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-06-17 11:31:21 +0200
committerBastien Nocera <hadess@hadess.net>2021-06-17 13:47:33 +0200
commit2bddb64f68c5358582d88dd364de74e0c54f8554 (patch)
tree4cf89ae7def70355d218a33274acd4a13e067923
parentd2053eff93df9ff6c90e30e48b9d2ae440b2239c (diff)
downloadupower-2bddb64f68c5358582d88dd364de74e0c54f8554.tar.gz
lib: Add UP_DEVICE_KIND_BLUETOOTH_GENERIC type
This will be useful to show information about Bluetooth devices which don't fit in with the existing types, and for which we don't want to show an unknown kind.
-rw-r--r--libupower-glib/up-types.c4
-rw-r--r--libupower-glib/up-types.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/libupower-glib/up-types.c b/libupower-glib/up-types.c
index 22d9d8d..23954d6 100644
--- a/libupower-glib/up-types.c
+++ b/libupower-glib/up-types.c
@@ -101,6 +101,8 @@ up_device_kind_to_string (UpDeviceKind type_enum)
return "wearable";
case UP_DEVICE_KIND_TOY:
return "toy";
+ case UP_DEVICE_KIND_BLUETOOTH_GENERIC:
+ return "bluetooth-generic";
default:
return "unknown";
}
@@ -173,6 +175,8 @@ up_device_kind_from_string (const gchar *type)
return UP_DEVICE_KIND_WEARABLE;
if (g_str_equal (type, "toy"))
return UP_DEVICE_KIND_TOY;
+ if (g_str_equal (type, "bluetooth-generic"))
+ return UP_DEVICE_KIND_BLUETOOTH_GENERIC;
return UP_DEVICE_KIND_UNKNOWN;
}
diff --git a/libupower-glib/up-types.h b/libupower-glib/up-types.h
index e67efe0..4944854 100644
--- a/libupower-glib/up-types.h
+++ b/libupower-glib/up-types.h
@@ -64,6 +64,7 @@ typedef enum {
UP_DEVICE_KIND_CAMERA,
UP_DEVICE_KIND_WEARABLE,
UP_DEVICE_KIND_TOY,
+ UP_DEVICE_KIND_BLUETOOTH_GENERIC,
UP_DEVICE_KIND_LAST
} UpDeviceKind;