diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-03-10 11:24:28 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-03-10 11:35:13 +0100 |
commit | 30bb76ef6a07fce76cda1e44e6ffef4766829c15 (patch) | |
tree | bd9e6c87aaa81bd15a0b070faff829d778e7d25d /lib | |
parent | f1681cafcd323110cd2e92e28541c5a6aa049b74 (diff) | |
download | gnome-bluetooth-30bb76ef6a07fce76cda1e44e6ffef4766829c15.tar.gz |
lib: Add MIDI to the UUID to string helper
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bluetooth-utils.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/bluetooth-utils.c b/lib/bluetooth-utils.c index 4a208c58..4d7c8746 100644 --- a/lib/bluetooth-utils.c +++ b/lib/bluetooth-utils.c @@ -390,6 +390,24 @@ uuid16_to_string (guint uuid16, const char *uuid) } } +static const char * +uuid128_to_string (const char *uuid) +{ + struct { + const char *uuid; + const char *str; + } uuids128[] = { + { "03B80E5A-EDE8-4B33-A751-6CE34EC4C700", "MIDI" }, + }; + guint i; + + for (i = 0; i < G_N_ELEMENTS (uuids128); i++) { + if (g_ascii_strcasecmp (uuids128[i].uuid, uuid) == 0) + return uuids128[i].str; + } + return NULL; +} + /** * bluetooth_uuid_to_string: * @uuid: a string representing a Bluetooth UUID @@ -401,10 +419,14 @@ uuid16_to_string (guint uuid16, const char *uuid) const char * bluetooth_uuid_to_string (const char *uuid) { + const char *ret; char **parts; guint uuid16; gboolean is_custom = FALSE; + ret = uuid128_to_string (uuid); + if (ret) + return ret; if (g_str_has_suffix (uuid, "-0000-1000-8000-0002ee000002") != FALSE) is_custom = TRUE; |