Bluetooth: ATT: Rename op parameter of att_write_rsp
This makes it clear that only request need to set an opcode since they require a error response in case it fails. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
8f812f30a1
commit
57a6858278
1 changed files with 7 additions and 6 deletions
|
@ -1188,7 +1188,7 @@ static u8_t att_read_group_req(struct bt_att *att, struct net_buf *buf)
|
|||
struct write_data {
|
||||
struct bt_conn *conn;
|
||||
struct net_buf *buf;
|
||||
u8_t op;
|
||||
u8_t req;
|
||||
const void *value;
|
||||
u8_t len;
|
||||
u16_t offset;
|
||||
|
@ -1209,7 +1209,8 @@ static u8_t write_cb(const struct bt_gatt_attr *attr, void *user_data)
|
|||
return BT_GATT_ITER_STOP;
|
||||
}
|
||||
|
||||
if (!data->op) {
|
||||
/* Set command flag if not a request */
|
||||
if (!data->req) {
|
||||
flags |= BT_GATT_WRITE_FLAG_CMD;
|
||||
}
|
||||
|
||||
|
@ -1226,7 +1227,7 @@ static u8_t write_cb(const struct bt_gatt_attr *attr, void *user_data)
|
|||
return BT_GATT_ITER_CONTINUE;
|
||||
}
|
||||
|
||||
static u8_t att_write_rsp(struct bt_conn *conn, u8_t op, u8_t rsp,
|
||||
static u8_t att_write_rsp(struct bt_conn *conn, u8_t req, u8_t rsp,
|
||||
u16_t handle, u16_t offset, const void *value,
|
||||
u8_t len)
|
||||
{
|
||||
|
@ -1247,7 +1248,7 @@ static u8_t att_write_rsp(struct bt_conn *conn, u8_t op, u8_t rsp,
|
|||
}
|
||||
|
||||
data.conn = conn;
|
||||
data.op = op;
|
||||
data.req = req;
|
||||
data.offset = offset;
|
||||
data.value = value;
|
||||
data.len = len;
|
||||
|
@ -1260,9 +1261,9 @@ static u8_t att_write_rsp(struct bt_conn *conn, u8_t op, u8_t rsp,
|
|||
if (rsp) {
|
||||
net_buf_unref(data.buf);
|
||||
/* Respond here since handle is set */
|
||||
send_err_rsp(conn, op, handle, data.err);
|
||||
send_err_rsp(conn, req, handle, data.err);
|
||||
}
|
||||
return op == BT_ATT_OP_EXEC_WRITE_REQ ? data.err : 0;
|
||||
return req == BT_ATT_OP_EXEC_WRITE_REQ ? data.err : 0;
|
||||
}
|
||||
|
||||
if (data.buf) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue