RA Flexible Software Package Documentation  Release v5.2.0

 

Functions

ble_status_t R_BLE_GATTC_Init (uint8_t cb_num)
 This function initializes the GATT Client and registers the number of the callbacks for GATT Client event. More...
 
ble_status_t R_BLE_GATTC_RegisterCb (ble_gattc_app_cb_t cb, uint8_t priority)
 This function registers a callback function for GATT Client event. More...
 
ble_status_t R_BLE_GATTC_DeregisterCb (ble_gattc_app_cb_t cb)
 This function deregisters the callback function for GATT Client event. More...
 
ble_status_t R_BLE_GATTC_ReqExMtu (uint16_t conn_hdl, uint16_t mtu)
 This function sends a MTU Exchange Request PDU to a GATT Server in order to change the current MTU. More...
 
ble_status_t R_BLE_GATTC_DiscAllPrimServ (uint16_t conn_hdl)
 This function discovers all Primary Services in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_DiscPrimServ (uint16_t conn_hdl, uint8_t *p_uuid, uint8_t uuid_type)
 This function discovers Primary Service specified by p_uuid in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_DiscAllSecondServ (uint16_t conn_hdl)
 This function discovers all Secondary Services in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_DiscIncServ (uint16_t conn_hdl, st_ble_gatt_hdl_range_t *p_range)
 This function discovers Included Services within the specified attribute handle range in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_DiscAllChar (uint16_t conn_hdl, st_ble_gatt_hdl_range_t *p_range)
 This function discovers Characteristic within the specified attribute handle range in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_DiscCharByUuid (uint16_t conn_hdl, uint8_t *p_uuid, uint8_t uuid_type, st_ble_gatt_hdl_range_t *p_range)
 This function discovers Characteristic specified by uuid within the specified attribute handle range in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_DiscAllCharDesc (uint16_t conn_hdl, st_ble_gatt_hdl_range_t *p_range)
 This function discovers Characteristic Descriptor within the specified attribute handle range in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_ReadChar (uint16_t conn_hdl, uint16_t value_hdl)
 This function reads a Characteristic/Characteristic Descriptor in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_ReadCharUsingUuid (uint16_t conn_hdl, uint8_t *p_uuid, uint8_t uuid_type, st_ble_gatt_hdl_range_t *p_range)
 This function reads a Characteristic in a GATT Server using a specified UUID. More...
 
ble_status_t R_BLE_GATTC_ReadLongChar (uint16_t conn_hdl, uint16_t value_hdl, uint16_t offset)
 This function reads a Long Characteristic in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_ReadMultiChar (uint16_t conn_hdl, st_ble_gattc_rd_multi_req_param_t *p_list)
 This function reads multiple Characteristics in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_WriteCharWithoutRsp (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_write_data)
 This function writes a Characteristic in a GATT Server without response. More...
 
ble_status_t R_BLE_GATTC_SignedWriteChar (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_write_data)
 This function writes Signed Data to a Characteristic in a GATT Server without response. More...
 
ble_status_t R_BLE_GATTC_WriteChar (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_write_data)
 This function writes a Characteristic in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_WriteLongChar (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_write_data, uint16_t offset)
 This function writes a Long Characteristic in a GATT Server. More...
 
ble_status_t R_BLE_GATTC_ReliableWrites (uint16_t conn_hdl, st_ble_gattc_reliable_writes_char_pair_t *p_char_pair, uint8_t pair_num, uint8_t auto_flag)
 This function performs the Reliable Writes procedure described in GATT Specification. More...
 
ble_status_t R_BLE_GATTC_ExecWrite (uint16_t conn_hdl, uint8_t exe_flag)
 If the auto execute of Reliable Writes is not specified by R_BLE_GATTC_ReliableWrites(), this function is used to execute a write to Characteristic. More...
 

Detailed Description

Data Structures

struct  st_ble_gatt_hdl_range_t
 Attribute handle range. More...
 
struct  st_ble_gattc_reliable_writes_char_pair_t
 This is used in R_BLE_GATTC_ReliableWrites() to specify the pair of Characteristic Value and Characteristic Value Handle. More...
 
struct  st_ble_gattc_conn_evt_t
 This structure notifies that the link with the GATT Server has been established. More...
 
struct  st_ble_gattc_disconn_evt_t
 This structure notifies that the link with the GATT Server has been disconnected. More...
 
struct  st_ble_gattc_ex_mtu_rsp_evt_t
 This structure notifies that a MTU Exchange Response PDU has been received from a GATT Server. More...
 
struct  st_ble_gattc_serv_16_evt_t
 This structure notifies that a 16-bit UUID Service has been discovered. More...
 
struct  st_ble_gattc_serv_128_evt_t
 This structure notifies that a 128-bit UUID Service has been discovered. More...
 
struct  st_ble_gattc_inc_serv_16_evt_t
 This structure notifies that a 16-bit UUID Included Service has been discovered. More...
 
struct  st_ble_gattc_inc_serv_128_evt_t
 This structure notifies that a 128-bit UUID Included Service has been discovered. More...
 
struct  st_ble_gattc_char_16_evt_t
 This structure notifies that a 16-bit UUID Characteristic has been discovered. More...
 
struct  st_ble_gattc_char_128_evt_t
 This structure notifies that a 128-bit UUID Characteristic has been discovered. More...
 
struct  st_ble_gattc_char_desc_16_evt_t
 This structure notifies that a 16-bit UUID Characteristic Descriptor has been discovered. More...
 
struct  st_ble_gattc_char_desc_128_evt_t
 This structure notifies that a 128-bit UUID Characteristic Descriptor has been discovered. More...
 
struct  st_ble_gattc_err_rsp_evt_t
 This structure notifies that a Error Response PDU has been received from a GATT Server. More...
 
struct  st_ble_gattc_ntf_evt_t
 This structure notifies that a Notification PDU has been received from a GATT Server. More...
 
struct  st_ble_gattc_ind_evt_t
 This structure notifies that a Indication PDU has been received from a GATT Server. More...
 
struct  st_ble_gattc_rd_char_evt_t
 This structure notifies that read response to R_BLE_GATTC_ReadChar() or R_BLE_GATTC_ReadCharUsingUuid() has been received from a GATT Server. More...
 
struct  st_ble_gattc_wr_char_evt_t
 This structure notifies that write response to R_BLE_GATTC_WriteChar() has been received from a GATT Server. More...
 
struct  st_ble_gattc_rd_multi_char_evt_t
 This structure notifies that read response to R_BLE_GATTC_ReadMultiChar() has been received from a GATT Server. More...
 
