Go to the documentation of this file.
56 #ifndef __BLE_GATTS_H__
57 #define __BLE_GATTS_H__
71 #define BLE_GATTS_MAX_INC_SRVC_NUM (5)
76 #define BLE_GATTS_BROADCAST (0x01)
77 #define BLE_GATTS_READ (0x02)
78 #define BLE_GATTS_WRITE_CMD (0x04)
79 #define BLE_GATTS_WRITE_REQ (0x08)
80 #define BLE_GATTS_NOTIFY (0x10)
81 #define BLE_GATTS_INDICATE (0x20)
82 #define BLE_GATTS_WRITE_SIGNED (0x40)
83 #define BLE_GATTS_EXT_PROP (0x80)
88 #define BLE_GATTS_READ_POS (0x00)
89 #define BLE_GATTS_WRITE_POS (0x02)
90 #define BLE_GATTS_INDICATE_POS (0x04)
91 #define BLE_GATTS_NOTIFY_POS (0x06)
97 #define BLE_GATTS_NOAUTH (0x00)
99 #define BLE_GATTS_UNAUTH (0x01)
101 #define BLE_GATTS_AUTH (0x02)
103 #define BLE_GATTS_SEC_CON (0x03)
109 #define BLE_GATTS_SEC_LEVEL_MASK (0x03)
115 #define BLE_GATTS_UUID_TYPE_16 (0x00)
116 #define BLE_GATTS_UUID_TYPE_128 (0x02)
136 #define BLE_GATTS_SRVC_SECONDARY_SET (0x80)
137 #define BLE_GATTS_SRVC_UUID_TYPE_SET(uuid_len) ((uuid_len) << 5)
138 #define BLE_GATTS_SRVC_DISABLE (0x10)
139 #define BLE_GATTS_SRVC_PERM(sec_level) (((sec_level) & SEC_LEVEL_MASK) << 2)
140 #define BLE_GATTS_SRVC_ENCRP_KEY_SIZE_16 (0x02)
141 #define BLE_GATTS_SRVC_MULTI_ENABLE (0x01)
168 #define BLE_GATTS_READ_PERM_UNSEC (BLE_GATTS_READ << 8)
169 #define BLE_GATTS_READ_PERM(sec_level) (BLE_GATTS_READ << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_READ_POS))
170 #define BLE_GATTS_WRITE_REQ_PERM_UNSEC (BLE_GATTS_WRITE_REQ << 8)
171 #define BLE_GATTS_WRITE_REQ_PERM(sec_level) (BLE_GATTS_WRITE_REQ << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))
172 #define BLE_GATTS_WRITE_CMD_PERM_UNSEC (BLE_GATTS_WRITE_CMD << 8)
173 #define BLE_GATTS_WRITE_CMD_PERM(sec_level) (BLE_GATTS_WRITE_CMD << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))
174 #define BLE_GATTS_WRITE_SIGNED_PERM_UNSEC (BLE_GATTS_WRITE_SIGNED << 8)
175 #define BLE_GATTS_WRITE_SIGNED_PERM(sec_level) (BLE_GATTS_WRITE_SIGNED << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))
176 #define BLE_GATTS_INDICATE_PERM_UNSEC (BLE_GATTS_INDICATE << 8)
177 #define BLE_GATTS_INDICATE_PERM(sec_level) (BLE_GATTS_INDICATE << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_INDICATE_POS))
178 #define BLE_GATTS_NOTIFY_PERM_UNSEC (BLE_GATTS_NOTIFY << 8)
179 #define BLE_GATTS_NOTIFY_PERM(sec_level) (BLE_GATTS_NOTIFY << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_NOTIFY_POS))
180 #define BLE_GATTS_BROADCAST_ENABLE (BLE_GATTS_BROADCAST << 8)
181 #define BLE_GATTS_EXT_PROP_ENABLE (BLE_GATTS_EXT_PROP << 8)
199 #define BLE_GATTS_ATT_VAL_LOC_USER (1 << 15)
200 #define BLE_GATTS_ATT_VAL_LOC_STACK (0 << 15)
201 #define BLE_GATTS_ATT_UUID_TYPE_SET(uuid_len) ((uuid_len) << 13)
202 #define BLE_GATTS_ATT_ENC_KEY_SIZE_16 (0x1000)
575 #endif // BLE_SDK_GATTS_H_
const ble_gatts_attm_desc_128_t * attr_tab_128
GATT read request event for BLE_GATTS_EVT_READ_REQUEST.
The struct of broadcast address with broadcast type.
GATT write attribute result description.
Parameter of Added service description.
@ BLE_GATTS_SERVICE_TABLE_TYPE_16
Service(16-bit UUID) description.
GATT sending Notification or Indication event param description.
ble_gap_bdaddr_t peer_addr
GATT prepare write request event for BLE_GATTS_EVT_PREP_WRITE_REQUEST.
@ BLE_GATTS_SERVICE_TABLE_TYPE_128
uint16_t ble_gatts_attr_permission_set(uint16_t handle, uint16_t perm, uint16_t ext_perm)
Update attribute permission.
ble_gatts_service_type_t
Service table type.
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.
File that contains error codes.
ble_gatts_evt_read_t read_req
ble_gatts_evt_write_t write_req
const ble_gatts_attm_desc_t * attr_tab_16
ble_gatts_service_type_t attr_tab_type
uint16_t ble_gatts_write_cfm(uint8_t conn_idx, const ble_gatts_write_cfm_t *p_param)
Respond to an attribute write request.
ble_gatts_evt_cccd_rec_t cccd_recovery
ble_gatt_evt_type_t
GATT common events.
uint16_t ble_gatts_srvc_db_create(ble_gatts_create_db_t *p_param)
Register a service's attribute list.
uint16_t ble_gatts_prepare_write_cfm(uint8_t conn_idx, const ble_gatts_prep_write_cfm_t *p_param)
Respond to an attribute prepare write request.
uint16_t ble_gatts_attr_permission_get(uint16_t handle, uint16_t *p_perm, uint16_t *p_ext_perm)
Retrieve attribute permission.
BLE GATTS event structure.
GATT write request event for BLE_GATTS_EVT_WRITE_REQUEST.
#define BLE_GATTS_MAX_INC_SRVC_NUM
ble_gatts_evt_ntf_ind_t ntf_ind_sended
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.
GATT prepare write result description.
void ble_gatts_service_changed(void)
When service on local device finishes upgrade, call this API to send service upgrade to stack....
ble_gatts_evt_prep_write_t prep_wr_req
GATT read attribute result description.
uint16_t ble_gatts_noti_ind(uint8_t conn_idx, const ble_gatts_noti_ind_t *p_param)
Send out a notification or an indication.
Service(128 bits UUID) description.
Gatt Notification or indication event for BLE_GATTS_EVT_NTF_IND.
uint16_t ble_gatts_read_cfm(uint8_t conn_idx, const ble_gatts_read_cfm_t *p_param)
Respond to an attribute read request..
Gatt cccd recovery event for BLE_GATTS_EVT_CCCD_RECOVERY.