Skip to contentSkip to conversation

lib/uuid: Add support to compare 16bit uuids

PATCH In review Ajay KV 4 participants 7 messages Feb 12, 2024 – Feb 13, 2024

Subsystems (4)
lore
Share & tools
lore

Ajay KV

author
#0 lore raw

PATCH 1/3 lib/uuid: Add support to compare 16bit uuids

---
 lib/uuid.c | 9 +++++++++
 lib/uuid.h | 1 +
 2 files changed, 10 insertions(+)
lib/uuid.c +9 -0
index 1d2e1f7328b8..3ef45db5408c 100644
@@ -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.
  */
lib/uuid.h +1 -0
index 8839dea08140..124e74985a80 100644
@@ -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
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/3 lib/uuid: Add GTBS UUIDS for Call Control Profile.

---
 lib/uuid.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
lib/uuid.h +21 -0
index 124e74985a80..8404b287ed01 100644
@@ -221,6 +221,27 @@ extern "C" {
 #define MICS_UUID					0x184D
 #define MUTE_CHRC_UUID					0x2BC3
 
+/* Call Control Service(TBS/CCS) */
+#define TBS_UUID                                0x184B
+#define GTBS_UUID                               0x184C
+
+#define BEARER_PROVIDER_NAME_CHRC_UUID          0x2bb3
+#define BEARER_UCI_CHRC_UUID                    0x2bb4
+#define BEARER_TECH_CHRC_UUID                   0x2bb5
+#define BEARER_URI_SCHEME_CHRC_UUID             0x2bb6
+#define BEARER_SIGNAL_STR_CHRC_UUID             0x2bb7
+#define BEARER_SIGNAL_INTRVL_CHRC_UUID          0x2bb8
+#define CURR_CALL_LIST_CHRC_UUID                0x2bb9
+#define BEARER_CCID_CHRC_UUID                   0x2bba
+#define CALL_STATUS_FLAG_CHRC_UUID              0x2bbb
+#define INCOM_CALL_TARGET_URI_CHRC_UUID         0x2bbc
+#define CALL_STATE_CHRC_UUID                    0x2bbd
+#define CALL_CTRL_POINT_CHRC_UUID               0x2bbe
+#define CALL_CTRL_POINT_OPT_OPCODE_CHRC_UUID    0x2bbf
+#define TERMINATION_REASON_CHRC_UUID            0x2bc0
+#define INCOMING_CALL_CHRC_UUID                 0x2bc1
+#define CALL_FRIENDLY_NAME_CHRC_UUID            0x2bc2
+
 typedef struct {
 	enum {
 		BT_UUID_UNSPEC = 0,
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 3/3 shared/ccp: Add initial code for Call Control Profile for Client Role.

In reply to Ajay KV
---
 Makefile.am      |    1 +
 src/shared/ccp.c | 1147 ++++++++++++++++++++++++++++++++++++++++++++++
 src/shared/ccp.h |   45 ++
 3 files changed, 1193 insertions(+)
 create mode 100644 src/shared/ccp.c
 create mode 100644 src/shared/ccp.h
Makefile.am +1 -0
index 2b1b9acdf825..fdffdc478a16 100644
@@ -230,6 +230,7 @@ shared_sources = src/shared/io.h src/shared/timeout.h \
 			src/shared/micp.c src/shared/micp.h \
 			src/shared/csip.c src/shared/csip.h \
 			src/shared/bass.h src/shared/bass.c \
+			src/shared/ccp.h src/shared/ccp.c \
 			src/shared/lc3.h src/shared/tty.h
 
 if READLINE
src/shared/ccp.c new file +1147 -0

1,147 lines not on this page · raw message

src/shared/ccp.h new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH BlueZ 3/3] shared/ccp: Add initial code for Call Control Profile for Client Role.

Dear Ajay,

Thank you very much for the patches.

Am 12.02.24 um 17:17 schrieb Ajay KV:

It’d be great, if you wrote a commit message with information about CCP and how this is implemented and can be tested.

(Also, I’d remove the dot/period from the end of the commit message summary (also in patch 2/3).

Quoted 26 lines
---
  Makefile.am      |    1 +
  src/shared/ccp.c | 1147 ++++++++++++++++++++++++++++++++++++++++++++++
  src/shared/ccp.h |   45 ++
  3 files changed, 1193 insertions(+)

create mode 100644 src/shared/ccp.c
create mode 100644 src/shared/ccp.h

Makefile.am +1 -0
index 2b1b9acdf825..fdffdc478a16 100644
@@ -230,6 +230,7 @@ shared_sources = src/shared/io.h src/shared/timeout.h \
  			src/shared/micp.c src/shared/micp.h \
  			src/shared/csip.c src/shared/csip.h \
  			src/shared/bass.h src/shared/bass.c \
+			src/shared/ccp.h src/shared/ccp.c \
  			src/shared/lc3.h src/shared/tty.h
 
  if READLINE
src/shared/ccp.c new file +0 -0
new file mode 100644
index 000000000000..9089779603bf

src/shared/ccp.c line 6

Quoted 6 lines
src/shared/ccp.c new file +6 -0
@@ -0,0 +1,1147 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2022  Intel Corporation. All rights reserved.

Was this just copied, or was it really written in 2022?

Quoted 10 lines
src/shared/ccp.c new file +10 -0
+ *
+ */
+
+#define _GNU_SOURCE
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <errno.h>

[…]

Quoted 6 lines
src/shared/ccp.h new file +0 -0
new file mode 100644
index 000000000000..809986c2601a

src/shared/ccp.h line 8

Quoted 8 lines
src/shared/ccp.h new file +8 -0
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2020  Intel Corporation. All rights reserved.
+ *
+ */

Ditto.

[…]

Kind regards,

Paul

#4 lore raw

Re: [PATCH BlueZ 3/3] shared/ccp: Add initial code for Call Control Profile for Client Role.

[CC: -<[email protected]>, 550 #5.1.0 Address rejected. (in reply to RCPT TO command)]

Am 12.02.24 um 13:23 schrieb Paul Menzel:

Quoted 83 lines

Dear Ajay,

Thank you very much for the patches.

Am 12.02.24 um 17:17 schrieb Ajay KV:

It’d be great, if you wrote a commit message with information about CCP and how this is implemented and can be tested.

(Also, I’d remove the dot/period from the end of the commit message summary (also in patch 2/3).

Quoted 26 lines

---
  Makefile.am      |    1 +
  src/shared/ccp.c | 1147 ++++++++++++++++++++++++++++++++++++++++++++++ src/shared/ccp.h |   45 ++

  3 files changed, 1193 insertions(+)

  create mode 100644 src/shared/ccp.c
  create mode 100644 src/shared/ccp.h

Makefile.am +1 -0
index 2b1b9acdf825..fdffdc478a16 100644
@@ -230,6 +230,7 @@ shared_sources = src/shared/io.h 
 src/shared/timeout.h \
               src/shared/micp.c src/shared/micp.h \
               src/shared/csip.c src/shared/csip.h \
               src/shared/bass.h src/shared/bass.c \
+            src/shared/ccp.h src/shared/ccp.c \

              src/shared/lc3.h src/shared/tty.h
  if READLINE

src/shared/ccp.c new file +0 -0
new file mode 100644
index 000000000000..9089779603bf

src/shared/ccp.c line 6

Quoted 6 lines
src/shared/ccp.c new file +6 -0
@@ -0,0 +1,1147 @@
+// SPDX-License-Identifier: LGPL-2.1-or-later
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2022  Intel Corporation. All rights reserved.

Was this just copied, or was it really written in 2022?

Quoted 10 lines
src/shared/ccp.c new file +10 -0
+ *
+ */
+
+#define _GNU_SOURCE
+#include <inttypes.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <unistd.h>
+#include <errno.h>

[…]

Quoted 6 lines
src/shared/ccp.h new file +0 -0
new file mode 100644
index 000000000000..809986c2601a

src/shared/ccp.h line 8

Quoted 8 lines
src/shared/ccp.h new file +8 -0
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2020  Intel Corporation. All rights reserved.
+ *
+ */

Ditto.

[…]

Kind regards,

Paul

#5 lore raw
In reply to Ajay KV

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=825164

---Test result---

Test Summary:

CheckPatch                    FAIL      1.79 seconds
GitLint                       FAIL      0.89 seconds
BuildEll                      PASS      24.03 seconds
BluezMake                     PASS      687.75 seconds
MakeCheck                     PASS      12.21 seconds
MakeDistcheck                 PASS      162.46 seconds
CheckValgrind                 PASS      225.62 seconds
CheckSmatch                   PASS      331.69 seconds
bluezmakeextell               PASS      108.23 seconds
IncrementalBuild              PASS      1945.91 seconds
ScanBuild                     PASS      939.98 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,1/3] lib/uuid: Add support to compare 16bit uuids WARNING:LEADING_SPACE: please, no spaces at the start of a line #90: FILE: lib/uuid.c:126:
+ if (!uuid1 || (uuid1->type != BT_UUID16))$

WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (2, 4) #90: FILE: lib/uuid.c:126:
+ if (!uuid1 || (uuid1->type != BT_UUID16))
+ return 0;

WARNING:LEADING_SPACE: please, no spaces at the start of a line #91: FILE: lib/uuid.c:127:
+ return 0;$

WARNING:LEADING_SPACE: please, no spaces at the start of a line #93: FILE: lib/uuid.c:129:
+ return (uuid1->value.u16 == uuid2);$

/github/workspace/src/src/13552944.patch total: 0 errors, 4 warnings, 22 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13552944.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

[BlueZ,3/3] shared/ccp: Add initial code for Call Control Profile for Client Role. WARNING:LEADING_SPACE: please, no spaces at the start of a line
#305: FILE: src/shared/ccp.c:202:
+ void *user_data, bt_ccp_destroy_func_t destroy)$

WARNING:LEADING_SPACE: please, no spaces at the start of a line #361: FILE: src/shared/ccp.c:258:
+ &uuid, BT_ATT_PERM_READ,$

WARNING:LEADING_SPACE: please, no spaces at the start of a line #362: FILE: src/shared/ccp.c:259:
+ BT_GATT_CHRC_PROP_READ | BT_GATT_CHRC_PROP_NOTIFY,$

WARNING:LEADING_SPACE: please, no spaces at the start of a line #363: FILE: src/shared/ccp.c:260:
+ ccs_call_state_read, NULL, ccs);$

WARNING:LONG_LINE: line length of 81 exceeds 80 columns #375: FILE: src/shared/ccp.c:272:
+ ccs->bearer_technology = gatt_db_service_add_characteristic(ccs->service,

WARNING:LONG_LINE: line length of 87 exceeds 80 columns #385: FILE: src/shared/ccp.c:282:
+ ccs->bearer_uri_schemes_list = gatt_db_service_add_characteristic(ccs->service,

WARNING:LONG_LINE: line length of 87 exceeds 80 columns #402: FILE: src/shared/ccp.c:299:
+ ccs->signal_reporting_intrvl = gatt_db_service_add_characteristic(ccs->service,

WARNING:LONG_LINE: line length of 81 exceeds 80 columns #410: FILE: src/shared/ccp.c:307:
+ ccs->current_call_list = gatt_db_service_add_characteristic(ccs->service,

WARNING:LONG_LINE: line length of 81 exceeds 80 columns #437: FILE: src/shared/ccp.c:334:
+ ccs->target_bearer_uri = gatt_db_service_add_characteristic(ccs->service,

WARNING:LONG_LINE: line length of 84 exceeds 80 columns #454: FILE: src/shared/ccp.c:351:
+ ccs->call_ctrl_opt_opcode = gatt_db_service_add_characteristic(ccs->service,

WARNING:LONG_LINE: line length of 88 exceeds 80 columns #456: FILE: src/shared/ccp.c:353:
+ BT_GATT_CHRC_PROP_WRITE | BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP |

WARNING:LONG_LINE: line length of 84 exceeds 80 columns #462: FILE: src/shared/ccp.c:359:
+ ccs->call_ctrl_opt_opcode = gatt_db_service_add_characteristic(ccs->service,

WARNING:LONG_LINE: line length of 82 exceeds 80 columns #469: FILE: src/shared/ccp.c:366:
+ ccs->termination_reason = gatt_db_service_add_characteristic(ccs->service,

WARNING:LONG_LINE: line length of 82 exceeds 80 columns
#596: FILE: src/shared/ccp.c:493:
+static void ccp_cb_status_flag_notify(uint16_t value_handle, const uint8_t *value,

WARNING:LEADING_SPACE: please, no spaces at the start of a line #601: FILE: src/shared/ccp.c:498:
+ DBG(ccp, "");$

WARNING:LEADING_SPACE: please, no spaces at the start of a line #621: FILE: src/shared/ccp.c:518:
+ DBG(ccp, "");$

WARNING:LONG_LINE: line length of 82 exceeds 80 columns
#640: FILE: src/shared/ccp.c:537:
+static void ccp_cb_bearer_name_notify(uint16_t value_handle, const uint8_t *value,

WARNING:LONG_LINE: line length of 81 exceeds 80 columns
#687: FILE: src/shared/ccp.c:584:
+static void ccp_cb_call_state_notify(uint16_t value_handle, const uint8_t *value,

WARNING:LONG_LINE: line length of 81 exceeds 80 columns
#711: FILE: src/shared/ccp.c:608:
+static void ccp_cb_incom_call_notify(uint16_t value_handle, const uint8_t *value,

WARNING:LONG_LINE: line length of 85 exceeds 80 columns #731: FILE: src/shared/ccp.c:628:
+ if (!gatt_db_attribute_get_char_data(ccs->incoming_call, NULL, &value_handle,

WARNING:LONG_LINE: line length of 82 exceeds 80 columns #749: FILE: src/shared/ccp.c:646:
+ if (!gatt_db_attribute_get_char_data(ccs->call_state, NULL, &value_handle,

WARNING:LONG_LINE: line length of 89 exceeds 80 columns #767: FILE: src/shared/ccp.c:664:
+ if (!gatt_db_attribute_get_char_data(ccs->current_call_list, NULL, &value_handle,

WARNING:LONG_LINE: line length of 83 exceeds 80 columns #785: FILE: src/shared/ccp.c:682:
+ if (!gatt_db_attribute_get_char_data(ccs->bearer_name, NULL, &value_handle,

WARNING:LONG_LINE: line length of 90 exceeds 80 columns #803: FILE: src/shared/ccp.c:700:
+ if (!gatt_db_attribute_get_char_data(ccs->termination_reason, NULL, &value_handle,

WARNING:LONG_LINE: line length of 83 exceeds 80 columns #821: FILE: src/shared/ccp.c:718:
+ if (!gatt_db_attribute_get_char_data(ccs->status_flag, NULL, &value_handle,

WARNING:LONG_LINE: line length of 82 exceeds 80 columns #839: FILE: src/shared/ccp.c:736:
+ if (!gatt_db_attribute_get_char_data(ccs->bearer_uci, NULL, &value_handle,

WARNING:LONG_LINE: line length of 89 exceeds 80 columns #857: FILE: src/shared/ccp.c:754:
+ if (!gatt_db_attribute_get_char_data(ccs->bearer_technology, NULL, &value_handle,

WARNING:LONG_LINE: line length of 87 exceeds 80 columns #874: FILE: src/shared/ccp.c:771:
+ if (!gatt_db_attribute_get_char_data(ccs->signal_strength, NULL, &value_handle,

WARNING:LONG_LINE: line length of 89 exceeds 80 columns #909: FILE: src/shared/ccp.c:806:
+ if (!gatt_db_attribute_get_char_data(ccs->target_bearer_uri, NULL, &value_handle,

WARNING:LONG_LINE: line length of 87 exceeds 80 columns #927: FILE: src/shared/ccp.c:824:
+ if (!gatt_db_attribute_get_char_data(ccs->call_ctrl_point, NULL, &value_handle,

WARNING:LEADING_SPACE: please, no spaces at the start of a line #943: FILE: src/shared/ccp.c:840:
+ DBG(ccp, "");$

WARNING:LONG_LINE: line length of 92 exceeds 80 columns #945: FILE: src/shared/ccp.c:842:
+ if (!gatt_db_attribute_get_char_data(ccs->call_ctrl_opt_opcode, NULL, &value_handle,

WARNING:LONG_LINE: line length of 85 exceeds 80 columns #951: FILE: src/shared/ccp.c:848:
+ ccp->call_control_opt_opcode_id = bt_gatt_client_register_notify(ccp->client,

WARNING:LONG_LINE: line length of 85 exceeds 80 columns #963: FILE: src/shared/ccp.c:860:
+ if (!gatt_db_attribute_get_char_data(ccs->friendly_name, NULL, &value_handle,

WARNING:LONG_LINE: line length of 95 exceeds 80 columns #981: FILE: src/shared/ccp.c:878:
+ if (!gatt_db_attribute_get_char_data(ccs->signal_reporting_intrvl, NULL, &value_handle,

WARNING:LONG_LINE: line length of 85 exceeds 80 columns #987: FILE: src/shared/ccp.c:884:
+ ccp->signal_reporting_intrvl_id = bt_gatt_client_register_notify(ccp->client,

WARNING:LONG_LINE: line length of 95 exceeds 80 columns #999: FILE: src/shared/ccp.c:896:
+ if (!gatt_db_attribute_get_char_data(ccs->bearer_uri_schemes_list, NULL, &value_handle,

WARNING:LONG_LINE: line length of 85 exceeds 80 columns #1005: FILE: src/shared/ccp.c:902:
+ ccp->bearer_uri_schemes_list_id = bt_gatt_client_register_notify(ccp->client,

WARNING:LONG_LINE: line length of 81 exceeds 80 columns #1040: FILE: src/shared/ccp.c:937:
+ DBG(ccp, "Found Bearer Technology, handle 0x%04x", value_handle);

WARNING:LONG_LINE: line length of 82 exceeds 80 columns #1110: FILE: src/shared/ccp.c:1007:
+ DBG(ccp, "Found Termination Reason, handle 0x%04x", value_handle);

WARNING:PREFER_DEFINED_ATTRIBUTE_MACRO: Prefer __packed over __attribute__((packed)) #1270: FILE: src/shared/ccp.h:14:
+#define __packed __attribute__((packed))

/github/workspace/src/src/13552946.patch total: 0 errors, 41 warnings, 1199 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/src/13552946.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,2/3] lib/uuid: Add GTBS UUIDS for Call Control Profile.

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
1: T3 Title has trailing punctuation (.): "[BlueZ,2/3] lib/uuid: Add GTBS UUIDS for Call Control Profile."
[BlueZ,3/3] shared/ccp: Add initial code for Call Control Profile for Client Role.

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
1: T1 Title exceeds max length (82>80): "[BlueZ,3/3] shared/ccp: Add initial code for Call Control Profile for Client Role."
1: T3 Title has trailing punctuation (.): "[BlueZ,3/3] shared/ccp: Add initial code for Call Control Profile for Client Role."

---
Regards,
Linux Bluetooth

#6 lore raw
In reply to Ajay KV
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 4 lines · On Mon, 12 Feb 2024 18:17:24 +0200 you wrote:
---
 lib/uuid.c | 9 +++++++++
 lib/uuid.h | 1 +
 2 files changed, 10 insertions(+)

Here is the summary with links:
- [BlueZ,1/3] lib/uuid: Add support to compare 16bit uuids (no matching commit)
- [BlueZ,2/3] lib/uuid: Add GTBS UUIDS for Call Control Profile.

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=24d97e35fcde

- [BlueZ,3/3] shared/ccp: Add initial code for Call Control Profile for Client Role. (no matching commit)

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html