struct  st_ble_gattc_char_part_wr_evt_t
 This structure notifies that write response to R_BLE_GATTC_WriteLongChar() or R_BLE_GATTC_ReliableWrites() has been received from a GATT Server. More...
 
struct  st_ble_gattc_reliable_writes_comp_evt_t
 This structure notifies that a response to R_BLE_GATTC_ExecWrite() has been received from a GATT Server. More...
 
struct  st_ble_gattc_rd_multi_req_param_t
 This is used in R_BLE_GATTC_ReadMultiChar() to specify multiple Characteristics to be read. More...
 
struct  st_ble_gattc_evt_data_t
 st_ble_gattc_evt_data_t is the type of the data notified in a GATT Client Event. More...
 
struct  st_ble_gatt_value_t
 Attribute Value. More...
 
struct  st_ble_gatt_hdl_value_pair_t
 Attribute handle and attribute Value. More...
 

Macros

#define BLE_GATTC_EXECUTE_WRITE_CANCEL_FLAG
 
#define BLE_GATTC_EXECUTE_WRITE_EXEC_FLAG
 
#define BLE_GATTC_MAX_CB
 GATT Client Callback Number.
 
#define BLE_GATTC_EXEC_AUTO
 Auto execution.
 
#define BLE_GATTC_EXEC_NOT_AUTO
 Not auto execution.
 
#define BLE_GATTC_RELIABLE_WRITES_MAX_CHAR_PAIR
 Length of the Queue used with Prepare Write procedure to write a characteristic whose size is larger than MTU.
 

Typedefs

typedef void(* ble_gattc_app_cb_t) (uint16_t event_type, ble_status_t event_result, st_ble_gattc_evt_data_t *p_event_data)
 ble_gattc_app_cb_t is the GATT Client Event callback function type. More...
 

Enumerations

enum  e_r_ble_gattc_evt_t
 GATT Client Event Identifier. More...
 

Data Structure Documentation

◆ st_ble_gatt_hdl_range_t

struct st_ble_gatt_hdl_range_t

Attribute handle range.

Data Fields
uint16_t start_hdl Start Attribute Handle.
uint16_t end_hdl End Attribute Handle.

◆ st_ble_gattc_reliable_writes_char_pair_t

struct st_ble_gattc_reliable_writes_char_pair_t

This is used in R_BLE_GATTC_ReliableWrites() to specify the pair of Characteristic Value and Characteristic Value Handle.

Data Fields
st_ble_gatt_hdl_value_pair_t write_data Pair of Characteristic Value and Characteristic Value Handle.
uint16_t offset Offset that indicates the location to be written.

Normally, set 0 to this parameter.
If this parameter sets to a value other than 0,Adjust the offset parameter and the length of the value to be written not to exceed the length of the Characteristic.

◆ st_ble_gattc_conn_evt_t

struct st_ble_gattc_conn_evt_t

This structure notifies that the link with the GATT Server has been established.

Data Fields
st_ble_dev_addr_t * p_addr Address of the GATT Server.

◆ st_ble_gattc_disconn_evt_t

struct st_ble_gattc_disconn_evt_t

This structure notifies that the link with the GATT Server has been disconnected.

Data Fields
st_ble_dev_addr_t * p_addr Address of the GATT Server.

◆ st_ble_gattc_ex_mtu_rsp_evt_t

struct st_ble_gattc_ex_mtu_rsp_evt_t

This structure notifies that a MTU Exchange Response PDU has been received from a GATT Server.

Data Fields
uint16_t mtu MTU size(in bytes) that GATT Server can receive.

◆ st_ble_gattc_serv_16_evt_t

struct st_ble_gattc_serv_16_evt_t

This structure notifies that a 16-bit UUID Service has been discovered.

Data Fields
st_ble_gatt_hdl_range_t range Attribute handle range of the 16-bit UUID service.
uint16_t uuid_16 Service UUID.

◆ st_ble_gattc_serv_128_evt_t

struct st_ble_gattc_serv_128_evt_t

This structure notifies that a 128-bit UUID Service has been discovered.

Data Fields
st_ble_gatt_hdl_range_t range Attribute handle range of the 128-bit UUID service.
uint8_t uuid_128[BLE_GATT_128_BIT_UUID_SIZE] Service UUID.

◆ st_ble_gattc_inc_serv_16_evt_t

struct st_ble_gattc_inc_serv_16_evt_t

This structure notifies that a 16-bit UUID Included Service has been discovered.

Data Fields
uint16_t decl_hdl Service Declaration handle of the 16-bit UUID Included Service.
st_ble_gattc_serv_16_evt_t service The contents of the Included Service.

◆ st_ble_gattc_inc_serv_128_evt_t

struct st_ble_gattc_inc_serv_128_evt_t

This structure notifies that a 128-bit UUID Included Service has been discovered.

Data Fields
uint16_t decl_hdl Service Declaration handle of the 128-bit UUID Included Service.
st_ble_gattc_serv_128_evt_t service The contents of the Included Service.

◆ st_ble_gattc_char_16_evt_t

struct st_ble_gattc_char_16_evt_t

This structure notifies that a 16-bit UUID Characteristic has been discovered.

Data Fields
uint16_t decl_hdl Attribute handle of Characteristic Declaration.
uint8_t cproperty Characteristic Properties.

It is a bitwise OR of the following values.
Refer to Core Spec [Vol.3] Generic Attribute Profile(GATT) "3.3.1.1 Characteristic Properties" regarding the details of the Characteristic Properties.

value description
0x01 Broadcast property
0x02 Read property
0x04 Write Without Response property
0x08 Write property
0x10 Notify property
0x20 Indicate property
0x40 Authenticated Signed Writes property
0x80 Extended Properties property
uint16_t value_hdl Value Handle of the Characteristic.
uint16_t uuid_16 Characteristic UUID.

◆ st_ble_gattc_char_128_evt_t

struct st_ble_gattc_char_128_evt_t

This structure notifies that a 128-bit UUID Characteristic has been discovered.

Data Fields
uint16_t decl_hdl Attribute Handle of Characteristic Declaration.
uint8_t cproperty Characteristic Properties.

It is a bitwise OR of the following values.
Refer to Core Spec [Vol.3] Generic Attribute Profile(GATT) "3.3.1.1 Characteristic Properties" regarding the details of the Characteristic Properties.

value description
0x01 Broadcast property
0x02 Read property
0x04 Write Without Response property
0x08 Write property
0x10 Notify property
0x20 Indicate property
0x40 Authenticated Signed Writes property
0x80 Extended Properties property
uint16_t value_hdl Value Handle of the Characteristic.
uint8_t uuid_128[BLE_GATT_128_BIT_UUID_SIZE] Characteristic UUID.

