Bluetooth: GATT: Add flag to indicate write command

Application may need to handle the write differently depending on the
write operation so this adds a flag called BT_GATT_WRITE_FLAG_CMD which
can then be checked by the callback, for instance one can respond with
BT_ATT_ERR_WRITE_REQ_REJECTED when that flag is not set which should
indicate to the client to use write command instead.

Fixes #11206

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2018-11-14 11:09:24 +02:00 committed by Johan Hedberg
commit ae05089946
2 changed files with 13 additions and 1 deletions

View file

@ -91,6 +91,13 @@ enum {
* authorized but no data shall be written.
*/
BT_GATT_WRITE_FLAG_PREPARE = BIT(0),
/** Attribute write command flag
*
* If set, indicates that write operation is a command (Write without
* response) which doesn't generate any response.
*/
BT_GATT_WRITE_FLAG_CMD = BIT(1),
};
/** @brief GATT Attribute structure. */