Macros
Attribute Permission
BLE » Generic Attribute Profile (GATT) » Generic Attribute Profile (GATT) Server » Defines

## Macros
#define | BLE_GATTS_READ_PERM_UNSEC (BLE_GATTS_READ << 8)
#define | BLE_GATTS_READ_PERM(sec_level) (BLE_GATTS_READ << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_READ_POS))
#define | BLE_GATTS_WRITE_REQ_PERM_UNSEC (BLE_GATTS_WRITE_REQ << 8)
#define | BLE_GATTS_WRITE_REQ_PERM(sec_level) (BLE_GATTS_WRITE_REQ << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))
#define | BLE_GATTS_WRITE_CMD_PERM_UNSEC (BLE_GATTS_WRITE_CMD << 8)
#define | BLE_GATTS_WRITE_CMD_PERM(sec_level) (BLE_GATTS_WRITE_CMD << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))
#define | BLE_GATTS_WRITE_SIGNED_PERM_UNSEC (BLE_GATTS_WRITE_SIGNED << 8)
#define | BLE_GATTS_WRITE_SIGNED_PERM(sec_level) (BLE_GATTS_WRITE_SIGNED << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))
#define | BLE_GATTS_INDICATE_PERM_UNSEC (BLE_GATTS_INDICATE << 8)
#define | BLE_GATTS_INDICATE_PERM(sec_level) (BLE_GATTS_INDICATE << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_INDICATE_POS))
#define | BLE_GATTS_NOTIFY_PERM_UNSEC (BLE_GATTS_NOTIFY << 8)
#define | BLE_GATTS_NOTIFY_PERM(sec_level) (BLE_GATTS_NOTIFY << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_NOTIFY_POS))
#define | BLE_GATTS_BROADCAST_ENABLE (BLE_GATTS_BROADCAST << 8)
#define | BLE_GATTS_EXT_PROP_ENABLE (BLE_GATTS_EXT_PROP << 8)

## Detailed Description

Attribute permission

| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7–6 | 5–4 | 3–2 | 1–0 | |----|----|----|----|----|----|----|----|--------|--------|--------|--------| |EXT | WS | I | N | WR | WC | RD | B | NP | IP | WP | RP |

Bit [0-1]: Read permission (0 = NOAUTH; 1 = UNAUTH; 2 = AUTH; 3 = SEC_CON)
Bit [2-3]: Write permission (0 = NOAUTH; 1 = UNAUTH; 2 = AUTH; 3 = SEC_CON)
Bit [4-5]: Indicate permission (0 = NOAUTH; 1 = UNAUTH; 2 = AUTH; 3 = SEC_CON)
Bit [6-7]: Notify permission (0 = NOAUTH; 1 = UNAUTH; 2 = AUTH; 3 = SEC_CON)
Bit [8] : Broadcast permission
Bit [9] : Read accepted
Bit [10] : Write Command accepted
Bit [11] : Write Request accepted
Bit [12] : Notify accepted
Bit [13] : Indicate accepted
Bit [14] : Write Signed accepted
Bit [15] : Extended Properties present

## Macro Definition Documentation

## ◆ BLE_GATTS_BROADCAST_ENABLE

#define BLE_GATTS_BROADCAST_ENABLE (BLE_GATTS_BROADCAST << 8)

Broadcast enable.

Definition at line 180 of file ble_gatts.h.

## ◆ BLE_GATTS_EXT_PROP_ENABLE

#define BLE_GATTS_EXT_PROP_ENABLE (BLE_GATTS_EXT_PROP << 8)

Extended Properties enable.

Definition at line 181 of file ble_gatts.h.

## ◆ BLE_GATTS_INDICATE_PERM

#define BLE_GATTS_INDICATE_PERM | ( |  | sec_level | ) | (BLE_GATTS_INDICATE << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_INDICATE_POS))

Indicate permission set. See Attribute and Service Access Rights.

Definition at line 177 of file ble_gatts.h.

## ◆ BLE_GATTS_INDICATE_PERM_UNSEC

#define BLE_GATTS_INDICATE_PERM_UNSEC (BLE_GATTS_INDICATE << 8)

Default Indicate Permission.

Definition at line 176 of file ble_gatts.h.

## ◆ BLE_GATTS_NOTIFY_PERM

#define BLE_GATTS_NOTIFY_PERM | ( |  | sec_level | ) | (BLE_GATTS_NOTIFY << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_NOTIFY_POS))

Notify permission set. See Attribute and Service Access Rights.

Definition at line 179 of file ble_gatts.h.

## ◆ BLE_GATTS_NOTIFY_PERM_UNSEC

#define BLE_GATTS_NOTIFY_PERM_UNSEC (BLE_GATTS_NOTIFY << 8)

Default Notify Permission.

Definition at line 178 of file ble_gatts.h.

## ◆ BLE_GATTS_READ_PERM

#define BLE_GATTS_READ_PERM | ( |  | sec_level | ) | (BLE_GATTS_READ << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_READ_POS))

Read permission set. See Attribute and Service Access Rights.

Definition at line 169 of file ble_gatts.h.

## ◆ BLE_GATTS_READ_PERM_UNSEC

#define BLE_GATTS_READ_PERM_UNSEC (BLE_GATTS_READ << 8)

Default Read permission.

Definition at line 168 of file ble_gatts.h.

## ◆ BLE_GATTS_WRITE_CMD_PERM

#define BLE_GATTS_WRITE_CMD_PERM | ( |  | sec_level | ) | (BLE_GATTS_WRITE_CMD << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))

Write without Response permission set. See Attribute and Service Access Rights.

Definition at line 173 of file ble_gatts.h.

## ◆ BLE_GATTS_WRITE_CMD_PERM_UNSEC

#define BLE_GATTS_WRITE_CMD_PERM_UNSEC (BLE_GATTS_WRITE_CMD << 8)

Default Write without Response Permission.

Definition at line 172 of file ble_gatts.h.

## ◆ BLE_GATTS_WRITE_REQ_PERM

#define BLE_GATTS_WRITE_REQ_PERM | ( |  | sec_level | ) | (BLE_GATTS_WRITE_REQ << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))

Write permission set. See Attribute and Service Access Rights.

Definition at line 171 of file ble_gatts.h.

## ◆ BLE_GATTS_WRITE_REQ_PERM_UNSEC

#define BLE_GATTS_WRITE_REQ_PERM_UNSEC (BLE_GATTS_WRITE_REQ << 8)

Default Write Permission.

Definition at line 170 of file ble_gatts.h.

## ◆ BLE_GATTS_WRITE_SIGNED_PERM

#define BLE_GATTS_WRITE_SIGNED_PERM | ( |  | sec_level | ) | (BLE_GATTS_WRITE_SIGNED << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))

Authenticated Signed Write permission set. See Attribute and Service Access Rights.

Definition at line 175 of file ble_gatts.h.

## ◆ BLE_GATTS_WRITE_SIGNED_PERM_UNSEC

#define BLE_GATTS_WRITE_SIGNED_PERM_UNSEC (BLE_GATTS_WRITE_SIGNED << 8)

Default Authenticated Signed Write Permission.

Definition at line 174 of file ble_gatts.h.