From d4c7714b90c6a953fa6835f2e07cb9ab3d1d7211 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 21 Aug 2006 12:48:22 +0000 Subject: [PATCH] hcidump: Decode host number of completed packets --- tools/parser/hci.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/tools/parser/hci.c b/tools/parser/hci.c index 0ac3a99c7..8dbd5be89 100644 --- a/tools/parser/hci.c +++ b/tools/parser/hci.c @@ -1014,6 +1014,21 @@ static inline void request_clock_dump(int level, struct frame *frm) cp->which_clock ? "piconet" : "local"); } +static inline void num_comp_pkts_dump(int level, struct frame *frm) +{ + uint8_t num = get_u8(frm); + uint16_t handle, packets; + int i; + + for (i = 0; i < num; i++) { + handle = btohs(htons(get_u16(frm))); + packets = btohs(htons(get_u16(frm))); + + p_indent(level, frm); + printf("handle %d packets %d\n", handle, packets); + } +} + static inline void command_dump(int level, struct frame *frm) { hci_command_hdr *hdr = frm->ptr; @@ -1198,6 +1213,9 @@ static inline void command_dump(int level, struct frame *frm) case OCF_READ_TRANSMIT_POWER_LEVEL: request_transmit_power_level_dump(level + 1, frm); return; + case OCF_HOST_NUM_COMP_PKTS: + num_comp_pkts_dump(level + 1, frm); + return; case OCF_FLUSH: case OCF_READ_LINK_SUPERVISION_TIMEOUT: generic_command_dump(level + 1, frm); @@ -2135,21 +2153,6 @@ static inline void role_change_dump(int level, struct frame *frm) } } -static inline void num_comp_pkts_dump(int level, struct frame *frm) -{ - uint8_t num = get_u8(frm); - uint16_t handle, packets; - int i; - - for (i = 0; i < num; i++) { - handle = btohs(htons(get_u16(frm))); - packets = btohs(htons(get_u16(frm))); - - p_indent(level, frm); - printf("handle %d packets %d\n", handle, packets); - } -} - static inline void mode_change_dump(int level, struct frame *frm) { evt_mode_change *evt = frm->ptr; -- 2.47.3