Diff between 680a72de23f71dd3b072435599df377362733bcb and 55eeda7afd5dd0b6ea5581295bbfcbfd7a742804

Changed Files

File Additions Deletions Status
monitor/bt.h +15 -0 modified
monitor/l2cap.c +23 -2 modified

Full Patch

diff --git a/monitor/bt.h b/monitor/bt.h
index f10d5d4..1bb9048 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -1403,3 +1403,18 @@ struct bt_l2cap_pdu_info_rsp {
 	uint16_t type;
 	uint16_t result;
 } __attribute__ ((packed));
+
+#define BT_L2CAP_PDU_CREATE_CHAN_REQ	0x0c
+struct bt_l2cap_pdu_create_chan_req {
+	uint16_t psm;
+	uint16_t scid;
+	uint8_t  ctrlid;
+} __attribute__ ((packed));
+
+#define BT_L2CAP_PDU_CREATE_CHAN_RSP	0x0d
+struct bt_l2cap_pdu_create_chan_rsp {
+	uint16_t dcid;
+	uint16_t scid;
+	uint16_t result;
+	uint16_t status;
+} __attribute__ ((packed));
diff --git a/monitor/l2cap.c b/monitor/l2cap.c
index ea85f53..355849a 100644
--- a/monitor/l2cap.c
+++ b/monitor/l2cap.c
@@ -427,6 +427,25 @@ static void sig_info_rsp(const void *data, uint16_t size)
 	}
 }
 
+static void sig_create_chan_req(const void *data, uint16_t size)
+{
+	const struct bt_l2cap_pdu_create_chan_req *pdu = data;
+
+	print_psm(pdu->psm);
+	print_cid("Source", pdu->scid);
+	print_field("Controller ID: %d", pdu->ctrlid);
+}
+
+static void sig_create_chan_rsp(const void *data, uint16_t size)
+{
+	const struct bt_l2cap_pdu_create_chan_rsp *pdu = data;
+
+	print_cid("Destination", pdu->dcid);
+	print_cid("Source", pdu->scid);
+	print_conn_result(pdu->result);
+	print_conn_status(pdu->status);
+}
+
 struct sig_opcode_data {
 	uint8_t opcode;
 	const char *str;
@@ -458,8 +477,10 @@ static const struct sig_opcode_data sig_opcode_table[] = {
 			sig_info_req, 2, true },
 	{ 0x0b, "Information Response",
 			sig_info_rsp, 4, false },
-	{ 0x0c, "Create Channel Request"		},
-	{ 0x0d, "Create Channel Response"		},
+	{ 0x0c, "Create Channel Request",
+			sig_create_chan_req, 5, true },
+	{ 0x0d, "Create Channel Response",
+			sig_create_chan_rsp, 8, true },
 	{ 0x0e, "Move Channel Request"			},
 	{ 0x0f, "Move Channel Response"			},
 	{ 0x10, "Move Channel Confirmation"		},