diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2019-05-17 14:13:23 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-03-02 14:42:35 -0800 |
commit | 209e2568c6970d174c45460d1e16c3e7e8571a5f (patch) | |
tree | 716934b6ff4c6e1a63f5b6fe78cf47a21a087cb8 /monitor/l2cap.c | |
parent | cc441474e77d098c84a9b4140d5e213ccef5d12e (diff) | |
download | bluez-209e2568c6970d174c45460d1e16c3e7e8571a5f.tar.gz |
monitor: Add support for decoding EATT
This decodes packets received over EATT PSM.
Diffstat (limited to 'monitor/l2cap.c')
-rw-r--r-- | monitor/l2cap.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/monitor/l2cap.c b/monitor/l2cap.c index 3b2b25f24..9409604c3 100644 --- a/monitor/l2cap.c +++ b/monitor/l2cap.c @@ -2573,6 +2573,36 @@ static void att_handle_value_conf(const struct l2cap_frame *frame) { } +static void att_multiple_vl_rsp(const struct l2cap_frame *frame) +{ + struct l2cap_frame *f = (void *) frame; + + while (frame->size) { + uint16_t handle; + uint16_t len; + + if (!l2cap_frame_get_le16(f, &handle)) + return; + + print_field("Handle: 0x%4.4x", handle); + + if (!l2cap_frame_get_le16(f, &len)) + return; + + print_field("Length: 0x%4.4x", len); + + print_hex_field(" Data", f->data, + len < f->size ? len : f->size); + + if (len > f->size) { + print_text(COLOR_ERROR, "invalid size"); + return; + } + + l2cap_frame_pull(f, f, len); + } +} + static void att_write_command(const struct l2cap_frame *frame) { print_field("Handle: 0x%4.4x", get_le16(frame->data)); @@ -2645,6 +2675,12 @@ static const struct att_opcode_data att_opcode_table[] = { att_handle_value_ind, 2, false }, { 0x1e, "Handle Value Confirmation", att_handle_value_conf, 0, true }, + { 0x20, "Read Multiple Request Variable Length", + att_read_multiple_req, 4, false }, + { 0x21, "Read Multiple Response Variable Length", + att_multiple_vl_rsp, 4, false }, + { 0x23, "Handle Multiple Value Notification", + att_multiple_vl_rsp, 4, false }, { 0x52, "Write Command", att_write_command, 2, false }, { 0xd2, "Signed Write Command", att_signed_write_command, 14, false }, @@ -3287,6 +3323,9 @@ void l2cap_frame(uint16_t index, bool in, uint16_t handle, uint16_t cid, case 0x001f: att_packet(index, in, handle, cid, data, size); break; + case 0x0027: + att_packet(index, in, handle, cid, data + 2, size - 2); + break; case 0x0017: case 0x001B: avctp_packet(&frame); |