Functions

Functions

uint16_t ble_gatts_enh_prf_add (ble_gatts_create_db_t *p_gatts_db, ble_evt_handler_t evt_handler)
 Add a server profile by providing its detailed information, including manager callback functions and GATT server callback functions. This API should be called in application initialization function. More...
 
uint16_t ble_gatts_enh_read_cfm (uint8_t conn_idx, uint16_t cid, const ble_gatts_read_cfm_t *p_param)
 Respond to an attribute read request. It is used in gatts event handle function BLE_GATTS_EVT_ENH_READ_REQUEST to send attribute value to stack which is saved in user space. More...
 
uint16_t ble_gatts_enh_write_cfm (uint8_t conn_idx, uint16_t cid, const ble_gatts_write_cfm_t *p_param)
 Respond to an attribute write request. It is used in gatts event handler function BLE_GATTS_EVT_ENH_WRITE_REQUEST to send write operation status to stack. More...
 
uint16_t ble_gatts_enh_prepare_write_cfm (uint8_t conn_idx, uint16_t cid, const ble_gatts_prep_write_cfm_t *p_param)
 Respond to an attribute prepare write request. It is used in gatts event handler function BLE_GATTS_EVT_ENH_PREP_WRITE_REQUEST to send prepare write operation status to stack. More...
 
uint16_t ble_gatts_enh_noti_ind (uint8_t conn_idx, uint16_t cid, const ble_gatts_noti_ind_t *p_param)
 Send out a notification or an indication. The execution status of sending notification or indication will be retrieved in the event BLE_GATTS_EVT_ENH_NTF_IND. More...
 
uint16_t ble_gatts_enh_mult_noti (uint8_t conn_idx, uint16_t cid, const ble_gatts_noti_multiple_t *p_param)
 Send out Multiple Variable Length Notifications. The execution status of sending notification or indication will be retrieved in the event BLE_GATTS_EVT_ENH_MULT_NTF. More...
 
uint16_t ble_gatts_prf_add (ble_gatts_create_db_t *p_gatts_db, ble_evt_handler_t evt_handler)
 Add a server profile by providing its detailed information.. More...
 
uint16_t ble_gattc_prf_add (ble_uuid_t *p_uuid, ble_evt_handler_t evt_handler)
 Add a client profile by providing its detail information. More...
 

Detailed Description

Function Documentation

◆ ble_gattc_prf_add()

uint16_t ble_gattc_prf_add ( ble_uuid_t p_uuid,
ble_evt_handler_t  evt_handler 
)

Add a client profile by providing its detail information.

Parameters
[in]p_uuidPointer to the target service uuid. See ble_uuid_t.
[out]evt_handlerPointer to ble events handler..
Return values
SDK_SUCCESSThe profile info is recorded successfully, and the profile ENV will be initialized in profile initialization callback function.
SDK_ERR_POINTER_NULLThe parameter p_uuid or evt_handler is NULL, or input parameters that prf_info points to are invalid.
SDK_ERR_NO_RESOURCESThe profile number is up to the maximum number the system can support.

◆ ble_gatts_enh_mult_noti()

uint16_t ble_gatts_enh_mult_noti ( uint8_t  conn_idx,
uint16_t  cid,
const ble_gatts_noti_multiple_t p_param 
)

Send out Multiple Variable Length Notifications. The execution status of sending notification or indication will be retrieved in the event BLE_GATTS_EVT_ENH_MULT_NTF.

Note
Check whether the relevant Client Characteristic Configuration Descriptor is enabled before using this API.
Parameters
[in]conn_idxCurrent connection index.
[in]cidThe local channel ID.
[in]p_paramPointer to the parameters filled by profile. see ble_gatts_noti_multiple_t.
Return values
SDK_SUCCESSSend Notification or Indication event to stack successfully.
SDK_ERR_POINTER_NULLParam is NULL.
SDK_ERR_INVALID_CONN_IDXConidx is invalid.
SDK_ERR_INVALID_PARAMType is invalid.
SDK_ERR_INVALID_HANDLEHandle not exist in the database.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_gatts_enh_noti_ind()

uint16_t ble_gatts_enh_noti_ind ( uint8_t  conn_idx,
uint16_t  cid,
const ble_gatts_noti_ind_t p_param 
)

Send out a notification or an indication. The execution status of sending notification or indication will be retrieved in the event BLE_GATTS_EVT_ENH_NTF_IND.

Note
Check whether the relevant Client Characteristic Configuration Descriptor is enabled before using this API.
Parameters
[in]conn_idxCurrent connection index.
[in]cidThe local channel ID.
[in]p_paramPointer to the parameters filled by profile. see ble_gatts_noti_ind_t.
Return values
SDK_SUCCESSSend Notification or Indication event to stack successfully.
SDK_ERR_POINTER_NULLParam is NULL.
SDK_ERR_INVALID_CONN_IDXConidx is invalid.
SDK_ERR_INVALID_PARAMType is invalid.
SDK_ERR_INVALID_HANDLEHandle not exist in the database.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_gatts_enh_prepare_write_cfm()

