Diff between 202fb6bd69703300b6e4b3a2a215018a90917aa7 and e0150908f1fc36ecba094dc6f3e3c58489398fa7

Changed Files

File Additions Deletions Status
monitor/rfcomm.c +19 -0 modified

Full Patch

diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
index 7d22fa0..be215a1 100644
--- a/monitor/rfcomm.c
+++ b/monitor/rfcomm.c
@@ -146,6 +146,23 @@ static void print_rfcomm_hdr(struct rfcomm_frame *rfcomm_frame, uint8_t indent)
 	print_field("%*cFCS: 0x%2.2x", indent, ' ', hdr.fcs);
 }
 
+static inline bool mcc_test(struct rfcomm_frame *rfcomm_frame, uint8_t indent)
+{
+	struct l2cap_frame *frame = &rfcomm_frame->l2cap_frame;
+	uint8_t data;
+
+	printf("%*cTest Data: 0x ", indent, ' ');
+
+	while (frame->size > 1) {
+		if (!l2cap_frame_get_u8(frame, &data))
+			return false;
+		printf("%2.2x ", data);
+	}
+
+	printf("\n");
+	return true;
+}
+
 static inline bool mcc_msc(struct rfcomm_frame *rfcomm_frame, uint8_t indent)
 {
 	struct l2cap_frame *frame = &rfcomm_frame->l2cap_frame;
@@ -358,6 +375,8 @@ static inline bool mcc_frame(struct rfcomm_frame *rfcomm_frame, uint8_t indent)
 	rfcomm_frame->mcc = mcc;
 
 	switch (type) {
+	case RFCOMM_TEST:
+		return mcc_test(rfcomm_frame, indent+10);
 	case RFCOMM_MSC:
 		return mcc_msc(rfcomm_frame, indent+2);
 	case RFCOMM_RPN: