OSDN Git Service

monitor: Add support for decoding read sync train params response
authorJohan Hedberg <johan.hedberg@intel.com>
Thu, 18 Apr 2013 12:26:27 +0000 (15:26 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 18 Apr 2013 14:01:55 +0000 (17:01 +0300)
monitor/bt.h
monitor/packet.c

index 64cbe74..0949b1d 100644 (file)
@@ -690,6 +690,14 @@ struct bt_hci_cmd_write_le_host_supported {
        uint8_t  simultaneous;
 } __attribute__ ((packed));
 
+#define BT_HCI_CMD_READ_SYNC_TRAIN_PARAMS      0x0c77
+struct bt_hci_rsp_read_sync_train_params {
+       uint8_t  status;
+       uint16_t interval;
+       uint32_t timeout;
+       uint8_t  service_data;
+} __attribute__ ((packed));
+
 #define BT_HCI_CMD_READ_LOCAL_VERSION          0x1001
 struct bt_hci_rsp_read_local_version {
        uint8_t  status;
index 80f5a06..c2f1015 100644 (file)
@@ -3238,6 +3238,17 @@ static void write_le_host_supported_cmd(const void *data, uint8_t size)
        print_field("Simultaneous: 0x%2.2x", cmd->simultaneous);
 }
 
+static void read_sync_train_params_rsp(const void *data, uint8_t size)
+{
+       const struct bt_hci_rsp_read_sync_train_params *rsp = data;
+
+       print_status(rsp->status);
+       print_interval(rsp->interval);
+       print_field("Timeout: %.3f msec (0x%8.8x)",
+                       btohl(rsp->timeout) * 0.625, btohl(rsp->timeout));
+       print_field("Service Data: 0x%2.2x", rsp->service_data);
+}
+
 static void read_local_version_rsp(const void *data, uint8_t size)
 {
        const struct bt_hci_rsp_read_local_version *rsp = data;
@@ -4075,7 +4086,9 @@ static const struct opcode_data opcode_table[] = {
        { 0x0c74, 252, "Set Reserved LT_ADDR" },
        { 0x0c75, 253, "Delete Reserved LT_ADDR" },
        { 0x0c76, 254, "Set Connectionless Slave Broadcast Data" },
-       { 0x0c77, 255, "Read Synchronization Train Parameters" },
+       { 0x0c77, 255, "Read Synchronization Train Parameters",
+                               null_cmd, 0, true,
+                               read_sync_train_params_rsp, 8, true },
        { 0x0c78, 256, "Write Synchronization Train Parameters" },
 
        /* OGF 4 - Information Parameter */