◆ st_ble_gattc_char_desc_16_evt_t

struct st_ble_gattc_char_desc_16_evt_t

This structure notifies that a 16-bit UUID Characteristic Descriptor has been discovered.

Data Fields
uint16_t desc_hdl Attribute Handle of Characteristic Descriptor.
uint16_t uuid_16 Characteristic Descriptor UUID.

◆ st_ble_gattc_char_desc_128_evt_t

struct st_ble_gattc_char_desc_128_evt_t

This structure notifies that a 128-bit UUID Characteristic Descriptor has been discovered.

Data Fields
uint16_t desc_hdl Attribute Handle of Characteristic Descriptor.
uint8_t uuid_128[BLE_GATT_128_BIT_UUID_SIZE] Characteristic Descriptor UUID.

◆ st_ble_gattc_err_rsp_evt_t

struct st_ble_gattc_err_rsp_evt_t

This structure notifies that a Error Response PDU has been received from a GATT Server.

Data Fields
uint8_t op_code The op code of the ATT Request that causes the Error Response.

op_code
Exchange MTU Request(0x02)
Find Information Request(0x04)
Find By Type Value Request(0x06)
Read By Type Request(0x08)
Read Request(0x0A)
Read Blob Request(0x0C)
Read Multiple Request(0x0E)
Read by Group Type Request(0x10)
Write Request(0x12)
Prepare Write Request(0x16)
Execute Write Request(0x18)
uint16_t attr_hdl Attribute handle that is target for the request.
uint16_t rsp_code The error codes notified from the GATT Server.

It is a bitwise OR of GATT Error Group ID : 0x3000 and the following error codes defined in Core Spec and Core Spec Supplement.

Error Code description
BLE_ERR_GATT_INVALID_HANDLE(0x3001) Invalid attribute handle
BLE_ERR_GATT_READ_NOT_PERMITTED(0x3002) The attribute cannot be read.
BLE_ERR_GATT_WRITE_NOT_PERMITTED(0x3003) The attribute cannot be written.
BLE_ERR_GATT_INVALID_PDU(0x3004) Invalid PDU.
BLE_ERR_GATT_INSUFFICIENT_AUTHENTICATION(0x3005) The authentication to access the attribute is insufficient.
BLE_ERR_GATT_REQUEST_NOT_SUPPORTED(0x3006) The request is not supported.
BLE_ERR_GATT_INVALID_OFFSET(0x3007) The specified offset is larger than the length of the attribute value.
BLE_ERR_GATT_INSUFFICIENT_AUTHORIZATION(0x3008) Authorization is required to access the attribute.
BLE_ERR_GATT_PREPARE_WRITE_QUEUE_FULL(0x3009) The Write Queue in the GATT Server is full.
BLE_ERR_GATT_ATTRIBUTE_NOT_FOUND(0x300A) The specified attribute is not found.
BLE_ERR_GATT_ATTRIBUTE_NOT_LONG(0x300B) The attribute cannot be read by Read Blob Request.
BLE_ERR_GATT_INSUFFICIENT_ENC_KEY_SIZE(0x300C) The Encryption Key Size is insufficient.
BLE_ERR_GATT_INVALID_ATTRIBUTE_LEN(0x300D) The length of the specified attribute is invalid.
BLE_ERR_GATT_UNLIKELY_ERROR(0x300E) Because an error has occurred, the process cannot be advanced.
BLE_ERR_GATT_INSUFFICIENT_ENCRYPTION(0x300F) Encryption is required to access the attribute.
BLE_ERR_GATT_UNSUPPORTED_GROUP_TYPE(0x3010) The type of the specified attribute is not supported.
BLE_ERR_GATT_INSUFFICIENT_RESOURCES(0x3011) The resource to complete the request is insufficient.
0x3080 - 0x309F Application Error. The upper layer defines the error codes.
0x30E0 - 0x30FF The error code defined in Common Profile and Service Error Core Specification Supplement(CSS).
CSS ver.7 defines the error codes from 0x30FC to 0x30FF.
BLE_ERR_GATT_WRITE_REQ_REJECTED(0x30FC) The Write Request has not been completed due to the reason other than Permission.
BLE_ERR_GATT_CCCD_IMPROPERLY_CFG(0x30FD) The CCCD is set to be invalid.
BLE_ERR_GATT_PROC_ALREADY_IN_PROGRESS(0x30FE) The request is now in progress.
BLE_ERR_GATT_OUT_OF_RANGE(0x30FF) The attribute value is out of range.

◆ st_ble_gattc_ntf_evt_t

struct st_ble_gattc_ntf_evt_t

This structure notifies that a Notification PDU has been received from a GATT Server.

Data Fields
st_ble_gatt_hdl_value_pair_t data Characteristic that causes the Notification.

◆ st_ble_gattc_ind_evt_t

struct st_ble_gattc_ind_evt_t

This structure notifies that a Indication PDU has been received from a GATT Server.

Data Fields
st_ble_gatt_hdl_value_pair_t data Characteristic that causes the Indication.

◆ st_ble_gattc_rd_char_evt_t

struct st_ble_gattc_rd_char_evt_t

This structure notifies that read response to R_BLE_GATTC_ReadChar() or R_BLE_GATTC_ReadCharUsingUuid() has been received from a GATT Server.

Data Fields
st_ble_gatt_hdl_value_pair_t read_data The contents of the Characteristic that has been read.

◆ st_ble_gattc_wr_char_evt_t

struct st_ble_gattc_wr_char_evt_t

This structure notifies that write response to R_BLE_GATTC_WriteChar() has been received from a GATT Server.

Data Fields
uint16_t value_hdl Value Handle of the Characteristic/Characteristic Descriptor that has been written.

◆ st_ble_gattc_rd_multi_char_evt_t

struct st_ble_gattc_rd_multi_char_evt_t

This structure notifies that read response to R_BLE_GATTC_ReadMultiChar() has been received from a GATT Server.

Data Fields
uint16_t value_hdl_num The number of Value Handles of the Characteristics that has been read.
st_ble_gatt_value_t multi_char_val The contents of multiple Characteristics that have been read.

◆ st_ble_gattc_char_part_wr_evt_t

struct st_ble_gattc_char_part_wr_evt_t

This structure notifies that write response to R_BLE_GATTC_WriteLongChar() or R_BLE_GATTC_ReliableWrites() has been received from a GATT Server.

Data Fields
st_ble_gatt_hdl_value_pair_t write_data The data to be written to the Characteristic/Long Characteristic/Long Characteristic Descriptor.
uint16_t offset Offset that indicates the location to be written.

◆ st_ble_gattc_reliable_writes_comp_evt_t

struct st_ble_gattc_reliable_writes_comp_evt_t

This structure notifies that a response to R_BLE_GATTC_ExecWrite() has been received from a GATT Server.

Data Fields
uint8_t exe_flag This field indicates the command of the Execute Write that has been done.
value description
0x00 Cancel the write.
0x01 Execute the write.

◆ st_ble_gattc_rd_multi_req_param_t

struct st_ble_gattc_rd_multi_req_param_t

This is used in R_BLE_GATTC_ReadMultiChar() to specify multiple Characteristics to be read.

Data Fields
uint16_t * p_hdl_list List of Value Handles that point the Characteristics to be read.
uint16_t list_count The number of Value Handles included in the hdl_list parameter.

◆ st_ble_gattc_evt_data_t

struct st_ble_gattc_evt_data_t

st_ble_gattc_evt_data_t is the type of the data notified in a GATT Client Event.

Data Fields
uint16_t conn_hdl Connection handle identifying the GATT Server.
uint16_t param_len The size of GATT Client Event parameters.
void * p_param GATT Client Event parameters. This parameter differs in each GATT Client Event.

◆ st_ble_gatt_value_t

struct st_ble_gatt_value_t

Attribute Value.

Data Fields
uint16_t value_len Length of the attribute value.
uint8_t * p_value Attribute Value.

◆ st_ble_gatt_hdl_value_pair_t

struct st_ble_gatt_hdl_value_pair_t

Attribute handle and attribute Value.

Data Fields
uint16_t attr_hdl Attribute Handle.
st_ble_gatt_value_t value Attribute Value.

Macro Definition Documentation

◆ BLE_GATTC_EXECUTE_WRITE_CANCEL_FLAG

#define BLE_GATTC_EXECUTE_WRITE_CANCEL_FLAG

GATT Execute Write Cancel Flag.

◆ BLE_GATTC_EXECUTE_WRITE_EXEC_FLAG

#define BLE_GATTC_EXECUTE_WRITE_EXEC_FLAG

GATT Execute Write Execute Flag.

Typedef Documentation

◆ ble_gattc_app_cb_t

ble_gattc_app_cb_t

ble_gattc_app_cb_t is the GATT Client Event callback function type.

Parameters
[in]event_typeThe type of GATT Client Event.
[in]event_resultThe result of GATT Client Event
[in]p_event_dataData notified by GATT Client Event.
Returns
none

Enumeration Type Documentation

◆ e_r_ble_gattc_evt_t

GATT Client Event Identifier.

Enumerator
BLE_GATTC_EVENT_ERROR_RSP 

This event notifies the application layer that a problem has occurred in the GATT Server while processing a request from GATT Client.

When GATT Client has received a Error Response PDU from a GATT Server, BLE_GATTC_EVENT_ERROR_RSP event is notified the application layer.

Event Code: 0x4001

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_err_rsp_evt_tBLE_GATTC_EVENT_ERROR_RSP

BLE_GATTC_EVENT_EX_MTU_RSP 

This event notifies the application layer that a MTU Exchange Response PDU has been received from a GATT Server.

Event Code: 0x4003

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_RSP_TIMEOUT(0x0011) 30 seconds or more have passed without receiving a Exchange MTU Response since GATT Client sent a Exchange MTU Request PDU to the GATT Server.

Event Data:

st_ble_gattc_ex_mtu_rsp_evt_tBLE_GATTC_EVENT_EX_MTU_RSP

BLE_GATTC_EVENT_CHAR_READ_BY_UUID_RSP 

When the read of Characteristic specified by UUID has been completed, this event is notified to the application layer.

Event Code: 0x4009

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_RSP_TIMEOUT(0x0011) 30 seconds or more have passed without receiving a Exchange MTU Response since GATT Client sent a Exchange MTU Request PDU to the GATT Server.

Event Data:

st_ble_gattc_rd_char_evt_tBLE_GATTC_EVENT_CHAR_READ_BY_UUID_RSP

BLE_GATTC_EVENT_CHAR_READ_RSP 

When the read of Characteristic/Characteristic Descriptor has been completed, this event is notified to the application layer.

Event Code: 0x400B

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_RSP_TIMEOUT(0x0011) 30 seconds or more have passed without receiving a read response since GATT Client sent a request for read by R_BLE_GATTC_ReadCharUsingUuid() to the GATT Server.

Event Data:

st_ble_gattc_rd_char_evt_tBLE_GATTC_EVENT_CHAR_READ_RSP

BLE_GATTC_EVENT_CHAR_PART_READ_RSP 

After calling R_BLE_GATTC_ReadLongChar(), this event notifies the application layer that the partial contents of Long Characteristic/Long Characteristic Descriptor has been received from the GATT Server.

Event Code: 0x400D

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_RSP_TIMEOUT(0x0011) 30 seconds or more have passed without receiving a read response since GATT Client sent a request for read by R_BLE_GATTC_ReadLongChar() to the GATT Server.

Event Data:

st_ble_gattc_rd_char_evt_tBLE_GATTC_EVENT_CHAR_PART_READ_RSP

BLE_GATTC_EVENT_MULTI_CHAR_READ_RSP 

This event notifies the application layer that the read of multiple Characteristics has been completed.

Event Code: 0x400F

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_RSP_TIMEOUT(0x0011) 30 seconds or more have passed without receiving a read response since GATT Client sent a request for read by R_BLE_GATTC_ReadMultiChar() to the GATT Server.

Event Data:

st_ble_gattc_rd_multi_char_evt_tBLE_GATTC_EVENT_MULTI_CHAR_READ_RSP

BLE_GATTC_EVENT_CHAR_WRITE_RSP 

This event notifies the application layer that the write of Characteristic/Characteristic Descriptor has been completed.

Event Code: 0x4013

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_RSP_TIMEOUT(0x0011) 30 seconds or more have passed without receiving a write response since GATT Client sent a request for write by R_BLE_GATTC_WriteChar() to the GATT Server.

Event Data:

st_ble_gattc_wr_char_evt_tBLE_GATTC_EVENT_CHAR_WRITE_RSP

BLE_GATTC_EVENT_CHAR_PART_WRITE_RSP 

This event notifies the application layer of the one of the following.

  • A segmentation to be written to Long Characteristic/Long Characteristic Descriptor has been sent to the GATT Server.
  • The data written to one Characteristic by Reliable Writes has been sent to the GATT Server.

