Bluetooth: GATT: Add BT_GATT_WRITE_FLAG_EXECUTE flag
Add the BT_GATT_WRITE_FLAG_EXECUTE flag that indicates whether a write callback is from an ATT execute write. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
88d0ad5b3e
commit
b78cd855b8
2 changed files with 10 additions and 0 deletions
|
@ -98,6 +98,14 @@ enum {
|
||||||
* response) which doesn't generate any response.
|
* response) which doesn't generate any response.
|
||||||
*/
|
*/
|
||||||
BT_GATT_WRITE_FLAG_CMD = BIT(1),
|
BT_GATT_WRITE_FLAG_CMD = BIT(1),
|
||||||
|
|
||||||
|
/** @brief Attribute write execute flag
|
||||||
|
*
|
||||||
|
* If set, indicates that write operation is a execute, which indicates
|
||||||
|
* the end of a long write, and will come after 1 or more
|
||||||
|
* @ref BT_GATT_WRITE_FLAG_PREPARE.
|
||||||
|
*/
|
||||||
|
BT_GATT_WRITE_FLAG_EXECUTE = BIT(2),
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @brief GATT Attribute structure. */
|
/** @brief GATT Attribute structure. */
|
||||||
|
|
|
@ -1666,6 +1666,8 @@ static uint8_t write_cb(const struct bt_gatt_attr *attr, uint16_t handle,
|
||||||
/* Set command flag if not a request */
|
/* Set command flag if not a request */
|
||||||
if (!data->req) {
|
if (!data->req) {
|
||||||
flags |= BT_GATT_WRITE_FLAG_CMD;
|
flags |= BT_GATT_WRITE_FLAG_CMD;
|
||||||
|
} else if (data->req == BT_ATT_OP_EXEC_WRITE_REQ) {
|
||||||
|
flags |= BT_GATT_WRITE_FLAG_EXECUTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write attribute value */
|
/* Write attribute value */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue