monitor: Decode QoS setup command and event

This commit is contained in:
Marcel Holtmann 2012-12-20 03:00:41 +01:00
parent bdd50fdd2d
commit 241f221d2d
2 changed files with 40 additions and 4 deletions

View File

@ -361,6 +361,15 @@ struct bt_hci_cmd_exit_park_state {
} __attribute__ ((packed));
#define BT_HCI_CMD_QOS_SETUP 0x0807
struct bt_hci_cmd_qos_setup {
uint16_t handle;
uint8_t flags;
uint8_t service_type;
uint32_t token_rate;
uint32_t peak_bandwidth;
uint32_t latency;
uint32_t delay_variation;
} __attribute__ ((packed));
#define BT_HCI_CMD_ROLE_DISCOVERY 0x0809
struct bt_hci_cmd_role_discovery {
@ -998,6 +1007,16 @@ struct bt_hci_evt_remote_version_complete {
} __attribute__ ((packed));
#define BT_HCI_EVT_QOS_SETUP_COMPLETE 0x0d
struct bt_hci_evt_qos_setup_complete {
uint8_t status;
uint16_t handle;
uint8_t flags;
uint8_t service_type;
uint32_t token_rate;
uint32_t peak_bandwidth;
uint32_t latency;
uint32_t delay_variation;
} __attribute__ ((packed));
#define BT_HCI_EVT_CMD_COMPLETE 0x0e
struct bt_hci_evt_cmd_complete {

View File

@ -2333,7 +2333,17 @@ static void exit_park_state_cmd(const void *data, uint8_t size)
static void qos_setup_cmd(const void *data, uint8_t size)
{
packet_hexdump(data, size);
const struct bt_hci_cmd_qos_setup *cmd = data;
print_handle(cmd->handle);
print_field("Flags: 0x%2.2x", cmd->flags);
print_service_type(cmd->service_type);
print_field("Token rate: %d", btohl(cmd->token_rate));
print_field("Peak bandwidth: %d", btohl(cmd->peak_bandwidth));
print_field("Latency: %d", btohl(cmd->latency));
print_field("Delay variation: %d", btohl(cmd->delay_variation));
}
static void role_discovery_cmd(const void *data, uint8_t size)
@ -3760,11 +3770,18 @@ static void remote_version_complete_evt(const void *data, uint8_t size)
static void qos_setup_complete_evt(const void *data, uint8_t size)
{
uint8_t status = *((uint8_t *) data);
const struct bt_hci_evt_qos_setup_complete *evt = data;
print_status(status);
print_status(evt->status);
print_handle(evt->handle);
print_field("Flags: 0x%2.2x", evt->flags);
packet_hexdump(data + 1, size - 1);
print_service_type(evt->service_type);
print_field("Token rate: %d", btohl(evt->token_rate));
print_field("Peak bandwidth: %d", btohl(evt->peak_bandwidth));
print_field("Latency: %d", btohl(evt->latency));
print_field("Delay variation: %d", btohl(evt->delay_variation));
}
static void cmd_complete_evt(const void *data, uint8_t size)