uint8_t length;
} __attribute__ ((packed));
+#define BT_L2CAP_ATT_READ_REQ 0x0a
+struct bt_l2cap_att_read_req {
+ uint16_t handle;
+} __attribute__ ((packed));
+
+#define BT_L2CAP_ATT_READ_RSP 0x0b
+
#define BT_L2CAP_ATT_READ_GROUP_TYPE_REQ 0x10
struct bt_l2cap_att_read_group_type_req {
uint16_t start_handle;
uint8_t length;
} __attribute__ ((packed));
+#define BT_L2CAP_ATT_HANDLE_VALUE_NOTIFY 0x1b
+struct bt_l2cap_att_handle_value_notify {
+ uint16_t handle;
+} __attribute__ ((packed));
+
+#define BT_L2CAP_ATT_HANDLE_VALUE_IND 0x1d
+struct bt_l2cap_att_handle_value_ind {
+ uint16_t handle;
+} __attribute__ ((packed));
+
+#define BT_L2CAP_ATT_HANDLE_VALUE_CONF 0x1e
+
struct bt_l2cap_hdr_smp {
uint8_t code;
} __attribute__ ((packed));
frame->data + 1, frame->size - 1);
}
+static void att_read_req(const struct l2cap_frame *frame)
+{
+ const struct bt_l2cap_att_read_req *pdu = frame->data;
+
+ print_field("Handle: 0x%4.4x", btohs(pdu->handle));
+}
+
+static void att_read_rsp(const struct l2cap_frame *frame)
+{
+ print_hex_field("Value", frame->data, frame->size);
+}
+
static void att_read_group_type_req(const struct l2cap_frame *frame)
{
print_handle_range("Handle range", frame->data);
frame->data + 1, frame->size - 1);
}
+static void att_handle_value_notify(const struct l2cap_frame *frame)
+{
+ const struct bt_l2cap_att_handle_value_notify *pdu = frame->data;
+
+ print_field("Handle: 0x%4.4x", btohs(pdu->handle));
+ print_hex_field(" Data", frame->data + 2, frame->size - 2);
+}
+
+static void att_handle_value_ind(const struct l2cap_frame *frame)
+{
+ const struct bt_l2cap_att_handle_value_ind *pdu = frame->data;
+
+ print_field("Handle: 0x%4.4x", btohs(pdu->handle));
+ print_hex_field(" Data", frame->data + 2, frame->size - 2);
+}
+
+static void att_handle_value_conf(const struct l2cap_frame *frame)
+{
+}
+
struct att_opcode_data {
uint8_t opcode;
const char *str;
att_read_type_req, 6, false },
{ 0x09, "Read By Type Response",
att_read_type_rsp, 4, false },
- { 0x0a, "Read Request" },
- { 0x0b, "Read Response" },
+ { 0x0a, "Read Request",
+ att_read_req, 2, true },
+ { 0x0b, "Read Response",
+ att_read_rsp, 0, false },
{ 0x0c, "Read Blob Request" },
{ 0x0d, "Read Blob Response" },
{ 0x0e, "Read Multiple Request" },
{ 0x17, "Prepare Write Response" },
{ 0x18, "Execute Write Request" },
{ 0x19, "Execute Write Response" },
- { 0x1b, "Handle Value Notification" },
- { 0x1d, "Handle Value Indication" },
- { 0x1e, "Handle Value Confirmation" },
+ { 0x1b, "Handle Value Notification",
+ att_handle_value_notify, 2, false },
+ { 0x1d, "Handle Value Indication",
+ att_handle_value_ind, 2, false },
+ { 0x1e, "Handle Value Confirmation",
+ att_handle_value_conf, 0, true },
{ 0x52, "Write Command" },
{ 0xd2, "Signed Write Command" },
{ }