Event Code: 0x4017

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_RSP_TIMEOUT(0x0011) 30 seconds or more have passed without receiving a response since GATT Client sent a request for segmentation write by R_BLE_GATTC_WriteLongChar(), or 1 Characteristic write by R_BLE_GATTC_ReliableWrites() to the GATT Server.

Event Data:

st_ble_gattc_char_part_wr_evt_tBLE_GATTC_EVENT_CHAR_PART_WRITE_RSP

BLE_GATTC_EVENT_HDL_VAL_NTF 

This event notifies the application layer that a Notification has been received from a GATT Server.

Event Code: 0x401B

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_ntf_evt_tBLE_GATTC_EVENT_HDL_VAL_NTF

BLE_GATTC_EVENT_HDL_VAL_IND 

This event notifies the application layer that a Indication has been received from a GATT Server.

When the GATT Client has received a Indication, host stack automatically sends a Confirmation to the GATT Server.

Event Code: 0x401D

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient resource is needed to generate the confirmation packet.

Event Data:

st_ble_gattc_ind_evt_tBLE_GATTC_EVENT_HDL_VAL_IND

BLE_GATTC_EVENT_CONN_IND 

This event notifies the application layer that the link with the GATT Server has been established.

Event Code: 0x4081

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_conn_evt_tBLE_GATTC_EVENT_CONN_IND

BLE_GATTC_EVENT_DISCONN_IND 

This event notifies the application layer that the link with the GATT Server has been disconnected.

Event Code: 0x4082

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_disconn_evt_tBLE_GATTC_EVENT_DISCONN_IND

BLE_GATTC_EVENT_PRIM_SERV_16_DISC_IND 

This event notifies the application layer that 16-bit UUID Primary Service has been discovered.

Event Code: 0x40E0

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_serv_16_evt_tBLE_GATTC_EVENT_PRIM_SERV_16_DISC_IND

BLE_GATTC_EVENT_PRIM_SERV_128_DISC_IND 

This event notifies the application layer that 128-bit UUID Primary Service has been discovered.

Event Code: 0x40E1

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_serv_128_evt_tBLE_GATTC_EVENT_PRIM_SERV_128_DISC_IND

BLE_GATTC_EVENT_ALL_PRIM_SERV_DISC_COMP 

When the Primary Service discovery by R_BLE_GATTC_DiscAllPrimServ() has been completed, this event is notified to the application layer.

Event Code: 0x40E2

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_ALL_PRIM_SERV_DISC_COMP

BLE_GATTC_EVENT_PRIM_SERV_DISC_COMP 

When the Primary Service discovery by R_BLE_GATTC_DiscPrimServ() has been completed, this event is notified to the application layer.

Event Code: 0x40E3

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_PRIM_SERV_DISC_COMP

BLE_GATTC_EVENT_SECOND_SERV_16_DISC_IND 

This event notifies the application layer that 16-bit UUID Secondary Service has been discovered.

Event Code: 0x40E4

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_serv_16_evt_tBLE_GATTC_EVENT_SECOND_SERV_16_DISC_IND

BLE_GATTC_EVENT_SECOND_SERV_128_DISC_IND 

This event notifies the application layer that 128-bit UUID Secondary Service has been discovered.

Event Code: 0x40E5

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_serv_128_evt_tBLE_GATTC_EVENT_SECOND_SERV_128_DISC_IND

BLE_GATTC_EVENT_ALL_SECOND_SERV_DISC_COMP 

When the Primary Service discovery by R_BLE_GATTC_DiscAllSecondServ() has been completed, this event is notified to the application layer.

Event Code: 0x40E6

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_ALL_SECOND_SERV_DISC_COMP

BLE_GATTC_EVENT_INC_SERV_16_DISC_IND 

This event notifies the application layer that Included Service that includes 16-bit UUID Service has been discovered.

Event Code: 0x40E7

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_inc_serv_16_evt_tBLE_GATTC_EVENT_INC_SERV_16_DISC_IND

BLE_GATTC_EVENT_INC_SERV_128_DISC_IND 

This event notifies the application layer that Included Service that includes 128-bit UUID Service has been discovered.

Event Code: 0x40E8

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_inc_serv_128_evt_tBLE_GATTC_EVENT_INC_SERV_128_DISC_IND

BLE_GATTC_EVENT_INC_SERV_DISC_COMP 

When the Included Service discovery by R_BLE_GATTC_DiscIncServ() has been completed, this event is notified to the application layer.

Event Code: 0x40E9

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_INC_SERV_DISC_COMP

BLE_GATTC_EVENT_CHAR_16_DISC_IND 

This event notifies the application layer that 16-bit UUID Characteristic has been discovered.

Event Code: 0x40EA

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_char_16_evt_tBLE_GATTC_EVENT_CHAR_16_DISC_IND

BLE_GATTC_EVENT_CHAR_128_DISC_IND 

This event notifies the application layer that 128-bit UUID Characteristic has been discovered.

Event Code: 0x40EB

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_char_128_evt_tBLE_GATTC_EVENT_CHAR_128_DISC_IND

BLE_GATTC_EVENT_ALL_CHAR_DISC_COMP 

When the Characteristic discovery by R_BLE_GATTC_DiscAllChar() has been completed, this event is notified to the application layer.

Event Code: 0x40EC

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_ALL_CHAR_DISC_COMP

BLE_GATTC_EVENT_CHAR_DISC_COMP 

When the Characteristic discovery by R_BLE_GATTC_DiscCharByUuid() has been completed, this event is notified to the application layer.

Event Code: 0x40ED

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_CHAR_DISC_COMP

BLE_GATTC_EVENT_CHAR_DESC_16_DISC_IND 

This event notifies the application layer that 16-bit UUID Characteristic Descriptor has been discovered.

Event Code: 0x40EE

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_char_desc_16_evt_tBLE_GATTC_EVENT_CHAR_DESC_16_DISC_IND

BLE_GATTC_EVENT_CHAR_DESC_128_DISC_IND 

This event notifies the application layer that 128-bit UUID Characteristic Descriptor has been discovered.

Event Code: 0x40EF

result:

BLE_SUCCESS(0x0000) Success

Event Data:

st_ble_gattc_char_desc_128_evt_tBLE_GATTC_EVENT_CHAR_DESC_128_DISC_IND

BLE_GATTC_EVENT_ALL_CHAR_DESC_DISC_COMP 

When the Characteristic Descriptor discovery by R_BLE_GATTC_DiscAllCharDesc() has been completed, this event is notified to the application layer.

Event Code: 0x40F0

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_ALL_CHAR_DESC_DISC_COMP

