RAFW Flexible Software Package Documentation  Release v2.0.1

 

Functions

ble_status_t R_BLE_GATTS_Init (uint8_t cb_num)
 This function initializes the GATT Server and registers the number of the callbacks for GATT Server event. More...
 
ble_status_t R_BLE_GATTS_SetDbInst (st_ble_gatts_db_cfg_t *p_db_inst)
 This function sets GATT Database to host stack. More...
 
ble_status_t R_BLE_GATTS_AddDbGroup (st_ble_gatts_db_group_t *p_attr_group)
 This function adds GATT Database Group to host stack. More...
 
ble_status_t R_BLE_GATTS_RemoveDbGroup (st_ble_gatts_db_group_t *p_attr_group)
 This function remove GATT Database group in host stack. More...
 
ble_status_t R_BLE_GATTS_GetCoreServiceHandle (uint8_t attr_index, uint16_t *p_attr_hdl)
 This function get GAP Service characteristic and descriptor attribute handles in GATT Database group in host stack. More...
 
ble_status_t R_BLE_GATTS_SetStoredClientSupportedFeature (uint16_t conn_hdl, uint8_t *p_csf_value, uint8_t csf_length)
 This function sets Client Supported Feature to host in order to process some feature such robust caching. More...
 
ble_status_t R_BLE_GATTS_SetClientAwareDbHash (uint16_t conn_hdl, uint8_t *p_db_hash)
 This function sets GATT Database Hash value when client became client-aware state to host stack. More...
 
ble_status_t R_BLE_GATTS_RegisterCb (ble_gatts_app_cb_t cb, uint8_t priority)
 This function registers a callback for GATT Server event. More...
 
ble_status_t R_BLE_GATTS_DeregisterCb (ble_gatts_app_cb_t cb)
 This function deregisters the callback function for GATT Server event. More...
 
ble_status_t R_BLE_GATTS_Notification (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_ntf_data)
 This function sends a notification of an attribute's value. More...
 
ble_status_t R_BLE_GATTS_MultipleVariableLengthNotfications (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_value_pairs, uint8_t pair_num)
 This function sends notifications specify attribute handle and attribute's value. More...
 
ble_status_t R_BLE_GATTS_Indication (uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t *p_ind_data)
 This function sends a indication of an attribute's value. More...
 
ble_status_t R_BLE_GATTS_GetAttr (uint16_t conn_hdl, uint16_t attr_hdl, st_ble_gatt_value_t *p_value)
 This function gets a attribute value from the GATT Database. More...
 
ble_status_t R_BLE_GATTS_SetAttr (uint16_t conn_hdl, uint16_t attr_hdl, st_ble_gatt_value_t *p_value)
 This function sets an attribute value to the GATT Database. More...
 
ble_status_t R_BLE_GATTS_SendErrRsp (uint16_t error_code)
 This function sends an error response to a remote device. More...
 
ble_status_t R_BLE_GATTS_RspExMtu (uint16_t conn_hdl, uint16_t mtu)
 This function replies to a MTU Exchange Request from a remote device. More...
 
ble_status_t R_BLE_GATTS_SetPrepareQueue (st_ble_gatt_pre_queue_t *p_pre_queues, uint8_t queue_num)
 Register prepare queue and buffer in Host Stack. More...
 

Detailed Description

Data Structures

struct  st_ble_gatt_value_t
 Attribute Value. More...
 
struct  st_ble_gatt_hdl_value_pair_t
 Attribute handle and attribute Value. More...
 
struct  st_ble_gatt_queue_att_val_t
 Queued writes Attribute Value. More...
 
struct  st_ble_gatt_queue_pair_t
 Queued writes Attribute Value. More...
 
struct  st_ble_gatt_queue_elm_t
 Prepare Write Queue element for long chracteristic. More...
 
struct  st_ble_gatt_pre_queue_t
 Prepare Write Queue for long chracteristic. More...
 
struct  st_ble_gatts_db_params_t
 Attribute value to be set to or retrieved from the GATT Database and the access type from the GATT Client. More...
 
struct  st_ble_gatts_db_conn_hdl_t
 Information about the service or the characteristic that the attribute belongs to. More...
 
struct  st_ble_gatts_db_access_evt_t
 This structure notifies that the GATT Database has been accessed from a GATT Client. More...
 
struct  st_ble_gatts_conn_evt_t
 This structure notifies that the link with the GATT Client has been established. More...
 
struct  st_ble_gatts_disconn_evt_t
 This structure notifies that the link with the GATT Client has been disconnected. More...
 
struct  st_ble_gatts_db_hash_evt_t
 This structure notifies that the GATT Database hash Caluculation has been completed. More...
 
struct  st_ble_gatts_ex_mtu_req_evt_t
 This structure notifies that a MTU Exchange Request PDU has been received from a GATT Client. More...
 
struct  st_ble_gatts_cfm_evt_t
 This structure notifies that a Confirmation PDU has been received from a GATT Client. More...
 
struct  st_ble_gatts_ntf_evt_t
 This structure notifies that a Notification process has started on the local host. More...
 
struct  st_ble_gatts_read_by_type_rsp_evt_t
 This structure notifies that a Read By Type Response PDU has been sent from GATT Server. More...
 
struct  st_ble_gatts_read_rsp_evt_t
 This structure notifies that a Read Response PDU has been sent from GATT Server. More...
 
struct  st_ble_gatts_read_blob_rsp_evt_t
 This structure notifies that a Read Blob Response PDU has been sent from GATT Server. More...
 
struct  st_ble_gatts_read_multi_rsp_evt_t
 This structure notifies that a Read Multiple Response PDU has been sent from GATT Server. More...
 
struct  st_ble_gatts_read_multiple_variable_rsp_evt_t
 This structure notifies that a Read Multiple Variable Response PDU has been sent from GATT Server. More...
 
struct  st_ble_gatts_write_rsp_evt_t
 This structure notifies that a Write Response PDU has been sent from GATT Server. More...
 
struct  st_ble_gatts_prepare_write_rsp_evt_t
 This structure notifies that a Prepare Write Response PDU has been sent from GATT Server. More...
 
struct  st_ble_gatts_exe_write_rsp_evt_t
 This structure notifies that a Execute Write Response PDU has been sent from GATT Server. More...
 
struct  st_ble_gatts_db_uuid_cfg_t
 A structure that defines the information on the position where UUIDs are used. More...
 
struct  st_ble_gatts_db_attr_cfg_t
 A structure that defines the detailed information of the attributes. More...
 
struct  st_ble_gatts_db_attr_list_t
 The number of attributes are stored. More...
 
struct  st_ble_gatts_db_char_cfg_t
 A structure that defines the detailed information of the characteristics. More...
 
struct  st_ble_gatts_db_serv_cfg_t
 A structure that defines the detailed information of the characteristics. More...
 
struct  st_ble_gatts_db_cfg_t
 This is the structure of GATT Database that is specified in R_BLE_GATTS_SetDbInst(). More...
 
struct  st_ble_gatts_db_attr_t
 st_ble_gatts_db_attr_t configures the attributes of the GATT database. More...
 
struct  st_ble_gatts_db_group_t
 st_ble_gatts_db_group_t is the type of data register gatt database to host. More...
 
