Diff between f8c2b5e4e1595f0784a0177b382fe0382a44e02c and 4305e6c3efdda319287c429ef96b253efb2e6424

Changed Files

File Additions Deletions Status
monitor/bt.h +9 -0 modified
monitor/packet.c +55 -17 modified

Full Patch

diff --git a/monitor/bt.h b/monitor/bt.h
index a66b1a5..25d84da 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -1337,6 +1337,15 @@ struct bt_hci_rsp_write_remote_amp_assoc {
 	uint8_t  phy_handle;
 } __attribute__ ((packed));
 
+#define BT_HCI_CMD_SET_TRIGGERED_CLOCK_CAPTURE	0x140d
+struct bt_hci_cmd_set_triggered_clock_capture {
+	uint16_t handle;
+	uint8_t  enable;
+	uint8_t  type;
+	uint8_t  lpo_allowed;
+	uint8_t  num_filter;
+} __attribute__ ((packed));
+
 #define BT_HCI_CMD_ENABLE_DUT_MODE		0x1803
 
 #define BT_HCI_CMD_WRITE_SSP_DEBUG_MODE		0x1804
diff --git a/monitor/packet.c b/monitor/packet.c
index 69383ce..c991d04 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -1318,6 +1318,25 @@ static void print_clock(uint32_t clock)
 	print_field("Clock: 0x%8.8x", btohl(clock));
 }
 
+static void print_clock_type(uint8_t type)
+{
+	const char *str;
+
+	switch (type) {
+	case 0x00:
+		str = "Local clock";
+		break;
+	case 0x01:
+		str = "Piconet clock";
+		break;
+	default:
+		str = "Reserved";
+		break;
+	}
+
+	print_field("Type: %s (0x%2.2x)", str, type);
+}
+
 static void print_clock_accuracy(uint16_t accuracy)
 {
 	if (btohs(accuracy) == 0xffff)
@@ -1327,6 +1346,11 @@ static void print_clock_accuracy(uint16_t accuracy)
 				btohs(accuracy) * 0.3125, btohs(accuracy));
 }
 
+static void print_lpo_allowed(uint8_t lpo_allowed)
+{
+	print_field("LPO allowed: 0x%2.2x", lpo_allowed);
+}
+
 static void print_broadcast_fragment(uint8_t fragment)
 {
 	const char *str;
@@ -3598,7 +3622,7 @@ static void set_slave_broadcast_cmd(const void *data, uint8_t size)
 
 	print_field("Enable: 0x%2.2x", cmd->enable);
 	print_lt_addr(cmd->lt_addr);
-	print_field("LPO allowed: 0x%2.2x", cmd->lpo_allowed);
+	print_lpo_allowed(cmd->lpo_allowed);
 	print_pkt_type(cmd->pkt_type);
 	print_slot_625("Min interval", cmd->min_interval);
 	print_slot_625("Max interval", cmd->max_interval);
@@ -4927,23 +4951,9 @@ static void read_afh_channel_map_rsp(const void *data, uint8_t size)
 static void read_clock_cmd(const void *data, uint8_t size)
 {
 	const struct bt_hci_cmd_read_clock *cmd = data;
-	const char *str;
 
 	print_handle(cmd->handle);
-
-	switch (cmd->type) {
-	case 0x00:
-		str = "Local clock";
-		break;
-	case 0x01:
-		str = "Piconet clock";
-		break;
-	default:
-		str = "Reserved";
-		break;
-	}
-
-	print_field("Type: %s (0x%2.2x)", str, cmd->type);
+	print_clock_type(cmd->type);
 }
 
 static void read_clock_rsp(const void *data, uint8_t size)
@@ -5044,6 +5054,32 @@ static void write_remote_amp_assoc_rsp(const void *data, uint8_t size)
 	print_phy_handle(rsp->phy_handle);
 }
 
+static void set_triggered_clock_capture_cmd(const void *data, uint8_t size)
+{
+	const struct bt_hci_cmd_set_triggered_clock_capture *cmd = data;
+	const char *str;
+
+	print_handle(cmd->handle);
+
+	switch (cmd->enable) {
+	case 0x00:
+		str = "Disabled";
+		break;
+	case 0x01:
+		str = "Enabled";
+		break;
+	default:
+		str = "Reserved";
+		break;
+	}
+
+	print_field("Capture: %s (0x%2.2x)", str, cmd->enable);
+
+	print_clock_type(cmd->type);
+	print_lpo_allowed(cmd->lpo_allowed);
+	print_field("Clock captures to filter: %u", cmd->num_filter);
+}
+
 static void write_ssp_debug_mode_cmd(const void *data, uint8_t size)
 {
 	const struct bt_hci_cmd_write_ssp_debug_mode *cmd = data;
@@ -6008,7 +6044,9 @@ static const struct opcode_data opcode_table[] = {
 				write_remote_amp_assoc_cmd, 6, false,
 				write_remote_amp_assoc_rsp, 2, true },
 	{ 0x140c, 243, "Get MWS Transport Layer Configuration" },
-	{ 0x140d, 245, "Set Triggered Clock Capture" },
+	{ 0x140d, 245, "Set Triggered Clock Capture",
+				set_triggered_clock_capture_cmd, 6, true,
+				status_rsp, 1, true },
 
 	/* OGF 6 - Testing */
 	{ 0x1801, 128, "Read Loopback Mode" },