Bluetooth: ATT: Handle Read By Type response

This adds function handler for Read By Type Response PDU which call the
request callback:

> ACL Data TX: Handle 3585 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0010-0x0011
        Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 3585 flags 0x02 dlen 13
      ATT: Read By Type Response (0x09) len 8
        Attribute data length: 7
        Attribute data list: 1 entry
        Handle: 0x0010
        Value: 081100392a
< ACL Data TX: Handle 3585 flags 0x00 dlen 11
      ATT: Read By Type Request (0x08) len 6
        Handle range: 0x0011-0x0011
        Attribute type: Characteristic (0x2803)
> ACL Data RX: Handle 3585 flags 0x02 dlen 9
      ATT: Error Response (0x01) len 4
        Read By Type Request (0x08)
        Handle: 0x0011
        Error: Attribute Not Found (0x0a)

Change-Id: Ieba837f603b7d76a4adf95cd637b8423061246f7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2015-07-06 13:34:03 +03:00 committed by Anas Nashif
commit 330846b39a

View file

@ -1210,6 +1210,20 @@ static uint8_t att_handle_find_type_rsp(struct bt_conn *conn,
return att_handle_rsp(conn, buf->data, buf->len, 0);
}
static uint8_t att_handle_read_type_rsp(struct bt_conn *conn,
struct bt_buf *buf)
{
struct bt_att *att = conn->att;
if (!att) {
return 0;
}
BT_DBG("\n");
return att_handle_rsp(conn, buf->data, buf->len, 0);
}
static const struct {
uint8_t op;
uint8_t (*func)(struct bt_conn *conn, struct bt_buf *buf);
@ -1229,6 +1243,8 @@ static const struct {
sizeof(struct bt_att_find_type_rsp) },
{ BT_ATT_OP_READ_TYPE_REQ, att_read_type_req,
sizeof(struct bt_att_read_type_req) },
{ BT_ATT_OP_READ_TYPE_RSP, att_handle_read_type_rsp,
sizeof(struct bt_att_read_type_rsp) },
{ BT_ATT_OP_READ_REQ, att_read_req,
sizeof(struct bt_att_read_req) },
{ BT_ATT_OP_READ_BLOB_REQ, att_read_blob_req,