BLE_GATTC_EVENT_LONG_CHAR_READ_COMP 

After calling R_BLE_GATTC_ReadLongChar(), this event notifies the application layer that all of the contents of the Characteristic/Long Characteristic Descriptor has been received from the GATT Server.

Event Code: 0x40F1

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_LONG_CHAR_READ_COMP

BLE_GATTC_EVENT_LONG_CHAR_WRITE_COMP 

This event notifies that the application layer that the write of Long Characteristic/Long Characteristic Descriptor has been completed.

Event Code: 0x40F2

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_RSP_TIMEOUT(0x0011) 30 seconds or more have passed without receiving a response since GATT Client sent a request for write by R_BLE_GATTC_WriteLongChar() to the GATT Server.

Event Data:

noneBLE_GATTC_EVENT_LONG_CHAR_WRITE_COMP

BLE_GATTC_EVENT_RELIABLE_WRITES_TX_COMP 

This event notifies that the application layer that the GATT Server has received the data to be written to the Characteristics.

Event Code: 0x40F3

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_RELIABLE_WRITES_TX_COMP

BLE_GATTC_EVENT_RELIABLE_WRITES_COMP 

This event notifies the application layer that the Reliable Writes has been completed.

Event Code: 0x40F4

result:

BLE_SUCCESS(0x0000) Success
BLE_ERR_RSP_TIMEOUT(0x0011) 30 seconds or more have passed without receiving a response since GATT Client sent a request for execute write by R_BLE_GATTC_ReliableWrites() or R_BLE_GATTC_ExecWrite() to the GATT Server.

Event Data:

st_ble_gattc_reliable_writes_comp_evt_tBLE_GATTC_EVENT_RELIABLE_WRITES_COMP

BLE_GATTC_EVENT_INVALID 

Invalid GATT Client Event.

Event Code: 0x40FF

result:

BLE_SUCCESS(0x0000) Success

Event Data:

noneBLE_GATTC_EVENT_INVALID

Function Documentation

◆ R_BLE_GATTC_Init()

ble_status_t R_BLE_GATTC_Init ( uint8_t  cb_num)

This function initializes the GATT Client and registers the number of the callbacks for GATT Client event.

Specify the cb_num parameter to a value between 1 and BLE_GATTC_MAX_CB.
R_BLE_GATTC_RegisterCb() registers the callback.
The result of this API call is returned by a return value.

Parameters
[in]cb_numThe number of callbacks to be registered.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)The cb_num parameter is out of range.

◆ R_BLE_GATTC_RegisterCb()

ble_status_t R_BLE_GATTC_RegisterCb ( ble_gattc_app_cb_t  cb,
uint8_t  priority 
)

This function registers a callback function for GATT Client event.

The number of the callback that may be registered by this function is the value specified by R_BLE_GATTC_Init().
The result of this API call is returned by a return value.

Parameters
[in]cbCallback function for GATT Client event.
[in]priorityThe priority of the callback function.
Valid range is 1 <= priority <= BLE_GATTC_MAX_CB.
A lower priority number means a higher priority level.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The cb parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The priority parameter is out of range.
BLE_ERR_CONTEXT_FULL(0x000B)Host stack has already registered the maximum number of callbacks.

◆ R_BLE_GATTC_DeregisterCb()

ble_status_t R_BLE_GATTC_DeregisterCb ( ble_gattc_app_cb_t  cb)

This function deregisters the callback function for GATT Client event.

The result of this API call is returned by a return value.

Parameters
[in]cbThe callback function to be deregistered.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The cb parameter is specified as NULL.
BLE_ERR_NOT_FOUND(0x000D)The callback has not been registered.

◆ R_BLE_GATTC_ReqExMtu()

ble_status_t R_BLE_GATTC_ReqExMtu ( uint16_t  conn_hdl,
uint16_t  mtu 
)

This function sends a MTU Exchange Request PDU to a GATT Server in order to change the current MTU.

MTU Exchange Response is notified by BLE_GATTC_EVENT_EX_MTU_RSP event.
The new MTU is the minimum value of the mtu parameter specified by this function and the mtu field in BLE_GATTC_EVENT_EX_MTU_RSP event. Default MTU size is 23 bytes.
The result of this API call is returned by a return value.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be sent.
[in]mtuThe maximum size(in bytes) of the GATT PDU that GATT Client can receive.
Valid range is 23 <= mtu <= 247.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)The mtu parameter is out of range.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_DiscAllPrimServ()

ble_status_t R_BLE_GATTC_DiscAllPrimServ ( uint16_t  conn_hdl)

This function discovers all Primary Services in a GATT Server.

When 16-bit UUID Primary Service has been discovered, BLE_GATTC_EVENT_PRIM_SERV_16_DISC_IND event is notified to the application layer.
When 128-bit UUID Primary Service has been discovered, BLE_GATTC_EVENT_PRIM_SERV_128_DISC_IND event is notified to the application layer.
When the Primary Service discovery has been completed, BLE_GATTC_EVENT_ALL_PRIM_SERV_DISC_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be discovered.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_OPERATION(0x0009)This function was called while processing other request.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_DiscPrimServ()

ble_status_t R_BLE_GATTC_DiscPrimServ ( uint16_t  conn_hdl,
uint8_t *  p_uuid,
uint8_t  uuid_type 
)

This function discovers Primary Service specified by p_uuid in a GATT Server.

When Primary Service whose uuid is the same as the specified uuid has been discovered, BLE_GATTC_EVENT_PRIM_SERV_16_DISC_IND event or BLE_GATTC_EVENT_PRIM_SERV_128_DISC_IND event is notified to the application layer.
When the Primary Service discovery has been completed, BLE_GATTC_EVENT_PRIM_SERV_DISC_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be discovered.
[in]p_uuidUUID of Primary Service to be discovered.
[in]uuid_typeUUID type(16-bit or 128-bit).
macro description
BLE_GATT_16_BIT_UUID_FORMAT(0x01) 16-bit UUID
BLE_GATT_128_BIT_UUID_FORMAT(0x02) 128-bit UUID
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_uuid parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The uuid_type parameter is out of range.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_DiscAllSecondServ()

ble_status_t R_BLE_GATTC_DiscAllSecondServ ( uint16_t  conn_hdl)

This function discovers all Secondary Services in a GATT Server.

When a 16-bit UUID Secondary Service has been discovered, BLE_GATTC_EVENT_SECOND_SERV_16_DISC_IND event is notified to the application layer.
When a 128-bit UUID Secondary Service has been discovered, BLE_GATTC_EVENT_SECOND_SERV_128_DISC_IND event is notified to the application layer.
When the Secondary Service discovery has been completed, BLE_GATTC_EVENT_ALL_SECOND_SERV_DISC_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be discovered.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_DiscIncServ()

