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_servs_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_servs_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_SERVS_Init (void)
 Initialize profile common server library. More...
 
ble_status_t R_BLE_SERVS_RegisterServer (const st_ble_servs_info_t *p_serv)
 Register server service information to profile common server library. More...
 
ble_status_t R_BLE_SERVS_SendHdlVal (const st_ble_servs_char_info_t *p_attr, uint16_t conn_hdl, const void *p_app_value, bool is_notify)
 Send notification or indication. More...
 
ble_status_t R_BLE_SERVS_GetChar (const st_ble_servs_char_info_t *p_attr, uint16_t conn_hdl, void *p_app_value)
 Get characteristic value from GATT database. More...
 
ble_status_t R_BLE_SERVS_SetChar (const st_ble_servs_char_info_t *p_attr, uint16_t conn_hdl, const void *p_app_value)
 Set characteristic value to GATT database. More...
 
ble_status_t R_BLE_SERVS_GetDesc (const st_ble_servs_desc_info_t *p_attr, uint16_t conn_hdl, void *p_app_value)
 Get descriptor value from GATT database. More...
 
ble_status_t R_BLE_SERVS_SetDesc (const st_ble_servs_desc_info_t *p_attr, uint16_t conn_hdl, const void *p_app_value)
 Set descriptor value to GATT database. More...
 
void R_BLE_SERVS_GattsCb (uint16_t type, ble_status_t result, st_ble_gatts_evt_data_t *p_data)
 Callback function used for GATT server event. More...
 
void R_BLE_SERVS_VsCb (uint16_t type, ble_status_t result, st_ble_vs_evt_data_t *p_data)
 Callback function used for vender specific event. More...
 

Typedef Documentation

◆ ble_servs_attr_decode_t

typedef ble_status_t(* ble_servs_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_servs_attr_encode_t

typedef ble_status_t(* ble_servs_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_SERVS_Init()

ble_status_t R_BLE_SERVS_Init ( void  )

Initialize profile common server library.

Returns
See ble_status_t

◆ R_BLE_SERVS_RegisterServer()

ble_status_t R_BLE_SERVS_RegisterServer ( const st_ble_servs_info_t p_serv)

Register server service information to profile common server library.

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

◆ R_BLE_SERVS_SendHdlVal()

ble_status_t R_BLE_SERVS_SendHdlVal ( const st_ble_servs_char_info_t p_attr,
uint16_t  conn_hdl,
const void *  p_app_value,
bool  is_notify 
)

Send notification or indication.

Parameters
[in]p_attrCharacteristic sending notification or indication.
[in]conn_hdlConnection handle.
[in]p_app_valueValue to be sent on notification or indication.
[in]is_notifyDefines notification or indication.
true = notification
false = indication
Returns
See ble_status_t

◆ R_BLE_SERVS_GetChar()

ble_status_t R_BLE_SERVS_GetChar ( const st_ble_servs_char_info_t p_attr,
uint16_t  conn_hdl,
void *  p_app_value 
)

Get characteristic value from GATT database.

Parameters
[in]p_attrCharacteristic getting value.
[in]conn_hdlConnection handle.
[out]p_app_valueCharacteristic value getting from GATT database.
Returns
See ble_status_t

◆ R_BLE_SERVS_SetChar()

ble_status_t R_BLE_SERVS_SetChar ( const st_ble_servs_char_info_t p_attr,
uint16_t  conn_hdl,
const void *  p_app_value 
)

Set characteristic value to GATT database.

Parameters
[in]p_attrCharacteristic setting value.
[in]conn_hdlConnection handle.
[in]p_app_valueCharacteristic value setting to GATT database.
Returns
See ble_status_t

◆ R_BLE_SERVS_GetDesc()

ble_status_t R_BLE_SERVS_GetDesc ( const st_ble_servs_desc_info_t p_attr,
uint16_t  conn_hdl,
void *  p_app_value 
)

Get descriptor value from GATT database.

Parameters
[in]p_attrDescriptor getting value.
[in]conn_hdlConnection handle.
[out]p_app_valueDescriptor value getting from GATT database.
Returns
See ble_status_t

◆ R_BLE_SERVS_SetDesc()

ble_status_t R_BLE_SERVS_SetDesc ( const st_ble_servs_desc_info_t p_attr,
uint16_t  conn_hdl,
const void *  p_app_value 
)

Set descriptor value to GATT database.

Parameters
[in]p_attrDescriptor setting value.
[in]conn_hdlConnection handle.
[in]p_app_valueDescriptor value setting to GATT database.
Returns
See ble_status_t

◆ R_BLE_SERVS_GattsCb()

void R_BLE_SERVS_GattsCb ( uint16_t  type,
ble_status_t  result,
st_ble_gatts_evt_data_t p_data 
)

Callback function used for GATT server event.

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 server callback event included in profile.

◆ R_BLE_SERVS_VsCb()

void R_BLE_SERVS_VsCb ( uint16_t  type,
ble_status_t  result,
st_ble_vs_evt_data_t p_data 
)

Callback function used for vender specific event.

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

You need to call this function if you use flow control callback.