All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ajay KV <ajay.k.v@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: kiran.k@intel.com, Ajay KV <ajay.k.v@intel.com>
Subject: [PATCH BlueZ 1/3] lib/uuid: Add support to compare 16bit uuids
Date: Tue, 13 Feb 2024 23:56:58 +0200	[thread overview]
Message-ID: <20240213215703.21507-1-ajay.k.v@intel.com> (raw)

---
 lib/uuid.c | 9 +++++++++
 lib/uuid.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/lib/uuid.c b/lib/uuid.c
index 1d2e1f7328b8..3ef45db5408c 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -120,6 +120,15 @@ int bt_uuid_cmp(const bt_uuid_t *uuid1, const bt_uuid_t *uuid2)
 	return bt_uuid128_cmp(&u1, &u2);
 }
 
+int bt_uuid16_cmp(const bt_uuid_t *uuid1, uint16_t uuid2)
+{
+
+  if (!uuid1 || (uuid1->type != BT_UUID16))
+    return 0;
+
+  return (uuid1->value.u16 == uuid2);
+}
+
 /*
  * convert the UUID to string, copying a maximum of n characters.
  */
diff --git a/lib/uuid.h b/lib/uuid.h
index 8839dea08140..124e74985a80 100644
--- a/lib/uuid.h
+++ b/lib/uuid.h
@@ -242,6 +242,7 @@ int bt_uuid32_create(bt_uuid_t *btuuid, uint32_t value);
 int bt_uuid128_create(bt_uuid_t *btuuid, uint128_t value);
 
 int bt_uuid_cmp(const bt_uuid_t *uuid1, const bt_uuid_t *uuid2);
+int bt_uuid16_cmp(const bt_uuid_t *uuid1, uint16_t uuid2);
 void bt_uuid_to_uuid128(const bt_uuid_t *src, bt_uuid_t *dst);
 
 #define MAX_LEN_UUID_STR 37
-- 
2.34.1


             reply	other threads:[~2024-02-13 16:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 21:56 Ajay KV [this message]
2024-02-13 18:01 ` [BlueZ,1/3] lib/uuid: Add support to compare 16bit uuids bluez.test.bot
2024-02-13 20:50 ` [PATCH BlueZ 1/3] " patchwork-bot+bluetooth
2024-02-13 21:56 ` [PATCH BlueZ 2/3] lib/uuid: Add GTBS UUIDS for Call Control Profile Ajay KV
2024-02-13 21:57 ` [PATCH BlueZ 3/3] shared/ccp: Add initial code for Call Control Profile for Client Role Ajay KV
2024-02-13 21:57 ` [PATCH v2 1/3] lib/uuid: Add support to compare 16bit uuids Ajay KV
2024-02-13 17:34   ` [v2,1/3] " bluez.test.bot
2024-02-13 20:50   ` [PATCH v2 1/3] " patchwork-bot+bluetooth
2024-02-13 21:57 ` [PATCH v2 2/3] lib/uuid: Add GTBS UUIDs for Call Control Profile Ajay KV
2024-02-13 20:50   ` patchwork-bot+bluetooth
2024-02-13 21:57 ` [PATCH v2 3/3] shared/ccp: Add initial code for Call Control Profile for Client Role Ajay KV
2024-02-13 20:50   ` patchwork-bot+bluetooth
  -- strict thread matches above, loose matches on Subject: below --
2024-02-12 16:17 [PATCH BlueZ 1/3] lib/uuid: Add support to compare 16bit uuids Ajay KV
2024-02-13 20:50 ` patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240213215703.21507-1-ajay.k.v@intel.com \
    --to=ajay.k.v@intel.com \
    --cc=kiran.k@intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.