From d25c3a159c1a762c07a93b07c2622ec8cea0722f Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Mon, 20 Oct 2014 14:00:58 -0700 Subject: [PATCH] shared/att-types: Add attribute permission defines GATT doesn't have a standard way of representing attribute permissions but coming up with values that can be used consistently among code that uses shared/att is valuable. This patch introduces defines to represent attribute permissions in a bitfield, with specific bits assigned to read and write access, encryption, authentication, and authorization permissions. --- src/shared/att-types.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/shared/att-types.h b/src/shared/att-types.h index b57a5f320..a6b23e440 100644 --- a/src/shared/att-types.h +++ b/src/shared/att-types.h @@ -74,6 +74,18 @@ #define BT_ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10 #define BT_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11 +/* + * ATT attribute permission bitfield values. Permissions are grouped as + * "Access", "Encryption", "Authentication", and "Authorization". A bitmask of + * permissions is a byte that encodes a combination of these. + */ +#define BT_ATT_PERM_READ 0x01 +#define BT_ATT_PERM_WRITE 0x02 +#define BT_ATT_PERM_ENCRYPT 0x04 +#define BT_ATT_PERM_AUTHEN 0x08 +#define BT_ATT_PERM_AUTHOR 0x10 +#define BT_ATT_PERM_NONE 0x20 + /* GATT Characteristic Properties Bitfield values */ #define BT_GATT_CHRC_PROP_BROADCAST 0x01 #define BT_GATT_CHRC_PROP_READ 0x02 -- 2.47.3