diff mbox series

[BlueZ,2/2] monitor: Fix printing Signed Write Command

Message ID 20230323102858.566934-3-simon.mikuda@streamunlimited.com (mailing list archive)
State Accepted
Commit 648b4362521bcd9146b88d03e51e05454269e27f
Headers show
Series monitor | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch warning WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #81: Handle: 0x006f Type: Vendor specific (f7debc9a-7856-3412-7856-341278563412) /github/workspace/src/src/13185462.patch total: 0 errors, 1 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/13185462.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.
tedd_an/GitLint fail 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 6: B1 Line exceeds max length (83>80): " Handle: 0x006f Type: Vendor specific (f7debc9a-7856-3412-7856-341278563412)"
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Simon Mikuda March 23, 2023, 10:28 a.m. UTC
Data field were print twice (1 time incorrectly):
> ACL Data RX: Handle 64 flags 0x02 dlen 19
      ATT: Signed Write Command (0xd2) len 14
        Handle: 0x006f Type: Vendor specific (f7debc9a-7856-3412-7856-341278563412)
          Data: 0800000087f303c224516133
          Data:
          Signature: 0800000087f303c224516133
---
 monitor/att.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/monitor/att.c b/monitor/att.c
index d3b82074f..18a5af05b 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -2934,13 +2934,14 @@  static void print_write(const struct l2cap_frame *frame, uint16_t handle,
 	struct gatt_handler *handler;
 
 	print_handle(frame, handle, false);
-	print_hex_field("  Data", frame->data, frame->size);
 
 	if (len > frame->size) {
 		print_text(COLOR_ERROR, "invalid size");
 		return;
 	}
 
+	print_hex_field("  Data", frame->data, len);
+
 	attr = get_attribute(frame, handle, false);
 	if (!attr)
 		return;
@@ -3105,7 +3106,6 @@  static void att_signed_write_command(const struct l2cap_frame *frame)
 	}
 
 	print_write(frame, handle, frame->size - 12);
-	print_hex_field("  Data", frame->data, frame->size - 12);
 	print_hex_field("  Signature", frame->data + frame->size - 12, 12);
 }