struct  st_ble_gatts_evt_data_t
 st_ble_gatts_evt_data_t is the type of the data notified in a GATT Server Event. More...
 
struct  e_ble_gatts_core_service_index_t
 e_ble_gatts_core_service_index_t is the type of the enumration using R_BLE_GATTS_GetCoreServiceHandle More...
 

Macros

#define BLE_GATT_DEFAULT_MTU
 GATT Default MTU.
 
#define BLE_GATT_16_BIT_UUID_FORMAT
 GATT Identification for 16-bit UUID Format.
 
#define BLE_GATT_128_BIT_UUID_FORMAT
 GATT Identification for 128-bit UUID Format.
 
#define BLE_GATT_16_BIT_UUID_SIZE
 GATT 16-bit UUID Size.
 
#define BLE_GATT_128_BIT_UUID_SIZE
 GATT 128-bit UUID Size.
 
#define BLE_GATT_INVALID_ATTR_HDL_VAL
 GATT Invalid Attribute Handle Value.
 
#define BLE_GATT_ATTR_HDL_START_RANGE
 GATT Attribute Handle Start Range.
 
#define BLE_GATT_ATTR_HDL_END_RANGE
 GATT Attribute Handle End Range.
 
#define BLE_GATTS_CLI_CNFG_NOTIFICATION
 GATT Client Configuration values. Enable Notification.
 
#define BLE_GATTS_CLI_CNFG_INDICATION
 GATT Client Configuration values. Enable Indication.
 
#define BLE_GATTS_CLI_CNFG_DEFAULT
 GATT Client Configuration values. Default value or disable notification/indication.
 
#define BLE_GATTS_CLIENT_SUPPORTED_FEAT_ROBUST_CACHING
 GATT Client Supported Features values. Supporting Robust Caching.
 
#define BLE_GATTS_CLIENT_SUPPORTED_FEAT_EATT
 GATT Client Supported Features values. Supporting Enhanced ATT Bearer.
 
#define BLE_GATTS_CLIENT_SUPPORTED_FEAT_MULTI_NOTIFICATIONS
 GATT Client Supported Features values. Supporting Multiple Notification.
 
#define BLE_GATTS_CLIENT_SUPPORTED_FEAT_LEN
 GATT Client Supported Features values length.
 
#define BLE_GATTS_SERVER_SUPPORTED_FEAT_EATT
 GATT Server Supported Features values. Supporting Enhanced ATT Bearer.
 
#define BLE_GATTS_DATABASE_HASH_LEN
 GATT Database Hash values length.
 
#define BLE_GATTS_SER_CNFG_BROADCAST
 GATT Server Configuration values. Enable broadcast.
 
#define BLE_GATTS_SER_CNFG_DEFAULT
 GATT Server Configuration values. Default value.
 
#define BLE_GATTS_MAX_CB
 GATT Server Callback Number.
 
#define BLE_GATTS_OP_CHAR_VALUE_READ_REQ
 Characteristic Value Local Read Operation.
 
#define BLE_GATTS_OP_CHAR_VALUE_WRITE_REQ
 Characteristic Value Local Write Operation.
 
#define BLE_GATTS_OP_CHAR_VALUE_WRITE_WITHOUT_REQ
 Characteristic Value Local Write Without Response Operation.
 
#define BLE_GATTS_OP_CHAR_CLI_CNFG_READ_REQ
 Characteristic Client Configuration Local Read Operation.
 
#define BLE_GATTS_OP_CHAR_CLI_CNFG_WRITE_REQ
 Characteristic Client Configuration Local Write Operation.
 
#define BLE_GATTS_OP_CHAR_SER_CNFG_READ_REQ
 Characteristic Server Configuration Local Read Operation.
 
#define BLE_GATTS_OP_CHAR_SER_CNFG_WRITE_REQ
 Characteristic Server Configuration Local Write Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_READ_REQ
 Characteristic Value Peer Read Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_WRITE_REQ
 Characteristic Value Peer Write Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_WRITE_CMD
 Characteristic Value Peer Write Command.
 
#define BLE_GATTS_OP_CHAR_PEER_CLI_CNFG_READ_REQ
 Characteristic Client Configuration Peer Read Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_CLI_CNFG_WRITE_REQ
 Characteristic Client Configuration Peer Write Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_SER_CNFG_READ_REQ
 Characteristic Server Configuration Peer Read Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_SER_CNFG_WRITE_REQ
 Characteristic Server Configuration Peer Write Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_USR_DESC_READ_REQ
 Characteristic User Description Peer Read Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_USR_DESC_WRITE_REQ
 Characteristic User Description Peer Write Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_HLD_DESC_READ_REQ
 Characteristic Higher Layer Defined Descriptor Peer Read Operation.
 
#define BLE_GATTS_OP_CHAR_PEER_HLD_DESC_WRITE_REQ
 Characteristic Higher Layer Defined Descriptor Peer Write Operation.
 
#define BLE_GATTS_OP_CHAR_REQ_AUTHOR
 Operation Required Authorization.
 
#define BLE_GATT_DB_READ
 Allow clients to read.
 
#define BLE_GATT_DB_WRITE
 Allow clients to write.
 
#define BLE_GATT_DB_WRITE_WITHOUT_RSP
 Allow clients to write without response.
 
#define BLE_GATT_DB_READ_WRITE
 Allow clients to access of all.
 
#define BLE_GATT_DB_NO_AUXILIARY_PROPERTY
 No auxiliary properties.
 
#define BLE_GATT_DB_FIXED_LENGTH_PROPERTY
 Fixed length attribute value.
 
#define BLE_GATT_DB_AUTHORIZATION_PROPERTY
 Attributes requiring authorization.
 
#define BLE_GATT_DB_ATTR_DISABLED
 The attribute is disabled. If this value is set, the attribute cannot be found and accessed by a GATT Client.
 
#define BLE_GATT_DB_128_BIT_UUID_FORMAT
 Attribute with 128 bit UUID.
 
#define BLE_GATT_DB_PEER_SPECIFIC_VAL_PROPERTY
 Attribute managed by each GATT Client.
 
#define BLE_GATT_DB_CONST_ATTR_VAL_PROPERTY
 Fixed attribute value.
 
#define BLE_GATT_DB_ENABLE_WRITE_WITHOUT_RSP
 Permit Write Without Response.
 
#define BLE_GATT_DB_ONLY_SIGNED_WRITE
 Signed writes are allowed.
 
#define BLE_GATT_DB_SECONN_ONLY_READ
 LE Secure Connection Pairing and 16 byte encryption key size are required in read access.
 
#define BLE_GATT_DB_SECONN_ONLY_WRITE
 LE Secure Connection Pairing 16 byte encryption key size are required in write access.
 
#define BLE_GATT_DB_SER_SECURITY_UNAUTH
 Unauthenticated pairing(Security Mode1 Security Level 2, Security Mode 2 Security Level 1). Unauthenticated pairing is required to access the service.
 
#define BLE_GATT_DB_SER_SECURITY_AUTH
 Authenticated pairing(Security Mode1 Security Level 3, Security Mode 2 Security Level 2). Authenticated pairing is required to access the service.
 
#define BLE_GATT_DB_SER_SECURITY_SECONN
 Authenticated LE secure connections that generates 16bytes LTK(Security Mode1 Security Level 4). Authenticated LE secure connections pairing that generates 16bytes LTK is required to access the service. If this bit is set, bit24-27 are ignored.
 
#define BLE_GATT_DB_SER_SECURITY_ENC
 Encryption. Encryption by the LTK exchanged in pairing is required to access.
 
#define BLE_GATT_DB_SER_NO_SECURITY_PROPERTY
 No Security(Security Mode1 Security Level 1).
 
#define BLE_GATT_DB_SER_ENC_KEY_SIZE_DONT_CARE
 7-byte or larger encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_7
 7-byte encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_8
 8-byte encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_9
 9-byte encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_10
 10-byte encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_11
 11-byte encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_12
 12-byte encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_13
 13-byte encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_14
 14-byte encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_15
 15-byte encryption key.
 
#define BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_16
 16-byte encryption key.
 
#define BLE_GATT_DB_PERMIT_NONE
 Set if attribute can not be written and read.
 
#define BLE_GATT_DB_PERMIT_WRITE
 Set if attribute can be written.
 
#define BLE_GATT_DB_PERMIT_WRITE_AUTH
 Set if attribute write requires authentication.
 
#define BLE_GATT_DB_PERMIT_WRITE_AUTHORIZ
 Set if attribute write requires authorization.
 
#define BLE_GATT_DB_PERMIT_WRITE_ENC
 Set if attribute write requires encryption.
 
#define BLE_GATT_DB_PERMIT_READ
 Set if attribute can be read.
 
#define BLE_GATT_DB_PERMIT_READ_AUTH
 Set if attribute read requires authentication.
 
#define BLE_GATT_DB_PERMIT_READ_AUTHORIZ
 Set if attribute read requires authorization.
 
#define BLE_GATT_DB_PERMIT_READ_ENC
 Set if attribute read requires encryption.
 

Typedefs

typedef void(* ble_gatts_app_cb_t) (uint16_t event_type, ble_status_t event_result, st_ble_gatts_evt_data_t *p_event_data)
 ble_gatts_app_cb_t is the GATT Server Event callback function type. More...
 

Enumerations

enum  e_r_ble_gatts_evt_t
 GATT Server Event Identifier. More...
 
enum  e_ble_gatts_core_service_index_t
 

Data Structure Documentation

◆ 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.

◆ st_ble_gatt_queue_att_val_t

struct st_ble_gatt_queue_att_val_t

Queued writes Attribute Value.

Data Fields
uint8_t * p_value Attribute Value for Queued Write .
uint16_t value_len Length of the attribute value.
uint16_t padding padding.

◆ st_ble_gatt_queue_pair_t

struct st_ble_gatt_queue_pair_t

Queued writes Attribute Value.

Data Fields
st_ble_gatt_queue_att_val_t queue_value Attribute Value for Queued Write.
uint16_t attr_hdl Attribute Handle.

◆ st_ble_gatt_queue_elm_t

struct st_ble_gatt_queue_elm_t

Prepare Write Queue element for long chracteristic.

Data Fields
st_ble_gatt_queue_pair_t queue_value_pair Part of Long Characteristic Value and Characteristic Value Handle.
uint16_t offset Offset that indicates the location to be written.

◆ st_ble_gatt_pre_queue_t

struct st_ble_gatt_pre_queue_t

Prepare Write Queue for long chracteristic.

Data Fields
uint8_t * p_buf_start Buffer start address for Write Long Characteristic Request.
st_ble_gatt_queue_elm_t * p_queue Prepare Write Queue for Long Characteristic Value.
uint16_t buffer_len Buffer length.
uint16_t conn_hdl Connection Handle.
uint16_t buf_offset Current buffer offset.
uint8_t queue_size Number of elements in the prepare write queue.
uint8_t queue_idx Index of Prepare Write Queue.

◆ st_ble_gatts_db_params_t

struct st_ble_gatts_db_params_t

Attribute value to be set to or retrieved from the GATT Database and the access type from the GATT Client.

Data Fields
st_ble_gatt_value_t value Attribute value to be set to or retrieved from the GATT Database. Note that the address of the value field in the value field is invalid in case of read access.
uint16_t attr_hdl Attribute handle identifying the attribute to be set or retrieved.
uint8_t db_op Type of the access to GATT Database from the GATT Client.
See also
access_type_to_gatt_database

◆ st_ble_gatts_db_conn_hdl_t

struct st_ble_gatts_db_conn_hdl_t

Information about the service or the characteristic that the attribute belongs to.

Data Fields
uint16_t conn_hdl Connection handle identifying the GATT Client that accesses to the GATT DataBase.
uint8_t service_id ID of the service that the attribute belongs to.
uint8_t char_id ID of the Characteristic that the attribute belongs to.

◆ st_ble_gatts_db_access_evt_t

struct st_ble_gatts_db_access_evt_t

This structure notifies that the GATT Database has been accessed from a GATT Client.

Data Fields
st_ble_gatts_db_conn_hdl_t * p_handle Information about the service or the characteristic that the attribute belongs to.
st_ble_gatts_db_params_t * p_params Attribute value to be set to or retrieved from the GATT Database and the access type from the GATT Client.

◆ st_ble_gatts_conn_evt_t

struct st_ble_gatts_conn_evt_t

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

Data Fields
st_ble_dev_addr_t * p_addr Address of the GATT Client.

◆ st_ble_gatts_disconn_evt_t

struct st_ble_gatts_disconn_evt_t

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

Data Fields
st_ble_dev_addr_t * p_addr Address of the GATT Client.

◆ st_ble_gatts_db_hash_evt_t

struct st_ble_gatts_db_hash_evt_t

This structure notifies that the GATT Database hash Caluculation has been completed.

Data Fields
uint8_t db_hash[BLE_GATTS_DATABASE_HASH_LEN] GATT database DBHash Value.

◆ st_ble_gatts_ex_mtu_req_evt_t

struct st_ble_gatts_ex_mtu_req_evt_t

This structure notifies that a MTU Exchange Request PDU has been received from a GATT Client.

Data Fields
uint16_t mtu Maximum receive MTU size by GATT Client.

◆ st_ble_gatts_cfm_evt_t

struct st_ble_gatts_cfm_evt_t

This structure notifies that a Confirmation PDU has been received from a GATT Client.

Data Fields
uint16_t attr_hdl Attribute handle identifying the Characteristic sent by the Indication PDU.

◆ st_ble_gatts_ntf_evt_t

struct st_ble_gatts_ntf_evt_t

This structure notifies that a Notification process has started on the local host.

Data Fields
uint16_t attr_hdl Attribute handle identifying the Characteristic sent by the Indication PDU.

◆ st_ble_gatts_read_by_type_rsp_evt_t

struct st_ble_gatts_read_by_type_rsp_evt_t

This structure notifies that a Read By Type Response PDU has been sent from GATT Server.

Data Fields
uint16_t attr_hdl Attribute handle identifying the Characteristic read by the Read By Type Request PDU.

◆ st_ble_gatts_read_rsp_evt_t

struct st_ble_gatts_read_rsp_evt_t

This structure notifies that a Read Response PDU has been sent from GATT Server.

Data Fields
uint16_t attr_hdl Attribute handle identifying the Characteristic read by the Read Request PDU.

◆ st_ble_gatts_read_blob_rsp_evt_t

struct st_ble_gatts_read_blob_rsp_evt_t

This structure notifies that a Read Blob Response PDU has been sent from GATT Server.

Data Fields
uint16_t attr_hdl Attribute handle identifying the Characteristic read by the Read Blob Request PDU.

◆ st_ble_gatts_read_multi_rsp_evt_t

struct st_ble_gatts_read_multi_rsp_evt_t

This structure notifies that a Read Multiple Response PDU has been sent from GATT Server.

Data Fields
uint8_t count The number of attribute read by the Read Multiple Request PDU.
uint16_t * p_attr_hdl_list The list of attribute read by the Read Multiple Request PDU.

◆ st_ble_gatts_read_multiple_variable_rsp_evt_t

struct st_ble_gatts_read_multiple_variable_rsp_evt_t

This structure notifies that a Read Multiple Variable Response PDU has been sent from GATT Server.

Data Fields
uint16_t count The number of attribute read by the Read Multiple Variable Request PDU.
uint16_t * p_attr_hdl_list The list of attribute read by the Read Multiple Variable Request PDU.

◆ st_ble_gatts_write_rsp_evt_t

struct st_ble_gatts_write_rsp_evt_t

This structure notifies that a Write Response PDU has been sent from GATT Server.

Data Fields
uint16_t attr_hdl Attribute handle identifying the Characteristic written by the Write Request PDU.

◆ st_ble_gatts_prepare_write_rsp_evt_t

struct st_ble_gatts_prepare_write_rsp_evt_t

This structure notifies that a Prepare Write Response PDU has been sent from GATT Server.

Data Fields
uint16_t attr_hdl Attribute handle identifying the Characteristic written by the Prepare Write Request PDU.
uint16_t length The length of written bytes by the Prepare Write Request PDU.
uint16_t offset The offset of the first octet to be written.

◆ st_ble_gatts_exe_write_rsp_evt_t

struct st_ble_gatts_exe_write_rsp_evt_t

This structure notifies that a Execute Write Response PDU has been sent from GATT Server.

Data Fields
uint8_t exe_flag The flag that indicates whether execution or cancellation.
value description
0x00 Cancellation.
0x01 Execution.

◆ st_ble_gatts_db_uuid_cfg_t

struct st_ble_gatts_db_uuid_cfg_t

A structure that defines the information on the position where UUIDs are used.

Data Fields
uint16_t offset The position of the defined UUID is specified by offset value in uuid_table of st_ble_gatts_db_cfg_t.
uint16_t first The attribute handle that indicates the first position in st_ble_gatts_db_attr_cfg_t for the defined UUID is specified.
uint16_t last The attribute handle that indicates the last position in st_ble_gatts_db_attr_cfg_t for the defined UUID is specified.

◆ st_ble_gatts_db_attr_cfg_t

struct st_ble_gatts_db_attr_cfg_t

A structure that defines the detailed information of the attributes.

Data Fields
uint8_t desc_prop The properties of attribute are specified.

Set the following properties by a bitwise OR.

macro description
BLE_GATT_DB_READ(0x01) Allow clients to read.
BLE_GATT_DB_WRITE(0x02) Allow clients to write.
BLE_GATT_DB_WRITE_WITHOUT_RSP(0x04) Allow clients to write.
BLE_GATT_DB_READ_WRITE(0x07) Allow clients to access of all.
uint8_t aux_prop The auxiliary properties of attribute are specified.

Set the following properties by a bitwise OR.

macro description
BLE_GATT_DB_NO_AUXILIARY_PROPERTY(0x00) No auxiliary properties.
It is invalid when used with other properties at the same time.
BLE_GATT_DB_FIXED_LENGTH_PROPERTY(0x01) Fixed length attribute value.
BLE_GATT_DB_AUTHORIZATION_PROPERTY(0x02) Attributes requiring authorization.
BLE_GATT_DB_ATTR_DISABLED(0x10) The attribute is disabled. If this value is set, the attribute cannot be found and accessed by a GATT Client. It is invalid when used with other properties at the same time.
BLE_GATT_DB_128_BIT_UUID_FORMAT(0x20) Attribute with 128 bit UUID.
If this macro is not set, the attribute value is 16-bits UUID.
BLE_GATT_DB_PEER_SPECIFIC_VAL_PROPERTY(0x40) Attribute managed by each GATT Client.
BLE_GATT_DB_CONST_ATTR_VAL_PROPERTY(0x80) Fixed attribute value.
Writing from Client and setting from Server are prohibited.
uint16_t length The length of the attribute value is specified.
uint16_t next The position of the next attribute with the same UUID as the defined attribute is specified by an attribute handle.
uint16_t uuid_offset The storage area of attribute value.

UUID of the defined attribute is set by specifying the position of the UUID registered in uuid_table of st_ble_gatts_db_cfg_t with the array offset value.

uint8_t * p_data_offset Storage area of attribute value.

The address in the array registered in No.1-No.4 is specified to set the attribute value storage area of the defined attribute.

◆ st_ble_gatts_db_attr_list_t

struct st_ble_gatts_db_attr_list_t

The number of attributes are stored.

Data Fields
uint8_t count The number of the services or the characteristics.

◆ st_ble_gatts_db_char_cfg_t

struct st_ble_gatts_db_char_cfg_t

A structure that defines the detailed information of the characteristics.

Data Fields
st_ble_gatts_db_attr_list_t list The total number of attributes in the defined characteristic is specified.
uint16_t start_hdl The first attribute handle of the characteristic is specified.
uint8_t service_id The index of service to which the characteristic belongs is specified.

◆ st_ble_gatts_db_serv_cfg_t

struct st_ble_gatts_db_serv_cfg_t

A structure that defines the detailed information of the characteristics.

Data Fields
st_ble_gatts_db_attr_list_t list The total number of service declarations in the defined service is specified.
uint32_t desc The properties of the defined service are specified.

Set the security level, the security mode and the key size with a bitwise OR. The bit0-bit3 are specified as the security level. Select one of the following.

macro description
BLE_GATT_DB_SER_SECURITY_UNAUTH(0x00000001) Unauthenticated pairing(Security Mode1 Security Level 2, Security Mode 2 Security Level 1)
Unauthenticated pairing is required to access the service.
BLE_GATT_DB_SER_SECURITY_AUTH(0x00000002) Authenticated pairing(Security Mode1 Security Level 3, Security Mode 2 Security Level 2)
Authenticated pairing is required to access the service.
BLE_GATT_DB_SER_SECURITY_SECONN(0x00000004) Authenticated LE secure connections that generates 16bytes LTK(Security Mode1 Security Level 4)
Authenticated LE secure connections pairing that generates 16bytes LTK is required to access the service. If this bit is set, bit24-27 are ignored.


The bit4 is specified as the security mode.

macro description
BLE_GATT_DB_SER_SECURITY_ENC(0x00000010) Encryption
Encryption by the LTK exchanged in pairing is required to access.


If the security requirement of the service is not needed, specify the bit0-bit4 to BLE_GATT_DB_SER_NO_SECURITY_PROPERTY(0x00000000).(Security Mode1 Security Level 1)
The bit24-bit27 are specified as the key size required by the defined service.
Select one of the following.

macro description
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_7(0x01000000) 7-byte encryption key.
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_8(0x02000000) 8-byte encryption key.
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_9(0x03000000) 9-byte encryption key.
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_10(0x04000000) 10-byte encryption key.
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_11(0x05000000) 11-byte encryption key.
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_12(0x06000000) 12-byte encryption key.
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_13(0x07000000) 13-byte encryption key.
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_14(0x08000000) 14-byte encryption key.
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_15(0x09000000) 15-byte encryption key.
BLE_GATT_DB_SER_ENCRYPT_KEY_SIZE_16(0x0A000000) 16-byte encryption key.
BLE_GATT_DB_SER_ENC_KEY_SIZE_DONT_CARE(0x00000000) 7-byte or larger encryption key.


Other bits are reserved.

uint16_t start_hdl The start attribute handle of the defined service is specified.
uint16_t end_hdl The end attribute handle of the defined service is specified.
uint8_t char_start_idx The start index of the characteristic that belongs to the defined service is specified.
uint8_t char_end_idx The end index of the characteristic that belongs to the defined service is specified.

◆ st_ble_gatts_db_cfg_t

struct st_ble_gatts_db_cfg_t

This is the structure of GATT Database that is specified in R_BLE_GATTS_SetDbInst().

Data Fields
const uint8_t * p_uuid_table The array to register the UUID to be used.
uint8_t * p_attr_val_table The array to register variable attribute values.
const uint8_t * p_const_attr_val_table The array to register fixed attribute values.
uint8_t * p_rem_spec_val_table The array to manage the attribute values handled for each GATT client.
const uint8_t * p_const_rem_spec_val_table The array to register the default of the attribute value handled by each GATT client.
const st_ble_gatts_db_uuid_cfg_t * p_uuid_cfg The array to register information on the position where UUIDs are used.
const st_ble_gatts_db_attr_cfg_t * p_attr_cfg The array to register the detailed information of attributes.
const st_ble_gatts_db_char_cfg_t * p_char_cfg The array to register the detailed information of characteristics.
const st_ble_gatts_db_serv_cfg_t * p_serv_cfg The array to register the detailed information of services.
uint8_t serv_cnt The number of services included in the GATT Database.
uint8_t char_cnt The number of characteristics included in the GATT Database.
uint8_t uuid_type_cnt The number of UUIDs included in the GATT Database.
uint8_t peer_spec_val_cnt The total size of attribute value that needs to be managed for each GATT client.

◆ st_ble_gatts_db_attr_t

struct st_ble_gatts_db_attr_t

st_ble_gatts_db_attr_t configures the attributes of the GATT database.

Data Fields
const uint8_t * p_uuid Attribute type.
uint8_t * p_value Attribute value.
uint16_t * p_value_len Attirubte value length. This parameter is ignored when aux_prop set BLE_GATT_DB_FIXED_LENGTH.
const uint16_t max_value_len Maximum Attirubte value length.
uint32_t permissions Attribute Permisions

value description
BLE_GATT_DB_PERMIT_NONE Does not permit read and write access.
BLE_GATT_DB_PERMIT_READ Permit to read access.
BLE_GATT_DB_PERMIT_READ_AUTH Authentication pairing is required to read access.
BLE_GATT_DB_PERMIT_READ_AUTHORIZ Authorization is required to read access.
BLE_GATT_DB_PERMIT_READ_ENC Encryption is required to read access.
BLE_GATT_DB_PERMIT_WRITE Permit to write access.
BLE_GATT_DB_PERMIT_WRITE_AUTH Authentication pairing is required to write access.
BLE_GATT_DB_PERMIT_WRITE_AUTHORIZ Authorization is required to write access.
BLE_GATT_DB_PERMIT_WRITE_ENC Encryption is required to write access.
uint16_t aux_prop The auxiliary properties of attribute are specified.

Set the following properties by a bitwise OR.

macro description
BLE_GATT_DB_NO_AUXILIARY_PROPERTY(0x0000) No auxiliary properties.
It is invalid when used with other properties at the same time.
BLE_GATT_DB_FIXED_LENGTH_PROPERTY(0x0001) Fixed length attribute value.
BLE_GATT_DB_ATTR_DISABLED(0x0010) The attribute is disabled. If this value is set, the attribute cannot be found and accessed by a GATT Client. It is invalid when used with other properties at the same time.
BLE_GATT_DB_128_BIT_UUID_FORMAT(0x0020) Attribute with 128 bit UUID.
If this macro is not set, the attribute value is 16-bits UUID.
BLE_GATT_DB_PEER_SPECIFIC_VAL_PROPERTY(0x0040) Attribute managed by each GATT Client.
BLE_GATT_DB_CONST_ATTR_VAL_PROPERTY(0x0080) Fixed attribute value.
Writing from Client and setting from Server are prohibited.
BLE_GATT_DB_ENABLE_WRITE_WITHOUT_RSP(0x0100) Permit Write Without Response.
Write by write without response from Client is not prohibited.
BLE_GATT_DB_ONLY_SIGNED_WRITE(0x0200) Signed writes are allowed.
In not encrypted connection, Writes other than Signed Write are not accepted.
BLE_GATT_DB_SECONN_ONLY_READ(0x1000) LE Secure Connection Pairing is required in read access.
BLE_GATT_DB_SECONN_ONLY_WRITE(0x2000) LE Secure Connection Pairing is required in write access.

◆ st_ble_gatts_db_group_t

struct st_ble_gatts_db_group_t

st_ble_gatts_db_group_t is the type of data register gatt database to host.

Data Fields
st_ble_gatts_db_attr_t * p_attrs attributes
uint16_t num_of_attr number of attributes
uint16_t start_hdl GATT Database Group Start handle register to host stack.
uint16_t actual_start_hdl Start handle registered GATT Database Group by host stack. This parameter is output parameter and set by host stack.
uint16_t actual_end_hdl End handle registered GATT Database Group by host stack. This parameter is output parameter and set by host stack.

◆ st_ble_gatts_evt_data_t

struct st_ble_gatts_evt_data_t

st_ble_gatts_evt_data_t is the type of the data notified in a GATT Server Event.

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

◆ e_ble_gatts_core_service_index_t

struct e_ble_gatts_core_service_index_t

e_ble_gatts_core_service_index_t is the type of the enumration using R_BLE_GATTS_GetCoreServiceHandle

Typedef Documentation

◆ ble_gatts_app_cb_t

ble_gatts_app_cb_t

ble_gatts_app_cb_t is the GATT Server Event callback function type.

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

Enumeration Type Documentation

◆ e_r_ble_gatts_evt_t

GATT Server Event Identifier.

Enumerator
BLE_GATTS_EVENT_EX_MTU_REQ 

MTU Exchange Request has been received.

This event notifies the application layer that a MTU Exchange Request PDU has been received from a GATT Client. Need to reply to the request by R_BLE_GATTS_RspExMtu().

Event Code: 0x3002

Event Data:

st_ble_gatts_ex_mtu_req_evt_tBLE_GATTS_EVENT_EX_MTU_REQ

BLE_GATTS_EVENT_READ_BY_TYPE_RSP_COMP 

Read By Type Response has been sent.

This event notifies the application layer that a Read By Type Response PDU has been sent from GATT Server to the GATT Client.

Event Code: 0x3009

Event Data:

st_ble_gatts_read_by_type_rsp_evt_tBLE_GATTS_EVENT_READ_BY_TYPE_RSP_COMP

BLE_GATTS_EVENT_READ_RSP_COMP 

Read Response has been sent.

This event notifies the application layer that a Read Response PDU has been sent from GATT Server to the GATT Client.

Event Code: 0x300B

Event Data:

st_ble_gatts_read_rsp_evt_tBLE_GATTS_EVENT_READ_RSP_COMP

BLE_GATTS_EVENT_READ_BLOB_RSP_COMP 

Read Blob Response has been sent.

This event notifies the application layer that a Read Blob Response PDU has been sent from GATT Server to the GATT Client.

Event Code: 0x300D

Event Data:

st_ble_gatts_read_blob_rsp_evt_tBLE_GATTS_EVENT_READ_BLOB_RSP_COMP

BLE_GATTS_EVENT_READ_MULTI_RSP_COMP 

Read Multiple Response has been sent.

This event notifies the application layer that a Read Multiple Response PDU has been sent from GATT Server to the GATT Client.

Event Code: 0x300F

Event Data:

st_ble_gatts_read_multi_rsp_evt_tBLE_GATTS_EVENT_READ_MULTI_RSP_COMP

BLE_GATTS_EVENT_READ_MULTIPLE_VARIABLE_RSP_COMP 

Read Multiple Response has been sent.

This event notifies the application layer that a Read Multiple Variable Response PDU has been sent from GATT Server to the GATT Client.

Event Code: 0x3021

Event Data:

st_ble_gatts_read_multiple_variable_rsp_evt_tBLE_GATTS_EVENT_READ_MULTIPLE_VARIABLE_RSP_COMP

BLE_GATTS_EVENT_WRITE_RSP_COMP 

Write Response has been sent.

This event notifies the application layer that a Write Response PDU has been sent from GATT Server to the GATT Client.

Event Code: 0x3013

Event Data:

st_ble_gatts_write_rsp_evt_tBLE_GATTS_EVENT_WRITE_RSP_COMP

BLE_GATTS_EVENT_PREPARE_WRITE_RSP_COMP 

Prepare Write Response has been sent.

This event notifies the application layer that a Prepare Write Response PDU has been sent from GATT Server to the GATT Client.

Event Code: 0x3017

Event Data:

st_ble_gatts_prepare_write_rsp_evt_tBLE_GATTS_EVENT_PREPARE_WRITE_RSP_COMP

BLE_GATTS_EVENT_EXE_WRITE_RSP_COMP 

Execute Write Response has been sent.

This event notifies the application layer that a Execute Write Response PDU has been sent from GATT Server to the GATT Client.

Event Code: 0x3019

Event Data:

st_ble_gatts_exe_write_rsp_evt_tBLE_GATTS_EVENT_EXE_WRITE_RSP_COMP

BLE_GATTS_EVENT_HDL_VAL_CNF 

Confirmation has been received.

This event notifies the application layer that a Confirmation PDU has been received from a GATT Client.

Event Code: 0x301E

Event Data:

st_ble_gatts_cfm_evt_tBLE_GATTS_EVENT_HDL_VAL_CNF

BLE_GATTS_EVENT_HDL_VAL_NTF_COMP 

Notification process has started.

This event notifies the application layer that a Notification process has started on the local host.

Event Code: 0x301B

Event Data:

st_ble_gatts_ntf_evt_tBLE_GATTS_EVENT_HDL_VAL_NTF_COMP

BLE_GATTS_EVENT_HDL_VAL_MULTIPLE_NTF_COMP 

Multiple Notification process has started.

This event notifies the application layer that a Multiple Notification process has started on the local host.

Event Code: 0x3023

Event Data:

noneBLE_GATTS_EVENT_HDL_VAL_MULTIPLE_NTF_COMP

BLE_GATTS_EVENT_DB_ACCESS_IND 

The GATT Database has been accessed from a GATT Client.

This event notifies the application layer that the GATT Database has been accessed from a GATT Client.

Event Code: 0x3040

Event Data:

st_ble_gatts_db_access_evt_tBLE_GATTS_EVENT_DB_ACCESS_IND

BLE_GATTS_EVENT_CONN_IND 

A connection has been established.

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

Event Code: 0x3081

Event Data:

st_ble_gatts_conn_evt_tBLE_GATTS_EVENT_CONN_IND

BLE_GATTS_EVENT_DISCONN_IND 

A connection has been disconnected.

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

Event Code: 0x3082

Event Data:

st_ble_gatts_disconn_evt_tBLE_GATTS_EVENT_DISCONN_IND

BLE_GATTS_EVENT_DB_HASH_CAL_COMP 

GATT Database Hash calculation has been completed.

Event Code: 0x3083

Event Data:

st_ble_gatts_db_hash_evt_tBLE_GATTS_EVENT_DB_HASH_CAL_COMP

BLE_GATTS_EVENT_DB_HASH_AWARENESS_IND 

DBHash when the client becomes change-aware.

Event Code: 0x3084

Event Data:

st_ble_gatts_db_hash_evt_tBLE_GATTS_EVENT_DB_HASH_AWARENESS_IND

BLE_GATTS_EVENT_INVALID 

Invalid GATT Server Event.

Event Code: 0x30FF

Event Data:

noneBLE_GATTS_EVENT_INVALID

◆ e_ble_gatts_core_service_index_t

Enumerator
BLE_GATTS_GAP_SERV_START_IDX 

GAP Service Start Handle.

BLE_GATTS_GAP_SERV_DEV_NAME_DECL_IDX 

GAP Service Device Name Characteristic Declaration Handle.

BLE_GATTS_GAP_SERV_DEV_NAME_VAL_IDX 

GAP Service Device Name Characteristic Value Handle.

BLE_GATTS_GAP_SERV_APPEARANCE_DECL_IDX 

GAP Service Apperance Characteristic Declaration Handle.

BLE_GATTS_GAP_SERV_APPEARANCE_VAL_IDX 

GAP Service Apperance Characteristic Value Handle.

BLE_GATTS_GAP_SERV_PER_PREF_CONN_PARAM_DECL_IDX 

GAP Service Periferal Prefer Connection Param Characteristic Declaration Handle.

BLE_GATTS_GAP_SERV_PER_PREF_CONN_PARAM_VAL_IDX 

GAP Service Periferal Prefer Connection Param Characteristic Value Handle.

BLE_GATTS_GAP_SERV_CENT_ADDR_RSLV_DECL_IDX 

GAP Service Central Address Resolution Characteristic Declaration Handle.

BLE_GATTS_GAP_SERV_CENT_ADDR_RSLV_VAL_IDX 

GAP Service Central Address Resolution Characteristic Value Handle.

BLE_GATTS_GAP_SERV_RSLV_PRIV_ADDR_ONLY_DECL_IDX 

GAP Service Resolve Privacy Address Only Characteristic Value Handle.

BLE_GATTS_GAP_SERV_RSLV_PRIV_ADDR_ONLY_VAL_IDX 

GAP Service Resolve Privacy Address Only Characteristic Declaration Handle.

