Go to the documentation of this file.
56 #ifndef __BLE_GATTS_H__
57 #define __BLE_GATTS_H__
70 #define MAX_INC_SRVC_NUM (5)
75 #define BROADCAST (0x01)
77 #define WRITE_CMD (0x04)
78 #define WRITE_REQ (0x08)
80 #define INDICATE (0x20)
81 #define WRITE_SIGNED (0x40)
82 #define EXT_PROP (0x80)
87 #define READ_POS (0x00)
88 #define WRITE_POS (0x02)
89 #define INDICATE_POS (0x04)
90 #define NOTIFY_POS (0x06)
102 #define SEC_CON (0x03)
108 #define SEC_LEVEL_MASK (0x03)
114 #define UUID_TYPE_16 (0x00)
115 #define UUID_TYPE_128 (0x02)
135 #define SRVC_SECONDARY_SET (0x80)
136 #define SRVC_UUID_TYPE_SET(uuid_len) ((uuid_len) << 5)
137 #define SRVC_DISABLE (0x10)
138 #define SRVC_PERM(sec_level) (((sec_level) & SEC_LEVEL_MASK) << 2)
139 #define SRVC_ENCRP_KEY_SIZE_16 (0x02)
140 #define SRVC_MULTI_ENABLE (0x01)
167 #define READ_PERM_UNSEC (READ << 8)
168 #define READ_PERM(sec_level) (READ << 8 | (((sec_level) & SEC_LEVEL_MASK) << READ_POS))
170 #define WRITE_REQ_PERM_UNSEC (WRITE_REQ << 8)
171 #define WRITE_REQ_PERM(sec_level) (WRITE_REQ << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS))
173 #define WRITE_CMD_PERM_UNSEC (WRITE_CMD << 8)
174 #define WRITE_CMD_PERM(sec_level) (WRITE_CMD << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS))
176 #define WRITE_SIGNED_PERM_UNSEC (WRITE_SIGNED << 8)
177 #define WRITE_SIGNED_PERM(sec_level) (WRITE_SIGNED << 8 | (((sec_level) & SEC_LEVEL_MASK) << WRITE_POS))
179 #define INDICATE_PERM_UNSEC (INDICATE << 8)
180 #define INDICATE_PERM(sec_level) (INDICATE << 8 | (((sec_level) & SEC_LEVEL_MASK) << INDICATE_POS))
182 #define NOTIFY_PERM_UNSEC (NOTIFY << 8)
183 #define NOTIFY_PERM(sec_level) (NOTIFY << 8 | (((sec_level) & SEC_LEVEL_MASK) << NOTIFY_POS))
185 #define BROADCAST_ENABLE (BROADCAST << 8)
186 #define EXT_PROP_ENABLE (EXT_PROP << 8)
204 #define ATT_VAL_LOC_USER (1 << 15)
205 #define ATT_VAL_LOC_STACK (0 << 15)
206 #define ATT_UUID_TYPE_SET(uuid_len) ((uuid_len) << 13)
207 #define ATT_ENC_KEY_SIZE_16 (0x1000)
533 #endif // BLE_SDK_GATTS_H_
gatts_service_type_t
Service table type.
Definition: ble_gatts.h:220
uint16_t length
Definition: ble_gatts.h:320
Service(16-bit UUID) description.
Definition: ble_gatts.h:236
@ SERVICE_TABLE_TYPE_16
Definition: ble_gatts.h:221
@ SERVICE_TABLE_TYPE_128
Definition: ble_gatts.h:222
uint16_t length
Definition: ble_gatts.h:352
uint16_t ble_gatts_read_cfm(uint8_t conn_idx, const gatts_read_cfm_t *p_param)
Respond to an attribute read request. It is used in profile read callback function gatts_prf_cbs_t::a...
uint16_t ble_gatts_prepare_write_cfm(uint8_t conn_idx, const gatts_prep_write_cfm_t *p_param)
Respond to an attribute prepare write request. It is used in profile prepare write callback function ...
uint8_t srvc_perm
Definition: ble_gatts.h:310
uint8_t * value
Definition: ble_gatts.h:353
Service(128 bits UUID) description.
Definition: ble_gatts.h:264
uint16_t ble_gatts_write_cfm(uint8_t conn_idx, const gatts_write_cfm_t *p_param)
Respond to an attribute write request. It is used in profile write callback function gatts_prf_cbs_t:...
GATT sending Notification or Indication event param description.
Definition: ble_gatts.h:349
gatt_evt_type_t
GATT common events.
Definition: ble_gatt.h:67
uint8_t * value
Definition: ble_gatts.h:322
gatts_service_type_t attr_tab_type
Definition: ble_gatts.h:311
uint16_t ble_gatts_srvc_db_create(gatts_create_db_t *p_param)
Register a service's attribute list.
const attm_desc_t * attr_tab_16
Definition: ble_gatts.h:305
uint16_t ble_gatts_attr_permission_set(uint16_t handle, uint16_t perm, uint16_t ext_perm)
Update attribute permission.
GATT write attribute result description.
Definition: ble_gatts.h:329
uint8_t * attr_tab_cfg
Definition: ble_gatts.h:298
uint16_t ble_gatts_value_set(uint16_t handle, uint16_t length, uint16_t offset, const uint8_t *p_value)
Update attribute value only if the attribute value is saved in the BLE Stack space.
uint16_t max_size
Definition: ble_gatts.h:280
uint16_t inc_srvc_num
Definition: ble_gatts.h:309
uint16_t length
Definition: ble_gatts.h:340
File that contains error codes.
Definition: ble_gatts.h:304
uint8_t status
Definition: ble_gatts.h:341
uint16_t perm
Definition: ble_gatts.h:266
uint16_t handle
Definition: ble_gatts.h:319
uint16_t ext_perm
Definition: ble_gatts.h:245
uint16_t uuid
Definition: ble_gatts.h:237
uint8_t status
Definition: ble_gatts.h:321
#define MAX_INC_SRVC_NUM
Definition: ble_gatts.h:70
GATT prepare write result description.
Definition: ble_gatts.h:338
uint16_t * shdl
Definition: ble_gatts.h:294
uint8_t status
Definition: ble_gatts.h:331
const uint8_t * uuid
Definition: ble_gatts.h:297
gatt_evt_type_t type
Definition: ble_gatts.h:350
uint16_t handle
Definition: ble_gatts.h:339
uint16_t ble_gatts_attr_permission_get(uint16_t handle, uint16_t *p_perm, uint16_t *p_ext_perm)
Retrieve attribute permission.
uint8_t max_nb_attr
Definition: ble_gatts.h:302
uint16_t handle
Definition: ble_gatts.h:330
uint16_t ble_gatts_noti_ind(uint8_t conn_idx, const gatts_noti_ind_t *p_param)
Send out a notification or an indication. The execution status of sending notification or indication ...
Parameter of Added service description.
Definition: ble_gatts.h:292
uint16_t ble_gatts_value_get(uint16_t handle, uint16_t *p_length, uint8_t *p_value)
Retrieve attribute value only if the attribute value is saved in the BLE Stack space.
void ble_gatts_service_changed(void)
When service on local device finishes upgrade, call this API to send service upgrade to stack....
uint16_t handle
Definition: ble_gatts.h:351
const attm_desc_128_t * attr_tab_128
Definition: ble_gatts.h:306
uint16_t max_size
Definition: ble_gatts.h:252
uint16_t perm
Definition: ble_gatts.h:238
GATT read attribute result description.
Definition: ble_gatts.h:318
uint16_t ext_perm
Definition: ble_gatts.h:273