Bluetooth: ATT: Handle Find By Type response

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

< ACL Data TX: Handle 3585 flags 0x00 dlen 13
      ATT: Find By Type Value Request (0x06) len 8
        Handle range: 0x000a-0xffff
        Attribute type: Primary Service (0x2800)
          UUID: Heart Rate (0x180d)
> ACL Data RX: Handle 3585 flags 0x02 dlen 9
      ATT: Find By Type Value Response (0x07) len 4
        Handle range: 0x000a-0x0011
< ACL Data TX: Handle 3585 flags 0x00 dlen 13
      ATT: Find By Type Value Request (0x06) len 8
        Handle range: 0x0011-0xffff
        Attribute type: Primary Service (0x2800)
          UUID: Heart Rate (0x180d)
> ACL Data RX: Handle 3585 flags 0x02 dlen 9
      ATT: Error Response (0x01) len 4
        Find By Type Value Request (0x06)
        Handle: 0x0011
        Error: Attribute Not Found (0x0a)

Change-Id: Ib5799d0530c8de40b7c7170f1b32312a42456484
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2015-07-03 14:48:14 +03:00 committed by Anas Nashif
commit df0cc2697d

View file

@ -1196,6 +1196,20 @@ static uint8_t att_error_rsp(struct bt_conn *conn, struct bt_buf *data)
return att_handle_rsp(conn, NULL, 0, err);
}
static uint8_t att_handle_find_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);
@ -1211,6 +1225,8 @@ static const struct {
sizeof(struct bt_att_find_info_req) },
{ BT_ATT_OP_FIND_TYPE_REQ, att_find_type_req,
sizeof(struct bt_att_find_type_req) },
{ BT_ATT_OP_FIND_TYPE_RSP, att_handle_find_type_rsp,
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_REQ, att_read_req,