Skip to contentSkip to conversation

lib/uuid: Add VCS UUIDs

PATCH In review Sathish Narasimman 5 participants 9 messages Sep 15, 2022 – Sep 16, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/4 lib/uuid: Add VCS UUIDs

This adds Volume Control Service UUIDs which will be used by Volume Control Profile.

---
 lib/uuid.h | 7 +++++++
 1 file changed, 7 insertions(+)
lib/uuid.h +7 -0
index cb9294be8c6e..f667a74b9b73 100644
@@ -164,6 +164,13 @@ extern "C" {
 #define ASE_SOURCE_UUID					0x2bc5
 #define ASE_CP_UUID					0x2bc6
 
+#define VCS_UUID					0x1844
+#define VOL_OFFSET_CS_UUID				0x1845
+#define AUDIO_INPUT_CS_UUID				0x1843
+#define VOL_STATE_CHRC_UUID				0x2B7D
+#define VOL_CP_CHRC_UUID				0x2B7E
+#define VOL_FLAG_CHRC_UUID				0x2B7F
+
 typedef struct {
 	enum {
 		BT_UUID_UNSPEC = 0,
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 2/4 shared/vcp: Add initial code for handling VCP

This adds initial code for Volume Control Profile.

---
 Makefile.am      |    1 +
 src/shared/vcp.c | 1041 ++++++++++++++++++++++++++++++++++++++++++++++
 src/shared/vcp.h |   58 +++
 3 files changed, 1100 insertions(+)
 create mode 100644 src/shared/vcp.c
 create mode 100644 src/shared/vcp.h
Makefile.am +1 -0
index 960bf21bc726..27715c73d76f 100644
@@ -231,6 +231,7 @@ shared_sources = src/shared/io.h src/shared/timeout.h \
 			src/shared/gap.h src/shared/gap.c \
 			src/shared/log.h src/shared/log.c \
 			src/shared/bap.h src/shared/bap.c src/shared/ascs.h \
+			src/shared/vcp.c src/shared/vcp.h \
 			src/shared/lc3.h src/shared/tty.h
 
 if READLINE
src/shared/vcp.c new file +1041 -0

1,041 lines not on this page · raw message

src/shared/vcp.h new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
2.25.1
#2 lore raw

PATCH v2 3/4 profiles: Add initial code for vcp plugin

In reply to Sathish Narasimman

This adds initial code for vcp plugin which handles Volume Control Profile and Volume Control Service.

---
 Makefile.plugins     |   5 +
 configure.ac         |   4 +
 profiles/audio/vcp.c | 312 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 321 insertions(+)
 create mode 100644 profiles/audio/vcp.c
Makefile.plugins +5 -0
index 213ed99edf2d..a3654980f86d 100644
@@ -121,3 +121,8 @@ if BAP
 builtin_modules += bap
 builtin_sources += profiles/audio/bap.c
 endif
+
+if VCP
+builtin_modules += vcp
+builtin_sources += profiles/audio/vcp.c
+endif
configure.ac +4 -0
index 1f76915b4349..79645e6917cc 100644
@@ -199,6 +199,10 @@ AC_ARG_ENABLE(bap, AS_HELP_STRING([--disable-bap],
 		[disable BAP profile]), [enable_bap=${enableval}])
 AM_CONDITIONAL(BAP, test "${enable_bap}" != "no")
 
+AC_ARG_ENABLE(vcp, AS_HELP_STRING([--disable-vcp],
+		[disable VCP profile]), [enable_vcp=${enableval}])
+AM_CONDITIONAL(VCP, test "${enable_vcp}" != "no")
+
 AC_ARG_ENABLE(tools, AS_HELP_STRING([--disable-tools],
 		[disable Bluetooth tools]), [enable_tools=${enableval}])
 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
profiles/audio/vcp.c new file +312 -0

312 lines not on this page · raw message

Signature · 1 line
2.25.1
#3 lore raw

PATCH v2 4/4 monitor/att: Add decoding support for Volume Control Serice

In reply to Sathish Narasimman

This adds decoding support for VCS attributes

Quoted 1 line

ACL Data RX: Handle 3585 flags 0x02 dlen 7

      ATT: Read Request (0x0a) len 2
        Handle: 0x0017 Type: Volume State (0x2b7d)

< ACL Data TX: Handle 3585 flags 0x00 dlen 8
ATT: Read Response (0x0b) len 3
Value: 000000
Handle: 0x0017 Type: Volume State (0x2b7d)
Volume Setting: 0
Not Muted: 0
Change Counter: 0

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 3585 Address: 49:71:FC:C0:66:C6 (Resolvable)
Count: 1

Quoted 1 line

ACL Data RX: Handle 3585 flags 0x02 dlen 7

      ATT: Read Request (0x0a) len 2
        Handle: 0x001c Type: Volume Flags (0x2b7f)
< ACL Data TX: Handle 3585 flags 0x00 dlen 6
      ATT: Read Response (0x0b) len 1
        Value: 01
        Handle: 0x001c Type: Volume Flags (0x2b7f)
            Volume Falg: 1
---
 monitor/att.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 159 insertions(+)
monitor/att.c +159 -0
index b7470f7a2ff4..3c1ff2e2aaa0 100644
@@ -1590,6 +1590,162 @@ static void pac_context_notify(const struct l2cap_frame *frame)
 	print_pac_context(frame);
 }
 
+static void print_vcs_state(const struct l2cap_frame *frame)
+{
+	uint8_t vol_set, mute, chng_ctr;
+
+	if (!l2cap_frame_get_u8((void *)frame, &vol_set)) {
+		print_text(COLOR_ERROR, "Volume Settings: invalid size");
+		goto done;
+	}
+	print_field("    Volume Setting: %u", vol_set);
+
+	if (!l2cap_frame_get_u8((void *)frame, &mute)) {
+		print_text(COLOR_ERROR, "Mute Filed: invalid size");
+		goto done;
+	}
+
+	switch (mute) {
+	case 0x00:
+		print_field("    Not Muted: %u", mute);
+		break;
+	case 0x01:
+		print_field("    Muted: %u", mute);
+		break;
+	default:
+		print_field("    Unknown Mute Value: %u", mute);
+		break;
+	}
+
+	if (!l2cap_frame_get_u8((void *)frame, &chng_ctr)) {
+		print_text(COLOR_ERROR, "Change Counter: invalid size");
+		goto done;
+	}
+	print_field("    Change Counter: %u", chng_ctr);
+
+done:
+	if (frame->size)
+		print_hex_field("  Data", frame->data, frame->size);
+}
+
+static void vol_state_read(const struct l2cap_frame *frame)
+{
+	print_vcs_state(frame);
+}
+
+static void vol_state_notify(const struct l2cap_frame *frame)
+{
+	print_vcs_state(frame);
+}
+
+static bool vcs_config_cmd(const struct l2cap_frame *frame)
+{
+	if (!l2cap_frame_print_u8((void *)frame, "    Change Counter"))
+		return false;
+
+	return true;
+}
+
+static bool vcs_absolute_cmd(const struct l2cap_frame *frame)
+{
+	if (!l2cap_frame_print_u8((void *)frame, "    Change Counter"))
+		return false;
+
+	if (!l2cap_frame_print_u8((void *)frame, "    Volume Setting"))
+		return false;
+
+	return true;
+}
+
+#define ASE_CMD(_op, _desc, _func) \
+[_op] = { \
+	.desc = _desc, \
+	.func = _func, \
+}
+
+struct vcs_cmd {
+	const char *desc;
+	bool (*func)(const struct l2cap_frame *frame);
+} vcs_cmd_table[] = {
+	/* Opcode = 0x00 (Relative Volume Down) */
+	ASE_CMD(0x00, "Relative Volume Down", vcs_config_cmd),
+	/* Opcode = 0x01 (Relative Volume Up) */
+	ASE_CMD(0x01, "Relative Volume Up", vcs_config_cmd),
+	/* Opcode = 0x02 (Unmute/Relative Volume Down) */
+	ASE_CMD(0x02, "Unmute/Relative Volume Down", vcs_config_cmd),
+	/* Opcode = 0x03 (Unmute/Relative Volume Up) */
+	ASE_CMD(0x03, "Unmute/Relative Volume Up", vcs_config_cmd),
+	/* Opcode = 0x04 (Set Absolute Volume) */
+	ASE_CMD(0x04, "Set Absolute Volume", vcs_absolute_cmd),
+	/* Opcode = 0x05 (Unmute) */
+	ASE_CMD(0x05, "Unmute", vcs_config_cmd),
+	/* Opcode = 0x06 (Mute) */
+	ASE_CMD(0x06, "Mute", vcs_config_cmd),
+};
+
+static struct vcs_cmd *vcs_get_cmd(uint8_t op)
+{
+	if (op > ARRAY_SIZE(vcs_cmd_table))
+		return NULL;
+
+	return &vcs_cmd_table[op];
+}
+
+static void print_vcs_cmd(const struct l2cap_frame *frame)
+{
+	uint8_t op;
+	struct vcs_cmd *cmd;
+
+	if (!l2cap_frame_get_u8((void *)frame, &op)) {
+		print_text(COLOR_ERROR, "opcode: invalid size");
+		goto done;
+	}
+
+	cmd = vcs_get_cmd(op);
+	if (!cmd) {
+		print_field("    Opcode: Reserved (0x%2.2x)", op);
+		goto done;
+	}
+
+	print_field("    Opcode: %s (0x%2.2x)", cmd->desc, op);
+	if (!cmd->func(frame))
+		print_field("    Unknown Opcode");
+
+done:
+	if (frame->size)
+		print_hex_field("  Data", frame->data, frame->size);
+}
+
+static void vol_cp_write(const struct l2cap_frame *frame)
+{
+	print_vcs_cmd(frame);
+}
+
+static void print_vcs_flag(const struct l2cap_frame *frame)
+{
+	uint8_t vol_flag;
+
+	if (!l2cap_frame_get_u8((void *)frame, &vol_flag)) {
+		print_text(COLOR_ERROR, "Volume Flag: invalid size");
+		goto done;
+	}
+	print_field("    Volume Falg: %u", vol_flag);
+
+done:
+	if (frame->size)
+		print_hex_field("  Data", frame->data, frame->size);
+}
+
+static void vol_flag_read(const struct l2cap_frame *frame)
+{
+	print_vcs_flag(frame);
+}
+
+static void vol_flag_notify(const struct l2cap_frame *frame)
+{
+	print_vcs_flag(frame);
+}
+
 #define GATT_HANDLER(_uuid, _read, _write, _notify) \
 { \
 	.uuid = { \
@@ -1617,6 +1773,9 @@ struct gatt_handler {
 	GATT_HANDLER(0x2bcc, pac_loc_read, NULL, pac_loc_notify),
 	GATT_HANDLER(0x2bcd, pac_context_read, NULL, pac_context_notify),
 	GATT_HANDLER(0x2bce, pac_context_read, NULL, pac_context_notify),
+	GATT_HANDLER(0x2b7d, vol_state_read, NULL, vol_state_notify),
+	GATT_HANDLER(0x2b7e, NULL, vol_cp_write, NULL),
+	GATT_HANDLER(0x2b7f, vol_flag_read, NULL, vol_flag_notify),
 };
 
 static struct gatt_handler *get_handler(struct gatt_db_attribute *attr)
Signature · 1 line
2.25.1
#4 lore raw

Re: [PATCH BlueZ v2 4/4] monitor/att: Add decoding support for Volume Control Serice

Hi Sathish,

Quoted 99 lines · Sathish Narasimman

This adds decoding support for VCS attributes

Quoted 1 line

ACL Data RX: Handle 3585 flags 0x02 dlen 7

      ATT: Read Request (0x0a) len 2
        Handle: 0x0017 Type: Volume State (0x2b7d)

< ACL Data TX: Handle 3585 flags 0x00 dlen 8
ATT: Read Response (0x0b) len 3
Value: 000000
Handle: 0x0017 Type: Volume State (0x2b7d)
Volume Setting: 0
Not Muted: 0
Change Counter: 0

Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 3585 Address: 49:71:FC:C0:66:C6 (Resolvable)
Count: 1

Quoted 1 line

ACL Data RX: Handle 3585 flags 0x02 dlen 7

      ATT: Read Request (0x0a) len 2
        Handle: 0x001c Type: Volume Flags (0x2b7f)
< ACL Data TX: Handle 3585 flags 0x00 dlen 6
      ATT: Read Response (0x0b) len 1
        Value: 01
        Handle: 0x001c Type: Volume Flags (0x2b7f)
            Volume Falg: 1
---
 monitor/att.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 159 insertions(+)
monitor/att.c +62 -0
index b7470f7a2ff4..3c1ff2e2aaa0 100644
@@ -1590,6 +1590,162 @@ static void pac_context_notify(const struct l2cap_frame *frame)
        print_pac_context(frame);
 }
 
+static void print_vcs_state(const struct l2cap_frame *frame)
+{
+       uint8_t vol_set, mute, chng_ctr;
+
+       if (!l2cap_frame_get_u8((void *)frame, &vol_set)) {
+               print_text(COLOR_ERROR, "Volume Settings: invalid size");
+               goto done;
+       }
+       print_field("    Volume Setting: %u", vol_set);
+
+       if (!l2cap_frame_get_u8((void *)frame, &mute)) {
+               print_text(COLOR_ERROR, "Mute Filed: invalid size");
+               goto done;
+       }
+
+       switch (mute) {
+       case 0x00:
+               print_field("    Not Muted: %u", mute);
+               break;
+       case 0x01:
+               print_field("    Muted: %u", mute);
+               break;
+       default:
+               print_field("    Unknown Mute Value: %u", mute);
+               break;
+       }
+
+       if (!l2cap_frame_get_u8((void *)frame, &chng_ctr)) {
+               print_text(COLOR_ERROR, "Change Counter: invalid size");
+               goto done;
+       }
+       print_field("    Change Counter: %u", chng_ctr);
+
+done:
+       if (frame->size)
+               print_hex_field("  Data", frame->data, frame->size);
+}
+
+static void vol_state_read(const struct l2cap_frame *frame)
+{
+       print_vcs_state(frame);
+}
+
+static void vol_state_notify(const struct l2cap_frame *frame)
+{
+       print_vcs_state(frame);
+}
+
+static bool vcs_config_cmd(const struct l2cap_frame *frame)
+{
+       if (!l2cap_frame_print_u8((void *)frame, "    Change Counter"))
+               return false;
+
+       return true;
+}
+
+static bool vcs_absolute_cmd(const struct l2cap_frame *frame)
+{
+       if (!l2cap_frame_print_u8((void *)frame, "    Change Counter"))
+               return false;
+
+       if (!l2cap_frame_print_u8((void *)frame, "    Volume Setting"))

monitor/att.c static void pac_context_notify(const struct l2cap_frame *frame) · line 1664

Quoted 10 lines
monitor/att.c +10 -0
+               return false;
+
+       return true;
+}
+
+#define ASE_CMD(_op, _desc, _func) \
+[_op] = { \
+       .desc = _desc, \
+       .func = _func, \
+}

Well those are not really ASE commands so Id probably reword that to be VCS_CMD instead.

Quoted 99 lines
monitor/att.c +86 -1
+struct vcs_cmd {
+       const char *desc;
+       bool (*func)(const struct l2cap_frame *frame);
+} vcs_cmd_table[] = {
+       /* Opcode = 0x00 (Relative Volume Down) */
+       ASE_CMD(0x00, "Relative Volume Down", vcs_config_cmd),
+       /* Opcode = 0x01 (Relative Volume Up) */
+       ASE_CMD(0x01, "Relative Volume Up", vcs_config_cmd),
+       /* Opcode = 0x02 (Unmute/Relative Volume Down) */
+       ASE_CMD(0x02, "Unmute/Relative Volume Down", vcs_config_cmd),
+       /* Opcode = 0x03 (Unmute/Relative Volume Up) */
+       ASE_CMD(0x03, "Unmute/Relative Volume Up", vcs_config_cmd),
+       /* Opcode = 0x04 (Set Absolute Volume) */
+       ASE_CMD(0x04, "Set Absolute Volume", vcs_absolute_cmd),
+       /* Opcode = 0x05 (Unmute) */
+       ASE_CMD(0x05, "Unmute", vcs_config_cmd),
+       /* Opcode = 0x06 (Mute) */
+       ASE_CMD(0x06, "Mute", vcs_config_cmd),
+};
+
+static struct vcs_cmd *vcs_get_cmd(uint8_t op)
+{
+       if (op > ARRAY_SIZE(vcs_cmd_table))
+               return NULL;
+
+       return &vcs_cmd_table[op];
+}
+
+static void print_vcs_cmd(const struct l2cap_frame *frame)
+{
+       uint8_t op;
+       struct vcs_cmd *cmd;
+
+       if (!l2cap_frame_get_u8((void *)frame, &op)) {
+               print_text(COLOR_ERROR, "opcode: invalid size");
+               goto done;
+       }
+
+       cmd = vcs_get_cmd(op);
+       if (!cmd) {
+               print_field("    Opcode: Reserved (0x%2.2x)", op);
+               goto done;
+       }
+
+       print_field("    Opcode: %s (0x%2.2x)", cmd->desc, op);
+       if (!cmd->func(frame))
+               print_field("    Unknown Opcode");
+
+done:
+       if (frame->size)
+               print_hex_field("  Data", frame->data, frame->size);
+}
+
+static void vol_cp_write(const struct l2cap_frame *frame)
+{
+       print_vcs_cmd(frame);
+}
+
+static void print_vcs_flag(const struct l2cap_frame *frame)
+{
+       uint8_t vol_flag;
+
+       if (!l2cap_frame_get_u8((void *)frame, &vol_flag)) {
+               print_text(COLOR_ERROR, "Volume Flag: invalid size");
+               goto done;
+       }
+       print_field("    Volume Falg: %u", vol_flag);
+
+done:
+       if (frame->size)
+               print_hex_field("  Data", frame->data, frame->size);
+}
+
+static void vol_flag_read(const struct l2cap_frame *frame)
+{
+       print_vcs_flag(frame);
+}
+
+static void vol_flag_notify(const struct l2cap_frame *frame)
+{
+       print_vcs_flag(frame);
+}
+
 #define GATT_HANDLER(_uuid, _read, _write, _notify) \
 { \
        .uuid = { \
@@ -1617,6 +1773,9 @@ struct gatt_handler {
        GATT_HANDLER(0x2bcc, pac_loc_read, NULL, pac_loc_notify),
        GATT_HANDLER(0x2bcd, pac_context_read, NULL, pac_context_notify),
        GATT_HANDLER(0x2bce, pac_context_read, NULL, pac_context_notify),
+       GATT_HANDLER(0x2b7d, vol_state_read, NULL, vol_state_notify),
+       GATT_HANDLER(0x2b7e, NULL, vol_cp_write, NULL),
+       GATT_HANDLER(0x2b7f, vol_flag_read, NULL, vol_flag_notify),
 };
 
 static struct gatt_handler *get_handler(struct gatt_db_attribute *attr)
--

2.25.1

Signature · 1 line
Luiz Augusto von Dentz
#5 lore raw
In reply to Sathish Narasimman

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=677268

---Test result---

Test Summary:

CheckPatch                    FAIL      4.02 seconds
GitLint                       PASS      1.89 seconds
Prep - Setup ELL              PASS      33.60 seconds
Build - Prep                  PASS      0.77 seconds
Build - Configure             PASS      10.44 seconds
Build - Make                  PASS      1169.04 seconds
Make Check                    PASS      12.60 seconds
Make Check w/Valgrind         PASS      356.41 seconds
Make Distcheck                PASS      304.10 seconds
Build w/ext ELL - Configure   PASS      11.04 seconds
Build w/ext ELL - Make        PASS      108.76 seconds
Incremental Build w/ patches  PASS      511.45 seconds
Scan Build                    WARNING   1239.48 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
Output:
[BlueZ,v2,2/4] shared/vcp: Add initial code for handling VCP WARNING:PREFER_DEFINED_ATTRIBUTE_MACRO: Prefer __packed over __attribute__((packed)) #1154: FILE: src/shared/vcp.h:16:
+#define __packed __attribute__((packed))

/github/workspace/src/12977204.patch total: 0 errors, 1 warnings, 1106 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/12977204.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,v2,3/4] profiles: Add initial code for vcp plugin ERROR:INITIALISED_STATIC: do not initialise statics to 0 #395: FILE: profiles/audio/vcp.c:288:
+static unsigned int vcp_id = 0;

/github/workspace/src/12977206.patch total: 1 errors, 0 warnings, 330 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/12977206.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: Scan Build - WARNING
Desc: Run Scan Build with patches
Output:
*****************************************************************************
The bugs reported by the scan-build may or may not be caused by your patches.
Please check the list and fix the bugs if they are caused by your patch.
*****************************************************************************
src/shared/vcp.c:285:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')

        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:294:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:318:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:327:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:351:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:360:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:385:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:394:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:419:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:428:29: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (req->change_counter != vstate->counter) {
                                   ^~~~~~~~~~~~~~~
src/shared/vcp.c:452:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:461:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:485:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:494:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~

14 warnings generated.

---
Regards,
Linux Bluetooth

#6 lore raw

Hi Sathish,

Quoted 116 lines · On Thu, Sep 15, 2022 at 4:41 AM <[email protected]> wrote:

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=677268

---Test result---

Test Summary:

CheckPatch                    FAIL      4.02 seconds
GitLint                       PASS      1.89 seconds
Prep - Setup ELL              PASS      33.60 seconds
Build - Prep                  PASS      0.77 seconds
Build - Configure             PASS      10.44 seconds
Build - Make                  PASS      1169.04 seconds
Make Check                    PASS      12.60 seconds
Make Check w/Valgrind         PASS      356.41 seconds
Make Distcheck                PASS      304.10 seconds
Build w/ext ELL - Configure   PASS      11.04 seconds
Build w/ext ELL - Make        PASS      108.76 seconds
Incremental Build w/ patches  PASS      511.45 seconds
Scan Build                    WARNING   1239.48 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
Output:
[BlueZ,v2,2/4] shared/vcp: Add initial code for handling VCP WARNING:PREFER_DEFINED_ATTRIBUTE_MACRO: Prefer __packed over __attribute__((packed)) #1154: FILE: src/shared/vcp.h:16:
+#define __packed __attribute__((packed))

/github/workspace/src/12977204.patch total: 0 errors, 1 warnings, 1106 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/12977204.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,v2,3/4] profiles: Add initial code for vcp plugin ERROR:INITIALISED_STATIC: do not initialise statics to 0 #395: FILE: profiles/audio/vcp.c:288:
+static unsigned int vcp_id = 0;

/github/workspace/src/12977206.patch total: 1 errors, 0 warnings, 330 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/12977206.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: Scan Build - WARNING
Desc: Run Scan Build with patches
Output:
*****************************************************************************
The bugs reported by the scan-build may or may not be caused by your patches.
Please check the list and fix the bugs if they are caused by your patch.
*****************************************************************************
src/shared/vcp.c:285:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')

        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:294:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:318:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:327:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:351:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:360:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:385:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:394:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:419:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:428:29: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (req->change_counter != vstate->counter) {
                                   ^~~~~~~~~~~~~~~
src/shared/vcp.c:452:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:461:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:485:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:494:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
Quoted 1 line

14 warnings generated.

Lets have these warnings fixed so vstate needs to be checked.

Quoted 7 lines

---
Regards,
Linux Bluetooth

Signature · 1 line
Luiz Augusto von Dentz
#7 lore raw

Hi Luiz

Quoted 115 lines · Luiz Augusto von Dentz

Hi Sathish,

Quoted 111 lines · On Thu, Sep 15, 2022 at 4:41 AM <[email protected]> wrote:

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=677268

---Test result---

Test Summary:

CheckPatch                    FAIL      4.02 seconds
GitLint                       PASS      1.89 seconds
Prep - Setup ELL              PASS      33.60 seconds
Build - Prep                  PASS      0.77 seconds
Build - Configure             PASS      10.44 seconds
Build - Make                  PASS      1169.04 seconds
Make Check                    PASS      12.60 seconds
Make Check w/Valgrind         PASS      356.41 seconds
Make Distcheck                PASS      304.10 seconds
Build w/ext ELL - Configure   PASS      11.04 seconds
Build w/ext ELL - Make        PASS      108.76 seconds
Incremental Build w/ patches  PASS      511.45 seconds
Scan Build                    WARNING   1239.48 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
Output:
[BlueZ,v2,2/4] shared/vcp: Add initial code for handling VCP WARNING:PREFER_DEFINED_ATTRIBUTE_MACRO: Prefer __packed over __attribute__((packed)) #1154: FILE: src/shared/vcp.h:16:
+#define __packed __attribute__((packed))

/github/workspace/src/12977204.patch total: 0 errors, 1 warnings, 1106 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/12977204.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,v2,3/4] profiles: Add initial code for vcp plugin ERROR:INITIALISED_STATIC: do not initialise statics to 0 #395: FILE: profiles/audio/vcp.c:288:
+static unsigned int vcp_id = 0;

/github/workspace/src/12977206.patch total: 1 errors, 0 warnings, 330 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/12977206.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: Scan Build - WARNING
Desc: Run Scan Build with patches
Output:
*****************************************************************************
The bugs reported by the scan-build may or may not be caused by your patches.
Please check the list and fix the bugs if they are caused by your patch.
*****************************************************************************
src/shared/vcp.c:285:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')

        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:294:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:318:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:327:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:351:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:360:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:385:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:394:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~
src/shared/vcp.c:419:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:428:29: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (req->change_counter != vstate->counter) {
                                   ^~~~~~~~~~~~~~~
src/shared/vcp.c:452:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:461:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~

src/shared/vcp.c:485:15: warning: Access to field 'vcs' results in a dereference of a null pointer (loaded from variable 'vdb')

Quoted 8 lines
Quoted 6 lines
        if (!vdb && !vdb->vcs)
                     ^~~~~~~~
src/shared/vcp.c:494:25: warning: Access to field 'counter' results in a dereference of a null pointer (loaded from variable 'vstate')
        if (*change_counter != vstate->counter) {
                               ^~~~~~~~~~~~~~~

14 warnings generated.

Lets have these warnings fixed so vstate needs to be checked.

Thanks for the review. Will Update for sure.
Is there a way I can run Checkpatch.pl locally?

Quoted 4 lines
Quoted 4 lines
Quoted 8 lines
Quoted 4 lines

---
Regards,
Linux Bluetooth

--
Luiz Augusto von Dentz

Sathish N

#8 lore raw
In reply to Sathish Narasimman
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 5 lines · On Thu, 15 Sep 2022 15:24:09 +0530 you wrote:

This adds Volume Control Service UUIDs which will be used by Volume Control Profile.

---
 lib/uuid.h | 7 +++++++
 1 file changed, 7 insertions(+)

Here is the summary with links:
- [BlueZ,v2,1/4] lib/uuid: Add VCS UUIDs

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

- [BlueZ,v2,2/4] shared/vcp: Add initial code for handling VCP (no matching commit)
- [BlueZ,v2,3/4] profiles: Add initial code for vcp plugin
(no matching commit)
- [BlueZ,v2,4/4] monitor/att: Add decoding support for Volume Control Serice (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