diff --git a/platform/posix/hci_dump_posix_fs.c b/platform/posix/hci_dump_posix_fs.c index 069848d8f..9bee26b62 100644 --- a/platform/posix/hci_dump_posix_fs.c +++ b/platform/posix/hci_dump_posix_fs.c @@ -96,12 +96,17 @@ static uint16_t hci_dump_iso_summary(uint8_t in, uint8_t *packet, uint16_t len) time_stamp = little_endian_read_32(packet, pos); pos += 4; } - uint16_t packet_sequence = little_endian_read_16(packet, pos); - pos += 2; - uint16_t iso_sdu_len = little_endian_read_16(packet, pos); - uint8_t packet_status_flag = packet[pos+1] >> 6; - return snprintf(log_message_buffer,sizeof(log_message_buffer), "ISO %s, handle %04x, pb %u, ts 0x%08x, sequence 0x%04x, packet status %u, iso len %u", - in ? "IN" : "OUT", conn_handle, pb, time_stamp, packet_sequence, packet_status_flag, iso_sdu_len); + if ((pb & 1) == 0) { + uint16_t packet_sequence = little_endian_read_16(packet, pos); + pos += 2; + uint16_t iso_sdu_len = little_endian_read_16(packet, pos); + uint8_t packet_status_flag = packet[pos+1] >> 6; + return snprintf(log_message_buffer,sizeof(log_message_buffer), "ISO %s, handle %04x, pb %u, ts 0x%08x, size %u, sequence 0x%04x, packet status %u, iso pdu len %u", + in ? "IN" : "OUT", conn_handle, pb, time_stamp, len, packet_sequence, packet_status_flag, iso_sdu_len); + } else { + return snprintf(log_message_buffer,sizeof(log_message_buffer), "ISO %s, handle %04x, pb %u, ts 0x%08x, size %u", + in ? "IN" : "OUT", conn_handle, pb, time_stamp, len); + } } static void hci_dump_posix_fs_log_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t len) {