* [PATCH BlueZ v1 1/2] monitor/att: Add initial decoding for HIDS attributes
@ 2026-01-30 15:56 Luiz Augusto von Dentz
2026-01-30 15:56 ` [PATCH BlueZ v1 2/2] monitor/att: Fix printing data twice Luiz Augusto von Dentz
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2026-01-30 15:56 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds decoders to HID Information and HID Control Point
characteristics.
---
monitor/att.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
diff --git a/monitor/att.c b/monitor/att.c
index 24aaa264c2bd..b77ffb66e89d 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -4506,6 +4506,87 @@ static void ras_data_overwritten_notify(const struct l2cap_frame *frame)
GATT_HANDLER(0x2c19, ras_data_overwritten_read, NULL, \
ras_data_overwritten_notify)
+static const struct bitfield_data hog_info_flags[] = {
+ { 0, "RemoteWake (0x01)" },
+ { 1, "NormallyConnectable (0x02)" },
+ { }
+};
+
+static void hog_info_read(const struct l2cap_frame *frame)
+{
+ uint16_t bcdhid;
+ uint8_t bcc, flags, mask;
+
+ if (!l2cap_frame_get_le16((void *)frame, &bcdhid)) {
+ print_text(COLOR_ERROR, " bcdHID: invalid size");
+ goto done;
+ }
+
+ print_field(" bcdHID: 0x%4.4x", bcdhid);
+
+ if (!l2cap_frame_get_u8((void *)frame, &bcc)) {
+ print_text(COLOR_ERROR, " bCountryCode: invalid size");
+ goto done;
+ }
+
+ print_field(" bCountryCode: 0x%2.2x", bcc);
+
+ if (!l2cap_frame_get_u8((void *)frame, &flags)) {
+ print_text(COLOR_ERROR, " Flags: invalid size");
+ goto done;
+ }
+
+ print_field(" Flags: 0x%2.2x", flags);
+
+ mask = print_bitfield(4, flags, hog_info_flags);
+ if (mask)
+ print_text(COLOR_WHITE_BG, " Unknown fields (0x%2.2x)",
+ mask);
+
+done:
+ if (frame->size)
+ print_hex_field(" Data", frame->data, frame->size);
+}
+
+static const char *hog_cmd_str(uint8_t opcode)
+{
+ switch (opcode) {
+ case 0x00:
+ return "Suspend";
+ case 0x01:
+ return "Exit Suspend";
+ default:
+ return NULL;
+ }
+}
+
+static void hog_cp_write(const struct l2cap_frame *frame)
+{
+ uint8_t opcode;
+ const char *str;
+
+ if (!l2cap_frame_get_u8((void *)frame, &opcode)) {
+ print_text(COLOR_ERROR, " Opcode: invalid size");
+ goto done;
+ }
+
+ str = hog_cmd_str(opcode);
+ if (!str) {
+ print_field(" Opcode: Reserved (0x%2.2x)", opcode);
+ goto done;
+ }
+
+ print_field(" Opcode: %s (0x%2.2x)", str, opcode);
+
+done:
+ if (frame->size)
+ print_hex_field(" Data", frame->data, frame->size);
+}
+
+#define HIDS \
+ GATT_HANDLER(0x2a4a, hog_info_read, NULL, NULL), \
+ GATT_HANDLER(0x2a4c, NULL, hog_cp_write, NULL)
+
#define GATT_HANDLER(_uuid, _read, _write, _notify) \
{ \
.uuid = { \
@@ -4588,6 +4669,7 @@ static const struct gatt_handler {
GATT_HANDLER(0x2bc1, incoming_call_read, NULL, incoming_call_notify),
GATT_HANDLER(0x2bc2, call_friendly_name_read, NULL,
call_friendly_name_notify),
+ HIDS,
GMAS,
RAS
};
--
2.52.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH BlueZ v1 2/2] monitor/att: Fix printing data twice
2026-01-30 15:56 [PATCH BlueZ v1 1/2] monitor/att: Add initial decoding for HIDS attributes Luiz Augusto von Dentz
@ 2026-01-30 15:56 ` Luiz Augusto von Dentz
2026-01-30 17:09 ` [BlueZ,v1,1/2] monitor/att: Add initial decoding for HIDS attributes bluez.test.bot
2026-02-02 16:40 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth
2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2026-01-30 15:56 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This fixes ATT Read Response printing the data read twice by checking if
there is a dedicated decoder then skip printing the value since it is
latter printed by att_read_func:
== Before ==
> ACL Data RX: Handle 2048 flags 0x02 dlen 7
ATT: Read Response (0x0b) len 2
Value[2]:
11 01
Handle: 0x0030 Type: Report Reference (0x2908)
Value Handle: 0x002e Type: Report (0x2a4d)
Value[2]:
11 01
== After ==
> ACL Data RX: Handle 2048 flags 0x02 dlen 7
ATT: Read Response (0x0b) len 2
Handle: 0x0030 Type: Report Reference (0x2908)
Value Handle: 0x002e Type: Report (0x2a4d)
Value[2]:
11 01
---
monitor/att.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/monitor/att.c b/monitor/att.c
index b77ffb66e89d..e76cb44d28f5 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -4989,11 +4989,11 @@ static void att_read_rsp(const struct l2cap_frame *frame)
{
struct att_read *read;
- print_hex_field("Value", frame->data, frame->size);
-
read = att_get_read(frame);
- if (!read)
+ if (!read) {
+ print_hex_field("Value", frame->data, frame->size);
return;
+ }
/* Check if the data size is equal to the MTU then read long procedure
* maybe used.
--
2.52.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [BlueZ,v1,1/2] monitor/att: Add initial decoding for HIDS attributes
2026-01-30 15:56 [PATCH BlueZ v1 1/2] monitor/att: Add initial decoding for HIDS attributes Luiz Augusto von Dentz
2026-01-30 15:56 ` [PATCH BlueZ v1 2/2] monitor/att: Fix printing data twice Luiz Augusto von Dentz
@ 2026-01-30 17:09 ` bluez.test.bot
2026-02-02 16:40 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth
2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2026-01-30 17:09 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
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=1049069
---Test result---
Test Summary:
CheckPatch PENDING 0.36 seconds
GitLint PENDING 0.33 seconds
BuildEll PASS 19.86 seconds
BluezMake PASS 640.73 seconds
MakeCheck PASS 18.18 seconds
MakeDistcheck PASS 237.68 seconds
CheckValgrind PASS 289.67 seconds
CheckSmatch PASS 346.94 seconds
bluezmakeextell PASS 180.44 seconds
IncrementalBuild PENDING 0.30 seconds
ScanBuild PASS 993.59 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH BlueZ v1 1/2] monitor/att: Add initial decoding for HIDS attributes
2026-01-30 15:56 [PATCH BlueZ v1 1/2] monitor/att: Add initial decoding for HIDS attributes Luiz Augusto von Dentz
2026-01-30 15:56 ` [PATCH BlueZ v1 2/2] monitor/att: Fix printing data twice Luiz Augusto von Dentz
2026-01-30 17:09 ` [BlueZ,v1,1/2] monitor/att: Add initial decoding for HIDS attributes bluez.test.bot
@ 2026-02-02 16:40 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2026-02-02 16:40 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Fri, 30 Jan 2026 10:56:36 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This adds decoders to HID Information and HID Control Point
> characteristics.
> ---
> monitor/att.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 82 insertions(+)
Here is the summary with links:
- [BlueZ,v1,1/2] monitor/att: Add initial decoding for HIDS attributes
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ba27f7a12246
- [BlueZ,v1,2/2] monitor/att: Fix printing data twice
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4c963f21e56a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-02 16:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-30 15:56 [PATCH BlueZ v1 1/2] monitor/att: Add initial decoding for HIDS attributes Luiz Augusto von Dentz
2026-01-30 15:56 ` [PATCH BlueZ v1 2/2] monitor/att: Fix printing data twice Luiz Augusto von Dentz
2026-01-30 17:09 ` [BlueZ,v1,1/2] monitor/att: Add initial decoding for HIDS attributes bluez.test.bot
2026-02-02 16:40 ` [PATCH BlueZ v1 1/2] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox