From 525cad7347db066f18029a8403860a1b0bda2a0a Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 11 Oct 2013 21:02:31 +0200 Subject: [PATCH] monitor: Add ATT Execute Write Request decoding --- monitor/l2cap.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/monitor/l2cap.c b/monitor/l2cap.c index fd35feb03..c363d7a11 100644 --- a/monitor/l2cap.c +++ b/monitor/l2cap.c @@ -1964,6 +1964,26 @@ static void att_write_rsp(const struct l2cap_frame *frame) { } +static void att_execute_write_req(const struct l2cap_frame *frame) +{ + uint8_t flags = *(uint8_t *) frame->data; + const char *flags_str; + + switch (flags) { + case 0x00: + flags_str = "Cancel all prepared writes"; + break; + case 0x01: + flags_str = "Immediately write all pending values"; + break; + default: + flags_str = "Unknown"; + break; + } + + print_field("Flags: %s (0x%02x)", flags_str, flags); +} + static void att_handle_value_notify(const struct l2cap_frame *frame) { const struct bt_l2cap_att_handle_value_notify *pdu = frame->data; @@ -2038,7 +2058,8 @@ static const struct att_opcode_data att_opcode_table[] = { att_write_rsp, 0, true }, { 0x16, "Prepare Write Request" }, { 0x17, "Prepare Write Response" }, - { 0x18, "Execute Write Request" }, + { 0x18, "Execute Write Request", + att_execute_write_req, 1, true }, { 0x19, "Execute Write Response" }, { 0x1b, "Handle Value Notification", att_handle_value_notify, 2, false }, -- 2.11.0