diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-08 23:09:02 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-10-08 23:09:02 -0700 |
commit | 9b24859815866f836621c7083982314b5a5f8085 (patch) | |
tree | 34d27d8c9d051a6fd09423aacb7a1714d8913c31 /monitor/l2cap.c | |
parent | e355434eedbecd2513e91f0fe947f43ba073fb37 (diff) | |
download | bluez-9b24859815866f836621c7083982314b5a5f8085.tar.gz |
monitor: Add decoding of L2CAP connectionless channel
Diffstat (limited to 'monitor/l2cap.c')
-rw-r--r-- | monitor/l2cap.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/monitor/l2cap.c b/monitor/l2cap.c index 610903991..2e49e32be 100644 --- a/monitor/l2cap.c +++ b/monitor/l2cap.c @@ -1223,6 +1223,36 @@ static void le_sig_packet(uint16_t index, bool in, uint16_t handle, opcode_data->func(&frame); } +static void connless_packet(uint16_t index, bool in, uint16_t handle, + uint16_t cid, const void *data, uint16_t size) +{ + struct l2cap_frame frame; + const struct bt_l2cap_hdr_connless *hdr = data; + uint16_t psm; + + if (size < 2) { + print_text(COLOR_ERROR, "malformed connectionless packet"); + packet_hexdump(data, size); + return; + } + + psm = btohs(hdr->psm); + + data += 2; + size -= 2; + + print_indent(6, COLOR_CYAN, "L2CAP: Connectionless", "", COLOR_OFF, + " len %d [PSM %d]", size, psm); + + switch (psm) { + default: + packet_hexdump(data, size); + break; + } + + l2cap_frame_init(&frame, index, in, handle, cid, data, size); +} + static void print_controller_list(const uint8_t *data, uint16_t size) { while (size > 2) { @@ -2441,6 +2471,9 @@ static void l2cap_frame(uint16_t index, bool in, uint16_t handle, case 0x0001: bredr_sig_packet(index, in, handle, cid, data, size); break; + case 0x0002: + connless_packet(index, in, handle, cid, data, size); + break; case 0x0003: amp_packet(index, in, handle, cid, data, size); break; |