Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]

Function definition. More...

Detailed Description

Function definition.

Typedefs

typedef ble_status_t(* ble_servc_attr_decode_t) (void *p_app_value, const st_ble_gatt_value_t *p_gatt_value)
 Decode function. Convert data from GATT database value to application data value. More...
 
typedef ble_status_t(* ble_servc_attr_encode_t) (const void *p_app_value, st_ble_gatt_value_t *p_gatt_value)
 Encode function. Convert data from application data value to GATT database value. More...
 

Functions

ble_status_t R_BLE_SERVC_Init (void)
 Initialize profile common client library. More...
 
ble_status_t R_BLE_SERVC_RegisterClient (const st_ble_servc_info_t *p_info)
 Register client service to profile common client library. More...
 
void R_BLE_SERVC_ServDiscCb (const st_ble_servc_info_t *p_info, uint16_t conn_hdl, uint8_t serv_idx, uint16_t type, void *p_param)
 Callback function used for service discovery. More...
 
uint8_t R_BLE_SERVC_GetConnIdx (const st_ble_dev_addr_t *p_addr)
 Get connection handle from BD address. More...
 
ble_status_t R_BLE_SERVC_ReadChar (const st_ble_servc_char_info_t *p_attr, uint16_t conn_hdl)
 Send read request of characteristic value for read operation. More...
 
ble_status_t R_BLE_SERVC_WriteChar (const st_ble_servc_char_info_t *p_attr, uint16_t conn_hdl, const void *p_app_value)
 Send write request of characteristic value for write operation. More...
 
ble_status_t R_BLE_SERVC_WriteCmdChar (const st_ble_servc_char_info_t *p_attr, uint16_t conn_hdl, const void *p_app_value)
 Send write command of characteristic value for write without request operation. More...
 
ble_status_t R_BLE_SERVC_ReadDesc (const st_ble_servc_desc_info_t *p_attr, uint16_t conn_hdl)
 Send read request of descriptor value for read operation. More...
 
ble_status_t R_BLE_SERVC_ReadDesc_with_Type (const st_ble_servc_desc_info_t *p_attr, uint16_t conn_hdl, int32_t type)
 Send read request of descriptor value for read operation or read long operation. More...
 
ble_status_t R_BLE_SERVC_WriteDesc (const st_ble_servc_desc_info_t *p_attr, uint16_t conn_hdl, const void *p_app_value)
 Send write request of descriptor value for write operation. More...
 
ble_status_t R_BLE_SERVC_WriteDesc_with_Size (const st_ble_servc_desc_info_t *p_attr, uint16_t conn_hdl, const st_ble_seq_data_t *p_app_value)
 Send write request of variable descriptor value for write operation. More...
 
ble_status_t R_BLE_SERVC_WriteDesc2 (const st_ble_servc_desc_info_t *p_attr, uint16_t conn_hdl, const void *p_app_value)
 Send write request of descriptor value for write without request operation. More...
 
void R_BLE_SERVC_GattcCb (uint16_t type, ble_status_t result, st_ble_gattc_evt_data_t *p_data)
 Callback function used for GATT client events. More...
 

Typedef Documentation

◆ ble_servc_attr_decode_t

typedef ble_status_t(* ble_servc_attr_decode_t) (void *p_app_value, const st_ble_gatt_value_t *p_gatt_value)

Decode function. Convert data from GATT database value to application data value.

Parameters
[out]p_app_valueApplication data value of characteristic or descriptor.
[in]p_gatt_valueGATT database value of characteristic or descriptor.

◆ ble_servc_attr_encode_t

typedef ble_status_t(* ble_servc_attr_encode_t) (const void *p_app_value, st_ble_gatt_value_t *p_gatt_value)

Encode function. Convert data from application data value to GATT database value.

Parameters
[in]p_app_valueApplication data value of characteristic or descriptor.
[out]p_gatt_valueGATT database value of characteristic or descriptor.

Function Documentation

◆ R_BLE_SERVC_Init()

ble_status_t R_BLE_SERVC_Init ( void  )

Initialize profile common client library.

Returns
See ble_status_t

◆ R_BLE_SERVC_RegisterClient()

ble_status_t R_BLE_SERVC_RegisterClient ( const st_ble_servc_info_t p_info)

Register client service to profile common client library.

Parameters
[in]p_infoClient service to be registered.
Returns
See ble_status_t

◆ R_BLE_SERVC_ServDiscCb()

void R_BLE_SERVC_ServDiscCb ( const st_ble_servc_info_t p_info,
uint16_t  conn_hdl,
uint8_t  serv_idx,
uint16_t  type,
void *  p_param 
)