uint16_t ble_gatts_enh_prepare_write_cfm ( uint8_t  conn_idx,
uint16_t  cid,
const ble_gatts_prep_write_cfm_t p_param 
)

Respond to an attribute prepare write request. It is used in gatts event handler function BLE_GATTS_EVT_ENH_PREP_WRITE_REQUEST to send prepare write operation status to stack.

Note
The status member ble_gatts_prep_write_cfm_t::status should be set to BLE_ATT_ERR_INSUFF_AUTHOR to control the authorization of particular client's write operation.
Parameters
[in]conn_idxCurrent connection index.
[in]cidThe local channel ID.
[in]p_paramPointer to the parameters filled by profile. see ble_gatts_prep_write_cfm_t.
Return values
SDK_SUCCESSSend prepare write confirm status to stack successfully.
SDK_ERR_POINTER_NULLParam is NULL.
SDK_ERR_INVALID_CONN_IDXConidx is invalid.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_gatts_enh_prf_add()

uint16_t ble_gatts_enh_prf_add ( ble_gatts_create_db_t p_gatts_db,
ble_evt_handler_t  evt_handler 
)

Add a server profile by providing its detailed information, including manager callback functions and GATT server callback functions. This API should be called in application initialization function.

Parameters
[in]p_gatts_dbPointer to the database info. See ble_gatts_create_db_t.
[in]evt_handlerEvent handler. See ble_evt_handler_t.
Note
If there are several profiles which need to be added, this function should be called corresponding times.
Return values
SDK_SUCCESSThe profile info is recorded successfully, and the database will be created in profile initialization callback function.
SDK_ERR_POINTER_NULLThe parameter prf_info is NULL, or input parameters that prf_info points to are invalid.
SDK_ERR_NO_RESOURCESThe profile number is up to the maximum number the system can support.

◆ ble_gatts_enh_read_cfm()

uint16_t ble_gatts_enh_read_cfm ( uint8_t  conn_idx,
uint16_t  cid,
const ble_gatts_read_cfm_t p_param 
)

Respond to an attribute read request. It is used in gatts event handle function BLE_GATTS_EVT_ENH_READ_REQUEST to send attribute value to stack which is saved in user space.

Note
The status member ble_gatts_read_cfm_t::status should be set to BLE_ATT_ERR_INSUFF_AUTHOR to control the authorization of particular read operations of a client.
Parameters
[in]conn_idxCurrent connection index.
[in]cidThe local channel ID.
[in]p_paramPointer to the parameters filled by profile. See ble_gatts_read_cfm_t.
Return values
SDK_SUCCESSSend read confirm value to stack successfully.
SDK_ERR_POINTER_NULLParam is NULL.
SDK_ERR_INVALID_CONN_IDXConidx is invalid.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_gatts_enh_write_cfm()

uint16_t ble_gatts_enh_write_cfm ( uint8_t  conn_idx,
uint16_t  cid,
const ble_gatts_write_cfm_t p_param 
)

Respond to an attribute write request. It is used in gatts event handler function BLE_GATTS_EVT_ENH_WRITE_REQUEST to send write operation status to stack.

Note
The status member ble_gatts_write_cfm_t::status should be set to BLE_ATT_ERR_INSUFF_AUTHOR to control the authorization of particular client's write operation.
Parameters
[in]conn_idxCurrent connection index.
[in]cidThe local channel ID.
[in]p_paramPointer to the parameters filled by profile. see ble_gatts_write_cfm_t.
Return values
SDK_SUCCESSSend write confirm status to stack successfully.
SDK_ERR_POINTER_NULLParam is NULL.
SDK_ERR_INVALID_CONN_IDXConidx is invalid.
SDK_ERR_NO_RESOURCESNot enough resources.

◆ ble_gatts_prf_add()

uint16_t ble_gatts_prf_add ( ble_gatts_create_db_t p_gatts_db,
ble_evt_handler_t  evt_handler 
)

Add a server profile by providing its detailed information..

Parameters
[in]p_gatts_dbPointer to the prf_info. See ble_gatts_create_db_t.
[in]evt_handlerPointer to ble events handler.
Return values
SDK_SUCCESSThe profile info is recorded successfully, and the database will be created in profile initialization callback function.
SDK_ERR_POINTER_NULLThe parameter p_gatts_db or evt_handler is NULL.
SDK_ERR_NO_RESOURCESThe profile number is up to the maximum number the system can support.