BLE_GATTS_GAP_SERV_ENC_DATA_KEY_MATERIAL_DECL_IDX 

GAP Service Encryption Data Key Materials Characteristic Declaration Handle.

BLE_GATTS_GAP_SERV_ENC_DATA_KEY_MATERIAL_VAL_IDX 

GAP Service Encryption Data Key Materials Characteristic Value Handle.

BLE_GATTS_GAP_SERV_ENC_DATA_KEY_MATERIAL_CLI_CNFG_DESC_IDX 

GAP Service Encryption Data Key Materials Characteristic Client Configuration Descriptor Handle.

BLE_GATTS_GAP_SERV_LE_GATT_SEC_LEVELS_DECL_IDX 

GAP Service LE GATT Security Levels Characteristic Declaration Handle.

BLE_GATTS_GAP_SERV_LE_GATT_SEC_LEVELS_VAL_IDX 

GAP Service LE GATT Security Levels Characteristic Value Handle.

BLE_GATTS_GAP_SERV_END_IDX 

GAP Service End Handle.

BLE_GATTS_GATT_SERV_START_IDX 

GATT Service Start Handle.

BLE_GATTS_GATT_SERV_SERV_CHGED_DECL_IDX 

GATT Service Service Changed Characteristic Declaration Handle.

BLE_GATTS_GATT_SERV_SERV_CHGED_VAL_IDX 

GATT Service Service Changed Characteristic Value Handle.

BLE_GATTS_GATT_SERV_SERV_CHGED_CLI_CNFG_DESC_IDX 

GATT Service Service Changed Client Configuration Descriptor Handle.

BLE_GATTS_GATT_SERV_CLI_SPRT_FEAT_DECL_IDX 

GATT Service Client Support Feature Declaration Characteristic Handle.

BLE_GATTS_GATT_SERV_CLI_SPRT_FEAT_VAL_IDX 

GATT Service Client Support Feature Value Characteristic Handle.

BLE_GATTS_GATT_SERV_DB_HASH_DECL_IDX 

GATT Service Database Hash Declaration Characteristic Handle.

BLE_GATTS_GATT_SERV_DB_HASH_VAL_IDX 

GATT Service Database Hash Value Characteristic Handle.

BLE_GATTS_GATT_SERV_SRV_SPRT_FEAT_DECL_IDX 

GATT Service Server Support Feature Characteristic Declaration Handle.

BLE_GATTS_GATT_SERV_SRV_SPRT_FEAT_VAL_IDX 

GATT Service Server Support Feature Characteristic Value Handle.

BLE_GATTS_GATT_SERV_END_IDX 

GATT Service End Handle.

Function Documentation

◆ R_BLE_GATTS_Init()

ble_status_t R_BLE_GATTS_Init ( uint8_t  cb_num)

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

Specify the cb_num parameter to a value between 1 and BLE_GATTS_MAX_CB.
R_BLE_GATTS_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_GATTS_SetDbInst()

ble_status_t R_BLE_GATTS_SetDbInst ( st_ble_gatts_db_cfg_t p_db_inst)

This function sets GATT Database to host stack.

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

Parameters
[in]p_db_instGATT Database to be set.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows.
  • The db_inst parameter is specified as NULL.
  • The array in the db_inst is specified as NULL.

◆ R_BLE_GATTS_AddDbGroup()

ble_status_t R_BLE_GATTS_AddDbGroup ( st_ble_gatts_db_group_t p_attr_group)

This function adds GATT Database Group to host stack.

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

Parameters
[in]p_attr_groupGATT Database to be set.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows.
  • The p_attr_group parameter is specified as NULL.
BLE_ERR_MEM_ALLOC_FAILED(0x000C)memory allocation failure for GATT Database group.

◆ R_BLE_GATTS_RemoveDbGroup()

ble_status_t R_BLE_GATTS_RemoveDbGroup ( st_ble_gatts_db_group_t p_attr_group)

This function remove GATT Database group in host stack.

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

Parameters
[in]p_attr_groupGATT Database to be removed.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows.
  • The p_attr_group parameter is specified as NULL.
BLE_ERR_NOT_FOUND(0x000D)Specified GATT Database group is not registed in host stack.

◆ R_BLE_GATTS_GetCoreServiceHandle()

ble_status_t R_BLE_GATTS_GetCoreServiceHandle ( uint8_t  attr_index,
uint16_t *  p_attr_hdl 
)

This function get GAP Service characteristic and descriptor attribute handles in GATT Database group in host stack.

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

Parameters
[in]attr_indexcore service attribute index refer e_ble_gatts_core_service_index_t;
[out]p_attr_hdlhandle information
Return values
BLE_SUCCESS(0x0000)Success

◆ R_BLE_GATTS_SetStoredClientSupportedFeature()

ble_status_t R_BLE_GATTS_SetStoredClientSupportedFeature ( uint16_t  conn_hdl,
uint8_t *  p_csf_value,
uint8_t  csf_length 
)

This function sets Client Supported Feature to host in order to process some feature such robust caching.

This function sets to the host stack the value of Client Supported Feature that a bonded client wrote before disconnecting. The result of this API call is returned by a return value.

Note
This function does not set any values ​​in the GATT database.
Parameters
[in]conn_hdlConnection handle identifying the remote device to be set the client supported feature.
[in]p_csf_valueClient Supported Feature value.
[in]csf_lengthClient Supported Feature value length.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows.
  • The p_csf_value parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The csf_length is not adapted.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl was not found.

◆ R_BLE_GATTS_SetClientAwareDbHash()

R_BLE_GATTS_SetClientAwareDbHash ( uint16_t  conn_hdl,
uint8_t *  p_db_hash 
)

This function sets GATT Database Hash value when client became client-aware state to host stack.

The host stack compares this db_hash value with the hash value of the current GATT database to determine the value of the client's Client Aware State at the time of connection. If the db_hash value matches the current GATT database value, the host stack determines that the client is in a Client-Aware State. If they do not match, the host stack determines that the client is in a Client-Unaware State. The result of this API call is returned by a return value.

Note
This function does not set any values ​​in the GATT database.
Parameters
[in]conn_hdlConnection handle identifying the remote device to be set the db_hash.
[in]p_db_hashGATT Database Hash value.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The reason for this error is as follows.
  • The p_db_hash parameter is specified as NULL.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by conn_hdl was not found.

◆ R_BLE_GATTS_RegisterCb()

ble_status_t R_BLE_GATTS_RegisterCb ( ble_gatts_app_cb_t  cb,
uint8_t  priority 
)

This function registers a callback for GATT Server event.

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

Parameters
[in]cbCallback function for GATT Server event.
[in]priorityThe priority of the callback function.
Valid range is 1 <= priority <= BLE_GATTS_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_GATTS_DeregisterCb()

ble_status_t R_BLE_GATTS_DeregisterCb ( ble_gatts_app_cb_t  cb)

This function deregisters the callback function for GATT Server 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_GATTS_Notification()

ble_status_t R_BLE_GATTS_Notification ( uint16_t  conn_hdl,
st_ble_gatt_hdl_value_pair_t p_ntf_data 
)

This function sends a notification of an attribute's value.

The maximum length of the attribute value that can be sent with notification is MTU-3.
The result of this API call is returned by a return value. BLE_GATTS_EVENT_HDL_VAL_NTF_COMP event notifies the application that notification process has started.

