struct bt_gatt_result *result;
result = new0(struct bt_gatt_result, 1);
- if (!result)
- return NULL;
-
result->pdu = malloc(pdu_len);
if (!result->pdu) {
free(result);
return 0;
if (result->opcode != BT_ATT_OP_READ_BY_GRP_TYPE_RSP &&
- result->opcode != BT_ATT_OP_FIND_BY_TYPE_VAL_RSP)
+ result->opcode != BT_ATT_OP_FIND_BY_TYPE_RSP)
return 0;
return result_element_count(result);
*end_handle = get_le16(pdu_ptr + 2);
convert_uuid_le(pdu_ptr + 4, iter->result->data_len - 4, uuid);
break;
- case BT_ATT_OP_FIND_BY_TYPE_VAL_RSP:
+ case BT_ATT_OP_FIND_BY_TYPE_RSP:
*start_handle = get_le16(pdu_ptr);
*end_handle = get_le16(pdu_ptr + 2);
return false;
op = new0(struct mtu_op, 1);
- if (!op)
- return false;
-
op->att = att;
op->client_rx_mtu = client_rx_mtu;
op->callback = callback;
/* PDU must contain 4 bytes and it must be a multiple of 4, where each
* 4 bytes contain the 16-bit attribute and group end handles.
*/
- if (opcode != BT_ATT_OP_FIND_BY_TYPE_VAL_RSP || !pdu || !length ||
+ if (opcode != BT_ATT_OP_FIND_BY_TYPE_RSP || !pdu || !length ||
length % 4) {
success = false;
goto done;
put_le16(op->service_type, pdu + 4);
bt_uuid_to_le(&op->uuid, pdu + 6);
- op->id = bt_att_send(op->att, BT_ATT_OP_FIND_BY_TYPE_VAL_REQ,
+ op->id = bt_att_send(op->att, BT_ATT_OP_FIND_BY_TYPE_REQ,
pdu, sizeof(pdu),
find_by_type_val_cb,
bt_gatt_request_ref(op),
return NULL;
op = new0(struct bt_gatt_request, 1);
- if (!op)
- return NULL;
-
op->att = att;
op->start_handle = start;
op->end_handle = end;
put_le16(op->service_type, pdu + 4);
bt_uuid_to_le(&op->uuid, pdu + 6);
- op->id = bt_att_send(att, BT_ATT_OP_FIND_BY_TYPE_VAL_REQ,
+ op->id = bt_att_send(att, BT_ATT_OP_FIND_BY_TYPE_REQ,
pdu, sizeof(pdu),
find_by_type_val_cb,
bt_gatt_request_ref(op),
struct read_incl_data *data;
data = new0(struct read_incl_data, 1);
- if (!data)
- return NULL;
-
data->op = bt_gatt_request_ref(res->op);
data->result = res;
return false;
op = new0(struct bt_gatt_request, 1);
- if (!op)
- return false;
-
op->att = att;
op->callback = callback;
op->user_data = user_data;
goto done;
}
+ success = true;
+
done:
discovery_op_complete(op, success, att_ecode);
}
return false;
op = new0(struct bt_gatt_request, 1);
- if (!op)
- return false;
-
op->att = att;
op->callback = callback;
op->user_data = user_data;
return false;
op = new0(struct bt_gatt_request, 1);
- if (!op)
- return false;
-
op->att = att;
op->callback = callback;
op->user_data = user_data;
return;
success = false;
+ goto done;
}
success = true;
return false;
op = new0(struct bt_gatt_request, 1);
- if (!op)
- return false;
-
op->att = att;
op->callback = callback;
op->user_data = user_data;