ble_status_t R_BLE_GATTC_DiscIncServ ( uint16_t  conn_hdl,
st_ble_gatt_hdl_range_t p_range 
)

This function discovers Included Services within the specified attribute handle range in a GATT Server.

When Included Service that includes 16-bit UUID Service has been discovered, BLE_GATTC_EVENT_INC_SERV_16_DISC_IND event is notified to the application layer.
When Included Service that includes 128-bit UUID Service has been discovered, BLE_GATTC_EVENT_INC_SERV_128_DISC_IND event is notified to the application layer.
When the Included Service discovery has been completed, BLE_GATTC_EVENT_INC_SERV_DISC_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be discovered.
[in]p_rangeRetrieval range of Included Service.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_range parameter is specified as NULL.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_DiscAllChar()

ble_status_t R_BLE_GATTC_DiscAllChar ( uint16_t  conn_hdl,
st_ble_gatt_hdl_range_t p_range 
)

This function discovers Characteristic within the specified attribute handle range in a GATT Server.

When 16-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_16_DISC_IND event is notified to the application layer.
When 128-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_128_DISC_IND event is notified to the application layer.
When the Characteristic discovery has been completed, BLE_GATTC_EVENT_ALL_CHAR_DISC_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be discovered.
[in]p_rangeRetrieval range of Characteristic.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_range parameter is specified as NULL.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_DiscCharByUuid()

ble_status_t R_BLE_GATTC_DiscCharByUuid ( uint16_t  conn_hdl,
uint8_t *  p_uuid,
uint8_t  uuid_type,
st_ble_gatt_hdl_range_t p_range 
)

This function discovers Characteristic specified by uuid within the specified attribute handle range in a GATT Server.

When 16-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_16_DISC_IND event is notified to the application layer.
When 128-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_128_DISC_IND event is notified to the application layer.
When the Characteristic discovery has been completed, BLE_GATTC_EVENT_CHAR_DISC_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be discovered.
[in]p_uuidUUID of Characteristic to be discovered.
[in]uuid_typeUUID type of Characteristic to be discovered.
macro description
BLE_GATT_16_BIT_UUID_FORMAT(0x01) The p_uuid parameter is 16-bit UUID.
BLE_GATT_128_BIT_UUID_FORMAT(0x02) The p_uuid parameter is 128-bit UUID.
[in]p_rangeRetrieval range of Characteristic.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_uuid parameter or the p_range parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The uuid_type parameter is out of range.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_DiscAllCharDesc()

ble_status_t R_BLE_GATTC_DiscAllCharDesc ( uint16_t  conn_hdl,
st_ble_gatt_hdl_range_t p_range 
)

This function discovers Characteristic Descriptor within the specified attribute handle range in a GATT Server.

When 16-bit UUID Characteristic Descriptor has been discovered, BLE_GATTC_EVENT_CHAR_DESC_16_DISC_IND event is notified to the application layer. When 128-bit UUID Characteristic Descriptor has been discovered, BLE_GATTC_EVENT_CHAR_DESC_128_DISC_IND event is notified to the application layer. When the Characteristic Descriptor discovery has been completed, BLE_GATTC_EVENT_ALL_CHAR_DESC_DISC_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be discovered.
[in]p_rangeRetrieval range of Characteristic Descriptor.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_range parameter is specified as NULL.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_ReadChar()

ble_status_t R_BLE_GATTC_ReadChar ( uint16_t  conn_hdl,
uint16_t  value_hdl 
)

This function reads a Characteristic/Characteristic Descriptor in a GATT Server.

The result of the read is notified in BLE_GATTC_EVENT_CHAR_READ_RSP event.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be read.
[in]value_hdlValue handle of the Characteristic/Characteristic Descriptor to be read.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)0 is specified in the value_hdl parameter.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_ReadCharUsingUuid()

ble_status_t R_BLE_GATTC_ReadCharUsingUuid ( uint16_t  conn_hdl,
uint8_t *  p_uuid,
uint8_t  uuid_type,
st_ble_gatt_hdl_range_t p_range 
)

This function reads a Characteristic in a GATT Server using a specified UUID.

The result of the read is notified in BLE_GATTC_EVENT_CHAR_READ_BY_UUID_RSP event.

Parameters
[in]conn_hdlConnection handle that identifies Characteristic to be read to GATT Server.
[in]p_uuidUUID of the Characteristic to be read.
[in]uuid_typeUUID type of the Characteristic to be read.
macro description
BLE_GATT_16_BIT_UUID_FORMAT(0x01) The p_uuid parameter is 16-bit UUID.
BLE_GATT_128_BIT_UUID_FORMAT(0x02) The p_uuid parameter is 128-bit UUID.
[in]p_rangeRetrieval range of Characteristic.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_uuid parameter or the p_range parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The uuid_type parameter is out of range.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_ReadLongChar()

ble_status_t R_BLE_GATTC_ReadLongChar ( uint16_t  conn_hdl,
uint16_t  value_hdl,
uint16_t  offset 
)

This function reads a Long Characteristic in a GATT Server.

The contents of the Long Characteristic that has been read is notified every MTU-1 bytes to the application layer by BLE_GATTC_EVENT_CHAR_READ_RSP event.
When all of the contents has been received in GATT Client, BLE_GATTC_EVENT_LONG_CHAR_READ_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be read.
[in]value_hdlValue handle of the Long Characteristic to be read.
[in]offsetOffset that indicates the location to be read.
Normally, set 0 to this parameter.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)0 is specified in the value_hdl parameter.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_ReadMultiChar()

ble_status_t R_BLE_GATTC_ReadMultiChar ( uint16_t  conn_hdl,
st_ble_gattc_rd_multi_req_param_t p_list 
)

This function reads multiple Characteristics in a GATT Server.

The contents of the multiple Characteristics that has been read is notified to the application layer by BLE_GATTC_EVENT_MULTI_CHAR_READ_RSP event.

Parameters
[in]conn_hdlConnection handle that identifies Characteristic to be read to GATT Server.
[in]p_listList of Value Handles that point the Characteristics to be read.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_list parameter or the p_hdl_list field in the p_list parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)0 is specified in the list_count field in the p_list parameter.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_WriteCharWithoutRsp()

ble_status_t R_BLE_GATTC_WriteCharWithoutRsp ( uint16_t  conn_hdl,
st_ble_gatt_hdl_value_pair_t p_write_data 
)

