From c073bc5f8d2634ca5e5134a0146de5a9744a7671 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 18 Apr 2013 15:26:27 +0300 Subject: [PATCH] monitor: Add support for decoding read sync train params response --- monitor/bt.h | 8 ++++++++ monitor/packet.c | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/monitor/bt.h b/monitor/bt.h index 64cbe74fd..0949b1d31 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -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; diff --git a/monitor/packet.c b/monitor/packet.c index 80f5a06ce..c2f1015ad 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -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 */ -- 2.47.3