![]() |
Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
|
Function definition. More...
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 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.
[out] | p_app_value | Application data value of characteristic or descriptor. |
[in] | p_gatt_value | GATT database value of characteristic or descriptor. |
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.
[in] | p_app_value | Application data value of characteristic or descriptor. |
[out] | p_gatt_value | GATT database value of characteristic or descriptor. |
ble_status_t R_BLE_SERVC_Init | ( | void | ) |
Initialize profile common client library.
ble_status_t R_BLE_SERVC_RegisterClient | ( | const st_ble_servc_info_t * | p_info | ) |
Register client service to profile common client library.
[in] | p_info | Client service to be registered. |
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.
[in] | p_info | Client server information structure to be discovered. |
[in] | conn_hdl | Connection handle. |
[in] | serv_idx | Index used if same service is included in one profile. |
[in] | type | Event type of discovery. |
[in] | p_param | Parameter of discovered information. |
uint8_t R_BLE_SERVC_GetConnIdx | ( | const st_ble_dev_addr_t * | p_addr | ) |
Get connection handle from BD address.
[in] | p_addr | BD address of connected device. |
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.
[in] | p_attr | Characteristic sending read request. |
[in] | conn_hdl | Connection handle. |
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.
[in] | p_attr | Characteristic sending write request. |
[in] | conn_hdl | Connection handle. |
[in] | p_app_value | Value to be sent on write request. |
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.
[in] | p_attr | Characteristic sending write command. |
[in] | conn_hdl | Connection handle. |
[in] | p_app_value | Value to be sent on write command. |
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.
[in] | p_attr | Descriptor sending read request. |
[in] | conn_hdl | Connection handle. |
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.
[in] | p_attr | Descriptor sending read request. |
[in] | conn_hdl | Connection handle. |
[in] | type | Defines read operation or read long operation. 0 = read operation Other value = read long operation |
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.
[in] | p_attr | Descriptor sending write request. |
[in] | conn_hdl | Connection handle. |
[in] | p_app_value | Value to be sent on write request. |
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.
[in] | p_attr | Descriptor sending write request. |
[in] | conn_hdl | Connection handle. |
[in] | p_app_value | Data value and size to be sent on write request. |
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.
[in] | p_attr | Descriptor sending write request. |
[in] | conn_hdl | Connection handle. |
[in] | p_app_value | Value to be sent on write request. |
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.
[in] | type | Type of event. |
[in] | result | Result of request sent to server. |
[in] | p_data | Event data. |
You need to call this function to enable all client callback event included in profile.