+ *
+ * category |
+ * macro |
+ * description |
+ *
+ *
+ * Legacy Advertising PDU type |
+ * BLE_GAP_LEGACY_PROP_ADV_IND(0x0013) |
+ * Connectable and scannable undirected Legacy Advertising Packet |
+ *
+ *
+ * BLE_GAP_LEGACY_PROP_ADV_DIRECT_IND(0x0015) |
+ * Connectable directed (low duty cycle) Legacy Advertising Packet |
+ *
+ *
+ * BLE_GAP_LEGACY_PROP_ADV_HDC_DIRECT_IND(0x001D) |
+ * Connectable directed (high duty cycle) Legacy Advertising Packet |
+ *
+ *
+ * BLE_GAP_LEGACY_PROP_ADV_SCAN_IND(0x0012) |
+ * Scannable undirected Legacy Advertising Packet |
+ *
+ *
+ * BLE_GAP_LEGACY_PROP_ADV_NONCONN_IND(0x0010) |
+ * Non-connectable and non-scannable undirected Legacy Advertising Packet |
+ *
+ *
+ * Extended Advertising PDU type |
+ * BLE_GAP_EXT_PROP_ADV_CONN_NOSCAN_UNDIRECT(0x0001) |
+ * Connectable and non-scannable undirected Extended Advertising Packet |
+ *
+ *
+ * BLE_GAP_EXT_PROP_ADV_CONN_NOSCAN_DIRECT(0x0005) |
+ * Connectable and non-scannable directed (low duty cycle) Extended Advertising Packet |
+ *
+ *
+ * BLE_GAP_EXT_PROP_ADV_CONN_NOSCAN_HDC_DIRECT(0x000D) |
+ * Connectable and non-scannable directed (high duty cycle) Extended Advertising Packet |
+ *
+ *
+ * BLE_GAP_EXT_PROP_ADV_NOCONN_SCAN_UNDIRECT(0x0002) |
+ * Non-connectable and scannable undirected Extended Advertising Packet |
+ *
+ *
+ * BLE_GAP_EXT_PROP_ADV_NOCONN_SCAN_DIRECT(0x0006) |
+ * Non-connectable and scannable directed (low duty cycle) Extended Advertising Packet |
+ *
+ *
+ * BLE_GAP_EXT_PROP_ADV_NOCONN_SCAN_HDC_DIRECT(0x000E) |
+ * Non-connectable and scannable directed (high duty cycle) Extended Advertising Packet |
+ *
+ *
+ * BLE_GAP_EXT_PROP_ADV_NOCONN_NOSCAN_UNDIRECT(0x0000) |
+ * Non-connectable and non-scannable undirected Extended Advertising Packet |
+ *
+ *
+ * BLE_GAP_EXT_PROP_ADV_NOCONN_NOSCAN_DIRECT(0x0004) |
+ * Non-connectable and non-scannable directed (low duty cycle) Extended Advertising Packet |
+ *
+ *
+ * BLE_GAP_EXT_PROP_ADV_NOCONN_NOSCAN_HDC_DIRECT(0x000C) |
+ * Non-connectable and non-scannable directed (high duty cycle) Extended Advertising Packet |
+ *
+ *
+ * Extended Advertising Option |
+ * BLE_GAP_EXT_PROP_ADV_ANONYMOUS(0x0020) |
+ * Omit the advertiser address from Extended Advertising Packet. |
+ *
+ *
+ * BLE_GAP_EXT_PROP_ADV_INCLUDE_TX_POWER(0x0040) |
+ * Indicate that the advertising data includes TX Power. |
+ *
+ *
+ */
+ uint16_t adv_prop_type;
+
+ /**
+ * @brief Minimum advertising interval.
+ * @details
+ * Time(ms) = adv_intv_min * 0.625.\n
+ * Valid range is 0x00000020 - 0x00FFFFFF.
+ */
+ uint32_t adv_intv_min;
+
+ /**
+ * @brief Maximum Advertising interval.
+ * @details
+ * Time(ms) = adv_intv_max * 0.625.\n
+ * Valid range is 0x00000020 - 0x00FFFFFF.
+ */
+ uint32_t adv_intv_max;
+
+ /**
+ * @brief The adv_ch_map is channels used in advertising with primary advertising channels.
+ * @details
+ * It is a bitwise OR of the following values.
+ * | macro | description |
+ * |:------------------------- |:----------------- |
+ * | BLE_GAP_ADV_CH_37(0x01) | Use 37 CH. |
+ * | BLE_GAP_ADV_CH_38(0x02) | Use 38 CH. |
+ * | BLE_GAP_ADV_CH_39(0x04) | Use 39 CH. |
+ * | BLE_GAP_ADV_CH_ALL(0x07) | Use 37 - 39 CH. |
+ */
+ uint8_t adv_ch_map;
+
+ /**
+ * @brief Own BD Address Type.
+ * @details
+ *
+ *
+ * macro |
+ * description |
+ *
+ *
+ * BLE_GAP_ADV_ALLOW_SCAN_ANY_CONN_ANY(0x00) |
+ * Process scan and connection requests from all devices. |
+ *
+ *
+ * BLE_GAP_ADV_ALLOW_SCAN_WLST_CONN_ANY(0x01) |
+ *
+ * Process connection requests from all devices and scan requests
+ * from only devices that are in the White List.
+ * |
+ *
+ *
+ * BLE_GAP_ADV_ALLOW_SCAN_ANY_CONN_WLST(0x02) |
+ *
+ * Process scan requests from all devices and connection requests from
+ * only devices that are in the White List.
+ * |
+ *
+ *
+ * BLE_GAP_ADV_ALLOW_SCAN_WLST_CONN_WLST(0x03) |
+ * Process scan and connection requests from only devices in the White List. |
+ *
+ *
+ */
+ uint8_t filter_policy;
+
+ /**
+ * @brief Primary ADV PHY.
+ * @details
+ * In this parameter, only 1M PHY and Coded PHY can be specified, and 2M PHY cannot be specified.
+ *
+ *
+ * macro |
+ * description |
+ *
+ *
+ * BLE_GAP_SCAN_ALLOW_ADV_ALL(0x00) |
+ *
+ * Accept all advertising and scan response PDUs except directed advertising
+ * PDUs not addressed to local device.
+ * |
+ *
+ *
+ * BLE_GAP_SCAN_ALLOW_ADV_WLST(0x01) |
+ *
+ * Accept only advertising and scan response PDUs from remote devices
+ * whose address is registered in the White List.
+ * Directed advertising PDUs which are not addressed to local device is ignored.
+ * |
+ *
+ *
+ * BLE_GAP_SCAN_ALLOW_ADV_EXCEPT_DIRECTED(0x02) |
+ *
+ * Accept all advertising and scan response PDUs except directed advertising
+ * PDUs whose the target address is identity address but doesn't address local device.
+ * However directed advertising PDUs whose the target address is the local resolvable private address
+ * are accepted.
+ * |
+ *
+ *
+ * BLE_GAP_SCAN_ALLOW_ADV_EXCEPT_DIRECTED_WLST(0x03) |
+ * Accept all advertising and scan response PDUs.
+ * The following are excluded.
+ *
+ * -
+ * Advertising and scan response PDUs where the advertiser's
+ * identity address is not in the White List.
+ *
+ * -
+ * Directed advertising PDUs whose the target address is identity address
+ * but doesn't address local device.
+ * However directed advertising PDUs whose the target address is the local
+ * resolvable private address are accepted.
+ *
+ *
+ * |
+ *
+ *
+ */
+ uint8_t filter_policy;
+
+ /**
+ * @brief Scan parameters 1M PHY.
+ * @details When this field is NULL, Controller doesn't set the scan parameters for 1M PHY.
+ */
+ st_ble_gap_scan_phy_param_t * p_phy_param_1M;
+
+ /**
+ * @brief Scan parameters Coded PHY.
+ * @details When this field is NULL, Controller doesn't set the scan parameters for Coded PHY.
+ */
+ st_ble_gap_scan_phy_param_t * p_phy_param_coded;
+} st_ble_gap_ext_scan_param_t;
+
+/******************************************************************************************************************//**
+ * @brief Scan parameters.
+ * @sa st_ble_gap_ext_scan_param_t
+ **********************************************************************************************************************/
+typedef st_ble_gap_ext_scan_param_t st_ble_gap_scan_param_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gap_scan_on_t
+ * @brief Parameters configured when scanning starts.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief Procedure type.
+ * @details
+ *
+ *
+ * macro |
+ * description |
+ *
+ *
+ * BLE_GAP_IOCAP_DISPLAY_ONLY(0x00) |
+ *
+ * Output function : Local device has the ability to display a 6 digit decimal number.
+ * Input function : None
+ * |
+ *
+ *
+ * BLE_GAP_IOCAP_DISPLAY_YESNO(0x01) |
+ *
+ * Output function : Output function : Local device has the ability to
+ * display a 6 digit decimal number.
+ * Input function : Local device has the ability to indicate 'yes' or 'no'
+ * |
+ *
+ *
+ * BLE_GAP_IOCAP_KEYBOARD_ONLY(0x02) |
+ *
+ * Output function : None
+ * Input function : Local device has the ability to input the number '0' - '9'.
+ * |
+ *
+ *
+ * BLE_GAP_IOCAP_NOINPUT_NOOUTPUT(0x03) |
+ *
+ * Output function : None
+ * Input function : None
+ * |
+ *
+ *
+ * BLE_GAP_IOCAP_KEYBOARD_DISPLAY(0x04) |
+ *
+ * Output function : Output function : Local device has the ability to
+ * display a 6 digit decimal number.
+ * Input function : Local device has the ability to input the number '0' - '9'.
+ * |
+ *
+ *
+ */
+ uint8_t iocap;
+
+ /**
+ * @brief MITM protection policy.
+ * @details
+ * Select one of the following.
+ * | macro | description |
+ * |:---------------------------------- |:------------------------------ |
+ * | BLE_GAP_SEC_MITM_BEST_EFFORT(0x00) | MITM Protection not required. |
+ * | BLE_GAP_SEC_MITM_STRICT (0x01) | MITM Protection required. |
+ */
+ uint8_t mitm;
+
+ /**
+ * @brief Bonding policy.
+ * @details
+ * | macro | description |
+ * |:---------------------------------- |:------------------------------------------------- |
+ * | BLE_GAP_BONDING_NONE(0x00) | Local device doesn't stores Bonding information. |
+ * | BLE_GAP_BONDING (0x01) | Local device stores Bonding information. |
+ */
+ uint8_t bonding;
+
+ /**
+ * @brief Maximum LTK size(in bytes).
+ * @details
+ * Valid range is 7 - 16.\n
+ * This field shall be set to a value not less than the min_key_size field.
+ */
+ uint8_t max_key_size;
+
+ /**
+ * @brief Minimum LTK size(in bytes).
+ * @details
+ * Valid range is 7 - 16.\n
+ * This field shall be set to a value not more than the max_key_size field.
+ */
+ uint8_t min_key_size;
+
+ /**
+ * @brief Type of keys to be distributed from local device.
+ * @details
+ * The loc_key_dist field is set to a bitwise OR of the following values.
+ * | macro | description |
+ * |:-------------------------------|:--------------------------- |
+ * | BLE_GAP_KEY_DIST_ENCKEY(0x01) | LTK |
+ * | BLE_GAP_KEY_DIST_IDKEY(0x02) | IRK and Identity Address. |
+ * | BLE_GAP_KEY_DIST_SIGNKEY(0x04) | CSRK |
+ */
+ uint8_t loc_key_dist;
+
+ /**
+ * @brief Type of keys which local device requests a remote device to distribute.
+ * @details
+ * The rem_key_dist field is set to a bitwise OR of the following values.
+ *
+ *
+ * macro |
+ * description |
+ *
+ *
+ * BLE_GATT_DB_NO_AUXILIARY_PROPERTY(0x00) |
+ *
+ * No auxiliary properties.\n
+ * 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.\n
+ * 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.\n
+ * Writing from Client and setting from Server are prohibited.
+ * |
+ *
+ *
+ */
+ uint8_t aux_prop;
+
+ /**
+ * @brief The length of the attribute value is specified.
+ */
+ uint16_t length;
+
+ /**
+ * @brief The position of the next attribute with the same UUID
+ * as the defined attribute is specified by an attribute handle.
+ */
+ uint16_t next;
+
+ /**
+ * @brief The storage area of attribute value.
+ * @details 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.
+ */
+ uint16_t uuid_offset;
+
+ /**
+ * @brief Storage area of attribute value.
+ * @details The address in the array registered in No.1-No.4 is specified to set the attribute value storage area of the defined attribute.
+ */
+ uint8_t * p_data_offset;
+} st_ble_gatts_db_attr_cfg_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gatts_db_attr_list_t
+ * @brief The number of attributes are stored.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief The number of the services or the characteristics.
+ */
+ uint8_t count;
+} st_ble_gatts_db_attr_list_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gatts_db_char_cfg_t
+ * @brief A structure that defines the detailed information of the characteristics.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief The total number of attributes in the defined characteristic is specified.
+ */
+ st_ble_gatts_db_attr_list_t list;
+
+ /**
+ * @brief The first attribute handle of the characteristic is specified.
+ */
+ uint16_t start_hdl;
+
+ /**
+ * @brief The index of service to which the characteristic belongs is specified.
+ */
+ uint8_t service_id;
+} st_ble_gatts_db_char_cfg_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gatts_db_serv_cfg_t
+ * @brief A structure that defines the detailed information of the characteristics.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief The total number of service declarations in the defined service is specified.
+ */
+ st_ble_gatts_db_attr_list_t list;
+
+ /**
+ * @brief The properties of the defined service are specified.
+ * @details 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.
+ * |
+ *
+ *
+ *
+ *
+ * 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. |
+ *
+ *
+ *
+ *
+ * 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. |
+ *
+ *
+ */
+ uint16_t rsp_code;
+} st_ble_gattc_err_rsp_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gattc_ntf_evt_t
+ * @brief This structure notifies that a Notification PDU has been received from a GATT Server.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief Characteristic that causes the Notification.
+ */
+ st_ble_gatt_hdl_value_pair_t data;
+} st_ble_gattc_ntf_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gattc_ind_evt_t
+ * @brief This structure notifies that a Indication PDU has been received from a GATT Server.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief Characteristic that causes the Indication.
+ */
+ st_ble_gatt_hdl_value_pair_t data;
+} st_ble_gattc_ind_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gattc_rd_char_evt_t
+ * @brief This structure notifies that read response to R_BLE_GATTC_ReadChar() or R_BLE_GATTC_ReadCharUsingUuid()
+ * has been received from a GATT Server.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief The contents of the Characteristic that has been read.
+ */
+ st_ble_gatt_hdl_value_pair_t read_data;
+} st_ble_gattc_rd_char_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gattc_wr_char_evt_t
+ * @brief This structure notifies that write response to R_BLE_GATTC_WriteChar() has been received from a GATT Server.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief Value Handle of the Characteristic/Characteristic Descriptor that has been written.
+ */
+ uint16_t value_hdl;
+} st_ble_gattc_wr_char_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gattc_rd_multi_char_evt_t
+ * @brief This structure notifies that read response to R_BLE_GATTC_ReadMultiChar() has been received
+ * from a GATT Server.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief The number of Value Handles of the Characteristics that has been read.
+ */
+ uint16_t value_hdl_num;
+
+ /**
+ * @brief The contents of multiple Characteristics that have been read.
+ */
+ st_ble_gatt_value_t multi_char_val;
+} st_ble_gattc_rd_multi_char_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gattc_char_part_wr_evt_t
+ * @brief This structure notifies that write response to R_BLE_GATTC_WriteLongChar() or R_BLE_GATTC_ReliableWrites()
+ * has been received from a GATT Server.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief The data to be written to the Characteristic/Long Characteristic/Long Characteristic Descriptor.
+ */
+ st_ble_gatt_hdl_value_pair_t write_data;
+
+ /**
+ * @brief Offset that indicates the location to be written.
+ */
+ uint16_t offset;
+} st_ble_gattc_char_part_wr_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gattc_reliable_writes_comp_evt_t
+ * @brief This structure notifies that a response to R_BLE_GATTC_ExecWrite() has been received
+ * from a GATT Server.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief This field indicates the command of the Execute Write that has been done.
+ * @details
+ * | value | description |
+ * |:-----------|:------------------- |
+ * | 0x00 | Cancel the write. |
+ * | 0x01 | Execute the write. |
+ */
+ uint8_t exe_flag;
+} st_ble_gattc_reliable_writes_comp_evt_t;
+
+/* RBLE GATT Client Command Parameters */
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gattc_rd_multi_req_param_t
+ * @brief This is used in R_BLE_GATTC_ReadMultiChar() to specify multiple Characteristics to be read.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief List of Value Handles that point the Characteristics to be read.
+ */
+ uint16_t * p_hdl_list;
+
+ /**
+ * @brief The number of Value Handles included in the hdl_list parameter.
+ */
+ uint16_t list_count;
+} st_ble_gattc_rd_multi_req_param_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_gattc_evt_data_t
+ * @brief st_ble_gattc_evt_data_t is the type of the data notified in a GATT Client Event.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief Connection handle identifying the GATT Server.
+ */
+ uint16_t conn_hdl;
+
+ /**
+ * @brief The size of GATT Client Event parameters.
+ */
+ uint16_t param_len;
+
+ /**
+ * @brief GATT Client Event parameters. This parameter differs in each GATT Client Event.
+ */
+ void * p_param;
+} st_ble_gattc_evt_data_t;
+
+/******************************************************************************************************************//**
+ * @typedef ble_gattc_app_cb_t
+ * @brief ble_gattc_app_cb_t is the GATT Client Event callback function type.
+ * @param[in] event_type The type of GATT Client Event.
+ * @param[in] event_result The result of GATT Client Event
+ * @param[in] p_event_data Data notified by GATT Client Event.
+ * @return none
+ **********************************************************************************************************************/
+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);
+
+/*@}*/
+
+/* ============================================= L2CAP Type Definitions ============================================= */
+
+/** @addtogroup L2CAP_API
+ * @ingroup BLE_API
+ * @{
+ */
+
+/******************************************************************************************************************//**
+ * @ingroup L2CAP_API
+ * @struct st_ble_l2cap_conn_req_param_t
+ * @brief L2CAP CBFC Channel connection request parameters.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief Identifier indicating the protocol/profile that uses L2CAP CBFC Channel on local device.
+ */
+ uint16_t local_psm;
+
+ /**
+ * @brief Identifier indicating the protocol/profile that uses L2CAP CBFC Channel on remote device.
+ */
+ uint16_t remote_psm;
+
+ /**
+ * @brief MTU size(byte) receivable on L2CAP CBFC Channel.
+ */
+ uint16_t mtu;
+
+ /**
+ * @brief MPS size(byte) receivable on L2CAP CBFC Channel.
+ */
+ uint16_t mps;
+
+ /**
+ * @brief The number of LE-Frame that local device can receive.
+ */
+ uint16_t credit;
+} st_ble_l2cap_conn_req_param_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_l2cap_conn_rsp_param_t
+ * @brief L2CAP CBFC Channel connection response parameters.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief CID identifying the L2CAP CBFC Channel on local device.
+ * The valid range is 0x40-0x40 + BLE_L2CAP_MAX_CBFC_PSM - 1.
+ */
+ uint16_t lcid;
+
+ /**
+ * @brief The response to the connection request. Select one of the following.
+ *
+ *
+ * macro |
+ * description |
+ *
+ *
+ * BLE_L2CAP_CF_RSP_SUCCESS(0x0000) |
+ * Notify the remote device that the connection can be established. |
+ *
+ *
+ * BLE_L2CAP_CF_RSP_RFSD_INSF_AUTH(0x0005) |
+ * Notify the remote device that the connection can not be established
+ * because of insufficient authentication. |
+ *
+ *
+ * BLE_L2CAP_CF_RSP_RFSD_INSF_AUTRZ(0x0006) |
+ * Notify the remote device that the connection can not be established
+ * because of insufficient Authorization. |
+ *
+ *
+ * BLE_L2CAP_CF_RSP_RFSD_INSF_ENC_KEY(0x0007) |
+ * Notify the remote device that the connection can not be established
+ * because of Encryption Key Size. |
+ *
+ *
+ * BLE_L2CAP_CF_RSP_RFSD_INSF_ENC(0x0008) |
+ * Notify the remote device that the connection can not be established
+ * because of Encryption. |
+ *
+ *
+ * BLE_L2CAP_CF_RSP_RFSD_UNAC_PARAM(0x000B) |
+ * Notify the remote device that the connection can not be established
+ * because the parameters is unacceptable to local device. |
+ *
+ *
+ */
+ uint16_t response;
+
+ /**
+ * @brief MTU(byte) of packet that L2CAP CBFC Channel on local device can receive.
+ */
+ uint16_t mtu;
+
+ /**
+ * @brief MPS(byte) of packet that L2CAP CBFC Channel on local device can receive.
+ */
+ uint16_t mps;
+
+ /**
+ * @brief The number of LE-Frame that L2CAP CBFC Channel on local device can receive.
+ */
+ uint16_t credit;
+} st_ble_l2cap_conn_rsp_param_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_l2cap_cf_conn_evt_t
+ * @brief L2CAP CBFC Channel connection parameters.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief CID identifying the L2CAP CBFC Channel.
+ */
+ uint16_t cid;
+
+ /**
+ * @brief PSM allocated by the cid field.
+ */
+ uint16_t psm;
+
+ /**
+ * @brief MTU of local/remote device.
+ */
+ uint16_t mtu;
+
+ /**
+ * @brief MPS of local/remote device.
+ */
+ uint16_t mps;
+
+ /**
+ * @brief Credit of local/remote device.
+ */
+ uint16_t credit;
+} st_ble_l2cap_cf_conn_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_l2cap_cf_data_evt_t
+ * @brief Sent/Received Data parameters.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief CID identifying the L2CAP CBFC Channel that has sent or received the data .
+ */
+ uint16_t cid;
+
+ /**
+ * @brief PSM allocated by the cid field.
+ */
+ uint16_t psm;
+
+ /**
+ * @brief Data length.
+ */
+ uint16_t data_len;
+
+ /**
+ * @brief Sent/Received data.
+ */
+ uint8_t * p_data;
+} st_ble_l2cap_cf_data_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_l2cap_cf_credit_evt_t
+ * @brief Credit parameters of local or remote device.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief CID identifying the L2CAP CBFC Channel.
+ */
+ uint16_t cid;
+
+ /**
+ * @brief PSM allocated by the cid field.
+ */
+ uint16_t psm;
+
+ /**
+ * @brief Current credit of local/remote device.
+ */
+ uint16_t credit;
+} st_ble_l2cap_cf_credit_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_l2cap_cf_disconn_evt_t
+ * @brief Disconnection parameters.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief CID identifying the L2CAP CBFC Channel that has been disconnected.
+ */
+ uint16_t cid;
+} st_ble_l2cap_cf_disconn_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_l2cap_rej_evt_t
+ * @brief Command Reject parameters.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief The reason that the remote device has sent Command Reject.
+ */
+ uint16_t reason;
+
+ /**
+ * @brief Optional information about the reason that the remote device has sent Command Reject.
+ */
+ uint16_t data_1;
+
+ /**
+ * @brief Optional information about the reason that the remote device has sent Command Reject.
+ */
+ uint16_t data_2;
+} st_ble_l2cap_rej_evt_t;
+
+/******************************************************************************************************************//**
+ * @struct st_ble_l2cap_cf_evt_data_t
+ * @brief st_ble_l2cap_cf_evt_data_t is the type of the data notified in a L2CAP Event.
+ **********************************************************************************************************************/
+typedef struct
+{
+ /**
+ * @brief Connection handle identifying the remote device.
+ */
+ uint16_t conn_hdl;
+
+ /**
+ * @brief The size of L2CAP Event parameters.
+ */
+ uint16_t param_len;
+
+ /**
+ * @brief L2CAP Event parameters. This parameter differs in each L2CAP Event.
+ */
+ void * p_param;
+} st_ble_l2cap_cf_evt_data_t;
+
+/******************************************************************************************************************//**
+ * @typedef ble_l2cap_cf_app_cb_t
+ * @brief ble_l2cap_cf_app_cb_t is the L2CAP Event callback function type.
+ * @param[in] event_type The type of L2CAP Event.
+ * @param[in] event_result The result of L2CAP Event
+ * @param[in] p_event_data Data notified by L2CAP Event.
+ * @return none
+ **********************************************************************************************************************/
+typedef void (* ble_l2cap_cf_app_cb_t)(uint16_t event_type, ble_status_t event_result,
+ st_ble_l2cap_cf_evt_data_t * p_event_data);
+
+/*@}*/
+
+/* ================================================ L2CAP Event Code ================================================ */
+
+/** @addtogroup L2CAP_API
+ * @ingroup BLE_API
+ * @{
+ */
+
+/******************************************************************************************************************//**
+ * @ingroup L2CAP_API
+ * @enum e_r_ble_l2cap_cf_evt_t
+ * @brief L2CAP Event Identifier
+ **********************************************************************************************************************/
+typedef enum
+{
+ /**
+ * @brief After the connection request for L2CAP CBFC Channel has been sent with R_BLE_L2CAP_ReqCfConn(),
+ * when the L2CAP CBFC Channel connection response has been received,
+ * BLE_L2CAP_EVENT_CF_CONN_CNF event occurs.
+ *
+ * ## Event Code: 0x5001
+ *
+ * ## result:
+ *
+ *
+ * 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. |
+ *
+ *
+ *
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_ARG(0x0003) The Group ID of the error_code parameter is not 0x3000, or it is 0x3000.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other error response,this function was called.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTS_SendErrRsp(uint16_t error_code);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTS_RspExMtu(uint16_t conn_hdl, uint16_t mtu)
+ * @brief This function replies to a MTU Exchange Request from a remote device.
+ * @details 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.\n
+ * 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.\n
+ * Default MTU size is 23 bytes.\n
+ * The result of this API call is returned by a return value.\n
+ * @param[in] conn_hdl Connection handle identifying the remote device to be sent MTU Exchange Response.
+ * @param[in] mtu The maximum size(in bytes) of the GATT PDU that GATT Server can receive.\n
+ * Valid range is 23 <= mtu <= 247.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_ARG(0x0003) The mtu parameter is out of range.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) This function was called while processing other request.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The remote device specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTS_RspExMtu(uint16_t conn_hdl, uint16_t mtu);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTS_SetPrepareQueue(st_ble_gatt_pre_queue_t * p_pre_queues, uint8_t queue_num)
+ * @brief Register prepare queue and buffer in Host Stack.
+ * @details 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.\n
+ * @param[in] p_pre_queues The prepare write queues to be registered.
+ * @param[in] queue_num The number of prepare write queues to be registered.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The p_pre_queue parameter is specified as NULL.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTS_SetPrepareQueue(st_ble_gatt_pre_queue_t * p_pre_queues, uint8_t queue_num);
+
+/*@}*/
+
+/* ========================================== GATT Client API Declarations ========================================== */
+
+/** @defgroup GATT_CLIENT_API GATT_CLIENT
+ * @ingroup BLE_API
+ * @{
+ */
+
+/******************************************************************************************************************//**
+ * @ingroup GATT_CLIENT_API
+ * @fn ble_status_t R_BLE_GATTC_Init(uint8_t cb_num)
+ * @brief This function initializes the GATT Client and registers the number of the callbacks for GATT Client event.
+ * @details Specify the cb_num parameter to a value between 1 and BLE_GATTC_MAX_CB.\n
+ * R_BLE_GATTC_RegisterCb() registers the callback.\n
+ * The result of this API call is returned by a return value.
+ * @param[in] cb_num The number of callbacks to be registered.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_ARG(0x0003) The cb_num parameter is out of range.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_Init(uint8_t cb_num);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_RegisterCb(ble_gattc_app_cb_t cb, uint8_t priority)
+ * @brief This function registers a callback function for GATT Client event.
+ * @details The number of the callback that may be registered by this function is the value specified
+ * by R_BLE_GATTC_Init().\n
+ * The result of this API call is returned by a return value.
+ * @param[in] cb Callback function for GATT Client event.
+ * @param[in] priority The priority of the callback function.\n
+ * Valid range is 1 <= priority <= BLE_GATTC_MAX_CB.\n
+ * A lower priority number means a higher priority level.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The cb parameter is specified as NULL.
+ * @retval BLE_ERR_INVALID_ARG(0x0003) The priority parameter is out of range.
+ * @retval BLE_ERR_CONTEXT_FULL(0x000B) Host stack has already registered the maximum number of callbacks.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_RegisterCb(ble_gattc_app_cb_t cb, uint8_t priority);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_DeregisterCb(ble_gattc_app_cb_t cb)
+ * @brief This function deregisters the callback function for GATT Client event.
+ * @details The result of this API call is returned by a return value.
+ * @param[in] cb The callback function to be deregistered.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The cb parameter is specified as NULL.
+ * @retval BLE_ERR_NOT_FOUND(0x000D) The callback has not been registered.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_DeregisterCb(ble_gattc_app_cb_t cb);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_ReqExMtu(uint16_t conn_hdl, uint16_t mtu)
+ * @brief This function sends a MTU Exchange Request PDU to a GATT Server in order to change the current MTU.
+ * @details MTU Exchange Response is notified by BLE_GATTC_EVENT_EX_MTU_RSP event.\n
+ * 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.\n
+ * The result of this API call is returned by a return value.\n
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be sent.
+ * @param[in] mtu The maximum size(in bytes) of the GATT PDU that GATT Client can receive. \n
+ * Valid range is 23 <= mtu <= 247.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_ARG(0x0003) The mtu parameter is out of range.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_ReqExMtu(uint16_t conn_hdl, uint16_t mtu);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_DiscAllPrimServ(uint16_t conn_hdl)
+ * @brief This function discovers all Primary Services in a GATT Server.
+ * @details When 16-bit UUID Primary Service has been discovered, BLE_GATTC_EVENT_PRIM_SERV_16_DISC_IND event
+ * is notified to the application layer.\n
+ * When 128-bit UUID Primary Service has been discovered, BLE_GATTC_EVENT_PRIM_SERV_128_DISC_IND event
+ * is notified to the application layer.\n
+ * When the Primary Service discovery has been completed, BLE_GATTC_EVENT_ALL_PRIM_SERV_DISC_COMP event
+ * is notified to the application layer.
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be discovered.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) This function was called while processing other request.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_DiscAllPrimServ(uint16_t conn_hdl);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_DiscPrimServ(uint16_t conn_hdl, uint8_t * p_uuid, uint8_t uuid_type)
+ * @brief This function discovers Primary Service specified by p_uuid in a GATT Server.
+ * @details 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.\n
+ * When the Primary Service discovery has been completed, BLE_GATTC_EVENT_PRIM_SERV_DISC_COMP event
+ * is notified to the application layer.
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be discovered.
+ * @param[in] p_uuid UUID of Primary Service to be discovered.
+ * @param[in] uuid_type UUID 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 |
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The p_uuid parameter is specified as NULL.
+ * @retval BLE_ERR_INVALID_ARG(0x0003) The uuid_type parameter is out of range.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_DiscPrimServ(uint16_t conn_hdl, uint8_t * p_uuid, uint8_t uuid_type);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_DiscAllSecondServ( uint16_t conn_hdl)
+ * @brief This function discovers all Secondary Services in a GATT Server.
+ * @details 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.\n
+ * 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.\n
+ * When the Secondary Service discovery has been completed, BLE_GATTC_EVENT_ALL_SECOND_SERV_DISC_COMP event
+ * is notified to the application layer.\n
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be discovered.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_DiscAllSecondServ(uint16_t conn_hdl);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_DiscIncServ(uint16_t conn_hdl, st_ble_gatt_hdl_range_t * p_range)
+ * @brief This function discovers Included Services within the specified attribute handle range in a GATT Server.
+ * @details 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.\n
+ * 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.\n
+ * When the Included Service discovery has been completed,
+ * BLE_GATTC_EVENT_INC_SERV_DISC_COMP event is notified to the application layer.\n
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be discovered.
+ * @param[in] p_range Retrieval range of Included Service.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The p_range parameter is specified as NULL.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_DiscIncServ(uint16_t conn_hdl, st_ble_gatt_hdl_range_t * p_range);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_DiscAllChar(uint16_t conn_hdl, st_ble_gatt_hdl_range_t * p_range)
+ * @brief This function discovers Characteristic within the specified attribute handle range in a GATT Server.
+ * @details When 16-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_16_DISC_IND event
+ * is notified to the application layer.\n
+ * When 128-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_128_DISC_IND event
+ * is notified to the application layer.\n
+ * When the Characteristic discovery has been completed, BLE_GATTC_EVENT_ALL_CHAR_DISC_COMP event
+ * is notified to the application layer.\n
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be discovered.
+ * @param[in] p_range Retrieval range of Characteristic.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The p_range parameter is specified as NULL.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_DiscAllChar(uint16_t conn_hdl, st_ble_gatt_hdl_range_t * p_range);
+
+/******************************************************************************************************************//**
+ * @fn 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
+ * )
+ * @brief This function discovers Characteristic specified by uuid within the specified attribute handle range
+ * in a GATT Server.
+ * @details When 16-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_16_DISC_IND event
+ * is notified to the application layer.\n
+ * When 128-bit UUID Characteristic has been discovered, BLE_GATTC_EVENT_CHAR_128_DISC_IND event
+ * is notified to the application layer.\n
+ * When the Characteristic discovery has been completed, BLE_GATTC_EVENT_CHAR_DISC_COMP event
+ * is notified to the application layer.\n
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be discovered.
+ * @param[in] p_uuid UUID of Characteristic to be discovered.
+ * @param[in] uuid_type UUID 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. |
+ * @param[in] p_range Retrieval range of Characteristic.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The p_uuid parameter or the p_range parameter is specified as NULL.
+ * @retval BLE_ERR_INVALID_ARG(0x0003) The uuid_type parameter is out of range.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+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);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_DiscAllCharDesc(uint16_t conn_hdl, st_ble_gatt_hdl_range_t * p_range)
+ * @brief This function discovers Characteristic Descriptor within the specified attribute handle range
+ * in a GATT Server.
+ * @details 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.
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be discovered.
+ * @param[in] p_range Retrieval range of Characteristic Descriptor.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The p_range parameter is specified as NULL.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_DiscAllCharDesc(uint16_t conn_hdl, st_ble_gatt_hdl_range_t * p_range);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_ReadChar(uint16_t conn_hdl, uint16_t value_hdl)
+ * @brief This function reads a Characteristic/Characteristic Descriptor in a GATT Server.
+ * @details The result of the read is notified in BLE_GATTC_EVENT_CHAR_READ_RSP event.
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be read.
+ * @param[in] value_hdl Value handle of the Characteristic/Characteristic Descriptor to be read.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_ARG(0x0003) 0 is specified in the value_hdl parameter.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_ReadChar(uint16_t conn_hdl, uint16_t value_hdl);
+
+/******************************************************************************************************************//**
+ * @fn 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
+ * );
+ * @brief This function reads a Characteristic in a GATT Server using a specified UUID.
+ * @details The result of the read is notified in BLE_GATTC_EVENT_CHAR_READ_BY_UUID_RSP event.
+ * @param[in] conn_hdl Connection handle that identifies Characteristic to be read to GATT Server.
+ * @param[in] p_uuid UUID of the Characteristic to be read.
+ * @param[in] uuid_type UUID 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. |
+ * @param[in] p_range Retrieval range of Characteristic.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The p_uuid parameter or the p_range parameter is specified as NULL.
+ * @retval BLE_ERR_INVALID_ARG(0x0003) The uuid_type parameter is out of range.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+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);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_ReadLongChar(uint16_t conn_hdl, uint16_t value_hdl, uint16_t offset)
+ * @brief This function reads a Long Characteristic in a GATT Server.
+ * @details 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.\n
+ * 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.
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be read.
+ * @param[in] value_hdl Value handle of the Long Characteristic to be read.
+ * @param[in] offset Offset that indicates the location to be read.\n
+ * Normally, set 0 to this parameter.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_ARG(0x0003) 0 is specified in the value_hdl parameter.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_ReadLongChar(uint16_t conn_hdl, uint16_t value_hdl, uint16_t offset);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_ReadMultiChar(uint16_t conn_hdl, st_ble_gattc_rd_multi_req_param_t * p_list)
+ * @brief This function reads multiple Characteristics in a GATT Server.
+ * @details 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.
+ * @param[in] conn_hdl Connection handle that identifies Characteristic to be read to GATT Server.
+ * @param[in] p_list List of Value Handles that point the Characteristics to be read.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_PTR(0x0001) The p_list parameter or the p_hdl_list field in the p_list parameter is
+ * specified as NULL.
+ * @retval BLE_ERR_INVALID_ARG(0x0003) 0 is specified in the list_count field in the p_list parameter.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_ReadMultiChar(uint16_t conn_hdl, st_ble_gattc_rd_multi_req_param_t * p_list);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_WriteCharWithoutRsp(uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t * p_write_data)
+ * @brief This function writes a Characteristic in a GATT Server without response.
+ * @details The result is returned from the API.
+ * @param[in] conn_hdl Connection handle that identifies Characteristic to be read to GATT Server.
+ * @param[in] p_write_data Value to be written to the Characteristic.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval 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.
+ * @retval 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.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_WriteCharWithoutRsp(uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t * p_write_data);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_SignedWriteChar(uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t * p_write_data)
+ * @brief This function writes Signed Data to a Characteristic in a GATT Server without response.
+ * @details The result of this API call is returned by a return value.
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be written.
+ * @param[in] p_write_data Signed Data to be written to the Characteristic.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval 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.
+ * @retval 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.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function or Signed Data.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_SignedWriteChar(uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t * p_write_data);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_WriteChar(uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t * p_write_data)
+ * @brief This function writes a Characteristic in a GATT Server.
+ * @details The result of the write is notified in BLE_GATTC_EVENT_CHAR_WRITE_RSP event.
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be written.
+ * @param[in] p_write_data Value to be written to the Characteristic.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval 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.
+ * @retval 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.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_WriteChar(uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t * p_write_data);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_WriteLongChar(uint16_t conn_hdl,
+ * st_ble_gatt_hdl_value_pair_t * p_write_data,
+ * uint16_t offset
+ * )
+ * @brief This function writes a Long Characteristic in a GATT Server.
+ * @details 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.\n
+ * The maximum writable size to a Long Characteristic with this function is 512 bytes.\n
+ * 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.
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be written.
+ * @param[in] p_write_data Value to be written to the Long Characteristic.
+ * @param[in] offset Offset that indicates the location to be written.
+ * Normally, set 0 to this parameter.\n
+ * 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.
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval 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.
+ * @retval 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.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_WriteLongChar(uint16_t conn_hdl, st_ble_gatt_hdl_value_pair_t * p_write_data, uint16_t offset);
+
+/******************************************************************************************************************//**
+ * @fn 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
+ * )
+ * @brief This function performs the Reliable Writes procedure described in GATT Specification.
+ * @details When the data written to the Characteristic has been transmitted, BLE_GATTC_EVENT_CHAR_PART_WRITE_RSP
+ * event is notified to the application layer.\n
+ * If the data included in the event is different from the data that GATT Client has sent,
+ * host stack automatically cancels the Reliable Writes.\n
+ * 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.\n
+ * 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().\n
+ * When the write has been done, BLE_GATTC_EVENT_RELIABLE_WRITES_COMP event is notified to
+ * the application layer.
+ * @param[in] conn_hdl Connection handle identifying the GATT Server to be written.
+ * @param[in] p_char_pair Pair of Characteristic Value and Characteristic Value Handle identifying the Characteristic
+ * to be written by Reliable Writes.
+ * @param[in] pair_num The number of the pairs specified by the p_char_pair parameter.\n
+ * Valid range is 0 < pair_num <= BLE_GATTC_RELIABLE_WRITES_MAX_CHAR_PAIR.
+ * @param[in] auto_flag The 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. |
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval 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.
+ * @retval 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.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) While processing other request, this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function or
+ * to store the temporary write data.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+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);
+
+/******************************************************************************************************************//**
+ * @fn ble_status_t R_BLE_GATTC_ExecWrite(uint16_t conn_hdl, uint8_t exe_flag)
+ * @brief 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.
+ * @details When all of the contents has been sent to the GATT Server, BLE_GATTC_EVENT_RELIABLE_WRITES_TX_COMP event
+ * notifies the application layer.\n
+ * After this event has been received, execute the write by this function.\n
+ * The result of the write is notified by BLE_GATTC_EVENT_RELIABLE_WRITES_COMP event.
+ * @param[in] conn_hdl Connection handle identifying the target GATT Server.
+ * @param[in] exe_flag The 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. |
+ * @retval BLE_SUCCESS(0x0000) Success
+ * @retval BLE_ERR_INVALID_ARG(0x0003) The exe_flag parameter is out of range.
+ * @retval BLE_ERR_INVALID_OPERATION(0x0009) The reason for this error is as follows:
+ * - GATT Client has not requested for Reliable Writes by R_BLE_GATTC_ReliableWrites().
+ * - Although auto execution has been specified by R_BLE_GATTC_ReliableWrites(), this function was called.
+ * @retval BLE_ERR_MEM_ALLOC_FAILED(0x000C) Insufficient memory is needed to generate this function.
+ * @retval BLE_ERR_INVALID_HDL(0x000E) The GATT Server specified by conn_hdl was not found.
+ **********************************************************************************************************************/
+ble_status_t R_BLE_GATTC_ExecWrite(uint16_t conn_hdl, uint8_t exe_flag);
+
+/*@}*/
+
+/* ============================================= L2CAP API Declarations ============================================= */
+
+/** @defgroup L2CAP_API L2CAP
+ * @ingroup BLE_API
+ * @{
+ */
+
+/******************************************************************************************************************//**
+ * @ingroup L2CAP_API
+ * @fn ble_status_t R_BLE_L2CAP_RegisterCfPsm(ble_l2cap_cf_app_cb_t cb, uint16_t psm, uint16_t lwm)
+ * @brief This function registers PSM that uses L2CAP CBFC Channel and a callback for L2CAP event.
+ * @details Only one callback is available per PSM. Configure in each PSM the Low Water Mark of the LE-Frames
+ * that the local device can receive.\n
+ * When the number of the credit reaches the Low Water Mark, BLE_L2CAP_EVENT_CF_LOW_RX_CRD_IND event is
+ * notified to the application layer.\n
+ * The number of PSM is defined as BLE_L2CAP_MAX_CBFC_PSM.\n
+ * The result of this API call is returned by a return value.
+ * @param[in] cb Callback function for L2CAP event.
+ * @param[in] psm Identifier indicating the protocol/profile that uses L2CAP CBFC Channel.
+ *