Parameters
[in]conn_hdlConnection handle identifying the remote device to be sent the notification.
[in]p_ntf_dataThe attribute value to send.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_ntf_data parameter or the value field in the value field in the p_ntf_data parameter is NULL.
BLE_ERR_INVALID_ARG(0x0003)The value_len field in the value field in the p_ntf_data parameter is 0 or the attr_hdl field in the p_ntf_data parameters is 0.
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 remote device specified by conn_hdl was not found.

◆ R_BLE_GATTS_MultipleVariableLengthNotfications()

ble_status_t R_BLE_GATTS_MultipleVariableLengthNotfications ( uint16_t  conn_hdl,
st_ble_gatt_hdl_value_pair_t p_value_pairs,
uint8_t  pair_num 
)

This function sends notifications specify attribute handle and attribute's value.

The maximum length of the attribute value that can be sent with notification is MTU-3.
The result of this API call is returned by a return value. BLE_GATTS_EVENT_HDL_VAL_MULTIPLE_NTF_COMP event notifies the application that notification process has started.

Parameters
[in]conn_hdlConnection handle identifying the remote device to be sent the notification.
[in]p_value_pairsThe attribute value handle pair to send.
[in]pair_numThe number of attribute to send.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_ntf_data parameter or the value field in the value field in the p_ntf_data parameter is NULL.
BLE_ERR_INVALID_ARG(0x0003)The value_len field in the value field in the p_ntf_data parameter is 0 or the attr_hdl field in the p_ntf_data parameters is 0.
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 remote device specified by conn_hdl was not found.

◆ R_BLE_GATTS_Indication()

ble_status_t R_BLE_GATTS_Indication ( uint16_t  conn_hdl,
st_ble_gatt_hdl_value_pair_t p_ind_data 
)

This function sends a indication of an attribute's value.

The maximum length of the attribute value that can be sent with indication is MTU-3.
The result of this API call is returned by a return value.
The remote device that receives a indication sends a confirmation.
BLE_GATTS_EVENT_HDL_VAL_CNF event notifies the application layer that the confirmation has been received.

Parameters
[in]conn_hdlConnection handle identifying the remote device to be sent the indication.
[in]p_ind_dataThe attribute value to send.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_ind_data parameter or the value field in the value field in the p_ind_data parameter is NULL.
BLE_ERR_INVALID_ARG(0x0003)The value_len field in the value field in the p_ind_data parameter is 0 or the attr_hdl field in the p_ind_data parameters is 0.
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 remote device specified by conn_hdl was not found.

◆ R_BLE_GATTS_GetAttr()

ble_status_t R_BLE_GATTS_GetAttr ( uint16_t  conn_hdl,
uint16_t  attr_hdl,
st_ble_gatt_value_t p_value 
)

This function gets a attribute value from the GATT Database.

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

Parameters
[in]conn_hdlIf the attribute value that has information about the remote device is retrieved, specify the remote device with the conn_hdl parameter. When information about the remote device is not required, set the conn_hdl parameter to BLE_GAP_INVALID_CONN_HDL.
[in]attr_hdlThe attribute handle of the attribute value to be retrieved.
[out]p_valueThe attribute value to be retrieved.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_value parameter is specified as NULL.
BLE_ERR_INVALID_ARG(0x0003)The attr_hdl parameter is 0 or larger than the last attribute handle of GATT Database.
BLE_ERR_INVALID_STATE(0x0008)The attribute is not in a state to be read.
BLE_ERR_INVALID_OPERATION(0x0009)The attribute cannot be read.
BLE_ERR_NOT_FOUND(0x000D)The attribute specified by the attr_hdl parameter is not belonging to any services or characteristics.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by the conn_hdl parameter was not found.

◆ R_BLE_GATTS_SetAttr()

ble_status_t R_BLE_GATTS_SetAttr ( uint16_t  conn_hdl,
uint16_t  attr_hdl,
st_ble_gatt_value_t p_value 
)

This function sets an attribute value to the GATT Database.

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

Parameters
[in]conn_hdlIf the attribute value that has information about the remote device is retrieved, specify the remote device with the conn_hdl parameter. When information about the remote device is not required, set the conn_hdl parameter to BLE_GAP_INVALID_CONN_HDL.
[in]attr_hdlThe attribute handle of the attribute value to be set.
[in]p_valueThe attribute value to be set.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_value parameter is specified as NULL.
BLE_ERR_INVALID_DATA(0x0002)The write size is larger than the length of the attribute value.
BLE_ERR_INVALID_ARG(0x0003)The attr_hdl parameter is 0 or larger than the last attribute handle of GATT Database.
BLE_ERR_INVALID_STATE(0x0008)The attribute is not in a state to be written.
BLE_ERR_INVALID_OPERATION(0x0009)The attribute cannot be written.
BLE_ERR_NOT_FOUND(0x000D)The attribute specified by the attr_hdl parameter is not belonging to any services or characteristics.
BLE_ERR_INVALID_HDL(0x000E)The remote device specified by the conn_hdl parameter was not found.

◆ R_BLE_GATTS_SendErrRsp()

ble_status_t R_BLE_GATTS_SendErrRsp ( uint16_t  error_code)

This function sends an error response to a remote device.

The result is returned from the API.
The error code specified in the callback is notified as Error Response to the remote device.
The result of this API call is returned by a return value.

Parameters
[in]error_codeThe error codes to be notified the client.
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.
BLE_ERR_GATT_DATABASE_OUT_OF_SYNC(0x3012) The server requests the client to rediscover the database.
BLE_ERR_GATT_VALUE_NOT_ALLOWED(0x3013) The attribute parameter value was not allowed.
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.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_ARG(0x0003)The Group ID of the error_code parameter is not 0x3000, or it is 0x3000.
BLE_ERR_INVALID_OPERATION(0x0009)While processing other error response,this function was called.

◆ R_BLE_GATTS_RspExMtu()

ble_status_t R_BLE_GATTS_RspExMtu ( uint16_t  conn_hdl,
uint16_t  mtu 
)

This function replies to a MTU Exchange Request from a remote device.

BLE_GATTS_EVENT_EX_MTU_REQ event notifies the application layer that a MTU Exchange Request has been received. Therefore when the callback has received the event, call this function.
The new MTU is the minimum of the mtu parameter specified by this function and the mtu field in BLE_GATTS_EVENT_EX_MTU_REQ 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 remote device to be sent MTU Exchange Response.
[in]mtuThe maximum size(in bytes) of the GATT PDU that GATT Server 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)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 remote device specified by conn_hdl was not found.

◆ R_BLE_GATTS_SetPrepareQueue()

ble_status_t R_BLE_GATTS_SetPrepareQueue ( st_ble_gatt_pre_queue_t p_pre_queues,
uint8_t  queue_num 
)

Register prepare queue and buffer in Host Stack.

This function registers the prepare queue and buffer for long chracteristic write and reliable writes. The result of this API call is returned by a return value.

Parameters
[in]p_pre_queuesThe prepare write queues to be registered.
[in]queue_numThe number of prepare write queues to be registered.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_INVALID_PTR(0x0001)The p_pre_queue parameter is specified as NULL.