Go to the documentation of this file.
56 #ifndef __BLE_GATTS_H__
57 #define __BLE_GATTS_H__
70 #define BLE_GATTS_MAX_INC_SRVC_NUM (5)
75 #define BLE_GATTS_BROADCAST (0x01)
76 #define BLE_GATTS_READ (0x02)
77 #define BLE_GATTS_WRITE_CMD (0x04)
78 #define BLE_GATTS_WRITE_REQ (0x08)
79 #define BLE_GATTS_NOTIFY (0x10)
80 #define BLE_GATTS_INDICATE (0x20)
81 #define BLE_GATTS_WRITE_SIGNED (0x40)
82 #define BLE_GATTS_EXT_PROP (0x80)
87 #define BLE_GATTS_READ_POS (0x00)
88 #define BLE_GATTS_WRITE_POS (0x02)
89 #define BLE_GATTS_INDICATE_POS (0x04)
90 #define BLE_GATTS_NOTIFY_POS (0x06)
96 #define BLE_GATTS_NOAUTH (0x00)
98 #define BLE_GATTS_UNAUTH (0x01)
100 #define BLE_GATTS_AUTH (0x02)
102 #define BLE_GATTS_SEC_CON (0x03)
108 #define BLE_GATTS_SEC_LEVEL_MASK (0x03)
114 #define BLE_GATTS_UUID_TYPE_16 (0x00)
115 #define BLE_GATTS_UUID_TYPE_128 (0x02)
135 #define BLE_GATTS_SRVC_SECONDARY_SET (0x80)
136 #define BLE_GATTS_SRVC_UUID_TYPE_SET(uuid_len) ((uuid_len) << 5)
137 #define BLE_GATTS_SRVC_DISABLE (0x10)
138 #define BLE_GATTS_SRVC_PERM(sec_level) (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << 2)
139 #define BLE_GATTS_SRVC_ENCRP_KEY_SIZE_16 (0x02)
140 #define BLE_GATTS_SRVC_MULTI_ENABLE (0x01)
167 #define BLE_GATTS_READ_PERM_UNSEC (BLE_GATTS_READ << 8)
168 #define BLE_GATTS_READ_PERM(sec_level) (BLE_GATTS_READ << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_READ_POS))
169 #define BLE_GATTS_WRITE_REQ_PERM_UNSEC (BLE_GATTS_WRITE_REQ << 8)
170 #define BLE_GATTS_WRITE_REQ_PERM(sec_level) (BLE_GATTS_WRITE_REQ << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))
171 #define BLE_GATTS_WRITE_CMD_PERM_UNSEC (BLE_GATTS_WRITE_CMD << 8)
172 #define BLE_GATTS_WRITE_CMD_PERM(sec_level) (BLE_GATTS_WRITE_CMD << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))
173 #define BLE_GATTS_WRITE_SIGNED_PERM_UNSEC (BLE_GATTS_WRITE_SIGNED << 8)
174 #define BLE_GATTS_WRITE_SIGNED_PERM(sec_level) (BLE_GATTS_WRITE_SIGNED << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_WRITE_POS))
175 #define BLE_GATTS_INDICATE_PERM_UNSEC (BLE_GATTS_INDICATE << 8)
176 #define BLE_GATTS_INDICATE_PERM(sec_level) (BLE_GATTS_INDICATE << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_INDICATE_POS))
177 #define BLE_GATTS_NOTIFY_PERM_UNSEC (BLE_GATTS_NOTIFY << 8)
178 #define BLE_GATTS_NOTIFY_PERM(sec_level) (BLE_GATTS_NOTIFY << 8 | (((sec_level) & BLE_GATTS_SEC_LEVEL_MASK) << BLE_GATTS_NOTIFY_POS))
179 #define BLE_GATTS_BROADCAST_ENABLE (BLE_GATTS_BROADCAST << 8)
180 #define BLE_GATTS_EXT_PROP_ENABLE (BLE_GATTS_EXT_PROP << 8)
198 #define BLE_GATTS_ATT_VAL_LOC_USER (1 << 15)
199 #define BLE_GATTS_ATT_VAL_LOC_STACK (0 << 15)
200 #define BLE_GATTS_ATT_UUID_TYPE_SET(uuid_len) ((uuid_len) << 13)
201 #define BLE_GATTS_ATT_ENC_KEY_SIZE_16 (0x1000)
617 #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.
uint16_t ble_gatts_service_hide_all(uint8_t conn_idx)
Hide all service.
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_evt_inited_ind_t inited_ind
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
uint16_t ble_gatts_service_discoverable_set(uint8_t conn_idx, uint16_t start_hdl, bool discoverable)
Set a service discoverable or not.
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
GATTS Database Inited Indication event structure.
uint16_t ble_gatts_service_discover_all(uint8_t conn_idx)
Set all service discoverable.
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.