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

Service permissions. More...

## Macros
#define | SRVC_SECONDARY_SET (0x80)
| Secondary service set. More...
#define | SRVC_UUID_TYPE_SET(uuid_len) ((uuid_len) << 5)
| Service UUID length set. More...
#define | SRVC_DISABLE (0x10)
| Service disable. More...
#define | SRVC_PERM(sec_level) (((sec_level) & SEC_LEVEL_MASK) << 2)
| Service permission authentication. More...
#define | SRVC_ENCRP_KEY_SIZE_16 (0x02)
| 16 bytes service encryption key size . More...
#define | SRVC_MULTI_ENABLE (0x01)
| Service is multi-instantiated. More...

## Detailed Description

Service permissions.

7 | 6–5 | 4 | 3–2 | 1 | 0
--- | --- | --- | --- | --- | ---
SEC | UUID_LEN | DIS | AUTH | EKS | MI

Bit [0] : Service is multi-instantiated (0 = not support; 1 = support)
Bit [1] : Encryption key size must be 16 bytes (0 = not need; 1 = need)
Bit [2-3]: Service permission (0 = NOAUTH; 1 = UNAUTH; 2 = AUTH; 3 = SEC_CON)
Bit [4] : Disable the service (0 = no; 1 = yes)
Bit [5-6]: UUID Length Type (0 = 16 bits; 2 = 128 bits)
Bit [7] : Secondary Service (0 = Primary Service; 1 = Secondary Service)

## Macro Definition Documentation

## ◆ SRVC_DISABLE

#define SRVC_DISABLE (0x10)

Service disable.

Definition at line 137 of file ble_gatts.h.

## ◆ SRVC_ENCRP_KEY_SIZE_16

#define SRVC_ENCRP_KEY_SIZE_16 (0x02)

16 bytes service encryption key size .

Definition at line 139 of file ble_gatts.h.

## ◆ SRVC_MULTI_ENABLE

#define SRVC_MULTI_ENABLE (0x01)

Service is multi-instantiated.

Definition at line 140 of file ble_gatts.h.

## ◆ SRVC_PERM

#define SRVC_PERM | ( |  | sec_level | ) | (((sec_level) & SEC_LEVEL_MASK) << 2)

Service permission authentication.

See Attribute and Service Access Rights.

Definition at line 138 of file ble_gatts.h.

## ◆ SRVC_SECONDARY_SET

#define SRVC_SECONDARY_SET (0x80)

Secondary service set.

Definition at line 135 of file ble_gatts.h.

## ◆ SRVC_UUID_TYPE_SET

#define SRVC_UUID_TYPE_SET | ( |  | uuid_len | ) | ((uuid_len) << 5)

Service UUID length set.

See Attribute and Service UUID Type.

Definition at line 136 of file ble_gatts.h.