This function writes a Characteristic in a GATT Server without response.

The result is returned from the API.

Parameters
[in]conn_hdlConnection handle that identifies Characteristic to be read to GATT Server.
[in]p_write_dataValue to be written to the Characteristic.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_write_data parameter or the p_value field in the value field in the p_write_data parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The reason for this error is as follows:
  • 0 is specified in the value_len field in the p_value field in the p_write_data parameter.
  • 0 is specified in the attr_hdl field in the p_write_data parameter.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_SignedWriteChar()

ble_status_t R_BLE_GATTC_SignedWriteChar ( uint16_t  conn_hdl,
st_ble_gatt_hdl_value_pair_t p_write_data 
)

This function writes Signed Data to a Characteristic in a GATT Server without response.

The result of this API call is returned by a return value.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be written.
[in]p_write_dataSigned Data to be written to the Characteristic.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_write_data parameter or the p_value field in the value field in the p_write_data parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The reason for this error is as follows:
  • 0 is specified in the value_len field in the value field in the p_write_data parameter.
  • 0 is specified in the attr_hdl field in the p_write_data parameter.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function or Signed Data.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_WriteChar()

ble_status_t R_BLE_GATTC_WriteChar ( uint16_t  conn_hdl,
st_ble_gatt_hdl_value_pair_t p_write_data 
)

This function writes a Characteristic in a GATT Server.

The result of the write is notified in BLE_GATTC_EVENT_CHAR_WRITE_RSP event.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be written.
[in]p_write_dataValue to be written to the Characteristic.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_write_data parameter or the p_value field in the value field in the p_write_data parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The reason for this error is as follows:
  • 0 is specified in the value_len field in the value field in the p_write_data parameter.
  • 0 is specified in the attr_hdl field in the p_write_data parameter.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_WriteLongChar()

ble_status_t R_BLE_GATTC_WriteLongChar ( uint16_t  conn_hdl,
st_ble_gatt_hdl_value_pair_t p_write_data,
uint16_t  offset 
)

This function writes a Long Characteristic in a GATT Server.

The result of a write that has been done every segmentation is notified to the application layer in BLE_GATTC_EVENT_CHAR_PART_WRITE_RSP event.
The maximum writable size to a Long Characteristic with this function is 512 bytes.
When all of the contents has been written to the Long Characteristic, BLE_GATTC_EVENT_LONG_CHAR_WRITE_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be written.
[in]p_write_dataValue to be written to the Long Characteristic.
[in]offsetOffset that indicates the location to be written. Normally, set 0 to this parameter.
If this parameter sets to a value other than 0, adjust the offset parameter and the length of the value to be written not to exceed the length of the Long Characteristic.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_write_data parameter or the p_value field in the value field in the p_write_data parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The reason for this error is as follows:
  • The value_len field in the value field in the p_write_data parameter is 0.
  • The sum of the value_len field in the value field in the p_write_data parameter and the offset parameter larger than 512.
  • The attr_hdl field in the p_write_data parameter is 0.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_ReliableWrites()

ble_status_t R_BLE_GATTC_ReliableWrites ( uint16_t  conn_hdl,
st_ble_gattc_reliable_writes_char_pair_t p_char_pair,
uint8_t  pair_num,
uint8_t  auto_flag 
)

This function performs the Reliable Writes procedure described in GATT Specification.

When the data written to the Characteristic has been transmitted, BLE_GATTC_EVENT_CHAR_PART_WRITE_RSP event is notified to the application layer.
If the data included in the event is different from the data that GATT Client has sent, host stack automatically cancels the Reliable Writes.
After all of the contents has been sent to the GATT Server, if the auto_flag parameter has been set to BLE_GATTC_EXEC_AUTO, the GATT Server automatically writes the data to the Characteristic.
If the auto_flag parameter has been set to BLE_GATTC_EXEC_NOT_AUTO, BLE_GATTC_EVENT_RELIABLE_WRITES_TX_COMP event notifies the application layer in GATT Client that all of the contents has been sent to the GATT Server. Then GATT Client requests for writing the data to the Characteristic to the GATT Server with R_BLE_GATTC_ExecWrite().
When the write has been done, BLE_GATTC_EVENT_RELIABLE_WRITES_COMP event is notified to the application layer.

Parameters
[in]conn_hdlConnection handle identifying the GATT Server to be written.
[in]p_char_pairPair of Characteristic Value and Characteristic Value Handle identifying the Characteristic to be written by Reliable Writes.
[in]pair_numThe number of the pairs specified by the p_char_pair parameter.
Valid range is 0 < pair_num <= BLE_GATTC_RELIABLE_WRITES_MAX_CHAR_PAIR.
[in]auto_flagThe flag that indicates whether auto execution or not.
macro description
BLE_GATTC_EXEC_AUTO(0x01) Auto execution.
BLE_GATTC_EXEC_NOT_AUTO (0x02) Not auto execution.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows:
  • The p_char_pair parameter is specified as NULL.
  • The p_value field in the value field in the write_data field in the p_char_pair parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The reason for this error is as follows:
  • The pair_num parameter or the auto_flag parameter is out of range.
  • The value_len field in the value field in the write_data field in the p_char_pair parameter is 0.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other request, this function was called.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function or to store the temporary write data.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.

◆ R_BLE_GATTC_ExecWrite()

ble_status_t R_BLE_GATTC_ExecWrite ( uint16_t  conn_hdl,
uint8_t  exe_flag 
)

If the auto execute of Reliable Writes is not specified by R_BLE_GATTC_ReliableWrites(), this function is used to execute a write to Characteristic.

When all of the contents has been sent to the GATT Server, BLE_GATTC_EVENT_RELIABLE_WRITES_TX_COMP event notifies the application layer.
After this event has been received, execute the write by this function.
The result of the write is notified by BLE_GATTC_EVENT_RELIABLE_WRITES_COMP event.

Parameters
[in]conn_hdlConnection handle identifying the target GATT Server.
[in]exe_flagThe flag that indicates whether execution or cancellation.
macro description
BLE_GATTC_EXECUTE_WRITE_CANCEL_FLAG(0x00) Execute the write.
BLE_GATTC_EXECUTE_WRITE_EXEC_FLAG(0x01) Cancel the write.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)The exe_flag parameter is out of range.
BLE_ERR_INVALID_OPERATION(0x0009)The reason for this error is as follows:
BLE_ERR_MEM_ALLOC_FAILED(0x000C)Insufficient memory is needed to generate this function.
BLE_ERR_INVALID_HDL(0x000E)The GATT Server specified by conn_hdl was not found.