RA Flexible Software Package Documentation
Release v5.2.0
|
|
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_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_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... | |
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_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_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_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_evt_data_t |
st_ble_gatts_evt_data_t is the type of the data notified in a GATT Server Event. 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_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_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. | |
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... | |
struct st_ble_gatt_value_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. |
struct st_ble_gatt_queue_att_val_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. |
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. |
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. |
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.
|
struct st_ble_gatts_db_conn_hdl_t |
Information about the service or the characteristic that the attribute belongs to.
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. |
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. |
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. |
struct st_ble_gatts_ex_mtu_req_evt_t |
struct st_ble_gatts_cfm_evt_t |
struct st_ble_gatts_read_by_type_rsp_evt_t |
struct st_ble_gatts_read_rsp_evt_t |
struct st_ble_gatts_read_blob_rsp_evt_t |
struct st_ble_gatts_read_multi_rsp_evt_t |
struct st_ble_gatts_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.
struct st_ble_gatts_exe_write_rsp_evt_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. |
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.
| ||||||||||||||||
uint8_t | aux_prop |
The auxiliary properties of attribute are specified. Set the following properties by a bitwise OR.
| ||||||||||||||||
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. |
struct st_ble_gatts_db_attr_list_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. |
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.
| ||||||||||||||||||||||||||||||||||||
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. |
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. |
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.
ble_gatts_app_cb_t |
ble_gatts_app_cb_t is the GATT Server Event callback function type.
[in] | event_type | The type of GATT Server Event. |
[in] | event_result | The result of GATT Server Event |
[in] | p_event_data | Data notified by GATT Server Event. |
enum 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: 0x3002Event 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: 0x3009Event 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: 0x300BEvent 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: 0x300DEvent 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: 0x300FEvent Data:st_ble_gatts_read_multi_rsp_evt_tBLE_GATTS_EVENT_READ_MULTI_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: 0x3013Event 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: 0x3017Event 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: 0x3019Event 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: 0x301EEvent Data:st_ble_gatts_cfm_evt_tBLE_GATTS_EVENT_HDL_VAL_CNF |
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: 0x3040Event 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: 0x3081Event 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: 0x3082Event Data:st_ble_gatts_disconn_evt_tBLE_GATTS_EVENT_DISCONN_IND |
BLE_GATTS_EVENT_INVALID | Invalid GATT Server Event. Event Code: 0x30FFEvent Data:noneBLE_GATTS_EVENT_INVALID |
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.
[in] | cb_num | The number of callbacks to be registered. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_ARG(0x0003) | The cb_num parameter is out of range. |
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.
[in] | p_db_inst | GATT Database to be set. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The reason for this error is as follows.
|
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.
[in] | cb | Callback function for GATT Server event. |
[in] | priority | The priority of the callback function. Valid range is 1 <= priority <= BLE_GATTS_MAX_CB. A lower priority number means a higher priority level. |
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. |
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.
[in] | cb | The callback function to be deregistered. |
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. |
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.
[in] | conn_hdl | Connection handle identifying the remote device to be sent the notification. |
[in] | p_ntf_data | The attribute value to send. |
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. |
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.
[in] | conn_hdl | Connection handle identifying the remote device to be sent the indication. |
[in] | p_ind_data | The attribute value to send. |
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. |
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.
[in] | conn_hdl | If 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_hdl | The attribute handle of the attribute value to be retrieved. |
[out] | p_value | The attribute value to be retrieved. |
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. |
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.
[in] | conn_hdl | If 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_hdl | The attribute handle of the attribute value to be set. |
[in] | p_value | The attribute value to be set. |
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. |
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.
[in] | error_code | The 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.
|
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. |
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.
[in] | conn_hdl | Connection handle identifying the remote device to be sent MTU Exchange Response. |
[in] | mtu | The maximum size(in bytes) of the GATT PDU that GATT Server can receive. Valid range is 23 <= mtu <= 247. |
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. |
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.
[in] | p_pre_queues | The prepare write queues to be registered. |
[in] | queue_num | The number of prepare write queues to be registered. |
BLE_SUCCESS(0x0000) | Success |
BLE_ERR_INVALID_PTR(0x0001) | The p_pre_queue parameter is specified as NULL. |