Callback function used for service discovery.

Parameters
[in]p_infoClient server information structure to be discovered.
[in]conn_hdlConnection handle.
[in]serv_idxIndex used if same service is included in one profile.
[in]typeEvent type of discovery.
[in]p_paramParameter of discovered information.

◆ R_BLE_SERVC_GetConnIdx()

uint8_t R_BLE_SERVC_GetConnIdx ( const st_ble_dev_addr_t p_addr)

Get connection handle from BD address.

Parameters
[in]p_addrBD address of connected device.
Returns
connection handle.

◆ R_BLE_SERVC_ReadChar()

ble_status_t R_BLE_SERVC_ReadChar ( const st_ble_servc_char_info_t p_attr,
uint16_t  conn_hdl 
)

Send read request of characteristic value for read operation.

Parameters
[in]p_attrCharacteristic sending read request.
[in]conn_hdlConnection handle.
Returns
See ble_status_t

◆ R_BLE_SERVC_WriteChar()

ble_status_t R_BLE_SERVC_WriteChar ( const st_ble_servc_char_info_t p_attr,
uint16_t  conn_hdl,
const void *  p_app_value 
)

Send write request of characteristic value for write operation.

Parameters
[in]p_attrCharacteristic sending write request.
[in]conn_hdlConnection handle.
[in]p_app_valueValue to be sent on write request.
Returns
See ble_status_t

◆ R_BLE_SERVC_WriteCmdChar()

ble_status_t R_BLE_SERVC_WriteCmdChar ( const st_ble_servc_char_info_t p_attr,
uint16_t  conn_hdl,
const void *  p_app_value 
)

Send write command of characteristic value for write without request operation.

Parameters
[in]p_attrCharacteristic sending write command.
[in]conn_hdlConnection handle.
[in]p_app_valueValue to be sent on write command.
Returns
See ble_status_t

◆ R_BLE_SERVC_ReadDesc()

ble_status_t R_BLE_SERVC_ReadDesc ( const st_ble_servc_desc_info_t p_attr,
uint16_t  conn_hdl 
)

Send read request of descriptor value for read operation.

Parameters
[in]p_attrDescriptor sending read request.
[in]conn_hdlConnection handle.
Returns
See ble_status_t

◆ R_BLE_SERVC_ReadDesc_with_Type()

ble_status_t R_BLE_SERVC_ReadDesc_with_Type ( const st_ble_servc_desc_info_t p_attr,
uint16_t  conn_hdl,
int32_t  type 
)

Send read request of descriptor value for read operation or read long operation.

Parameters
[in]p_attrDescriptor sending read request.
[in]conn_hdlConnection handle.
[in]typeDefines read operation or read long operation.
0 = read operation
Other value = read long operation
Returns
See ble_status_t

◆ R_BLE_SERVC_WriteDesc()

ble_status_t R_BLE_SERVC_WriteDesc ( const st_ble_servc_desc_info_t p_attr,
uint16_t  conn_hdl,
const void *  p_app_value 
)

Send write request of descriptor value for write operation.

Parameters
[in]p_attrDescriptor sending write request.
[in]conn_hdlConnection handle.
[in]p_app_valueValue to be sent on write request.
Returns
See ble_status_t

◆ R_BLE_SERVC_WriteDesc_with_Size()

ble_status_t R_BLE_SERVC_WriteDesc_with_Size ( const st_ble_servc_desc_info_t p_attr,
uint16_t  conn_hdl,
const st_ble_seq_data_t p_app_value 
)

Send write request of variable descriptor value for write operation.

Parameters
[in]p_attrDescriptor sending write request.
[in]conn_hdlConnection handle.
[in]p_app_valueData value and size to be sent on write request.
Returns
See ble_status_t

◆ R_BLE_SERVC_WriteDesc2()

ble_status_t R_BLE_SERVC_WriteDesc2 ( const st_ble_servc_desc_info_t p_attr,
uint16_t  conn_hdl,
const void *  p_app_value 
)

Send write request of descriptor value for write without request operation.

Parameters
[in]p_attrDescriptor sending write request.
[in]conn_hdlConnection handle.
[in]p_app_valueValue to be sent on write request.
Returns
See ble_status_t

◆ R_BLE_SERVC_GattcCb()

void R_BLE_SERVC_GattcCb ( uint16_t  type,
ble_status_t  result,
st_ble_gattc_evt_data_t p_data 
)

Callback function used for GATT client events.

Parameters
[in]typeType of event.
[in]resultResult of request sent to server.
[in]p_dataEvent data.

You need to call this function to enable all client callback event included in profile.