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

## Macros
#define | READ_PERM_UNSEC (READ << 8)
#define | READ_PERM(sec_level) (READ << 8 | (((sec_level) & SEC_LEVEL_MASK) << READ_POS))
#define | WRITE_REQ_PERM_UNSEC (WRITE_REQ << 8)
#define | WRITE_REQ_PERM(sec_level) (WRITE_REQ << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS))
#define | WRITE_CMD_PERM_UNSEC (WRITE_CMD << 8)
#define | WRITE_CMD_PERM(sec_level) (WRITE_CMD << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS))
#define | WRITE_SIGNED_PERM_UNSEC (WRITE_SIGNED << 8)
#define | WRITE_SIGNED_PERM(sec_level) (WRITE_SIGNED << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS))
#define | INDICATE_PERM_UNSEC (INDICATE << 8)
#define | INDICATE_PERM(sec_level) (INDICATE << 8 | (((sec_level) & SEC_LEVEL_MASK) << INDICATE_POS))
#define | NOTIFY_PERM_UNSEC (NOTIFY << 8)
#define | NOTIFY_PERM(sec_level) (NOTIFY << 8 | (((sec_level) & SEC_LEVEL_MASK) << NOTIFY_POS))
#define | BROADCAST_ENABLE (BROADCAST << 8)
#define | EXT_PROP_ENABLE (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

## ◆ BROADCAST_ENABLE

#define BROADCAST_ENABLE (BROADCAST << 8)

Broadcast enable.

## ◆ EXT_PROP_ENABLE

#define EXT_PROP_ENABLE (EXT_PROP << 8)

Extended Properties enable.

## ◆ INDICATE_PERM

#define INDICATE_PERM | ( |  | sec_level | ) | (INDICATE << 8 | (((sec_level) & SEC_LEVEL_MASK) << INDICATE_POS))

Indicate permission set. See Attribute and Service Access Rights.

## ◆ INDICATE_PERM_UNSEC

#define INDICATE_PERM_UNSEC (INDICATE << 8)

Default Indicate Permission.

## ◆ NOTIFY_PERM

#define NOTIFY_PERM | ( |  | sec_level | ) | (NOTIFY << 8 | (((sec_level) & SEC_LEVEL_MASK) << NOTIFY_POS))

Notify permission set. See Attribute and Service Access Rights.

## ◆ NOTIFY_PERM_UNSEC

#define NOTIFY_PERM_UNSEC (NOTIFY << 8)

Default Notify Permission.

## ◆ READ_PERM

#define READ_PERM | ( |  | sec_level | ) | (READ << 8 | (((sec_level) & SEC_LEVEL_MASK) << READ_POS))

Read permission set. See Attribute and Service Access Rights.

## ◆ READ_PERM_UNSEC

#define READ_PERM_UNSEC (READ << 8)

Default Read permission.

## ◆ WRITE_CMD_PERM

#define WRITE_CMD_PERM | ( |  | sec_level | ) | (WRITE_CMD << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS))

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

## ◆ WRITE_CMD_PERM_UNSEC

#define WRITE_CMD_PERM_UNSEC (WRITE_CMD << 8)

Default Write without Response Permission.

## ◆ WRITE_REQ_PERM

#define WRITE_REQ_PERM | ( |  | sec_level | ) | (WRITE_REQ << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS))

Write permission set. See Attribute and Service Access Rights.

## ◆ WRITE_REQ_PERM_UNSEC

#define WRITE_REQ_PERM_UNSEC (WRITE_REQ << 8)

Default Write Permission.

## ◆ WRITE_SIGNED_PERM

#define WRITE_SIGNED_PERM | ( |  | sec_level | ) | (WRITE_SIGNED << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS))

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

## ◆ WRITE_SIGNED_PERM_UNSEC

#define WRITE_SIGNED_PERM_UNSEC (WRITE_SIGNED << 8)

Default Authenticated Signed Write Permission.