[PATCH 5/5] monitor/rfcomm: Add support for NSC frame decoding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changes made to decode NSC frame in RFCOMM for btmon.
Not able capture the output.
---
 monitor/rfcomm.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
index b448527..69ca195 100644
--- a/monitor/rfcomm.c
+++ b/monitor/rfcomm.c
@@ -118,6 +118,9 @@ struct rfcomm_rls {
 	uint8_t error;
 } __attribute__((packed));
 
+struct rfcomm_nsc {
+	uint8_t cmd_type;
+} __attribute__((packed));
 
 struct rfcomm_lmcc {
 	uint8_t type;
@@ -290,6 +293,19 @@ static inline bool mcc_pn(struct rfcomm_frame *rfcomm_frame, uint8_t indent)
 	return true;
 }
 
+static inline bool mcc_nsc(struct rfcomm_frame *rfcomm_frame, uint8_t indent)
+{
+	struct l2cap_frame *frame = &rfcomm_frame->l2cap_frame;
+	struct rfcomm_nsc nsc;
+
+	if (!l2cap_frame_get_u8(frame, &nsc.cmd_type))
+		return false;
+
+	print_field("%*ccr %d, mcc_cmd_type %x", indent, ' ',
+		GET_CR(nsc.cmd_type), RFCOMM_GET_MCC_TYPE(nsc.cmd_type));
+
+	return true;
+}
 
 struct mcc_data {
 	uint8_t type;
@@ -360,6 +376,8 @@ static inline bool mcc_frame(struct rfcomm_frame *rfcomm_frame, uint8_t indent)
 		return mcc_rls(rfcomm_frame, indent+2);
 	case RFCOMM_PN:
 		return mcc_pn(rfcomm_frame, indent+2);
+	case RFCOMM_NSC:
+		return mcc_nsc(rfcomm_frame, indent+2);
 	default:
 		packet_hexdump(frame->data, frame->size);
 	}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux