This file contains the declarations of the BLE API functions.

/*******************************************************************************
 * @file  rsi_ble_apis.h
 *******************************************************************************
 * # License
 * <b>Copyright 2024 Silicon Laboratories Inc. www.silabs.com</b>
 *******************************************************************************
 *
 * SPDX-License-Identifier: Zlib
 *
 * The licensor of this software is Silicon Laboratories Inc.
 *
 * This software is provided 'as-is', without any express or implied
 * warranty. In no event will the authors be held liable for any damages
 * arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 *
 * 1. The origin of this software must not be misrepresented; you must not
 *    claim that you wrote the original software. If you use this software
 *    in a product, an acknowledgment in the product documentation would be
 *    appreciated but is not required.
 * 2. Altered source versions must be plainly marked as such, and must not be
 *    misrepresented as being the original software.
 * 3. This notice may not be removed or altered from any source distribution.
 *
 ******************************************************************************/

#ifndef RSI_BLE_APIS_H
#define RSI_BLE_APIS_H

#include "rsi_bt_common.h"

/******************************************************
 * *                      Macros
 * ******************************************************/

/** @addtogroup BT_BLE_CONSTANTS
 *  @{
 */
/// Maximum number of response list for BLE.
#define RSI_BLE_MAX_RESP_LIST 0x05
/// Maximum size of an advertising report.
#define RSI_MAX_ADV_REPORT_SIZE 31
/// Size of the BLE passkey.
#define BLE_PASSKEY_SIZE 6

/// Defines the output power front end loss for BLE
#ifndef BLE_OUTPUT_POWER_FRONT_END_LOSS
#define BLE_OUTPUT_POWER_FRONT_END_LOSS 0 /* db */
#endif

/// Host descriptor length
#define RSI_HOST_DESC_LENGTH 16

/** @} */

/******************************************************
 * *                    Constants
 * ******************************************************/
/******************************************************
 * *                   Enumerations
 * ******************************************************/

/******************************************************
 * *                 Type Definitions
 * ******************************************************/

/******************************************************
 * *                    Structures
******************************************************/

/** @addtogroup BT_BLE_EVENT_TYPES Event Types
  * @{ */

// GAP Event structures

//Advertise report event structure
/**
 * @brief Structure representing a BLE advertising report event.
 */
typedef struct rsi_ble_event_adv_report_s {
  /**Address type of the advertising device */
  uint8_t dev_addr_type;
  /**Address of the advertising device*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**Raw advertisement data length*/
  uint8_t adv_data_len;
  /**advertisement data*/
  uint8_t adv_data[RSI_MAX_ADV_REPORT_SIZE];
  /**Signal strength*/
  int8_t rssi;
  /** Report type 
-
       0x00 Connectable and scannable undirected advertising (ADV_IND) 
-
       0x01 Connectable directed advertising (ADV_DIRECT_IND) 
-
       0x02 Scannable undirected advertising (ADV_SCAN_IND)  
-
       0x03 Non connectable undirected advertising (ADV_NONCONN_IND) 
-
       0x04 Scan Response (SCAN_RSP) 
-
       All other values Reserved for future use*/
  uint8_t report_type;
} rsi_ble_event_adv_report_t;

//Connection status event structure
/**
 * @brief Structure representing the connection status event in the BLE module.
 */
typedef struct rsi_ble_event_conn_status_s {
  /** Address type of the remote device */
  uint8_t dev_addr_type;
  /** Address of the remote device */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Status of the connection - success/failure */
  uint16_t status;
} rsi_ble_event_conn_status_t;

//enhance connection status event structure
/**
 * @brief Structure representing the enhanced connection status event in the BLE module.
 */
typedef struct rsi_ble_event_enhnace_conn_status_s {

  /**Device address type of the Connected Remote Device*/
  uint8_t dev_addr_type;
  /**Device address of the remote device.*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**Local Device resolvable address*/
  uint8_t local_resolvlable_addr[RSI_DEV_ADDR_LEN];
  /**Remote Device resolvable address*/
  uint8_t peer_resolvlable_addr[RSI_DEV_ADDR_LEN];
  /**The role of the device - central/ peripheral*/
  uint8_t role;
  /**Connection interval used on this connection. Range: 0x0006 to 0x0C80*/
  uint16_t conn_interval;
  /**Peripheral latency for the connection in number of connection events. Range: 0x0000 to 0x01F3*/
  uint16_t conn_latency;
  /**Connection supervision timeout. Range: 0x000A to 0x0C80*/
  uint16_t supervision_timeout;
  /**Only applicable for peripheral, for central this value is set to 0x00*/
  uint8_t master_clock_accuracy;
  /**Status of the Connection - success/failure*/
  uint16_t status;
} rsi_ble_event_enhance_conn_status_t;

//Disconnect event structure
/**
 * @brief Disconnection event structure for BLE.
 *
 * This structure contains information about the disconnection event of a BLE device.
 */
typedef struct rsi_ble_event_disconnect_s {
  /** Device address of the remote device */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** The type of the remote device (LE) */
  uint8_t dev_type;
} rsi_ble_event_disconnect_t;

//le ping timeout expired event structure
/**
 * @brief Structure representing the BLE event for LE ping time expiration.
 */
typedef struct rsi_ble_event_le_ping_time_expired_s {
  /**Device address of the remote device*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];

} rsi_ble_event_le_ping_time_expired_t;

//le ltk request event Structure
/**
 * @brief Structure representing a Bluetooth Low Energy (LE) Long Term Key (LTK) request event.
 */
typedef struct rsi_bt_event_le_ltk_request_s {
  /**BD Address of the remote device*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**ediv of local device*/
  uint16_t localediv;
  /**rand of local device*/
  uint8_t localrand[8];
  /**Address type of remote device*/
  uint8_t dev_addr_type;
} rsi_bt_event_le_ltk_request_t;

//le security keys event Structure
/**
 * @brief Structure representing the Bluetooth Low Energy (BLE) event for security keys.
 */
typedef struct rsi_bt_event_le_security_keys_s {
  /**BD Address of the remote device*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**16 byte irk of the local device*/
  uint8_t local_irk[16];
  /**16 byte irk of the remote device*/
  uint8_t remote_irk[16];
  /**remote device ediv value*/
  uint16_t remote_ediv;
  /**remote device rand value*/
  uint8_t remote_rand[16];
  /**remote device ltk value*/
  uint8_t remote_ltk[16];
  /**Identity address type - public/random 
-
      0x00 --> Public Identity Address 
-
      0x01 --> Random (static) Identity Address 
-
      All other values Reserved for future use*/
  uint8_t Identity_addr_type;
  /**Identity address which is resolved after security keys exchange*/
  uint8_t Identity_addr[6];
  /**Device address type*/
  uint8_t dev_addr_type;
} rsi_bt_event_le_security_keys_t;

//encryption enabled structure
/**
 * @brief Structure to hold the event data for encryption enabled event.
 */
typedef struct rsi_bt_event_encryption_enabled_s {
  /**Remote device Address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**Status of the Encryption 
-
      ENCRYPT_ENABLED BIT(0) --> To indicate or set encryption is enabled AUTH_LTK_OR_STK_ENC 
-
      BIT(1) --> To indicate or set Authenticated Pairing and Encryption UN_AUTH_LTK_OR_STK_ENC 
-
      BIT(2) --> To indicate or set UnAuthenticated Pairing and Encryption AUTH_LTK_WITH_LE_SC_ENC 
-
      BIT(3) --> To indicate or set Authenticated Pairing and Encryption with LE SC */
  uint8_t enabled;
  /**BLE Secure Connections Enable/Disable indication 
-
      0 --> Disable 
-
      1 --> Enable */
  uint8_t sc_enable;
  /**Local device EDIV*/
  uint16_t localediv;
  /**Local RAND*/
  uint8_t localrand[8];
  /**Local Long term Key*/
  uint8_t localltk[16];
  /**Remote Device Address type*/
  uint8_t dev_addr_type;
} rsi_bt_event_encryption_enabled_t;

//SMP protocol structure
//SMP Request event structure
/**
 * @brief Structure to hold the Security Manager Protocol (SMP) request event.
 */
typedef struct rsi_bt_event_smp_req_s {
  /**address of remote device*/
  uint8_t dev_addr[6];
  /**auth req of remote device*/
  uint8_t auth_req;
} rsi_bt_event_smp_req_t;

//SMP Response event structure
/**
 * @brief Structure to hold the SMP response event data.
 */
typedef struct rsi_bt_event_smp_resp_s {
  /**address of remote device*/
  uint8_t dev_addr[6];
  /**Device input output capability 
-
      0x00 - Display Only 
-
      0x01 - Display Yes/No 
-
      0x02 - Keyboard Only  
-
      0x03 - No Input No Output
      0x04 - Keyboard Display*/
  uint8_t io_cap;
  /**Out Of the Band data*/
  uint8_t oob_data;
  /**Authentication Request contains bonding type 
-
      MITM Request - BIT(2) 
-
      Secure Connections - BIT(3) 
-
      Keypress - BIT(4) 
-
      CT2 - BIT(5)*/
  uint8_t auth_req;
  /**Minimum required key size*/
  uint8_t min_req_key_size;
  /** Initiator generates/requires the no .of keys after successful paring 
-
      BIT(0) - EncKey: Initiator distributes the Long-Term Key (LTK) followed by Encrypted Diversifier (EDIV) and Random Number (Rand) 
-
      BIT(1) - IdKey : Initiator distributes the Identity Resolving Key (IRK) followed by its address 
-
      BIT(2) - Sign  : Initiator distributes the Connection Signature Resolving Key (CSRK) 
-
      BIT(3) - BIT(7): Reserved for future use */
  uint8_t ini_key_distrb;
  /** Responder generates/requires the no .of keys after successful paring 
-
      BIT(0) - EncKey: Responder distributes the LTK followed by EDIV and Rand 
-
      BIT(1) - IdKey : Responder distributes the IRK followed by its address 
-
      BIT(2) - Sign  : Responder distributes the CSRK 
-
      BIT(3) - BIT(7): Reserved for future use */
  uint8_t resp_key_distrb;
} rsi_bt_event_smp_resp_t;

//SMP passkey event structure
/**
 * @brief Structure to hold the SMP passkey event data.
 */
typedef struct rsi_bt_event_smp_passkey_s {
  /**address of remote device*/
  uint8_t dev_addr[6];
} rsi_bt_event_smp_passkey_t;

//SMP passkey display event structure
/**
 * @brief Structure to hold the SMP passkey display event.
 */
typedef struct rsi_bt_event_smp_passkey_display_s {
  /**address of remote device*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**This is the key required in pairing process( 6 bytes)*/
  uint8_t passkey[BLE_PASSKEY_SIZE];
} rsi_bt_event_smp_passkey_display_t;

//SC passkey display event structure
/**
 * @brief Structure to hold the Secure Connections (SC) passkey event.
 */
typedef struct rsi_bt_event_sc_passkey_s {
  /**address of remote device*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**Reserved for future use*/
  uint8_t reserved[2];
  /**This is the key required in pairing process*/
  uint32_t passkey;
} rsi_bt_event_sc_passkey_t;

//SMP failed event structure
/**
 * @brief Structure to hold the information related to a Bluetooth Low Energy (BLE) Security Manager Protocol (SMP) failed event.
 */
typedef struct rsi_bt_event_smp_failed_s {
  /**device address of the remote device*/
  uint8_t dev_addr[6];
} rsi_bt_event_smp_failed_t;

//Security Methods event structure
/**
 * @brief Structure to define the Bluetooth event security method.
 */
typedef struct rsi_bt_event_sc_method_s {
  /**Security Method --> Justworks or Passkey 
-
     RSI_BT_LE_SC_JUST_WORKS        0x01 
-
     RSI_BT_LE_SC_PASSKEY           0x02 */
  uint8_t sc_method;
} rsi_bt_event_sc_method_t;

/**
 * @brief Structure representing the BLE event for Cross Transport Key Derivation (CTKD).
 *
 * This structure is used to define the parameters for the BLE event related to Cross Transport Key Derivation,
 * including the remote device address and the derived key.
 */
typedef struct rsi_bt_event_ctkd_s {
  /** Address of the remote device */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Derived key */
  uint8_t key[16];
} rsi_ble_event_ctkd_t;

// phy update complete event
/**
 * @brief Structure to hold the BLE PHY update event information.
 */
typedef struct rsi_ble_event_phy_update_s {

  /**Device address of the remote device.*/
  uint8_t dev_addr[6];
  /**Transmission PHY rate(1 byte) 
-
     BIT(0) - The Host prefers to use the LE 1M transmitter PHY (possibly among others) 
-
     BIT(1) - The Host prefers to use the LE 2M transmitter PHY (possibly among others) 
-
     BIT(2) - The Host prefers to use the LE Coded transmitter PHY (possibly among others) 
-
     BIT(3) - BIT(7) Reserved for future use */
  uint8_t TxPhy;
  /**Reception PHY rate(1 byte) 
-
     BIT(0) - The Host prefers to use the LE 1M transmitter PHY (possibly among others) 
-
     BIT(1) - The Host prefers to use the LE 2M transmitter PHY (possibly among others) 
-
     BIT(2) - The Host prefers to use the LE Coded transmitter PHY (possibly among others) 
-
     BIT(3) - BIT(7) Reserved for future use */
  uint8_t RxPhy;
} rsi_ble_event_phy_update_t;

// connection parameters complete event

/**
 * @brief Structure to hold the data of the BLE connection update event.
 * 
 */
typedef struct rsi_ble_event_conn_update_s {
  /**Device address of the remote device*/
  uint8_t dev_addr[6];
  /**Connection Interval*/
  uint16_t conn_interval;
  /**Slave Latency*/
  uint16_t conn_latency;
  /**Supervision Timeout*/
  uint16_t timeout;
} rsi_ble_event_conn_update_t;

// remote connection params request event  //event_id : 0x152E

/**
 * @brief Structure representing the parameters of a remote connection parameter request event in BLE.
 */
typedef struct rsi_ble_event_remote_conn_param_req_s {
  /** Device address of the remote device */
  uint8_t dev_addr[6];
  /** Minimum connection interval */
  uint16_t conn_interval_min;
  /** Maximum connection interval */
  uint16_t conn_interval_max;
  /** Slave Latency */
  uint16_t conn_latency;
  /** Supervision Timeout */
  uint16_t timeout;
} rsi_ble_event_remote_conn_param_req_t;

/**
 * @brief Structure to hold the data of the remote features event.
 */
typedef struct rsi_ble_event_remote_features_s {
  /**Remote device address*/
  uint8_t dev_addr[6];
  /**Remote device supported features 
-
     @note please refer spec for the supported features list */
  uint8_t remote_features[8];
} rsi_ble_event_remote_features_t;

/**
 * @brief Structure to hold the BLE event LE device buffer indication.
 */
typedef struct rsi_ble_event_le_dev_buf_ind_s {

  /**Remote device address*/
  uint8_t remote_dev_bd_addr[RSI_DEV_ADDR_LEN];
  /**No. of Available buffer*/
  uint8_t avail_buf_cnt;
} rsi_ble_event_le_dev_buf_ind_t;

/**
 * @brief Structure representing the data for the BLE length update event.
 * 
 */
typedef struct rsi_ble_event_data_length_update_s {

  /**Device address of the remote device.*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**Maximum TX Octets to be transmitted*/
  uint16_t MaxTxOctets;
  /**Maximum TX time to transmit the MaxTxOctets*/
  uint16_t MaxTxTime;
  /**Maximum Rx Octets to be received*/
  uint16_t MaxRxOctets;
  /**Maximum Rx time to receive the MaxRxOctets*/
  uint16_t MaxRxTime;
} rsi_ble_event_data_length_update_t;

/**
 * @brief Structure representing a 128-bit Universal Unique IDentifier (UUID).
 */
typedef struct uuid128_s {
  /** Holds the value of data1 */
  uint32_t data1;
  /** Holds the value of data2 */
  uint16_t data2;
  /**
   * @brief Holds the value of data3.
   */
  uint16_t data3;
  /**
   * @brief Array to store 8 bytes of data.
   */
  uint8_t data4[8];
} uuid128_t;

/// 16 bit UUID format structure
typedef uint16_t uuid16_t;

/// 32 bit UUID format structure
typedef uint32_t uuid32_t;

// UUID format structure

/**
 * @brief Structure representing a Universally Unique Identifier (UUID).
 *
 * This structure encapsulates a UUID, which can be of varying sizes— 16, 32, or 128-bits.
 * It includes the size of the UUID, a reserved field, and a union to hold the value 
 * of one of the three types of UUIDs.
 */
typedef struct uuid_s {
  /** 
   * Size of the UUID.
   * Indicates the size of the UUID in bits. It can be 16, 32, or 128, depending on the type of UUID used.
   */
  uint8_t size;

  /** 
   * Reserved field.
   * This field is reserved for future use.
   */
  uint8_t reserved[3];

  /** 
   * @brief Union representing the value of the UUID.
   * This union stores the value of the UUID, which can be of three different sizes:
   * 128-bit, 32-bit, or 16-bit. The appropriate field in the union should be used 
   * depending on the size of the UUID.
   */
  union uuid_t {
    /** 
  * @brief 128-bit UUID value. \ref uuid128_t
  *
  * This member holds the value of a 128-bit UUID, which is divided into four segments:
  * - The first 32 bits (`data1`)
  * - The next 16 bits (`data2`)
  * - The following 16 bits (`data3`)
  * - The final 64 bits (`data4`), stored as an array of 8 bytes
  *
  * These segments together represent a full 128-bit UUID, compliant with the standard UUID format.
  */
    uuid128_t val128;

    /** 
     * 32-bit UUID value.
     * This field holds the value of a 32-bit UUID, stored as an array of 4 bytes.
     */
    uuid32_t val32;

    /** 
     * 16-bit UUID value.
     * This field holds the value of a 16-bit UUID, stored as an array of 2 bytes.
     */
    uuid16_t val16;
  } val; ///< Value of one of the 3 types (128-bit, 32-bit, or 16-bit) of UUIDs
} uuid_t;

/** @} */
/** @addtogroup BT_BLE_TYPES
  * @{ */
// profile descriptor/primary service structure
/**
 * @brief Represents the data of the particular profile descriptor.
 */
typedef struct profile_descriptor_s {
  /** Start handle. */
  uint8_t start_handle[2];
  /** End handle. */
  uint8_t end_handle[2];
  /** profile uuid. */
  uuid_t profile_uuid;
} profile_descriptors_t;
/** @} */

// GATT attribute descriptor structure
/** @addtogroup BT_BLE_TYPES
  * @{ */
/**
 * @brief Structure representing an attribute descriptor.
 *
 * This structure is used to define the parameters for an attribute descriptor,
 * including the attribute handle, reserved field, and attribute UUID.
 */
typedef struct att_desc_s {
  /** Attribute handle */
  uint8_t handle[2];
  /** Reserved */
  uint8_t reserved[2];
  /** Attribute UUID (attribute type) */
  uuid_t att_type_uuid;
} att_desc_t;

//characteristic service attribute value structure

/**
 * @brief Structure representing characteristic service data.
 *
 * This structure is used to define the parameters for characteristic service data,
 * including the characteristic value property, handle, and UUID.
 */
typedef struct char_serv_data_s {
  /** Characteristic value property */
  uint8_t char_property;
  /** Reserved */
  uint8_t reserved;
  /** Characteristic value handle */
  uint16_t char_handle;
  /** Characteristic value attributes UUID */
  uuid_t char_uuid;
} char_serv_data_t;

//characteristic service attribute structure

/**
 * @brief Structure representing a characteristic service.
 *
 * This structure is used to define the parameters for a characteristic service,
 * including the attribute handle, reserved space for future use, and the characteristic service attribute value.
 */
typedef struct char_serv_s {
  /** Characteristic service attribute handle */
  uint16_t handle;
  /** Reserved for future use */
  uint8_t reserved[2];
  /** Characteristic service attribute value */
  char_serv_data_t char_data;
} char_serv_t;

//include service attribute value structure
/**
 * @brief Structure representing the included service data.
 */
typedef struct inc_serv_data_s {

  /**include service start handle*/
  uint16_t start_handle;
  /**include service end handle*/
  uint16_t end_handle;
  /**UUID value of the included service*/
  uuid_t uuid;
} inc_serv_data_t;

// include service attribute structure
/**
 * @brief Structure representing an included service attribute in a GATT server.
 *
 */
typedef struct inc_serv_s {
  /**Include service attribute handle*/
  uint16_t handle;
  /**Reserved field */
  uint8_t reserved[2];
  /**Include service attribute data structure */
  inc_serv_data_t inc_serv;
} inc_serv_t;

/** @} */
/** @addtogroup BT_BLE_TYPES
  * @{ */
// GATT Request structures
// add new attributes to service request structure
/**
 * @brief Structure representing a request to add an attribute in the BLE stack.
 */
typedef struct rsi_ble_req_add_att_s {
  /** service handler */
  void *serv_handler;
  /** Attribute handle */
  uint16_t handle;
  /** If this variable is 1, Host has to maintain attributes and records in the application. 
-
      If 0, Stack will maintain the attributes and records
   */
  uint16_t config_bitmap;
  /** Attribute type UUID */
  uuid_t att_uuid;
  /** Attribute property */
  uint8_t property;
  /** Attribute data length */
  uint16_t data_len;
  /** Attribute data. The maximum value is 240, please refer RSI_DEV_ATT_LEN Macro*/
  uint8_t data[RSI_DEV_ATT_LEN];
} rsi_ble_req_add_att_t;
/** @} */

// GATT Response structures

//Presentation Format descriptor structure
// actual value =  char value * 10 ^ exponent;
/**
 * @brief Structure representing the presentation format of a Bluetooth Low Energy (BLE) device.
 */
typedef struct rsi_ble_presentation_format {
  /**Format of the data*/
  uint8_t format;
  /**Exponent of the data*/
  uint8_t exponent;
  /**uints of the data*/
  uint16_t unit;
  /**name space of the data*/
  uint8_t name_space;
  /**Description for data*/
  uint16_t description;
} rsi_ble_pesentation_format_t;

/** @addtogroup BT_BLE_EVENT_TYPES Event Types
  * @{ */

//RSI_BLE_EVENT_GATT_ERROR_RESP, event_id: 0x1500
/**
 * @brief Structure representing the response for a BLE event error.
 */
typedef struct rsi_ble_event_error_resp_s {

  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**attribute handle*/
  uint8_t handle[2];
  /**Error indicates the type of Gatt Error*/
  uint8_t error[2];
} rsi_ble_event_error_resp_t;

//RSI_BLE_EVENT_GATT_CHAR_DESC - event_ix = 1501

/**
 * @brief Structure representing a GATT descriptor event.
 */
typedef struct rsi_ble_event_gatt_desc_s {
  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**number of descriptors found*/
  uint8_t num_of_att;
  /**Reserved for future use*/
  uint8_t reserved;
  /**Attribute descriptors list. The maximum value is 5*/
  att_desc_t att_desc[RSI_BLE_MAX_RESP_LIST];
} rsi_ble_event_gatt_desc_t;

//RSI_BLE_EVENT_GATT_PRIMARY_SERVICE_LIST, event_id: 0x1509

/**
 * @brief Structure representing the BLE event profiles list.
 *
 * This structure is used to define the parameters for the BLE event profiles list,
 * including the remote device address, number of profiles found, and the list of found profiles.
 */
typedef struct rsi_ble_event_profiles_list_s {
  /** Remote device address */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Number of profiles found */
  uint8_t number_of_profiles;
  /** Reserved for future use */
  uint8_t reserved;
  /** List of found profiles. The maximum value is 5 */
  profile_descriptors_t profile_desc[RSI_BLE_MAX_RESP_LIST];
} rsi_ble_event_profiles_list_t;

//RSI_BLE_EVENT_GATT_PRIMARY_SERVICE_BY_UUID, event_id = 0x1502
/**
 * @brief Structure to hold the BLE event profile by UUID.
 */
typedef struct rsi_ble_event_profile_by_uuid_s {

  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**profile start handle*/
  uint8_t start_handle[2];
  /**profile end handle*/
  uint8_t end_handle[2];
} rsi_ble_event_profile_by_uuid_t;

//RSI_BLE_EVENT_GATT_READ_CHAR_SERVS, event_id = 0x1503
/**
 * @brief Structure representing the BLE event for reading characteristic services by type.
 *
 * This structure is used to represent the BLE event `RSI_BLE_EVENT_GATT_READ_CHAR_SERVS` 
 * with event ID `0x1503`. It provides information related to the read operation 
 * of characteristic services.
 */
typedef struct rsi_ble_event_read_by_type1_s {
  /** Remote device address */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Number of characteristic services found */
  uint8_t num_of_services;
  /** Reserved for future use */
  uint8_t reserved;
  /** It contains the characteristic service list. The maximum value is 5. */
  char_serv_t char_services[RSI_BLE_MAX_RESP_LIST];
} rsi_ble_event_read_by_type1_t;

//RSI_BLE_EVENT_GATT_READ_INC_SERVS, event_id = 0x1504
/**
 * @brief Structure for BLE event read by type 2.
 */
typedef struct rsi_ble_event_read_by_type2_s {

  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**number of characteristic services found*/
  uint8_t num_of_services;
  /**Reserved for future use*/
  uint8_t reserved;
  /**list of included services. The maximum value is 5*/
  inc_serv_t services[RSI_BLE_MAX_RESP_LIST];
} rsi_ble_event_read_by_type2_t;

//RSI_BLE_EVENT_GATT_READ_VAL_BY_UUID, event_id = 0x1505
/**
 * @brief Structure definition for the BLE event "Read By Type 3" response.
 */
typedef struct rsi_ble_event_read_by_type3_s {

  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**attribute handle*/
  uint8_t handle[2];
  /**length of attribute value*/
  uint16_t length;
  /**This contains the attribute value. The maximum value is 240, refer to RSI_DEV_ATT_LEN Macro*/
  uint8_t att_value[RSI_DEV_ATT_LEN];
} rsi_ble_event_read_by_type3_t;

//RSI_BLE_EVENT_GATT_READ_RESP , evet_id = 0x1506,0x1507,0x1508
/**
 * @brief Structure representing the BLE ATT value event.
 */
typedef struct rsi_ble_event_att_value_s {

  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**length of attribute value*/
  uint16_t length;
  /**This contains the attribute value. The maximum value is 240, refer to RSI_DEV_ATT_LEN Macro*/
  uint8_t att_value[RSI_DEV_ATT_LEN];
} rsi_ble_event_att_value_t;

//RSI_BLE_EVENT_GATT_WRITE_RESP, event_id: 0x150A,0x150C
/**
 * @brief Structure to hold the response for the BLE set attribute request.
 */
typedef struct rsi_ble_set_att_resp_s {
  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
} rsi_ble_set_att_resp_t;

//RSI_BLE_EVENT_GATT_PREPARE_WRITE_RESP, event_id: 0x150B
/**
 * @brief Structure representing the response for the prepare write operation in BLE.
 */
typedef struct rsi_ble_prepare_write_resp_s {

  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**attribute handle*/
  uint8_t handle[2];
  /**attribute value offset*/
  uint8_t offset[2];
  /**length of attribute value*/
  uint8_t length;
  /**This contains the attribute value. The maximum value is 240, refer to RSI_DEV_ATT_LEN Macro*/
  uint8_t att_value[RSI_DEV_ATT_LEN];
} rsi_ble_prepare_write_resp_t;

// GATT Profiles list response structure
/**
 * @brief Structure representing the list of received profiles, The maximum value is 5.
 */
typedef struct rsi_ble_resp_profiles_list_s {
  /** Number of profiles found */
  uint8_t number_of_profiles;
  /** Reserved */
  uint8_t reserved[3];
  /** List of found profiles 
-
      The maximum value is 5 */
  profile_descriptors_t profile_desc[RSI_BLE_MAX_RESP_LIST];
} rsi_ble_resp_profiles_list_t;

/**
 * @brief Structure representing the list of received profile descriptor of a particular profile, The maximum value is 5.
 */
typedef struct rsi_ble_resp_query_profile_descriptor_s {
  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**List of found profiles 
-
      The maximum value is 5 */
  profile_descriptors_t profile_desc[RSI_BLE_MAX_RESP_LIST];
} rsi_ble_resp_query_profile_descriptor_t;

// GATT characteristic query service response structure

#ifndef RSI_BLE_APIS_H
#define RSI_BLE_APIS_H

#include <stdint.h>

#endif /* RSI_BLE_APIS_H */
/**
 * @brief Structure to hold the response of characteristic services.
 */
typedef struct rsi_ble_resp_char_serv_s {
  /** The number of profiles found */
  uint8_t num_of_services;
  /** Reserved */
  uint8_t reserved[3];
  /** Characteristic service array. 
-
      The maximum value is 5. */
  char_serv_t char_services[RSI_BLE_MAX_RESP_LIST];
} rsi_ble_resp_char_services_t;

// GATT include service response structure
/**
 * @brief Structure representing the list of received included service attributes for a particular included service. The maximum value is 5.
 */
typedef struct rsi_ble_resp_inc_serv {
  /** Number of profiles found */
  uint8_t num_of_services;
  /** Reserved */
  uint8_t reserved[3];
  /** Include service list. 
-
      The maximum value is 5. */
  inc_serv_t services[RSI_BLE_MAX_RESP_LIST];
} rsi_ble_resp_inc_services_t;

// GATT attribute value response structure
/**
 * @brief Structure representing the response for an  Attribute Protocol (ATT) value in  Bluetooth Low Energy (BLE).
 */
typedef struct rsi_ble_resp_att_value_t {
  /** Length of attribute value */
  uint8_t len;
  /** Attribute values list. 
- 
      Each attribute value is maximum of size 240, see RSI_DEV_ATT_LEN Macro */
  uint8_t att_value[RSI_DEV_ATT_LEN];
} rsi_ble_resp_att_value_t;

// GATT attribute descriptors response structure
/**
 * @brief Structure representing the list of received attribute descriptors, The maximum value is 5.
 */
typedef struct rsi_ble_resp_att_descs_s {
  /** Number of descriptors found */
  uint8_t num_of_att;
  /** Reserved */
  uint8_t reserved[3];
  /** Attribute descriptors list. 
-
      The maximum value is 5. */
  att_desc_t att_desc[RSI_BLE_MAX_RESP_LIST];
} rsi_ble_resp_att_descs_t;

// add new service response structure
/**
 * @brief Structure representing the response for adding a service in BLE.
 */
typedef struct rsi_ble_resp_add_serv_s {
  /** Contains the address of the service record stored in the Silicon Labs stack. */
  void *serv_handler;
  /** The handle from where the service starts. */
  uint16_t start_handle;
} rsi_ble_resp_add_serv_t;

// read local attribute value response structure
/**
 * @brief Structure representing the response for local attribute value in BLE.
 */
typedef struct rsi_ble_resp_local_att_value_s {
  /** Attribute handle */
  uint16_t handle;
  /** Attribute value length */
  uint16_t data_len;
  /** Attribute value (data). The maximum value is 240, see RSI_DEV_ATT_LEN Macro */
  uint8_t data[RSI_DEV_ATT_LEN];
} rsi_ble_resp_local_att_value_t;

/**
 * @brief Structure representing the BLE event for remote device information.
 *
 * This structure is used to define the parameters for a BLE event
 * that provides information about a remote device.
 */
typedef struct rsi_ble_event_remote_device_info_s {
  /** Remote device address */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Remote device version */
  uint8_t remote_version;
  /** Remote device company ID */
  uint16_t remote_company_id;
  /** Remote device sub-version */
  uint16_t remote_sub_version;
} rsi_ble_event_remote_device_info_t;

/**
 * @brief Structure representing the BLE event for received Remote Control Protocol (RCP) information.
 *
 * This structure is used to define the parameters for a BLE event
 * that involves receiving RCP information.
 */
typedef struct rsi_ble_event_rcp_rcvd_info_s {
  /** Received RCP data */
  uint8_t data[1024];
} rsi_ble_event_rcp_rcvd_info_t;
// GATT Event structures

// GATT Write event structure
/**
 * @brief Structure representing a BLE write event.
 */
typedef struct rsi_ble_event_write_s {
  /** remote device address  */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Reserved for future use */
  uint8_t reserved;

/** @addtogroup BT_BLE_CONSTANTS
 *  @{
 */

/// BLE write command event
#define RSI_BLE_WRITE_CMD_EVENT 0x01
/// BLE write request event
#define RSI_BLE_WRITE_REQUEST_EVENT 0x02
/// BLE notification event
#define RSI_BLE_NOTIFICATION_EVENT 0x03
/// BLE indication event
#define RSI_BLE_INDICATION_EVENT 0x04
  /** @} */
  /**Type of the event received from the remote device 
-
     RSI_BLE_WRITE_CMD_EVENT     0x01 
-
     RSI_BLE_WRITE_REQUEST_EVENT 0x02 
-
     RSI_BLE_NOTIFICATION_EVENT  0x03 
-
     RSI_BLE_INDICATION_EVENT    0x04 */
  uint8_t pkt_type;
  /**attribute handle*/
  uint8_t handle[2];
  /**length of attribute value*/
  uint8_t length;
  /**This contains the attribute value. The maximum value is 240, see RSI_DEV_ATT_LEN Macro*/
  uint8_t att_value[RSI_DEV_ATT_LEN];
} rsi_ble_event_write_t;

// GATT prepare Write event structure
/**
 * @brief Structure definition for preparing a write operation in BLE event.
 */
typedef struct rsi_ble_event_prepare_write_s {

  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**attribute handle*/
  uint8_t handle[2];
  /**attribute value offset*/
  uint8_t offset[2];
  /**length of attribute value*/
  uint16_t length;
  /**This contains the attribute value. The maximum value is 240, see RSI_DEV_ATT_LEN Macro*/
  uint8_t att_value[RSI_DEV_ATT_LEN];
} rsi_ble_event_prepare_write_t;

/**
 * @brief Structure representing the BLE execute write request.
 *
 * This structure is used to define the parameters for an execute write request
 * to a remote BLE device.
 */
typedef struct rsi_ble_execute_write_s {
  /** Remote device address (6 bytes) */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Execute write flag */
  uint8_t exeflag;
} rsi_ble_execute_write_t;

// GATT Read event structure

/**
 * @brief Structure representing the BLE read request.
 *
 * This structure is used to define the parameters for a BLE read request,
 * including the remote device address, attribute handle, request type, and offset.
 */
typedef struct rsi_ble_read_req_s {
  /** Remote device address */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Attribute handle */
  uint16_t handle;
  /** Request type: 0 - Read request, 1 - Read Blob request */
  uint8_t type;
  /** Reserved for future use */
  uint8_t reserved;
  /** Offset of attribute value to be read */
  uint16_t offset;
} rsi_ble_read_req_t;

// GATT MTU event structure
/**
 * @brief Structure to hold the BLE MTU event information.
 */
typedef struct rsi_ble_event_mtu_s {

  /**remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**MTU size*/
  uint16_t mtu_size;
} rsi_ble_event_mtu_t;
/** @addtogroup BT_BLE_CONSTANTS
 *  @{
 */
#define PEER_DEVICE_INITATED_MTU_EXCHANGE \
  0x1 ///< Indicates that the Maximum Transmission Unit (MTU) exchange was initiated by the peer device.
#define LOCAL_DEVICE_INITATED_MTU_EXCHANGE 0x2 ///< Indicates that the MTU exchange was initiated by the local device.
/** @} */
//MTU Exchange Information event structure
/**
 * @brief Structure to hold the MTU exchange information for a BLE event.
 */
typedef struct rsi_ble_event_mtu_exchange_information_s {
  /**uint8_t[6], remote device address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**uint8_t[2], Remote MTU Size*/
  uint16_t remote_mtu_size;
  /**uint8_t[2], Local MTU Size*/
  uint16_t local_mtu_size;
  /**uint8_t Initiated role, who initiated MTU exchange 
-
     PEER_DEVICE_INITATED_MTU_EXCHANGE     0x01 
-
     LOCAL_DEVICE_INITATED_MTU_EXCHANGE    0x02  */
  uint8_t initiated_role;
} rsi_ble_event_mtu_exchange_information_t;

/**
 * @brief Structure to hold the information of a directed advertising report event.
 */
typedef struct rsi_ble_event_directedadv_report_s {
  /**Event type 
-
      0x01  Connectable directed advertising (ADV_DIRECT_IND) */
  uint16_t event_type;
  /**Address type of remote device*/
  uint8_t dev_addr_type;
  /**Address of the remote device*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /**Directed address type*/
  uint8_t directed_addr_type;
  /**Directed device address*/
  uint8_t directed_dev_addr[RSI_DEV_ADDR_LEN];
  /**rssi value*/
  int8_t rssi;
} rsi_ble_event_directedadv_report_t;

/**
 * @brief Structure representing the BLE event for CBFC connection request.
 *
 * This structure is used to define the parameters for a BLE event
 * that involves a Circular Buffer Flow Control (CBFC) connection request from a remote device.
 */
typedef struct rsi_ble_event_cbfc_conn_req_s {
  /** Address of the remote device */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Protocol/Service Multiplexer (PSM) value */
  uint16_t psm;
  /** Local Channel Identifier (LCID) */
  uint16_t lcid;
} rsi_ble_event_cbfc_conn_req_t;

/**
 * @brief Structure representing the BLE event for CBFC connection complete.
 *
 * This structure is used to define the parameters for a BLE event
 * that indicates the completion of a Circular Buffer Flow Control (CBFC) connection with a remote device.
 */
typedef struct rsi_ble_event_cbfc_conn_complete_s {
  /** Address of the remote device */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Protocol/Service Multiplexer (PSM) value */
  uint16_t psm;
  /** Maximum Transmission Unit (MTU) size */
  uint16_t mtu;
  /** Maximum PDU Size (MPS) */
  uint16_t mps;
  /** Local Channel Identifier (LCID) */
  uint16_t lcid;
} rsi_ble_event_cbfc_conn_complete_t;

/**
 * @brief Structure representing the BLE event for CBFC received data.
 *
 * This structure is used to define the parameters for a BLE event
 * that involves receiving data over a Circular Buffer Flow Control (CBFC) connection from a remote device.
 */
typedef struct rsi_ble_event_cbfc_rx_data_s {
  /** Address of the remote device */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Local Channel Identifier (LCID) */
  uint16_t lcid;
  /** Length of the received data */
  uint16_t len;
  /** Received data */
  uint8_t data[RSI_DEV_ATT_LEN];
} rsi_ble_event_cbfc_rx_data_t;

/**
 * @brief Structure representing the BLE event for CBFC disconnection.
 *
 * This structure is used to define the parameters for a BLE event
 * that involves the disconnection of a Circular Buffer Flow Control (CBFC) connection with a remote device.
 */
typedef struct rsi_ble_event_cbfc_disconn_s {
  /** Address of the remote device */
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** Local Channel Identifier (LCID) */
  uint16_t lcid;
} rsi_ble_event_cbfc_disconn_t;

/** @addtogroup BT-LOW-ENERGY1 GAP
  * @{ */
// SMP pairing capabilities    cmd_ix = 0x00FE
/**
 * @brief Structure for setting SMP pairing capability data.
 */
typedef struct rsi_ble_set_smp_pairing_capabilty_data {

  /**Device input output capability 
-
      0x00 - Display Only 
-
      0x01 - Display Yes/No 
-
      0x02 - Keyboard Only  
-
      0x03 - No Input No Output
      0x04 - Keyboard Display*/
  uint8_t io_capability;
  /** oob_data_flag 
-
      0 - disable 
- 1 - enable */
  uint8_t oob_data_flag;
  /** Authentication Request contains bonding type 
-
      MITM Request - BIT(2) 
-
      Secure Connections - BIT(3) 
-
      Keypress - BIT(4) 
-
      CT2 - BIT(5) */
  uint8_t auth_req;
  /** Supported Encryption key size 7 to 16 bytes */
  uint8_t enc_key_size;
  /** Initiator generates/requires the no .of keys after successful paring 
-
      BIT(0) - EncKey: Initiator distributes the LTK followed by EDIV and Rand 
-
      BIT(1) - IdKey : Initiator distributes the IRK followed by its address 
-
      BIT(2) - Sign  : Initiator distributes the CSRK 
-
      BIT(3) - BIT(7): Reserved for future use */
  uint8_t ini_key_distribution;
  /** Responder generates/requires the no .of keys after successful paring 
-
      BIT(0) - EncKey: Responder distributes the LTK followed by EDIV and Rand 
-
      BIT(1) - IdKey : Responder distributes the IRK followed by its address 
-
      BIT(2) - Sign  : Responder distributes the CSRK 
-
      BIT(3) - BIT(7): Reserved for future use */
  uint8_t rsp_key_distribution;

} rsi_ble_set_smp_pairing_capabilty_data_t;

//LE read PHY request command response structure, cmd_ix - 0x00B0

/**
 * @brief Structure to hold the response for the BLE read PHY command.
 */
typedef struct rsi_ble_resp_read_phy_s {
  /** Remote device Bluetooth Address*/
  uint8_t dev_addr[RSI_DEV_ADDR_LEN];
  /** TX PHY Rate 
-
       0x01 The transmitter PHY for the connection is LE 1M 
-
       0x02 The transmitter PHY for the connection is LE 2M 
-
       0x03 The transmitter PHY for the connection is LE Coded 
-
       All other values Reserved for future use*/
  uint8_t tx_phy;
  /** RX PHY Rate 
-
       0x01 The receiver PHY for the connection is LE 1M 
-
       0x02 The receiver PHY for the connection is LE 2M 
-
       0x03 The receiver PHY for the connection is LE Coded 
-
       All other values Reserved for future use*/
  uint8_t rx_phy;
} rsi_ble_resp_read_phy_t;

//LE read max data length command response structure, cmd_ix - 0x00B3
/**
 * @brief Structure representing the response for reading the maximum data length in BLE.
 */
typedef struct rsi_ble_resp_read_max_data_length_s {
  /** maxtxoctets 
- 
        Preferred maximum number of payload octets that the local Controller should
        include in a single Link Layer packet on this connection. */
  uint16_t maxtxoctets;
  /** maxtxtime 
- 
        Preferred maximum number of microseconds that the local Controller
        should use to transmit a single Link Layer packet on this connection */
  uint16_t maxtxtime;
  /** maxrxoctets 
- 
        Maximum number of payload octets that the local Controller supports
        for reception of a single Link Layer packet on a data connection */
  uint16_t maxrxoctets;
  /** maxrxtime 
- 
        Maximum time, in microseconds, that the local Controller supports for
        reception of a single Link Layer packet on a data connection. */
  uint16_t maxrxtime;
} rsi_ble_read_max_data_length_t;

/** @} */

/** @addtogroup BT-LOW-ENERGY6 Test Mode
  * @{ */
//LE Per Transmit mode, cmd_ix = 0x00BE

/**
 * @brief Structure to hold the parameters for BLE periodic advertising transmission.
 */
typedef struct rsi_ble_per_transmit_s {
  /** Command ID 
-
   Takes per BLE_TRANSMIT_CMD_ID of value 0x13*/
  uint8_t cmd_ix;
  /** Enables/disables the BLE per transmit mode 
-
     1  PER Transmit Enable 
-
     0  PER Transmit Disable */
  uint8_t transmit_enable;
  /** Access address with which packets are transmitted */
  uint8_t access_addr[4];
  /** Phy rate at which packets are transmitted 
-
       1  1Mbps  
-
       2  2 Mbps 
-
       4  125 Kbps Coded 
-
       8  500 Kbps Coded */
  uint8_t phy_rate;
  /** Rx channel number (0 - 39) 
     @note Removed the BLE packet transmission on channel-39 (2480 MHz) at a 2 Mbps data rate */
  uint8_t rx_chnl_num;
  /** Tx channel number (0 - 39) 
     @note Removed the BLE packet transmission on channel-39 (2480 MHz) at a 2 Mbps data rate */
  uint8_t tx_chnl_num;
  /** Initial seed to be used for whitening. It should be set to 0 in order to disable whitening. 
-
      In order to enable, one should give the scrambler seed value which is used on the receive side */
  uint8_t scrambler_seed;
  /** LE channel type (data or advertise channel) 
-
       0x00  Advertise Channel 
-
       0x01  Data Channel (to be used by Default) */
  uint8_t le_chnl_type;
  /** Frequency hopping type to be used 
-
       0  No Hopping 
-
       1  Fixed Hopping 
-
       2  Random Hopping (rx_chnl_num, tx_chnl_num parameters are unused in this mode) */
  uint8_t freq_hop_en;
  /** Select the antenna to be used. Refer to the data sheet for your hardware to check whether or not it contains an onboard antenna. 
-
       2  ONBOARD_ANT_SEL 
-
       3  EXT_ANT_SEL */
  uint8_t ant_sel;
  /** pll_mode type to be used 
- 
       0  PLL_MODE0 (to be used by Default) 
- 
       1  PLL_MODE1 */
  uint8_t pll_mode;
  /** Selection of RF type (internal/external) 
-
       0  BT_EXTERNAL_RF 
-
       1  BT_INTERNAL_RF (to be used by Default) 
      @note  The above macros are applicable for both BT and BLE */
  uint8_t rf_type;
  /** Selection of RF Chain (HP/LP) to be used 
-
       2  BT_HP_CHAIN 
-
       3  BT_LP_CHAIN
      @note  The above macros are applicable for both BT and BLE */
  uint8_t rf_chain;
  /** Length of the packet to be transmitted*/
  uint8_t pkt_len[2];
  /** Type of payload data sequence 
-
       0x00  PRBS9 sequence �11111111100000111101... 
-
       0x01  Repeated �11110000� 
-
       0x02  Repeated �10101010� 
-
       0x03  PRBS15 
-
       0x04  Repeated �11111111� 
-
       0x05  Repeated �00000000� 
-
       0x06  Repeated '00001111' 
-
       0x07  Repeated '01010101' */
  uint8_t payload_type;
  /** Transmit Power 
- 
       Default Value for BLE TX Power Index is 31, The range for the BLE TX Power Index is 1 to 127 (0, 32 indexes are invalid). 
-
       TX power index for the BLE LP Chain : 1 to 31 (0 dBm Mode), 33 to 63 ( 10 dBm Mode) 
-
       TX power index for the BLE HP Chain : 1 to 127 
-
     @note  For the LP Chain - Power index vs Outpt power in dBm.

 *    -----------------------------------------------------------------------------------------
 *   |       Power Index   |                  Output Power in dBm                              |
 *   ----------------------|-------------------------------------------------------------------
 *   |      1              |             -22.3054959                       |
 *   |      2              |             -16.59332574                      |
 *   |      3              |             -13.38278365                      |
 *   |      4              |             -11.19804718                                  |
 *   |      5              |             -9.576522466                                  |
 *   |      6              |             -8.312070432                                  |
 *   |      7              |             -7.294640362                                  |
 *   |      8              |             -6.458448154                                  |
 *   |      9              |             -5.760963318                                  |
 *   |      10             |             -5.173042366                                  |
 *   |      11             |             -4.673788189                                  |
 *   |      12             |             -4.247653993                                  |
 *   |      13             |             -3.882708784                                  |
 *   |      14             |             -3.569545894                                  |
 *   |      15             |             -3.300567503                                  |
 *   |      16             |             -3.069499167                                  |
 *   |      17             |             -2.871050592                                  |
 *   |      18             |             -2.700672503                                  |
 *   |      19             |             -2.554378603                                  |
 *   |      20             |             -2.428612817                                  |
 *   |      21             |             -2.32014891                                   |
 *   |      22             |             -2.226013876                                  |
 *   |      23             |             -2.143429275                                  |
 *   |      24             |             -2.069766557                                  |
 *   |      25             |             -2.002513642                                  |
 *   |      26             |             -1.939250859                                  |
 *   |      27             |             -1.87763493                                   |
 *   |      28             |             -1.815390046                                  |
 *   |      29             |             -1.750305305                                  |
 *   |      30             |             -1.680237892                                  |
 *   |      31             |             -1.603121401                                  |
 *   |      32             |                     NA                            |
 *   |      33             |                     -10.4822997                           |
 *   |      34             |                     -4.9531679                        |
 *   |      35             |                     -1.931961022                          |
 *   |      36             |                     0.057132993                           |
 *   |      37             |                     1.476764101                           |
 *   |      38             |                     2.5332116                         |
 *   |      39             |                     3.336771823                           |
 *   |      40             |                     3.953605265                           |
 *   |      41             |                     4.426779615                           |
 *   |      42             |                     4.786171523                           |
 *   |      43             |                     5.053647759                           |
 *   |      44             |                     5.246007208                           |
 *   |      45             |                     5.37676618                        |
 *   |      46             |                     5.457304255                           |
 *   |      47             |                     5.497635316                           |
 *   |      48             |                     5.506945838                           |
 *   |      49             |                     5.493978354                           |
 *   |      50             |                     5.467302132                           |
 *   |      51             |                     5.435491631                           |
 *   |      52             |                     5.407220119                           |
 *   |      53             |                     5.391268248                           |
 *   |      54             |                     5.396444507                           |
 *   |      55             |                     5.431416481                           |
 *   |      56             |                     5.504458826                           |
 *   |      57             |                     5.62313521                        |
 *   |      58             |                     5.793945208                           |
 *   |      59             |                     6.02197959                        |
 *   |      60             |                     6.310634089                           |
 *   |      61             |                     6.661428559                           |
 *   |      62             |                     7.073964236                           |
 *   |      63             |                     7.546029076                           |
 *   -----------------------------------------------------------------------------------------
-
     @note  For the HP Chain - Power index vs Outpt power in dBm.

 *    -----------------------------------------------------------------------------------------
 *   |       Power Index   |                  Output Power in dBm                              |
 *   ----------------------|-------------------------------------------------------------------
 *   |         1           |                1                          |
 *   |         2           |                2                          |
 *   |         3           |                3                          |
 *   |         4           |                4                                      |
 *   |         5           |                5                          |
 *   |         6           |                6                                          |
 *   |         7           |                7                                          |
 *   |         8           |                8                                          |
 *   |         9           |                9                                          |
 *   |         10          |                10                                         |
 *   |         -           |                -                                          |
 *   |         -           |                -                                          |
 *   |         -           |                -                                          |
 *   |         -           |                -                                          |
 *   |         41          |                0.5                                        |
 *   |         42          |                1                                          |
 *   |         43          |                1.5                                        |
 *   |         44          |                2                                          |
 *   |         45          |                2.5                                        |
 *   |         46          |                3                                          |
 *   |         47          |                3.5                                        |
 *   |         48          |                4                                          |
 *   |         49          |                4.5                                        |
 *   |         50          |                5                                          |
 *   |         -           |                -                                          |
 *   |         -           |                -                                          |
 *   |         127         |        (Max Power Supported by Country region)                |
 *   ----------------------|-------------------------------------------------------------------
 */

  uint8_t tx_power;
  /** Transmit mode to be used either Burst/Continuous 
-
       0  BURST_MODE 
-
       1  CONTINUOUS_MODE 
-
       2  CONTINUOUS_WAVE_MODE (CW_MODE) */
  uint8_t transmit_mode;
  /** This field takes the value of inter packet gap. 
-
      Number of slots to be skipped between two packets - Each slot will be 1250 usec */
  uint8_t inter_pkt_gap;
  /** This field defines the number of packets to be transmitted, default to zero for continuous transmission */
  uint8_t num_pkts[4];
} rsi_ble_per_transmit_t;

//LE Per Receive mode, cmd_ix = 0x00BF
/**
 * @brief Structure representing the parameters for BLE periodic receive operation.
 */
typedef struct rsi_ble_per_receive_s {
  /** Command ID 
-
   Takes per BLE_RECEIVE_CMD_ID of value 0x14*/
  uint8_t cmd_ix;
  /** Enables/disables the ble per receive mode 
-
     1  PER Receive Enable 
-
     0  PER Receive Disable */
  uint8_t receive_enable;
  /** Access address with which packets are received */
  uint8_t access_addr[4];
  /** Phy rate at which packets are received 
-
       1  1Mbps  
-
       2  2 Mbps 
-
       4  125 Kbps Coded 
-
       8  500 Kbps Coded */
  uint8_t phy_rate;
  /** Rx channel number (0 - 39) */
  uint8_t rx_chnl_num;
  /** Tx channel number (0 - 39) */
  uint8_t tx_chnl_num;
  /** Initial seed to be used for whitening. It should be set to 0 in order to disable whitening. 
-
      In order to enable, one should give the scrambler seed value which is used on the transmit side */
  uint8_t scrambler_seed;
  /** LE channel type (data or advertise channel) 
-
       0x00  Advertise Channel 
-
       0x01  Data Channel (to be used by Default) */
  uint8_t le_chnl_type;
  /** Frequency hopping type to be used 
-
       0  No Hopping 
-
       1  Fixed Hopping 
-
       2  Random Hopping (rx_chnl_num, tx_chnl_num parameters are unused in this mode) */
  uint8_t freq_hop_en;
  /** Select the antenna to be used. Refer to the datasheet for your hardware to check whether or not it contains an onboard antenna. 
- 
       2  ONBOARD_ANT_SEL 
-
       3  EXT_ANT_SEL */
  uint8_t ant_sel;
  /** pll_mode type to be used 
- 
       0  PLL_MODE0 (to be used by Default) 
- 
       1  PLL_MODE1 */
  uint8_t pll_mode;
  /** Selection of RF type (internal/external) 
-
       0  BT_EXTERNAL_RF 
-
       1  BT_INTERNAL_RF (to be used by Default) 
      @note  The above macros are applicable for both BT and BLE */
  uint8_t rf_type;
  /** Selection of RF Chain (HP/LP) to be used 
-
       2  BT_HP_CHAIN 
-
       3  BT_LP_CHAIN
      @note  The above macros are applicable for both BT and BLE */
  uint8_t rf_chain;
  /** This field enables/disables the extended data length 
-
       0  Extended Data length disabled 
-
       1  Extended Data length enabled */
  uint8_t ext_data_len_indication;
  /** This field defines the loopback to be enable or disable 
-
       0  LOOP_BACK_MODE_DISABLE 
-
       1  LOOP_BACK_MODE_ENABLE*/
  uint8_t loop_back_mode;
  /** This field enables/disables the duty cycling 
-
       0  Duty Cycling Disabled (to be used by Default) 
-
       1  Duty Cycling Enabled */
  uint8_t duty_cycling_en;
} rsi_ble_per_receive_t;
/** @} */
/** @addtogroup BT_BLE_CONSTANTS
 *  @{
 */

///The maximum length of advertising data.
#define ADV_DATA_LEN 210
///Length of the device address in bytes.
#define DEVICE_ADDR_LEN 6
/** @} */
//! ae adv report event
typedef struct rsi_ble_ae_adv_report_s {
  /**
 *    -----------------------------------------------------------------------------------------
 *   |       Bit Number    |                    Parameter Description                          |
 *   ----------------------|-------------------------------------------------------------------
 *   |      0              |                   Connectable Advertising                         |
 *   |      1              |                   Scannable Advertising                           |
 *   |      2              |                   Direct Advertising                              |
 *   |      3              |                    Scan Response                                  |
 *   |      4              |                 Legacy Advertising PDUs used                      |
 *   |    5 to 6           |                       Data status : 
 *                            |
 *   |                     |             0b00  = complete 
 *                                   |
 *   |                     |             0b01  = Incomplete, more data to come 
 *              |
 *   |                     |             0b10  = Incomplete, data truncated, no more to come 
 *|
 *   |                     |             0b11  = Reserved for future use                       |
 */
  uint16_t event_type;
  /**
    uint8_t Remote Address Type, Indicates the type of the Address
         0x00 - Public Device Address
         0x01 - Random Device Address
         0x02 - Public Identity Address (corresponds to Resolved Private Address)
         0x03 - Random (static) Identity Address (corresponds to Resolved Private Address)
   */
  uint8_t remote_addr_type;
  /**  uint8[6] remote_Address : Address of the remote address Type */
  uint8_t remote_addr[DEVICE_ADDR_LEN];
  /**
       uint8_t Primary PHY
        0x01 - Advertiser PHY is LE 1M
        0x03 - Advertiser PHY is LE Coded
  */
  uint8_t pri_phy;
  /**
       uint8_t Secondary PHY
          0x00 - No packets on the secondary advertising physical channel
          0x01 - Advertiser PHY is LE 1M
          0x02 - Advertiser PHY is LE 2M
          0x03 - Advertiser PHY is LE Coded
  */
  uint8_t sec_phy;
  /** uint8_t Advertising_SID
   *    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   *   |           Value     |                    Parameter Description                                                                                                                                         |
   *   ----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   *   |       0x00 to 0x0F  |  Value of the Advertising SID subfield in the ADI field of the PDU or, 
 *  for  scan responses, in the ADI field of the original scannable advertisement                         |
   *   |           0xFF      |                   No ADI field provided                                                                                                                                          |
   *
   */
  uint8_t SID;
  /**
    uint8_t TX_Power, It shall be set based on the AUX_SYNC_IND PDU
     TX_Power ranges from -127 to +20 and it's units is in dBm
  */
  uint8_t tx_power;
  /**
    uint8_t RSSI , this parameter contains the RSSI value, excluding any constant tone Extension.
     RSSI ranges from -127 to +20 and it's units is in dBm
  */
  uint8_t RSSI;
  /** uint16_t Periodic_Advertising_Interval. This parameter specifies the interval between the periodic advertising events */
  uint16_t per_adv_interval;
  /**
   uint8_t Direct Address Type ,Indicates the type of the Address
         0x00 - Public Device Address
         0x01 - Random Device Address
         0x02 - Public Identity Address (corresponds to Resolved Private Address)
         0x03 - Random (static) Identity Address (corresponds to Resolved Private Address)
         0xFE - Resolves Private Address
  */
  uint8_t direct_addr_type;
  /** uint8[6] Direct_Address, Direct_Address of the Advertiser type */
  uint8_t direct_addr[DEVICE_ADDR_LEN];
  /** uint8_t Data _length , Length of the Data field for each device which responded , ranges from 0 to 229 */
  uint8_t data_len;
  /** uint8[256] Data */
  uint8_t data[ADV_DATA_LEN];
} rsi_ble_ae_adv_report_t;

//! ae periodic sync establishment report event
typedef struct rsi_ble_per_adv_sync_estbl_s {
  /**
     uint8_t status , It indicates whether Periodic Advertising is successful or not
              0 - Periodic advertising sync successful
             !0 - Periodic advertising sync failed
  */
  uint8_t status;
  /** uint16_t Sync_Handle, It identifies the periodic Advertising train. Range : 0x0000 to 0x0EFF */
  uint16_t sync_handle;
  /** uint8_t Advertising_SID,  Value of the Advertising SID subfield in the ADI field of the PDU, Range : 0x00 to 0x0F */
  uint8_t adv_sid;
  /**
    uint8_t Advertiser_Address_Type : Indicates the type of the Address
         0x00 - Public Device Address
         0x01 - Random Device Address
         0x02 - Public Identity Address (corresponds to Resolved Private Address)
         0x03 - Random (static) Identity Address (corresponds to Resolved Private Address)
  */
  uint8_t advertiser_addr_type;
  /** uint8[6], Advertiser_Address of the Advertiser type */
  uint8_t advertiser_addr[DEVICE_ADDR_LEN];
  /**
     uint8_t Advertiser_PHY. This parameter specifies the PHY used for the periodic advertising.
                 0x01 - Advertiser PHY is LE 1M
                 0x02 - Advertiser PHY is LE 2M
                 0x03 - Advertiser PHY is LE Coded
  */
  uint8_t advertiser_phy;
  /** uint16_t Periodic_Advertising_Interval. This parameter specifies the interval between the periodic advertising events. */
  uint16_t per_adv_interval;
  /**
    uint16_t Advertiser_Clock_Accuracy. This parameter specifies the accuracy of the periodic advertiser's clock.
                  0x00 - 500 ppm
                  0x01 - 250 ppm
                  0x02 - 150 ppm
                  0x03 - 100 ppm
                  0x04 - 75 ppm
                  0x05 - 50 ppm
                  0x06 - 30 ppm
                  0x07 - 20 ppm
  */
  uint16_t advertiser_clock_accuracy;
} rsi_ble_per_adv_sync_estbl_t;

//! ae periodic adv report event
typedef struct rsi_ble_per_adv_report_s {
  /** uint16_t Sync_Handle, It identifies the periodic Advertising train. Range : 0x0000 to 0x0EFF */
  uint16_t sync_handle;
  /** int8_t TX_Power, It shall be set based on the AUX_SYNC_IND PDU
     TX_Power ranges from -127 to +20 and it's units is in dBm
  */
  int8_t tx_power;
  /** int8_t RSSI , this parameter contains the RSSI value, excluding any constant tone Extension.
     RSSI ranges from -127 to +20 and it's units is in dBm
  */
  int8_t RSSI;
  /** Unused byte for alignment */
  uint8_t unused;
  /**
     uint8_t Data_Status, It specifies about the status of the data sent
                 0x00 - Data Complete
                 0x01 - Data Incomplete, more Data to come
  */
  uint8_t data_status;
  /** uint8_t Data_Length ,Length of the Data Field, Ranges from 0 to 247 */
  uint8_t data_len;
  /** uint8[256] Data, Data received from a Periodic Advertising Packet */
  uint8_t data[ADV_DATA_LEN];
} rsi_ble_per_adv_report_t;

//! ae periodic sync lost report event
typedef struct rsi_ble_per_adv_sync_lost_s {
  /** uint16_t Sync_Handle, It identifies the periodic Advertising train. Range : 0x0000 to 0x0EFF */
  uint16_t sync_handle;
} rsi_ble_per_adv_sync_lost_t;

//! ae scan timeout report event
typedef struct rsi_ble_scan_timeout_s {
  /** uint8_t status , Status indicates that scanning has ended because the duration has expired */
  uint8_t status;
} rsi_ble_scan_timeout_t;

//! ae adv set terminated report event
typedef struct rsi_ble_adv_set_terminated_s {
  /** uint8_t status : Status shows the status on how the Advertising ended
        0 - Advertising successfully ended with a connection being created
       !0 - Advertising ended for another reason and usually error codes would be listed
  */
  uint8_t status;
  /** uint8_t Advertising_Handle : Advertising_Handle in which Advertising has ended, Range : 0x00 to 0xEF */
  uint8_t adv_handle;
  /** uint16_t Connection_Handle : It is the Connection Handle of the connection whose creation ended the advertising, Range : 0x00 to 0xEF */
  uint16_t conn_handle;
  /**
     uint8_t Num_Completed_Extended_Advertising_Events
     Number of completed extended advertising events transmitted by the Controller
  */
  uint8_t num_completed_ae_events;
} rsi_ble_adv_set_terminated_t;

//! ae scan request recvd report event
typedef struct rsi_ble_scan_req_recvd_s {
  /** uint8_t Advertising_Handle : Used to identify an Advertising set , Range : 0x00 to 0xEF */
  uint8_t adv_handle;
  /**
      uint8_t Scanner_Address_Type : Indicates the type of the Address
         0x00 - Public Device Address
         0x01 - Random Device Address
         0x02 - Public Identity Address (corresponds to Resolved Private Address)
         0x03 - Random (static) Identity Address (corresponds to Resolved Private Address)
  */
  uint8_t scanner_addr_type;
  /** uint8[6] Scanner_Address : Address of the Advertising Type */
  uint8_t scanner_addr[DEVICE_ADDR_LEN];
} rsi_ble_scan_req_recvd_t;

/******************************************************
 * *                 Global Variables
 * ******************************************************/
/**
 * @brief Structure representing the BLE buffer statistics.
 *
 * This structure is used to define the parameters for BLE buffer statistics,
 * including the utilization of Asynchronous Connection-Less (ACL) buffers and command packet buffers.
 */
typedef struct chip_ble_buffers_stats_s {
  /** Utilization of ACL (Asynchronous Connection-Less) buffers*/
  uint8_t acl_buffer_utilization;
  /** Utilization of command packet buffers */
  uint8_t cp_buffer_utilization;
} chip_ble_buffers_stats_t;

/******************************************************
 * *              GAP API's Declarations
 * ******************************************************/

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @fn uint8_t rsi_convert_db_to_powindex(int8_t tx_power_in_dBm)
 * @brief Converts the given transmit power in dBm to power index.
 *
 * This function takes a transmit power value in dBm and converts it to a power index value.
 * The power index is used to set the transmit power level in the BLE module.
 *
 * @param tx_power_in_dBm The transmit power in dBm.
 * @return The power index corresponding to the given transmit power.
 */
uint8_t rsi_convert_db_to_powindex(int8_t tx_power_in_dBm);

/** @addtogroup BT-LOW-ENERGY1
* @{
*/
/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_random_address(void)
 * @brief      Request the local device to set a random address. This is a blocking API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @return The following values are returned:
 *     *             - 0 - Success 
 *             Non-Zero Value - Failure 
 *             If the return value is less than 0 
 *             -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_random_address(void);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_random_address_with_value(uint8_t *random_addr)
 * @brief      Request the local device to set a given random address. This is a blocking API.
 * @pre Pre-condition:
 *      - Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  random_addr - random address of the device to be set
 * @return The following values are returned:
 *           *             - 0 - Success 
 *           Non-Zero Value - Failure 
 *           If the return value is less than 0 
 *           -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_random_address_with_value(uint8_t *random_addr);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_start_advertising(void)
 * @brief      Request the local device to start advertising. This is a blocking API.
 *             A received event \ref rsi_ble_on_enhance_connect_t/ \ref rsi_ble_on_connect_t indicates remote device given ble connect command and got connected
 * @pre Pre-condition:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @return The following values are returned:
 *     *             - 0 - Success 
 *     Non-Zero Value - Failure 
 *     If the return value is less than 0 
 *     -4 - Buffer not available to serve the command 
 *     0x4E0C - Command disallowed 
 *     0x4046 - Invalid Arguments
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */

int32_t rsi_ble_start_advertising(void);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_start_advertising_with_values(const void *rsi_ble_adv)
 * @brief      Request the local device to start advertising with specified values. This is a blocking API.
 *     A received event \ref rsi_ble_on_enhance_connect_t/ \ref rsi_ble_on_connect_t indicates remote device given ble connect command and got connected
 * @pre Pre-condition:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API, this is a blocking API.
 * @param[in]  rsi_ble_adv - This structure pointer holds the information of advertising values. This variable is the pointer of the \ref rsi_ble_req_adv_s structure.
 * @return The following values are returned:
 *     *             - 0 - Success 
 *     Non-Zero Value - Failure 
 *     If the return value is less than 0 
 *     -4 - Buffer not available to serve the command 
 *     0x4E0C - Command disallowed 
 *     0x4046 - Invalid Arguments
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_start_advertising_with_values(const void *rsi_ble_adv);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_encrypt(const uint8_t *key, const uint8_t *data, uint8_t *resp)
 * @brief      Encrypt the plain text data fed by the user using the key provided, it uses the AES-128 bit block cypher a logo to generate encrypted data, refer to Bluetooth Spec 5.4 for further details.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API, this is a blocking API.
 * @param[in]  key - 16 Bytes key for Encryption of data.
 * @param[in]  data - 16 Bytes of Data request to encrypt.
 * @param[out] resp - Encrypted data
 * @return The following values are returned:
 *     *             - 0 - Success 
 * Non-Zero Value - Failure 
 * If the return value is less than 0 
 * -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_encrypt(const uint8_t *key, const uint8_t *data, uint8_t *resp);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_stop_advertising(void)
 * @brief      Stop advertising, this is a Blocking API
 * @pre Pre-conditions:
 *        Call rsi_ble_start_advertising() or rsi_ble_start_advertising_with_values() before calling this API.
 * @return The following values are returned:
 *     *             - 0 - Success 
 *     Non-Zero Value - Failure 
 *     If the return value is less than 0 
 *     -4 - Buffer not available to serve the command 
 *     0x4E0C - Command disallowed 
 *     0x4046 - Invalid Arguments
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_stop_advertising(void);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_advertise_data(const uint8_t *data, uint16_t data_len)
 * @brief      Set the advertising data. This is a blocking API.
 * @pre Pre-condition:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  data - Advertising data.
 * @param[in]  data_len - Total length of advertising data.
 * @return The following values are returned:
 *     *             - 0 - Success 
 *     Non-Zero Value - Failure 
 *     If the return value is less than 0 
 *     -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 * @note       The maximum length of advertising data payload is 31 bytes. 
 * @note       The basic format of advertising payload record contains length and data.
 */
int32_t rsi_ble_set_advertise_data(const uint8_t *data, uint16_t data_len);

/*========================================================*/
/**
 * @fn         int32_t rsi_ble_set_scan_response_data(const uint8_t *data, uint16_t data_len);
 * @brief      Request the local device to set the scan response data, this is a Blocking API
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API, this is a Blocking API.
 * @param[in]  data - Data about to be sent
 * @param[in]  data_len - Length of data, which is about to be sent
 * @return The following values are returned:
 *     *             - 0 - Success 
 *     Non-Zero Value - Failure 
 *     If the return value is less than 0 
 *     -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_scan_response_data(const uint8_t *data, uint16_t data_len);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_start_scanning(void)
 * @brief      Start scanning, this is a Blocking API
 *             A received event \ref rsi_ble_on_adv_report_event_t indicates advertise report of remote device received.
 * @pre Pre-condition:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API, this is a Blocking API.
 * @return The following values are returned:
 *     *             - 0 - Success 
 *     Non-Zero Value - Failure 
 *     If the return value is less than 0 
 *     -4 - Buffer not available to serve the command 
 *     0x4E0C - Command disallowed 
 *     0x4046 - Invalid Arguments
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_start_scanning(void);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_start_scanning_with_values(void *rsi_ble_scan_params)
 * @brief      Start scanning with values. This is a blocking API. A received event \ref rsi_ble_on_adv_report_event_t indicates the advertise report of a remote device received.
 * @pre Pre-condition:
 *      - Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  rsi_ble_scan_params - BLE scan parameters structure
 *             please refer rsi_ble_req_scan_s structure for more info
 * @return The following values are returned:
 *     *             - 0 - Success 
 *     Non-Zero Value - Failure 
 *     0x4E0C - Command disallowed 
 *     0x4046 - Invalid Arguments
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_start_scanning_with_values(void *rsi_ble_scan_params);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_stop_scanning(void)
 * @brief      Stop scanning. This is a blocking API
 * @pre Pre-conditions:
 *      - \ref rsi_ble_start_scanning() or rsi_ble_start_scanning_with_values() API needs to be called before this API.
 * @return The following values are returned:
 *     *             - 0 - Success 
 *     Non-Zero Value - Failure 
 *     If the return value is less than 0 
 *     -4 - Buffer not available to serve the command
 *     0x4E0C - Command disallowed
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_stop_scanning(void);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_connect_with_params(uint8_t remote_dev_addr_type,
 *                                              const int8_t *remote_dev_addr,
 *                                              uint16_t scan_interval,
 *                                              uint16_t scan_window,
 *                                              uint16_t conn_interval_max,
 *                                              uint16_t conn_interval_min,
 *                                              uint16_t conn_latency,
 *                                              uint16_t supervision_tout)
 * @brief      Connect to the remote BLE device with the user configured parameters. This is a blocking API,
 * a received event \ref rsi_ble_on_enhance_connect_t / \ref rsi_ble_on_connect_t indicates that the connection successful and 
 * a received event \ref rsi_ble_on_disconnect_t indicates that connection failures have occurred.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  remote_dev_addr_type - AddressType - Specifies the type of the address mentioned in BD Address 
 *                                  - 0 - Public Address 
 *                                  - 1 - Random Address
 * @param[in]  remote_dev_addr - This parameter describes the device address of remote device
 * @param[in]  scan_interval - LE Scan Interval : N=0xXXXX 
 *                           - It is defined as the time interval from when the Controller started its last LE scan until it 
 *                               begins the subsequent LE scan. 
 *                           - Range: 0x0004 to 0x4000 
 *                           - Time = N * 0.625 msec 
 *                           - Time Range: 2.5 msec to 10 . 24 seconds
 * @param[in]  scan_window - LE Scan Window : N=0xXXXX 
 *                         - Amount of time for the duration of the LE scan. LE_Scan_Window
 *                           must be less than or equal to LE_Scan_Interval 
 *                         - Range: 0x0004 to 0x4000 
 *                         - Time = N * 0.625 msec 
 *                         - Time Range: 2.5 msec to 10 . 24 seconds
 * @param[in]  conn_interval_max - Max Connection Interval : N=0xXXXX 
 *                               - Minimum value for the connection event interval, which must 
 *                                 be greater than or equal to Conn_Interval_Min. 
 *                               - Range: 0x0006 to 0x0C80 
 *                               - Time = N * 1.25 msec 
 *                               - Time Range: 7.5 msec to 4 seconds. 
 *                               - 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use
 * @param[in]  conn_interval_min - Min Connection Interval : N=0xXXXX 
 *                               - Minimum value for the connection event interval, which must
 *                                 be greater than or equal to Conn_Interval_Max. 
 *                               - Range: 0x0006 to 0x0C80 
 *                               - Time = N * 1.25 msec 
 *                               - Time Range: 7.5 msec to 4 seconds. 
 *                               - 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use
 * @param[in]  conn_latency - Connection Latency : N = 0xXXXX 
 *                          - Peripheral latency for the connection in number of connection events. 
 *                          - Range: 0x0000 to 0x01F4
 * @param[in]  supervision_tout - Supervision Timeout : N = 0xXXXX 
 *                              - Supervision timeout for the LE Link. 
 *                              - Range: 0x000A to 0x0C80 
 *                              - Time = N * 10 msec 
 *                              - Time Range: 100 msec to 32 seconds 
 *                              - 0x0000 - 0x0009 and 0x0C81 - 0xFFFF - Reserved for future use
 * @return The following values are returned:
 *                              -     0 - Success 
 *                              -     Non-Zero Value - Failure 
 *                              -     0x4E0C - Command disallowed 
 *                              -     0x4046 - Invalid Arguments
 * @note       If a connection can't be established, for example, the remote device has gone out of range, has entered into deep sleep, or is not advertising, 
 *             the stack will try to connect forever. In this case, the application will not get an event related to the connection request. 
 * @note       To recover from this situation, the application can implement a timeout and call rsi_ble_connect_cancel() to cancel the connection request. 
 *             Subsequent calls of this command have to wait for the ongoing command to complete.
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_connect_with_params(uint8_t remote_dev_addr_type,
                                    const int8_t *remote_dev_addr,
                                    uint16_t scan_interval,
                                    uint16_t scan_window,
                                    uint16_t conn_interval_max,
                                    uint16_t conn_interval_min,
                                    uint16_t conn_latency,
                                    uint16_t supervision_tout);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_connect(uint8_t remote_dev_addr_type, const int8_t *remote_dev_addr)
 * @brief      Connect to the remote BLE device. This is a blocking API,
 * a received event \ref rsi_ble_on_enhance_connect_t/ \ref rsi_ble_on_connect_t indicates that the connection successful and 
 * a received event \ref rsi_ble_on_disconnect_t indicates that connection failures have occurred.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  remote_dev_addr_type - This parameter describes the address type of the remote device
 * @param[in]  remote_dev_addr - This parameter describes the device address of the remote device
 * @return The following values are returned:
 * *             - 0 - Success 
 * Non-Zero Value - Failure 
 * 0x4E0C - Command disallowed 
 * 0x4046 - Invalid Arguments
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 * @note If a connection can't be established, for example, the remote device has gone out of range, has entered into deep sleep, or is not advertising, 
 * @note The stack will try to connect forever. In this case, the application will not get an event related to the connection request. 
 * @note To recover from this situation, the application can implement a timeout and call rsi_ble_connect_cancel() to cancel the connection request. 
 * @note Subsequent calls of this command have to wait for the ongoing command to complete.
 */
int32_t rsi_ble_connect(uint8_t remote_dev_addr_type, const int8_t *remote_dev_addr);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_enhance_connect_with_params(void* ble_enhance_conn_params)
 * @brief      Connect to the remote BLE device with the user configured parameters.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  ble_enhance_conn_params - BLE enhance connection parameter structure. See notes for the fields in this structure.
 * @return The following values are returned:
 * *             - 0 - Success 
 * Non-Zero Value - Failure 
 * If the return value is less than 0 
 * -4 - Buffer not available to serve the command 
 * 0x4E0C - Command disallowed 
 * 0x4046 - Invalid Arguments 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors).
 * @note       The following fields are included in the ble_enhance_conn_params parameter structure:
 *               - dev_addr_type - Address type of the device to connect.
 *                 - 0 - Public Address 
 *                 - 1 - Random Address  
 *               - dev_addr - Address of the device to connect.  
 *               - filter_policy - Policy used to determine whether the filter accept list is used.
 *                 - 0 - Filter accept list is not used to determine which advertiser to connect to. 
 *                 - 1 - Filter accept list is used to determine which advertiser to connect to.  
 *               - own_addr_type - Own address type
 *               - le_scan_interval - The time interval from when the Controller started its last LE scan until it begins the subsequent LE scan. 
 *                 - Range: 0x0004 to 0x4000 
 *                 - Time = le_scan_interval * 0.625 msec
 *                 - Time Range: 2.5 msec to 10 . 24 seconds  
 *               - le_scan_window - Amount of time for the duration of the LE scan. This must be less than or equal to le_scan_interval. 
 *                 - Range: 0x0004 to 0x4000 
 *                 - Time = le_scan_window * 0.625 msec 
 *                 - Time Range: 2.5 msec to 10.24 seconds  
 *               - conn_interval_min - Minimum value for the connection event interval. This must be greater than or equal to conn_interval_max. 
 *                 - Range: 0x0006 to 0x0C80 
 *                 - Time = conn_interval_min * 1.25 msec 
 *                 - Time Range: 7.5 msec to 4 seconds. 
 *                 - 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use  
 *               - conn_interval_max - Maximum value for the connection event interval. This must be greater than or equal to conn_interval_min.
 *                 - Range: 0x0006 to 0x0C80 
 *                 - Time = conn_interval_max * 1.25 msec 
 *                 - Time Range: 7.5 msec to 4 seconds. 
 *                 - 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use  
 *               - conn_latency - Peripheral latency for the connection in number of connection events. 
 *                 - Range: 0x0000 to 0x01F4  
 *               - supervision_tout - Supervision timeout for the LE Link.
 *                 - Range: 0x000A to 0x0C80 
 *                 - Time = N * 10 msec 
 *                 - Time Range: 100 msec to 32 seconds 
 *                 - 0x0000 - 0x0009 and 0x0C81 - 0xFFFF - Reserved for future use  
 *               - min_ce_length - Minimum length of connection event recommended for this LE connection. 
 *                 - Range: 0x0000 to 0xFFFF 
 *                 - Time = N * 0.625 msec  
 *               - max_ce_length - Maximum length of connection event recommended for this LE connection. 
 *                 - Range: 0x0000 to 0xFFFF 
 *                 - Time = N * 0.625 msec  
 */
int32_t rsi_ble_enhance_connect_with_params(void *ble_enhance_conn_params);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_connect_cancel(const int8_t *remote_dev_address)
 * @brief      Cancel the connection to the remote BLE device. This is a blocking API,
 * A received event \ref rsi_ble_on_disconnect_t indicates disconnect complete.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address - This parameter describes the device address of the remote device
 * @return The following values are returned:
 *                             - 0 - Success 
 *                             - Non-Zero Value - Failure 
 *                             - 0x4E0C - Command disallowed 
 *                             - 0x4046 - Invalid Arguments 
 *                             - 0x4E02 - Unknown Connection Identifier 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_connect_cancel(const int8_t *remote_dev_address);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_disconnect(const int8_t *remote_dev_address)
 * @brief      Disconnect with the remote BLE device. This is a blocking API.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address - This parameter describes the device address of the remote device
 * @return The following values are returned:
 * 0 - Success 
 * Non-Zero Value - Failure 
 * 0x4E0C - Command disallowed 
 * 0x4D05 - BLE socket not available 
 * 0x4E62 - Invalid Parameters 
 * 0x4D04-  BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_disconnect(const int8_t *remote_dev_address);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_device_state(uint8_t *resp)
 * @brief      Get the local device state. This is a blocking API. The state value is filled in "resp".
 * @pre Pre-conditions:
 *        - Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] resp - This is an output parameter which consists of local device state. 
 * This is a 1-byte value. The possible states are described below: 
 * BIT(0)    Advertising state 
 * BIT(1)    Scanning state 
 * BIT(2)    Initiating state 
 * BIT(3)    Connected state 
 * BIT(4)    Extended Advertising state 
 * BIT(5)    Extended Scanning state
 * BIT(6)    Extended Initiating state         
 * @return The following values are returned:
 *                                   - 0 - Success 
 *                                   - Non-Zero Value - Failure 
 *                                   - If the return value is less than 0 
 *                                   - -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_device_state(uint8_t *resp);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_smp_pairing_cap_data(rsi_ble_set_smp_pairing_capabilty_data_t *smp_pair_cap_data)
 * @brief      Set the SMP Pairing Capability of local device. This is a blocking API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  smp_pair_cap_data - This structure pointer holds the information of the SMP capability data values 
 * please refer \ref rsi_ble_set_smp_pairing_capabilty_data structure for more info
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_smp_pairing_cap_data(rsi_ble_set_smp_pairing_capabilty_data_t *smp_pair_cap_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_local_irk_value(const uint8_t *l_irk)
 * @brief      Set the IRK value to the local device. This is a blocking API.
 * @pre Pre-conditions:
 *        - Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  l_irk -  l_irk  Pointer to local_irk
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_local_irk_value(const uint8_t *l_irk);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_conn_param_resp(const uint8_t *remote_dev_address, uint8_t status)
 * @brief      Give the response for the remote device connection parameter request. This is a blocking API.
 * A received event \ref rsi_ble_on_conn_update_complete_t indicates connection update procedure is successful.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 *             rsi_ble_on_remote_conn_params_request_event should be called by the application.
 * @param[in]  remote_dev_address   - remote device address
 * @param[in]  status           - accept or reject the connection parameters update request 
 *                          -   0 - ACCEPT, 
 *                          - 1 - REJECT 
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure
 * - 0x4E0C - Command disallowed 
 * - 0x4046 - Invalid Arguments 
 * - 0x4E02 - Unknown Connection Identifier
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_conn_param_resp(const uint8_t *remote_dev_address, uint8_t status);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_smp_pair_request(uint8_t *remote_dev_address, uint8_t io_capability, uint8_t mitm_req)
 * @brief      Request the SMP pairing process with the remote device. This is a blocking API. 
 * - A received event \ref rsi_ble_on_smp_request_t indicated remote device is given Security Request  and need to respond back with \ref rsi_ble_smp_pair_request 
 * - A received event \ref rsi_ble_on_smp_response_t indicated remote device is given SMP Pair Request and need to respond back with \ref rsi_ble_smp_pair_response 
 * - A received event \ref rsi_ble_on_smp_failed_t indicated SMP procedure have failed
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address -  This is the remote device address
 * @param[in]  io_capability - This is the device input output capability 
 * - 0x00 - Display Only 
 * - 0x01 - Display Yes/No 
 * - 0x02 - Keyboard Only 
 * - 0x03 - No Input No Output
 * @param[in]  mitm_req - MITM enable/disable 
 *                      - 0 - Disable 
 *                      - 1 - Enable
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command 
 * - 0x4D05  BLE socket not available 
 * - 0x4E62     Invalid Parameters 
 * - 0x4D04 BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_smp_pair_request(uint8_t *remote_dev_address, uint8_t io_capability, uint8_t mitm_req);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_smp_pair_failed(uint8_t *remote_dev_address, uint8_t reason)
 * @brief      Send SMP pairing failure reason to the remote device.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address -  This is the remote device address
 * @param[in]  reason - This is the reason for SMP Pairing Failure 
 * - 0x05 - Pairing Not Supported 
 * - 0x08 - Unspecified Reason 
 * - 0x09 - Repeated Attempts 
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command
 */
int32_t rsi_ble_smp_pair_failed(uint8_t *remote_dev_address, uint8_t reason);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_ltk_req_reply(uint8_t *remote_dev_address,
 *                                           uint8_t reply_type, const uint8_t *ltk)
 * @brief      Send the local long term key of its associated local EDIV and local Rand. This is a blocking API. 
 * - A received event \ref rsi_ble_on_encrypt_started_t indicated encrypted event is received from module 
 * - A received event \ref rsi_ble_on_smp_failed_t indicated SMP procedure have failed
 * @param[in]  remote_dev_address - remote device address
 * @param[in]  reply_type  - 0 - Negative reply 
 *                         - BIT(0) - Positive Reply (Encryption Enabled)
 *                         - BIT(1) - Un authenticated LTK or STK-based Encryption Enabled 
 *                         - BIT(2) - Authenticated LTK or STK-based Encryption Enabled 
 *                         - BIT(3) - Authenticated LTK with LE Secure Connections based Encryption Enabled 
 *                         - BIT(4) to BIT(6) - Reserved for Future use 
 *                         - BIT(7) - LE Secure Connection Enabled 
 * @param[in]  ltk - Long Term Key 16 bytes
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command 
 * - 0x4D05  BLE socket not available 
 * - 0x4E62     Invalid Parameters 
 * - 0x4D04 BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_ltk_req_reply(uint8_t *remote_dev_address, uint8_t reply_type, const uint8_t *ltk);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_smp_pair_response(uint8_t *remote_dev_address, uint8_t io_capability, uint8_t mitm_req)
 * @brief      Send SMP pairing response during the process of pairing with the remote device. This is a blocking API.
 * - A received event \ref rsi_ble_on_smp_passkey_t indicated Legacy SMP passkey is received and need to respond back with \ref rsi_ble_smp_passkey() 
 * - A received event \ref rsi_ble_on_sc_passkey_t indicated BLE SC passkey is received and need to respond back with \ref rsi_ble_smp_passkey() 
 * - A received event \ref rsi_ble_on_smp_passkey_display_t indicates SMP passkey display is received from the module 
 * - A received event \ref rsi_ble_on_smp_failed_t indicated SMP Failed event is received
 * @pre Pre-condition:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address -  This is the remote device address
 * @param[in]  io_capability - This is the device input output capability 
 * 0x00 - Display Only 
 * 0x01 - Display Yes/No 
 * 0x02 - Keyboard Only 
 * 0x03 - No Input No Output
 * @param[in]  mitm_req -  MITM Request info 
 *                      - 0 - Disable 
 *                      - 1 - Enable
 * @return The following values are returned:
 *  - 0 - Success 
 *  - Non-Zero Value - Failure 
 *  - If the return value is less than 0 
 *  - -4 - Buffer not available to serve the command 
 *  - 0x4D05  BLE socket not available 
 *  - 0x4E62    Invalid Parameters 
 *  - 0x4D04    BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_smp_pair_response(uint8_t *remote_dev_address, uint8_t io_capability, uint8_t mitm_req);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_smp_passkey(uint8_t *remote_dev_address, uint32_t passkey)
 * @brief      Send SMP passkey during SMP pairing process with the remote device. This is a Blocking API 
 * A received event \ref rsi_ble_on_encrypt_started_t indicated encrypted event is received from module 
 * A received event \ref rsi_ble_on_le_security_keys_t indicates exchange of security keys completed after encryption 
 * A received event \ref rsi_ble_on_smp_failed_t indicated SMP procedure have failed
 * @pre Pre-conditions:
 *        Call \ref rsi_ble_smp_pair_request and \ref rsi_ble_smp_pair_response
 *             before calling this API.
 * @param[in]  remote_dev_address -  This is the remote device address
 * @param[in]  passkey - This is the key required in pairing process
 * @return The following values are returned:
 * -  0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command 
 * - 0x4D05  BLE socket not available 
 * - 0x4E62     Invalid Parameters 
 * - 0x4D04 BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_smp_passkey(uint8_t *remote_dev_address, uint32_t passkey);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_le_ping_timeout(uint8_t *remote_dev_address, uint16_t *time_out)
 * @brief      Get the timeout value of the LE ping. This is a blocking API.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address - This is the remote device address
 * @param[out] time_out - This a response parameter which holds timeout value for 
 *                        authentication payload command.
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command 
 * - 0x4D05  BLE socket not available 
 * - 0x4E62     Invalid Parameters 
 * - 0x4D04 BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 * @note       Currently Get ping is not supported.
 */
int32_t rsi_ble_get_le_ping_timeout(uint8_t *remote_dev_address, uint16_t *time_out);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_le_ping_timeout(uint8_t *remote_dev_address, uint16_t time_out)
 * @brief      Set the timeout value of the LE ping. This is a blocking API.
 * A received event of \ref rsi_ble_on_le_ping_payload_timeout_t indicates LE ping payload timeout expired
 * @pre Pre-conditions:
 *       - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address -  This is the remote device address
 * @param[out] time_out - This input parameter sets timeout value for authentication 
 *                       payload command.(in milliseconds)
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command 
 * - 0x4D05  BLE socket not available 
 * - 0x4E62     Invalid Parameters 
 * - 0x4D04 BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_le_ping_timeout(uint8_t *remote_dev_address, uint16_t time_out);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_clear_acceptlist(void)
 * @brief      Clear all the BD address present in accept list. This is a blocking API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_clear_acceptlist(void);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_addto_acceptlist(const int8_t *dev_address, uint8_t dev_addr_type)
 * @brief      Add BD address to accept list. This is a blocking API.
 * @pre Pre-conditions:
 *        - Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  dev_address - Address of the device which is going to add in accept list
 * @param[in]  dev_addr_type - address type of BD address
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command
 * @note       Maximum number of device address that firmware can store is 10. 
 * Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_addto_acceptlist(const int8_t *dev_address, uint8_t dev_addr_type);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_deletefrom_acceptlist(const int8_t *dev_address, uint8_t dev_addr_type)
 * @brief      Delete particular BD address from accept list. This is a blocking API.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_addto_acceptlist() API needs to be called before this API.
 * @param[in]  dev_address - Address of the device which is going to delete from accept list
 * @param[in]  dev_addr_type - address type of BD address
 * @return The following values are returned:
 * - 0 - Success 
 * - Non-Zero Value - Failure 
 * - If the return value is less than 0 
 * - -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_deletefrom_acceptlist(const int8_t *dev_address, uint8_t dev_addr_type);
/*==============================================*/
/**
 * @fn        int32_t rsi_ble_resolvlist(uint8_t process_type,
 *                                      uint8_t remote_dev_addr_type,
 *                                      uint8_t *remote_dev_address,
 *                                      const uint8_t *peer_irk,
 *                                      const uint8_t *local_irk)
 * @brief     Resolvlist API used for multiple purposes based on the process type. It will be used to add/remove/clear a device to/from the list. This is a blocking API.
 * @pre Pre-conditions:
 *       Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in] process_type - Indicates which type of process this is, as follows: 
 *                          1 - add a device to the resolve list 
 *                          2 - remove a device from the resolve list 
 *                          3 - clear the entire resolve list
 * @param[in] remote_dev_addr_type  - typr of the remote device address
 * @param[in] remote_dev_address    - remote device address 
 *              0 - Public identity address 
 *              1 - Random (static) identity address 
 * @param[in] peer_irk          - 16-byte IRK of the peer device
 * @param[in] local_irk         - 16-byte IRK of the local device
 * @return The following values are returned:
 *             - 0 - Success 
 *             - Non-Zero Value - Failure 
 *             - If the return value is less than 0 
 *             - -4 - Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_resolvlist(uint8_t process_type,
                           uint8_t remote_dev_addr_type,
                           uint8_t *remote_dev_address,
                           const uint8_t *peer_irk,
                           const uint8_t *local_irk);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_resolving_list_size(uint8_t *resp)
 * @brief      Request to get resolving list size. This is a blocking API.
 * @pre Pre-conditions:
 *       - Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] resp - output parameter which consists of supported resolving the list size.
 * @return The following values are returned:
 *            - 0 - Success 
 *            - Non-Zero Value - Failure 
 *            - If the return value is less than 0 
 *            - -4 : Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_resolving_list_size(uint8_t *resp);
/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_addr_resolution_enable(uint8_t enable, uint16_t tout)
 * @brief      Request to enable address resolution, and to set resolvable private address timeout. This is a blocking API.
 * @pre Pre-conditions:
 *        - Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  enable - value to enable/disable address resolution 
 *      - 1 - enables address resolution 
 *    - 0 - disables address resolution
 * @param[in]  tout -  the period for changing address of our local device in seconds 
 *      Value ranges from 0x0001 to 0xA1B8 (1 s to approximately 11.5 hours)
 * @return The following values are returned:
 *             - 0 - Success 
 *             - Non-Zero Value - Failure 
 *             - If the return value is less than 0 
 *             - -4 : Buffer not available to serve the command
 */
int32_t rsi_ble_set_addr_resolution_enable(uint8_t enable, uint16_t tout);
/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_privacy_mode(uint8_t remote_dev_addr_type,
 *                                              uint8_t *remote_dev_address, uint8_t privacy_mode)
 * @brief      Request to set privacy mode for particular device, this is a Blocking API
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  remote_dev_addr_type - type of the remote device address 
 *                                    0 - Public Identity Address 
 *                                    1 - Random (static) Identity Address
 * @param[in]  remote_dev_address   - remote device address
 * @param[in]  privacy_mode         - type of the privacy mode 
 *              0 - Network privacy mode 
 *        1 - Device privacy mode
 * @return The following values are returned:
 *             0 - Success 
 *             Non-Zero Value - Failure 
 *             If the return value is less than 0 
 *             -4 : Buffer not available to serve the command
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_privacy_mode(uint8_t remote_dev_addr_type, uint8_t *remote_dev_address, uint8_t privacy_mode);
/*==============================================*/
/**
 * @fn         int32_t rsi_ble_readphy(const int8_t *remote_dev_address, rsi_ble_resp_read_phy_t *resp)
 * @brief      Reads the TX and RX PHY rates of the Connection. This is a blocking API.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address - remote device address
 * @param[out] resp - pointer to store the response
        please refer \ref rsi_ble_resp_read_phy_s structure for more info.
 * @return The following values are returned:
 *             0 - Success 
 *             Non-Zero Value - Failure
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_readphy(const int8_t *remote_dev_address, rsi_ble_resp_read_phy_t *resp);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_setphy(const int8_t *remote_dev_address, uint8_t tx_phy, uint8_t rx_phy,
 *                                    uint16_t coded_phy)
 * @brief      Set TX and RX PHY. This is a blocking API.
 *             A received event \ref rsi_ble_on_phy_update_complete_t indicates PHY rate update complete.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address - remote device address 
 * @param[in]  tx_phy - transmit PHY rate 
 *      BIT(0) - Host prefers to use the LE 1M transmitter PHY (possibly among others)
 *                      - BIT(1) - Host prefers to use the LE 2M transmitter PHY (possibly among others) 
 *                      - BIT(2) - Host prefers to use the LE Coded transmitter PHY (possibly among others) 
 *                      - BIT(3) - BIT(7) Reserved for future use 
 * @param[in]  rx_phy - receive PHY rate 
 *      BIT(0) - Host prefers to use the LE 1M receiver PHY (possibly among others) 
 *                      - BIT(1) - Host prefers to use the LE 2M receiver PHY (possibly among others) 
 *                      - BIT(2) - Host prefers to use the LE Coded receiver PHY (possibly among others) 
 *                      - BIT(3) - BIT(7) Reserved for future use 
 * @param[in]  coded_phy - TX/RX coded PHY rate 
 *                           - 0 = Host has no preferred coding when transmitting on the LE Coded PHY 
 *                         - 1 = Host prefers that S=2 coding be used when transmitting on the LE Coded PHY 
 *                         - 2 = Host prefers that S=8 coding be used when transmitting on the LE Coded PHY 
 *                         - 3 = Reserved for future use 
 * @return The following values are returned:
 *              0   -  Success 
 *              Non-Zero Value - Failure 
 *              0x4D05  BLE socket not available 
 *              0x4E62  Invalid Parameters 
 *              0x4D04  BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_setphy(const int8_t *remote_dev_address, uint8_t tx_phy, uint8_t rx_phy, uint16_t coded_phy);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_conn_params_update(const uint8_t *remote_dev_address,
 *                                             uint16_t min_int,
 *                                             uint16_t max_int,
 *                                             uint16_t latency,
 *                                             uint16_t timeout)
 * @brief       Requests the connection parameters change with the remote device,
 *                    When the Silicon Labs device acts as a central, this API is used to update the connection parameters.
 *                    When the Silicon Labs device acts as a peripheral, this API is used to request the central to initiate the connection update procedure. This is a blocking API.
 *              A received event \ref rsi_ble_on_conn_update_complete_t indicates connection parameters update complete.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address   - remote device address
 * @param[in]  min_int          - minimum value for the connection interval. 
 *                                this shall be less than or equal to max_int .
 * @param[in]  max_int          - maximum value for the connection interval. 
 *                                this shall be greater than or equal to min_int.
 * @param[in]  latency          - peripheral latency for the connection in number of connection events.
 *                    Ranges from 0 to 499
 * @param[in]  timeout          - supervision timeout for the LE Link. 
 *                                Ranges from 10 to 3200 (Time = N * 10 ms, Time Range: 100 ms to 32 s)
 * @return The following values are returned:
 *              - 0   -  Success 
 *              - Non-Zero Value - Failure 
 *              - 0x4D05  BLE socket not available 
 *              - 0x4E62    Invalid Parameters 
 *              - 0x4D04    BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors).
 * @note       min_int and max_int values ranges from 6 to 3200 (Time = N * 1.25 ms, Time Range: 7.5 ms to 4 s)
        latency : If latency value is greater than 32 ,Limiting the peripheral latency value to 32
        Max supported peripheral latency is 32 when Device is in peripheral Role.
 *
 */
int32_t rsi_ble_conn_params_update(const uint8_t *remote_dev_address,
                                   uint16_t min_int,
                                   uint16_t max_int,
                                   uint16_t latency,
                                   uint16_t timeout);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_data_len(uint8_t *remote_dev_address, uint16_t tx_octets, uint16_t tx_time)
 * @brief      Sets the TX octets and the TX time of specified link (remote device connection), this is a Blocking API. 
 *             A received event \ref rsi_ble_on_data_length_update_t indicates data length update complete.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  remote_dev_address   - remote device device 
 * @param[in]  tx_octets        - preferred maximum number of payload octets that the local Controller 
 *                                should include in a single Link Layer packet on this connection.
 * @param[in]  tx_time          - preferred maximum number of microseconds that the local Controller 
 *                                should use to transmit a single Link Layer packet on this connection.
 * @return The following values are returned:
 *              - 0 - LE_Set_Data_Length command succeeded. 
 *              - Non-Zero Value - Failure 
 *              - 0x4D05  BLE socket not available 
 *              - 0x4E62    Invalid Parameters 
 *              - 0x4D04    BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_data_len(uint8_t *remote_dev_address, uint16_t tx_octets, uint16_t tx_time);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_read_max_data_len(rsi_ble_read_max_data_length_t *blereaddatalen)
 * @brief      reads the max supported values of TX octets, TX time, RX octets and Rx time. This is a blocking API.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[out]  blereaddatalen - pointer to structure variable,
         Please refer rsi_ble_resp_read_max_data_length_s structure for more info.
 * @return The following values are returned:
 *             - 0 - command success 
 *             - Non-Zero Value - Failure
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_read_max_data_len(rsi_ble_read_max_data_length_t *blereaddatalen);
/** @} */

/** @addtogroup BT-LOW-ENERGY6
* @{
*/

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_rx_test_mode(uint8_t rx_channel, uint8_t phy, uint8_t modulation)
 * @brief      Start the BLE RX test mode in controller. This is a blocking API.
 * @param[in]  rx_channel - Channel in which packet have to be received (0 - 39)
 * @param[in]  phy - 0x00  Reserved for future use 
 *                   0x01  Receiver set to use the LE 1M PHY 
 *                   0x02  Receiver set to use the LE 2M PHY 
 *                   0x03  Receiver set to use the LE Coded PHY 
 *                   (0x04 - 0xFF)   Reserved for future use.
 * @param[in]  modulation - 0x00  Assume transmitter would have a standard standard modulation index 
 *                          0x01  Assume transmitter would have a stable modulation index 
 *                          (0x02 - 0xFF)  Reserved for future use
 * @return The following values are returned:
 *             - 0 - Success 
 *             - Non-Zero Value - Failure
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_rx_test_mode(uint8_t rx_channel, uint8_t phy, uint8_t modulation);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_tx_test_mode(uint8_t tx_channel, uint8_t phy,
 *                                          uint8_t tx_len, uint8_t mode)
 * @brief      Start the BLE TX test mode in controller. This is a blocking API.
 * @param[in]  tx_channel -  RF Channel (0-39). 
 * @param[in]  phy - 0x00  Reserved for future use 
 *                  - 0x01  Transmitter set to use the LE 1M PHY 
 *                  - 0x02  Transmitter set to use the LE 2M PHY 
 *                  - 0x03  Transmitter set to use the LE Coded PHY with S = 8 data coding 
 *                  - 0x04  Transmitter set to use the LE Coded PHY with S = 2 data coding 
 *                  - (0x05 - 0xFF)  Reserved for future use.
 * @param[in] tx_len - Length in bytes of payload data in each packet ( 1 - 251 bytes).
 * @param[in] mode - 0x00  PRBS9 sequence '11111111100000111101...' 
 *                 - 0x01  Repeated '11110000' 
 *                 - 0x02  Repeated '10101010' 
 *                 - 0x03  PRBS15 
 *                 - 0x04  Repeated '11111111' 
 *                 - 0x05  Repeated '00000000' 
 *                   - 0x06  Repeated '00001111' 
 *                   - 0x07  Repeated '01010101' 
 *                 - 0x08 - 0xFF Reserved for future use 
 * @return The following values are returned:
 *               - 0 - Success 
 *               - Non-Zero Value - Failure
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_tx_test_mode(uint8_t tx_channel, uint8_t phy, uint8_t tx_len, uint8_t mode);

/*==============================================*/
/**
 * @fn        int32_t rsi_ble_end_test_mode(uint16_t *num_of_pkts)
 * @brief     Stop the BLE TX / RX test mode in controller. This is a blocking API.
 * @param[out] num_of_pkts - Number of RX packets received are displayed when RX test is stopped 
 * @return The following values are returned:
 *             - 0 - Success 
 *             - Non-Zero Value - Failure
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_end_test_mode(uint16_t *num_of_pkts);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_per_transmit(struct rsi_ble_per_transmit_s *rsi_ble_per_tx)
 * @brief      Initiate the BLE transmit PER mode in the controller. This is a blocking API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  rsi_ble_per_tx - This parameter is the buffer to hold the structure values 
 *                            This is a structure variable of struct \ref rsi_ble_per_transmit_s
 * @return The following values are returned:
 *             - 0 - Success 
 *             - Non-Zero Value - Failure
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_per_transmit(struct rsi_ble_per_transmit_s *rsi_ble_per_tx);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_per_receive(struct rsi_ble_per_receive_s *rsi_ble_per_rx)
 * @brief      Initiate the BLE receive PER mode in the controller. This is a blocking API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  rsi_ble_per_rx - This parameter is the buffer to hold the structure values 
 *             This is a structure variable of struct \ref rsi_ble_per_receive_s
 * @return The following values are returned:
 *             - 0 - Success 
 *             - Non-Zero Value - Failure
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_per_receive(struct rsi_ble_per_receive_s *rsi_ble_per_rx);
/** @} */

/** @addtogroup BT-LOW-ENERGY1
* @{
*/
/*==============================================*/
/**
 * @fn         int32_t rsi_ble_accept_list_using_adv_data(uint8_t enable,
 *                                                    uint8_t data_compare_index,
 *                                                    uint8_t len_for_compare_data,
 *                                                    const uint8_t *payload)
 * @brief      Give vendor-specific command to set the acceptlist feature based on
 *             the advertisers advertising payload, this is a Blocking API
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  enable - enable/disable
 * @param[in]  data_compare_index - the starting index of the data to compare
 * @param[in]  len_for_compare_data - total length of data to compare
 * @param[in]  payload - Payload
 * @return The following values are returned:
 *             - 0 - Success 
 *             - Non-Zero Value - Failure 
 *             - If the return value is less than 0 
 *             - -4 - Buffer not available to serve the command
 *             - 0x4E62     Invalid Parameters 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_accept_list_using_adv_data(uint8_t enable,
                                           uint8_t data_compare_index,
                                           uint8_t len_for_compare_data,
                                           const uint8_t *payload);

/*==============================================*/
/**
 * @fn         void BT_LE_ADPacketExtract(uint8_t *remote_name, const uint8_t *pbuf, uint8_t buf_len);
 * @brief      Used to extract remote Bluetooth device name from the received advertising report.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  remote_name - device name
 * @param[in]  pbuf -  advertise data packet buffer pointer
 * @param[in]  buf_len - buffer length
 * 
 */
void BT_LE_ADPacketExtract(uint8_t *remote_name, const uint8_t *pbuf, uint8_t buf_len);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_start_encryption(uint8_t *remote_dev_address, uint16_t ediv,
 *                                              const uint8_t *rand, const uint8_t *ltk)
 * @brief      Start the encryption process with the remote device. This is a blocking API.
 *             A received event \ref rsi_ble_on_encrypt_started_t indicated encrypted event is received from module.
 *             A received event \ref rsi_ble_on_le_security_keys_t indicates exchange of security keys completed after encryption.
 *             A received event \ref rsi_ble_on_smp_failed_t indicated SMP procedure have failed.
 * @pre Pre-conditions:
 *       - Encryption enabled event should come before calling this API for second time SMP connection.
 * @param[in]  remote_dev_address - Remote BD address in string format
 * @param[in]  ediv - remote device ediv value.
 * @param[in]  rand - remote device rand value.
 * @param[in]  ltk  - remote device ltk value.
 * @return The following values are returned:
 *             - 0 - Success 
 *             - Non-Zero Value - Failure 
 *             - If the return value is less than 0 
 *             - -4 - Buffer not available to serve the command
 *             - 0x4D05  BLE socket not available 
 *             - 0x4E62     Invalid Parameters 
 *             - 0x4D04 BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors).
 */
int32_t rsi_ble_start_encryption(uint8_t *remote_dev_address, uint16_t ediv, const uint8_t *rand, const uint8_t *ltk);

/*==============================================*/
/**
 * @fn          int32_t rsi_ble_set_ble_tx_power(int8_t tx_power)
 * @brief       Set TX power
 * @param[in]   tx_power Power value
 * @return The following values are returned:
 *              - 0 - Success 
 *              - Non-zero value - Failure
 *              - 0x4E02 - Unknown connection identifier
 *              - 0x4E01    - Unknown HCI command
 *              - 0x4E0C    - Command disallowed 
 *              - 0x4046 - Invalid arguments
 *              - 0x4D04    - BLE not connected 
 *              - 0x4D14    - BLE parameter out of mandatory range
 *              - 0x4D15  - Unsuported power index for 915
 * @note        This is a Blocking API.
 * @note        Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors).
 * @note        The higher power will be backed off based on country region.
 * @note        Use the following setting to indicate tx_power as an index: `#define RSI_BLE_PWR_INX 30`
 * Default value for power index is 31. 
 * Valid values for power index range from 1 to 31 and 33 to 127:
 *   - 1 to 31: BLE - 0 dBm mode.  
 *   - 33 to 63: BLE - 10 dBm mode. 
 *   - 64 to 82: BLE - 1 dBm - 18 dBm HP mode in the resolution of 1 dBm.
 *   - 104 to 126: BLE - 0.5d Bm - 11 dBm HP mode in the resolution of 0.5 dbm.
 *   - 127: BLE HP Mode, max power supported.
 * @note        Use the following setting to indicate tx_power in dBm (-8 to 18 dBm): `#define RSI_BLE_PWR_INX_DBM  1`
 * @note        When switching between HP mode and LP mode, ensure that no protocol activity is running.  
 * @note        For the LP Chain - Power index vs output power in dBm in E2E mode:
 *   |       Power Index   |                  Output Power in dBm                              |
 *   ----------------------|-------------------------------------------------------------------|
 *   |      1              |             -22.3054959                       |
 *   |      2              |             -16.59332574                      |
 *   |      3              |             -13.38278365                      |
 *   |      4              |             -11.19804718                                  |
 *   |      5              |             -9.576522466                                  |
 *   |      6              |             -8.312070432                                  |
 *   |      7              |             -7.294640362                                  |
 *   |      8              |             -6.458448154                                  |
 *   |      9              |             -5.760963318                                  |
 *   |      10             |             -5.173042366                                  |
 *   |      11             |             -4.673788189                                  |
 *   |      12             |             -4.247653993                                  |
 *   |      13             |             -3.882708784                                  |
 *   |      14             |             -3.569545894                                  |
 *   |      15             |             -3.300567503                                  |
 *   |      16             |             -3.069499167                                  |
 *   |      17             |             -2.871050592                                  |
 *   |      18             |             -2.700672503                                  |
 *   |      19             |             -2.554378603                                  |
 *   |      20             |             -2.428612817                                  |
 *   |      21             |             -2.32014891                                   |
 *   |      22             |             -2.226013876                                  |
 *   |      23             |             -2.143429275                                  |
 *   |      24             |             -2.069766557                                  |
 *   |      25             |             -2.002513642                                  |
 *   |      26             |             -1.939250859                                  |
 *   |      27             |             -1.87763493                                   |
 *   |      28             |             -1.815390046                                  |
 *   |      29             |             -1.750305305                                  |
 *   |      30             |             -1.680237892                                  |
 *   |      31             |             -1.603121401                                  |
 *   |      32             |                     N/A                               |
 *   |      33             |                     -10.4822997                           |
 *   |      34             |                     -4.9531679                        |
 *   |      35             |                     -1.931961022                          |
 *   |      36             |                     0.057132993                           |
 *   |      37             |                     1.476764101                           |
 *   |      38             |                     2.5332116                         |
 *   |      39             |                     3.336771823                           |
 *   |      40             |                     3.953605265                           |
 *   |      41             |                     4.426779615                           |
 *   |      42             |                     4.786171523                           |
 *   |      43             |                     5.053647759                           |
 *   |      44             |                     5.246007208                           |
 *   |      45             |                     5.37676618                        |
 *   |      46             |                     5.457304255                           |
 *   |      47             |                     5.497635316                           |
 *   |      48             |                     5.506945838                           |
 *   |      49             |                     5.493978354                           |
 *   |      50             |                     5.467302132                           |
 *   |      51             |                     5.435491631                           |
 *   |      52             |                     5.407220119                           |
 *   |      53             |                     5.391268248                           |
 *   |      54             |                     5.396444507                           |
 *   |      55             |                     5.431416481                           |
 *   |      56             |                     5.504458826                           |
 *   |      57             |                     5.62313521                        |
 *   |      58             |                     5.793945208                           |
 *   |      59             |                     6.02197959                        |
 *   |      60             |                     6.310634089                           |
 *   |      61             |                     6.661428559                           |
 *   |      62             |                     7.073964236                           |
 *   |      63             |                     7.546029076                           |
 * @note For the HP Chain - Power index vs output power in dBm in E2E mode:
 *   |       Power Index   |                  Output Power in dBm                              |
 *   |---------------------|-------------------------------------------------------------------|
 *   |         64      |            1                          |
 *   |         65      |            2                          |
 *   |         66      |            3                          |
 *   |         67      |            4                                      |
 *   |         68      |            5                              |
 *   |         69      |            6                                          |
 *   |         70      |            7                                          |
 *   |         71      |            8                                          |
 *   |         72      |            9                                          |
 *   |         73      |            10                                         |
 *   |         74      |            11                                         |
 *   |         75      |            12                                         |
 *   |         76      |            13                                         |
 *   |         77      |            14                                         |
 *   |         78      |            15                                         |
 *   |         -       |            -                                          |
 *   |         -       |            -                                          |
 *   |         104     |            0.5                                        |
 *   |         105     |            1                                          |
 *   |         106     |            1.5                                        |
 *   |         107     |            2                                          |
 *   |         108     |            2.5                                        |
 *   |         109     |            3                                          |
 *   |         110     |            3.5                                        |
 *   |         111     |            4                                          |
 *   |         -       |            -                                          |
 *   |         126     |            10.5                                           |
 *   |         127     | Max Power Supported by Country region                 |
 */
int32_t rsi_ble_set_ble_tx_power(int8_t tx_power);
/** @} */

/******************************************************
 * *        GATT Client API's Declarations
 * ******************************************************/

/** @addtogroup BT-LOW-ENERGY3
* @{
*/

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_profiles(uint8_t *dev_addr,
 *                                         uint16_t start_handle,
 *                                         uint16_t end_handle,
 *                                         rsi_ble_resp_profiles_list_t *p_prof_list)
 * @brief      Get the supported profiles / services of the connected
 *                 remote device. The \ref rsi_ble_on_profiles_list_resp_t callback
 *                 function will be called after the profiles list response is received. This is a non-blocking API,
 *                 Still user need to wait until the callback \ref rsi_ble_on_profiles_list_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  start_handle - start handle (index) of the remote device's service records
 * @param[in]  end_handle   - end handle (index) of the remote device's service records
 * @param[out] p_prof_list  - profiles/services information will be filled in this structure after retrieving from the remote device,
                  refer to rsi_ble_resp_profiles_list_s structure for more info.
 *
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_profiles(uint8_t *dev_addr,
                             uint16_t start_handle,
                             uint16_t end_handle,
                             rsi_ble_resp_profiles_list_t *p_prof_list);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_profile(uint8_t *dev_addr, uuid_t profile_uuid,
 *                                         profile_descriptors_t *p_profile)
 * @brief      Get the specific profile / service of the connected remote device. 
 *                 The \ref rsi_ble_on_profile_resp_t callback function is called after the service
 *                 characteristics response is received. This is a non-blocking API,
 *                 Still user need to wait until the callback \ref rsi_ble_on_profile_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  profile_uuid     - services/profiles which are searched using profile_uuid 
 *
 * @param[out] p_profile    - profile / service information filled in this structure after retrieving from the remote device.
                       See profile_descriptor_s structure for more info. 
 *
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_profile(uint8_t *dev_addr, uuid_t profile_uuid, profile_descriptors_t *p_profile);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_char_services(uint8_t *dev_addr,
 *                                               uint16_t start_handle,
 *                                               uint16_t end_handle,
 *                                               rsi_ble_resp_char_services_t *p_char_serv_list)
 * @brief      Get the service characteristic services of the connected remote device,
 *                 \ref rsi_ble_on_char_services_resp_t callback function is called after the characteristic service
 *                      response is received, this is a non-blocking API,
 *                 Still user need to wait until the callback \ref rsi_ble_on_char_services_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  start_handle     - start handle (index) of the remote device's service records
 * @param[in]  end_handle   - end handle (index) of the remote device's service records
 * @param[out] p_char_serv_list - service characteristics details are filled in this structure, refer to rsi_ble_resp_char_serv_s structure for more info. 
 *
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_char_services(uint8_t *dev_addr,
                                  uint16_t start_handle,
                                  uint16_t end_handle,
                                  rsi_ble_resp_char_services_t *p_char_serv_list);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_inc_services(uint8_t *dev_addr,
 *                                             uint16_t start_handle,
 *                                             uint16_t end_handle,
 *                                             rsi_ble_resp_inc_services_t *p_inc_serv_list)
 * @brief      Get the supported include services of the connected remote device. 
 *                 The \ref rsi_ble_on_inc_services_resp_t callback function is called after
 *                 the include service response is received. This is a non-blocking API.
 *                 Still user need to wait until the callback \ref rsi_ble_on_inc_services_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  start_handle     - start handle (index) of the remote device's service records
 * @param[in]  end_handle   - end handle (index) of the remote device's service records
 * @param[out] p_inc_serv_list  - include service characteristics details are filled in this structure, refer to rsi_ble_resp_inc_serv structure for more info.
 *
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_inc_services(uint8_t *dev_addr,
                                 uint16_t start_handle,
                                 uint16_t end_handle,
                                 rsi_ble_resp_inc_services_t *p_inc_serv_list);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_char_value_by_uuid(uint8_t *dev_addr,
 *                                                    uint16_t start_handle,
 *                                                    uint16_t end_handle,
 *                                                    uuid_t char_uuid,
 *                                                    rsi_ble_resp_att_value_t *p_char_val)
 * @brief      Get the characteristic value by UUID (char_uuid).
 *                 The \ref rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API.
 *                 Still user need to wait until the callback \ref rsi_ble_on_read_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
  * @param[in]  dev_addr    - remote device address
 * @param[in]  start_handle     - start handle (index) of the remote device's service records
 * @param[in]  end_handle   - end handle (index) of the remote device's service records
 * @param[in]  char_uuid    - UUID of the characteristic
 * @param[out] p_char_val   - Characteristic value is filled in this structure. See rsi_ble_resp_att_value_s structure for more info.
 *
 * @return The following values are returned:
 *             -  0     -   Success 
 *             - Non-Zero Value -   Failure 
 *             - If the return value is less than 0 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_char_value_by_uuid(uint8_t *dev_addr,
                                       uint16_t start_handle,
                                       uint16_t end_handle,
                                       uuid_t char_uuid,
                                       rsi_ble_resp_att_value_t *p_char_val);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_att_descriptors(uint8_t *dev_addr,
 *                                                 uint16_t start_handle,
 *                                                 uint16_t end_handle,
 *                                                 rsi_ble_resp_att_descs_t *p_att_desc)
 * @brief      Get the characteristic descriptors list from the remote device.
 *                 The \ref rsi_ble_on_att_desc_resp_t callback function is called after
 *                 the attribute descriptors response is received. This is a non-blocking API.
 *                 Still user need to wait until the callback \ref rsi_ble_on_att_desc_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  start_handle - start handle (index) of the remote device's service records
 * @param[in]  end_handle - end handle (index) of the remote device's service records
 * @param[out] p_att_desc - pointer to characteristic descriptor structure, refer to rsi_ble_resp_att_descs_s structure for more info.
 * @return The following values are returned:
 *     - 0      -   Success 
 *     - Non-Zero Value -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_att_descriptors(uint8_t *dev_addr,
                                    uint16_t start_handle,
                                    uint16_t end_handle,
                                    rsi_ble_resp_att_descs_t *p_att_desc);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_att_value(uint8_t *dev_addr, uint16_t handle, rsi_ble_resp_att_value_t *p_att_val)
 * @brief      Get the attribute by handle. 
 *                 The \ref rsi_ble_on_read_resp_t callback function is called upon receiving the attribute value. This is a non-blocking API.
 *                 Still user need to wait until the callback \ref rsi_ble_on_read_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr  - remote device address
 * @param[in]  handle    - handle value of the attribute
 * @param[out] p_att_val - attribute value is filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.
 * @return The following values are returned:
 *     - 0          -  Success 
 *     - Non-Zero Value - Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 *
 */
int32_t rsi_ble_get_att_value(uint8_t *dev_addr, uint16_t handle, rsi_ble_resp_att_value_t *p_att_val);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_multiple_att_values(uint8_t *dev_addr,
 *                                                     uint8_t num_of_handlers,
 *                                                     const uint16_t *handles,
 *                                                     rsi_ble_resp_att_value_t *p_att_vals)
 * @brief      Get the multiple attribute values by using multiple handles.
 *                 The \ref rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API,
 *                 Still user need to wait until the callback \ref rsi_ble_on_read_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  num_of_handlers  - number of handles in the list
 * @param[in]  handles      - list of attribute handles
 * @param[out] p_att_vals   - attribute values filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.
 * @return The following values are returned:
 *     - 0      -   Success 
 *     - Non-Zero Value -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_multiple_att_values(uint8_t *dev_addr,
                                        uint8_t num_of_handlers,
                                        const uint16_t *handles,
                                        rsi_ble_resp_att_value_t *p_att_vals);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_long_att_value(uint8_t *dev_addr,
 *                                                uint16_t handle,
 *                                                uint16_t offset,
 *                                                rsi_ble_resp_att_value_t *p_att_vals)
 * @brief      Get the long attribute value by using handle and offset.
 *                 The \ref rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API.
 *                 Still user need to wait until the callback \ref rsi_ble_on_read_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute handle
 * @param[in]  offset   - offset within the attribute value
 * @param[out] p_att_vals - attribute value filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.
 * @return The following values are returned:
 *     - 0      -   Success 
 *     - Non-Zero Value -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_long_att_value(uint8_t *dev_addr,
                                   uint16_t handle,
                                   uint16_t offset,
                                   rsi_ble_resp_att_value_t *p_att_vals);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_att_value(uint8_t *dev_addr, uint16_t handle,
 *                                           uint8_t data_len, const uint8_t *p_data)
 * @brief      Set the attribute value of the remote device,
 *                 \ref rsi_ble_on_write_resp_t callback function is called if the attribute set action is completed, this is a non-blocking API,
 *                 Still user need to wait until the callback \ref rsi_ble_on_write_resp_t is received from the device,
 *                 to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute value handle
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *     - 0      -   Success 
 *     - Non-Zero Value -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_att_value(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_att_cmd(uint8_t *dev_addr, uint16_t handle,
 *                                         uint8_t data_len, const uint8_t *p_data)
 * @brief      Set the attribute value without waiting for an ACK from the remote device. This is a blocking API.
 *             If the API returns RSI_ERROR_BLE_DEV_BUF_FULL  (-31) error then wait until the \ref rsi_ble_on_le_more_data_req_t event gets received from the module.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute value handle
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *     - 0      -   Success 
 *     - Non-Zero Value -   Failure 
 *     - 0x4E60  -  Invalid Handle range 
 *     - 0x4E62  -  Invalid Parameters 
 *     - 0x4D04  -  BLE not connected 
 *     - 0x4D05  -  BLE Socket not available 
 *     - 0x4E65  -  Invalid Attribute Length When Small Buffer Mode is Configured 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_att_cmd(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_long_att_value(uint8_t *dev_addr,
 *                                             uint16_t handle,
 *                                             uint16_t offset,
 *                                             uint8_t data_len,
 *                                             const uint8_t *p_data)
 * @brief      Set the long attribute value of the remote device. The \ref rsi_ble_on_write_resp_t
 *             callback function is called after the attribute set action is completed. This is a non-blocking API.
 *             Still user need to wait until the callback \ref rsi_ble_on_write_resp_t is received from the device,
 *             to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute handle
 * @param[in]  offset   - attribute value offset
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *    - 0       -   Success 
 *    - Non-Zero Value  -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_long_att_value(uint8_t *dev_addr,
                                   uint16_t handle,
                                   uint16_t offset,
                                   uint8_t data_len,
                                   const uint8_t *p_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_prepare_write(uint8_t *dev_addr, uint16_t handle, uint16_t offset,
 *                                           uint8_t data_len, const uint8_t *p_data)
 * @brief      Prepare the attribute value. The \ref rsi_ble_on_write_resp_t
 *                 callback function is called after the prepare attribute write action is completed. This is a non-blocking API.
 *             Still user need to wait until the callback \ref rsi_ble_on_write_resp_t is received from the device,
 *             to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *       - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute handle
 * @param[in]  offset   - attribute value offset
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *       - 0        -   Success 
 *       - Non-Zero Value   -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 *
 */
int32_t rsi_ble_prepare_write(uint8_t *dev_addr,
                              uint16_t handle,
                              uint16_t offset,
                              uint8_t data_len,
                              const uint8_t *p_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_execute_write(uint8_t *dev_addr, uint8_t exe_flag)
 * @brief      Execute the prepared attribute values. The \ref rsi_ble_on_write_resp_t
 *             callback function is called after the execute attribute write action is completed. This is a non-blocking API.
 *             Still user need to wait until the callback \ref rsi_ble_on_write_resp_t is received from the device,
 *             to initiate further attribute related transactions on this remote device address.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  exe_flag - execute flag to write, possible values mentioned below
 * - 0 - BLE_ATT_EXECUTE_WRITE_CANCEL 
 * - 1 - BLE_ATT_EXECUTE_PENDING_WRITES_IMMEDIATELY 
 * @return The following values are returned:
 *     - 0      -   Success 
 *     - Non-Zero Value -   Failure 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_execute_write(uint8_t *dev_addr, uint8_t exe_flag);
/** @} */

/********************************************************
 * *        GATT Server API's Declarations
 * ******************************************************/
/** @addtogroup BT-LOW-ENERGY5
* @{
*/

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_add_service(uuid_t service_uuid, rsi_ble_resp_add_serv_t *p_resp_serv)
 * @brief      Add a new service to the local GATT Server. This is a blocking API.
 * @pre Pre-conditions:
 *        - Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  service_uuid     - new service UUID value, refer to uuid_s structure for more info.
 * @param[out] p_resp_serv  - new service handler filled in this structure, refer to rsi_ble_resp_add_serv_s structure for more info.
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4046  -  Invalid Arguments 
 *             - 0x4D08  -  Profile record full 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_add_service(uuid_t service_uuid, rsi_ble_resp_add_serv_t *p_resp_serv);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_add_attribute(rsi_ble_req_add_att_t *p_attribute)
 * @brief      Add a new attribute to a specific service. This is a blocking API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  p_attribute - add a new attribute to the service, refer to rsi_ble_req_add_att_s structure for more info. 
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4046  -  Invalid Arguments 
 *             - 0x4D09  -  Attribute record full  
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_add_attribute(rsi_ble_req_add_att_t *p_attribute);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_local_att_value(uint16_t handle, uint16_t data_len,
 *                                                 const uint8_t *p_data)
 * @brief      Change the local attribute value. This is a blocking API.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  handle   - attribute value handle
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4046  -  Invalid Arguments 
 *             - 0x4D06  -  Attribute record not found 
 *             - 0x4E60  -  Invalid Handle Range 
 * @note      Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 * @note      This API can only be used if the service is maintained inside the firmware. 
 * @note      The services which are maintained by firmware must follow the below rules. 
 * @note      Rule 1: The attribute_data_size is less than 20 bytes during the service_creation 
 * @note      Rule 2: while creating the service, don't use the RSI_BLE_ATT_MAINTAIN_IN_HOST bit 
 *                    in the RSI_BLE_ATT_CONFIG_BITMAP macro. 
 * @note      Rule 3: The data_len must be less than or equal to the dat_length mentioned while 
 *                    creating the service/attribute 
 * @note          Rule 4: If the services are maintained in the Application/Host,
 *              then need to use \ref rsi_ble_notify_value() API to send the notifications to the remote devices.
 */
int32_t rsi_ble_set_local_att_value(uint16_t handle, uint16_t data_len, const uint8_t *p_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_wo_resp_notify_buf_info(const uint8_t *dev_addr, uint8_t buf_mode,
 *                                                         uint8_t buf_cnt)
 * @brief      Configure the buf mode for Notify and WO response commands for the remote device. This is a blocking API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  buf_mode - buffer mode configuration
 *     - 0 - BLE_SMALL_BUFF_MODE 
 *     - 1 - BLE_BIG_BUFF_MODE 
 * @param[in]  buf_cnt - no of buffers to be configured 
 *    only value 1 and 2 are supported in BLE_SMALL_BUFF_MODE  
            in BLE_BIG_BUFF_MODE, buffers allocated based on the below notations.
            intial available_buf_cnt = RSI_BLE_NUM_CONN_EVENTS,
            a) When connection 1 is formed, the possible range of buffers is (available_buf_cnt - remaining possible number of connections)
            b) After allocating X buffers using \ref rsi_ble_set_wo_resp_notify_buf_info to the 1st connection remaining available_buf_cnt = (available_buf_cnt - X ) 
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure
 *             - 0x4046  -  Invalid Arguments 
 *             - 0x4D05  -  BLE socket not available 
 *             - 0x4D06  -  Attribute record not found 
 *             - 0x4E60  -  Invalid Handle Range 
 *             - 0x4E63  -  BLE Buffer Count Exceeded 
 *             - 0x4E64  -  BLE Buffer already in use  
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_wo_resp_notify_buf_info(const uint8_t *dev_addr, uint8_t buf_mode, uint8_t buf_cnt);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_notify_value(const uint8_t *dev_addr, uint16_t handle,
 *                                          uint16_t data_len, const uint8_t *p_data)
 * @brief      Notify the local value to the remote device. This is a blocking API.
 *             If the API returns RSI_ERROR_BLE_DEV_BUF_FULL  (-31) error then wait until the \ref rsi_ble_on_le_more_data_req_t event gets received from the module.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - local attribute handle
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4046  -  Invalid Arguments 
 *             - 0x4A0D  -  Invalid attribute value length 
 *             - 0x4D05  -  BLE socket not available 
 *             - 0x4D06  -  Attribute record not found 
 *             - 0x4E60  -  Invalid Handle Range 
 *             - 0x4E65  -  Invalid Attribute Length When Small Buffer Mode is Configured  
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 * @note    If the services are maintained in the Application/Host,
 *          then need to use \ref rsi_ble_notify_value() API instead of using \ref rsi_ble_set_local_att_value() API
 *          to send the notifications to the remote devices.
 */
int32_t rsi_ble_notify_value(const uint8_t *dev_addr, uint16_t handle, uint16_t data_len, const uint8_t *p_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_indicate_value(const uint8_t *dev_addr, uint16_t handle,
 *                                            uint16_t data_len, const uint8_t *p_data)
 * @brief      Indicate the local value to the remote device. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_indicate_confirmation_t.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - local attribute handle
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4D05  -  BLE socket not available 
 *             - 0x4E60  -  Invalid Handle Range 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 */
int32_t rsi_ble_indicate_value(const uint8_t *dev_addr, uint16_t handle, uint16_t data_len, const uint8_t *p_data);
/** @} */

/** @addtogroup BT-LOW-ENERGY4
 * @{
 */

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_indicate_value_sync(const uint8_t *dev_addr, uint16_t handle,
 *                                            uint16_t data_len, const uint8_t *p_data)
 * @brief      Indicate the local value to the remote device. This is a blocking API.
 *
 *             This will not send any confirmation event to the application instead 
 *
 *             send the status as success on receiving confirmation from remote side.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - local attribute handle
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4D05  -  BLE socket not available 
 *             - 0x4E60  -  Invalid Handle Range 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 */
int32_t rsi_ble_indicate_value_sync(const uint8_t *dev_addr, uint16_t handle, uint16_t data_len, const uint8_t *p_data);

/*==============================================*/
/**
 * @fn        int32_t rsi_ble_indicate_confirm(const uint8_t *dev_addr)
 * @brief     Send indicate confirmation to the remote device. This is a blocking API.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in] dev_addr - remote device address
 * @return The following values are returned:
 *            - 0           -   Success 
 *            - Non-Zero Value  -   Failure
 *            - 0x4D05  -  BLE socket not available 
 * @note      Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 */
int32_t rsi_ble_indicate_confirm(const uint8_t *dev_addr);
/** @} */

/** @addtogroup BT-LOW-ENERGY5
* @{
*/

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_local_att_value(uint16_t handle,
 *                                                 rsi_ble_resp_local_att_value_t *p_resp_local_att_val)
 * @brief      Get the local attribute value. This is a blocking API.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  handle           - local attribute handle
 * @param[out] p_resp_local_att_val     - local attribute value filled in this structure, see rsi_ble_resp_local_att_value_s structure for more info.
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4046  -  Invalid Arguments 
 *             - 0x4D06  -  Attribute record not found 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 * @note       This API can only be used if the service is maintained inside the firmware. The services which are maintained by firmware must
 *             follow the below rules.
 * @note       Rule 1: The attribute_data_size is less than 20 bytes during the service_creation 
 * @note       Rule 2: While creating the service, don't use the RSI_BLE_ATT_MAINTAIN_IN_HOST bit in the RSI_BLE_ATT_CONFIG_BITMAP macro.
 */
int32_t rsi_ble_get_local_att_value(uint16_t handle, rsi_ble_resp_local_att_value_t *p_resp_local_att_val);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_gatt_read_response(uint8_t *dev_addr,
 *                                                uint8_t read_type,
 *                                                uint16_t handle,
 *                                                uint16_t offset,
 *                                                uint16_t length,
 *                                                const uint8_t *p_data)
 * @brief      Send the response for the read request received from the remote device This is a blocking API.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device Address
 * @param[in]  read_type    - read value type 
 *        - 0 - Read response 
 *        - 1 - Read blob response
 * @param[in]  handle       - attribute value handle
 * @param[in]  offset       - attribute value offset
 * @param[in]  length       - attribute value length
 * @param[in]  p_data       - attribute value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4D04  -  BLE not connected 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 */
int32_t rsi_ble_gatt_read_response(uint8_t *dev_addr,
                                   uint8_t read_type,
                                   uint16_t handle,
                                   uint16_t offset,
                                   uint16_t length,
                                   const uint8_t *p_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_remove_gatt_service(uint32_t service_handler)
 * @brief      Remove the GATT service record. This is a blocking API.
 * @pre Pre-conditions:
 *             GATT database needs to be present, GATT Database value can be modified at any point following its creation.
 * @param[in]  service_handler - GATT service record handle
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4D0A  -  BLE profile not found (profile handler invalid) 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 */
int32_t rsi_ble_remove_gatt_service(uint32_t service_handler);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_remove_gatt_attibute(uint32_t service_handler, uint16_t att_hndl)
 * @brief      Remove the GATT attribute record. This is a blocking API.
 * @pre Pre-conditions:
 *             GATT database needs to be present, GATT Database value can be modified at any point following its creation.
 * @param[in]  service_handler - GATT service record handle
 * @param[in]  att_hndl - attribute handle
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4D06  -  Attribute record not found  
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 */
int32_t rsi_ble_remove_gatt_attibute(uint32_t service_handler, uint16_t att_hndl);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_att_error_response(uint8_t *dev_addr, uint16_t handle,
 *                                                uint8_t opcode, uint8_t err)
 * @brief      Send attribute error response for any of the att request. This is a blocking API.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute handle
 * @param[in]  opcode   - error response opcode
 * @param[in]  err - specific error related Gatt
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure
 *             - 0x4D04  -  BLE not Connected  
 *             - 0x4E62  -  Invalid Parameters 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 */
int32_t rsi_ble_att_error_response(uint8_t *dev_addr, uint16_t handle, uint8_t opcode, uint8_t err);
/** @} */

/** @addtogroup BT-LOW-ENERGY3
* @{
*/

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_mtu_exchange_event(uint8_t *dev_addr, uint8_t mtu_size)
 * @brief      Initiates the MTU exchange request with the remote device.  
 *             This is a blocking API and will receive a callback event \ref rsi_ble_on_mtu_event_t as the response for this API.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  mtu_size - requested MTU value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure
 *             - 0x4D04  -  BLE not Connected  
 *             - 0x4E62  -  Invalid Parameters 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors)
 * @note       When services are maintained on the host, this API need to be triggered by the application.
 */
int32_t rsi_ble_mtu_exchange_event(uint8_t *dev_addr, uint8_t mtu_size);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_mtu_exchange_resp(uint8_t *dev_addr, uint8_t mtu_size)
 * @brief      This function (Exchange MTU Response) is sent in reply to a received Exchange MTU Request.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - Remote Device Address
 * @param[in]  mtu_size - requested MTU value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - 0x4D0C   -   When RSI_BLE_MTU_EXCHANGE_FROM_HOST BIT is not SET.
 *             - 0x4D05   -   BLE Socket Not Available.
 *             - Non-Zero Value -   Failure
 * @note   Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors)
 */
int32_t rsi_ble_mtu_exchange_resp(uint8_t *dev_addr, uint8_t mtu_size);
/** @} */

/** @addtogroup BT-LOW-ENERGY5
* @{
*/

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_gatt_write_response(uint8_t *dev_addr, uint8_t type)
 * @brief      Send the response to the write request received from the remote device. This is a blocking API.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  type     - response type 
 *  - 0 - write response, 
 *  - 1 - execute write response.
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure
 *             - 0x4046  -  Invalid Arguments  
 *             - 0x4D04  -  BLE not Connected  
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors)
 * @note       When services are maintained on the host, this API need to be triggered by the application.
 */
int32_t rsi_ble_gatt_write_response(uint8_t *dev_addr, uint8_t type);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_gatt_prepare_write_response(uint8_t *dev_addr,
 *                                                         uint16_t handle,
 *                                                         uint16_t offset,
 *                                                         uint16_t length,
 *                                                         const uint8_t *data)
 * @brief      Send the response for the prepare write requests received from the remote device. This is a blocking API.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute value handle
 * @param[in]  offset   - attribute value offset
 * @param[in]  length - attribute value length
 * @param[in]  data     - attribute value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure
 *             - 0x4046  -  Invalid Arguments  
 *             - 0x4D04  -  BLE not Connected  
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) 
 * @note       When services are maintained on the host, this API need to be triggered by the application.
 */
int32_t rsi_ble_gatt_prepare_write_response(uint8_t *dev_addr,
                                            uint16_t handle,
                                            uint16_t offset,
                                            uint16_t length,
                                            const uint8_t *data);
/** @} */

/** @addtogroup BT-LOW-ENERGY1
* @{ */
/*========================================================*/
/**
 * @fn         int32_t rsi_ble_get_max_adv_data_len(uint8_t *resp)
 * @brief      Get maximum advertising data length
 * @param[out] resp Maximum supported advertising data length returned by the controller. Possible values range from 0x001F to 0x0672.
 * @return The following values are returned:
 *     - 0   =  success
 * @return The following values are returned:
 *     - !0  = failure
 * @note  This function requests the controller to return the maximum supported advertising data length.
 */
int32_t rsi_ble_get_max_adv_data_len(uint8_t *resp);

/*========================================================*/
/**
 * @fn         int32_t rsi_ble_get_max_no_of_supp_adv_sets(uint8_t *resp)
 * @brief      Get maximum number of advertising sets
 * @param[out] resp Number of supported advertising sets returned by the controller. Possible values range from 0x01 to 0xF0.
 * @return The following values are returned:
 *     0   =  success
 * @return The following values are returned:
 *     !0 = failure
 * @note This function requests the controller to return the maximum number of supporting advertising sets.
 * @note The number of supported advertising sets can be configured through the operating modes.
 */
int32_t rsi_ble_get_max_no_of_supp_adv_sets(uint8_t *resp);

/*==============================================*/
/**
 * @fn         rsi_ble_set_ae_set_random_address(uint8_t handle, const uint8_t *rand_addr)
 * @brief      Update AE random address
 * @param[in]  handle  The advertising handle used to identify an advertising set
 * @param[in]  rand_addr Random device address set to either a static or private address
 * @return The following values are returned:
 *     - 0   =  success
 * @return The following values are returned:
 *     - !0  = failure
 */
int32_t rsi_ble_set_ae_set_random_address(uint8_t handle, const uint8_t *rand_addr);

/*========================================================*/
/**
 * @fn         int32_t rsi_ble_set_ae_data(void *ble_ae_data)
 * @brief      Update AE advertiser data
 * @param[in]  ble_ae_data Extended Advertising data to be updated
 * @return The following values are returned:
 *     0  =  success
 * @return The following values are returned:
 *     !0 = failure
 * @note  This function sets the AE advertiser data used in advertising PDUs.
 * @note  Refer to Bluetooth specification 5.3 for possible combinations ae_adv/scanresp data can be set for .
 */
int32_t rsi_ble_set_ae_data(void *ble_ae_data);

/*========================================================*/
/**
 * @fn         int32_t rsi_ble_set_ae_params(void *ble_ae_params, int8_t *sel_tx_pwr)
 * @brief      Update AE parameters
 * @param[in]  ble_ae_params Extended Advertising parameters to be updated
 * @param[out] sel_tx_pwr Output transmit power in dBm, ranging from -127 to +20.
 * @return The following values are returned:
 *     0  =  success
 * @return The following values are returned:
 *     !0 = failure
 */
int32_t rsi_ble_set_ae_params(void *ble_ae_params, int8_t *sel_tx_pwr);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_start_ae_advertising(void *adv_enable)
 * @brief      Enable or disable AE advertising
 * @param[in]  adv_enable Parameters to enable or disable specific advertising sets identified by advertising handle
 * @return The following values are returned:
 *     0  =  success
 * @return The following values are returned:
 *     !0  = failure
 */
int32_t rsi_ble_start_ae_advertising(void *adv_enable);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_app_adv_set_clear_or_remove(uint8_t type, uint8_t handle)
 * @brief      request the local device to clear or remove the advertising sets based on the type specified
 *             This function requests the local device to clear or remove an advertising set from the controller based on the type specified
 * @param[in]  type - Specifies whether to remove or clear the advertising sets.
 *             {1}  - clear
 *             {2}  - remove
 * @param[in]  handle - Advertising_Handle - Used to identify an Advertising set. Possible Values : 0x00 to 0xEF
 * @return     0  =  success \n
 *            !0 = failure \n
 */
int32_t rsi_ble_app_adv_set_clear_or_remove(uint8_t type, uint8_t handle);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_app_set_periodic_ae_params(void *periodic_adv_params)
 * @brief      Update periodic AE parameters
 * @param[in]  periodic_adv_params Periodic advertising parameters to be updated
 * @return The following values are returned:
 *     0  =  success
 * @return The following values are returned:
 *     !0  = failure
 */
int32_t rsi_ble_app_set_periodic_ae_params(void *periodic_adv_params);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_app_set_periodic_ae_enable(uint8_t enable, uint8_t handle)
 * @brief      Enable periodic advertising
 * @param[in]  enable Configure the "enable" parameter to 0 to enable ae periodic advertisement on specified set, or 1 to include the ADI field in AUX_SYNC_IND PDUs
 * @param[in]  handle Advertising handle of the advertising set to enable or disable
 * @return The following values are returned:
 *     0  =  success:
 *     !0 =  failure
 * @note
 * This function requests the controller to enable or disable periodic advertising for the specified advertising set.
 */
int32_t rsi_ble_app_set_periodic_ae_enable(uint8_t enable, uint8_t handle);

/*========================================================*/
/**
 * @fn         int32_t rsi_ble_ae_set_scan_params(void *ae_scan_params)
 * @brief      Update AE scan parameters
 * @param[in]  ae_scan_params Extended scan parameters to be updated
 * @return The following values are returned:
 *     0  =  success
 * @return The following values are returned:
 *     !0 = failure
 * @note
 * This function sets the extended scan parameters to be used on the physical advertising channels.
 */
int32_t rsi_ble_ae_set_scan_params(void *ae_scan_params);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_ae_set_scan_enable(void *ae_scan_enable)
 * @brief      request the local device to enable scanning for both legacy and extended advertising PDUs
 * @param[in]  ae_scan_enable - Extended Scan Enable command Parameters would be filled here 
 * @return     0  =  success \n
 *            !0  = failure \n
 */
int32_t rsi_ble_ae_set_scan_enable(void *ae_scan_enable);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_ae_set_periodic_sync(uint8_t type, void *periodic_sync_data)
 * @brief      Synchronize with a periodic advertising train from an advertiser and begin receiving periodic advertising packets.
 * @param[in]  type - Configure the "type" parameter to values 1 to begin, 2 to cancel and 3 to terminate the periodic advertising sync
 * @param[in]  periodic_sync_data Parameters for starting a perodic advertising sync operation
 * @return The following values are returned:
 *     0  =  success
 *     0x4E42 = unknown advertising identifier
 *     0x4E0C = command not permitted 
 * @note
 * The operation is either started, cancelled or terminated depending on the type parameter.
 * @note
 * "Sync Terminate" to be used when synchronization has already been established, and operation needs to be stopped.
 * "Sync Cancel" to be used when synchronization is still in progress, and process is no longer intended to be completed.
 */
int32_t rsi_ble_ae_set_periodic_sync(uint8_t type, void *periodic_sync_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_ae_dev_to_periodic_list(void *dev_to_list)
 * @brief      Manage a device in the periodic advertiser list
 *             This function adds a device to periodic advertiser list stored in the controller.
 * @param[in]  dev_to_list Details of a device to be added to the periodic advertiser list
 * @return The following values are returned:
 *     0  =  success
 *    !0  = failure
 */
int32_t rsi_ble_ae_dev_to_periodic_list(void *dev_to_list);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_ae_read_periodic_adv_list_size(uint8_t *resp)
 * @brief      Get periodic advertiser list size
 * @param[out] resp Periodic advertiser list size returned by the controller
 * @return The following values are returned:
 *     0  =  success
 * @return The following values are returned:
 *     !0 = failure
 */
int32_t rsi_ble_ae_read_periodic_adv_list_size(uint8_t *resp);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_extended_connect_with_params(void *ble_extended_conn_params)
 * @brief      Establish ACL connection to advertiser
 * @param[in]  ble_extended_conn_params Connection parameters
 * @return The following values are returned:
 *     0  =  success
 * @return The following values are returned:
 *     !0 = failure
 * @note
 * This function establishes an ACL connection to an advertiser, with the local device in the BLE central role.
 */
int32_t rsi_ble_extended_connect_with_params(void *ext_create_conn);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_read_transmit_power(void *resp)
 * @brief      Get supported transmit power range
 * @param[out] resp Minimum and maximum supported transmit power, returned by the controller. Power ranges from -127 dBm to +20 dBm.
 * @return The following values are returned:
 *     0  =  success
 * @return The following values are returned:
 *     !0 = failure
 * @note
 * This function requests the controller to return the minimum and maximum supported transmit power.
 */
int32_t rsi_ble_read_transmit_power(void *resp);

/** @} */

// GATT Client Functions
/**********************************************************************
 * In all GAT client APIs, all actions (get/set/write) are referred to
 * the GATT server running on the remote / connected device.
 *********************************************************************/

/** @addtogroup BT-LOW-ENERGY4
* @{
*/

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_profiles_async(uint8_t *dev_addr,
 *                                                uint16_t start_handle,
 *                                                uint16_t end_handle,
 *                                                rsi_ble_resp_profiles_list_t *p_prof_list)
 * @brief      Get the supported profiles / services of the connected
 *             remote device asynchronously. The \ref rsi_ble_on_event_profiles_list_t callback function will be
 *             called after the profiles list event is received. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_profiles_list_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  start_handle - start handle (index) of the remote device's service records
 * @param[in]  end_handle   - end handle (index) of the remote device's service records
 * @param[out] p_prof_list  - Profiles/services information will be filled in this structure after retrieving from the remote device.
                  See the rsi_ble_resp_profiles_list_s structure for more info.
 *
 *      @note   p_prof_list structure should be passed as NULL because nothing will be filled in this structure 
 *
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */

int32_t rsi_ble_get_profiles_async(uint8_t *dev_addr,
                                   uint16_t start_handle,
                                   uint16_t end_handle,
                                   rsi_ble_resp_profiles_list_t *p_prof_list);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_profile_async(uint8_t *dev_addr, uuid_t profile_uuid,
 *                                               profile_descriptors_t *p_profile)
 * @brief      Get the specific profile / service of the connected remote device. 
 *             The rsi_ble_one_event_profile_by_uuid_t callback function is called after
 *             the service characteristics response is received. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either rsi_ble_one_event_profile_by_uuid_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  profile_uuid     - services/profiles which are searched using profile_uuid 
 * @param[out] p_profile    - profile / service information filled in this structure after retrieving from the remote device,
 *            refer to profile_descriptor_s structure for more info. 
 *      @note   p_profile structure should be passed as NULL because nothing will be filled in this structure 
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_profile_async(uint8_t *dev_addr, uuid_t profile_uuid, profile_descriptors_t *p_profile);

/*==============================================*/
/**
 * @fn         rint32_t rsi_ble_get_char_services_async(uint8_t *dev_addr,
 *                                                     uint16_t start_handle,
 *                                                     uint16_t end_handle,
 *                                                     rsi_ble_resp_char_services_t *p_char_serv_list)
 * @brief      Get the service characteristics of the connected remote device.
 *             The \ref rsi_ble_on_event_read_by_char_services_t callback function is called after
 *             the included service characteristics response is received. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_read_by_char_services_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  start_handle     - start handle (index) of the remote device's service records
 * @param[in]  end_handle   - end handle (index) of the remote device's service records
 * @param[out] p_char_serv_list - Service Characteristics details are filled in this structure. See rsi_ble_resp_char_serv_s structure for more info. 
 *
 * @note    p_char_services_list structure should be passed as NULL because nothing will be filled in this structure 
 *
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4E60  -  Invalid Handle range 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_char_services_async(uint8_t *dev_addr,
                                        uint16_t start_handle,
                                        uint16_t end_handle,
                                        rsi_ble_resp_char_services_t *p_char_serv_list);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_inc_services_async(uint8_t *dev_addr,
 *                                                    uint16_t start_handle,
 *                                                    uint16_t end_handle,
 *                                                    rsi_ble_resp_inc_services_t *p_inc_serv_list)
 * @brief      Get the supported include services of the connected remote device. 
 *                 The \ref rsi_ble_on_event_read_by_inc_services_t callback function is called after
 *                 the service characteristics response is received. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_read_by_inc_services_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  start_handle     - start handle (index) of the remote device's service records
 * @param[in]  end_handle   - end handle (index) of the remote device's service records
 * @param[out] p_inc_serv_list  - include service characteristics details are filled in this structure, refer to rsi_ble_resp_inc_serv structure for more info.
 *
 * @note    p_inc_serv_list structure should be passed as NULL because nothing will be filled in this structure 
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4E60  -  Invalid Handle range 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_inc_services_async(uint8_t *dev_addr,
                                       uint16_t start_handle,
                                       uint16_t end_handle,
                                       rsi_ble_resp_inc_services_t *p_inc_serv_list);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_char_value_by_uuid_async(uint8_t *dev_addr,
 *                                                          uint16_t start_handle,
 *                                                          uint16_t end_handle,
 *                                                          uuid_t char_uuid,
 *                                                          rsi_ble_resp_att_value_t *p_char_val)
 * @brief      Get the characteristic value by UUID (char_uuid).
 *                 The \ref rsi_ble_on_event_read_att_value_t callback function is called
 *                 after the attribute value is received. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_read_att_value_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        - \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  start_handle     - start handle (index) of the remote device's service records
 * @param[in]  end_handle   - end handle (index) of the remote device's service records
 * @param[in]  char_uuid    - UUID of the characteristic
 * @param[out] p_char_val   - characteristic value is filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.
 * @note    p_char_val structure should be passed as NULL because nothing will be filled in this structure 
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4E60  -  Invalid Handle range 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_char_value_by_uuid_async(uint8_t *dev_addr,
                                             uint16_t start_handle,
                                             uint16_t end_handle,
                                             uuid_t char_uuid,
                                             rsi_ble_resp_att_value_t *p_char_val);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_att_descriptors_async(uint8_t *dev_addr,
 *                                                       uint16_t start_handle,
 *                                                       uint16_t end_handle,
 *                                                       rsi_ble_resp_att_descs_t *p_att_desc)
 * @brief      Get the characteristic descriptors list from the remote device. The \ref rsi_ble_on_gatt_desc_val_event_t
 *               callback function is called after the attribute descriptors response is received. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_gatt_desc_val_event_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  start_handle - start handle (index) of the remote device's service records
 * @param[in]  end_handle - end handle (index) of the remote device's service records
 * @param[out] p_att_desc - pointer to characteristic descriptor structure, refer to rsi_ble_resp_att_descs_s strcuture for more info.
 *
 *      @note   p_att_desc structure should be passed as NULL because nothing will be filled in this structure 
 *
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure
 *             - 0x4E60  -  Invalid Handle range 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_att_descriptors_async(uint8_t *dev_addr,
                                          uint16_t start_handle,
                                          uint16_t end_handle,
                                          rsi_ble_resp_att_descs_t *p_att_desc);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_att_value_async(uint8_t *dev_addr, uint16_t handle,
 *                                                 rsi_ble_resp_att_value_t *p_att_val)
 * @brief      Get the attribute with a handle.
 *                 The \ref rsi_ble_on_event_read_resp_t callback function is called upon receiving the attribute value. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_read_resp_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - handle value of the attribute
 * @param[out] p_att_val - attribute value is filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.
 * @note    p_att_val structure should be passed as NULL because nothing will be filled in this structure 
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4E60  -  Invalid Handle range 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_att_value_async(uint8_t *dev_addr, uint16_t handle, rsi_ble_resp_att_value_t *p_att_val);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_multiple_att_values_async(uint8_t *dev_addr,
 *                                                           uint8_t num_of_handlers,
 *                                                           const uint16_t *handles,
 *                                                           rsi_ble_resp_att_value_t *p_att_vals)
 * @brief      Get the multiple attribute values by using multiple handles. 
 *             The \ref rsi_ble_on_event_read_resp_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_read_resp_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr     - remote device address
 * @param[in]  num_of_handlers  - number of handles in the list
 * @param[in]  handles      - list of attribute handles
 * @param[out] p_att_vals   - attribute values filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.
 * @note    p_att_vals structure should be passed as NULL because nothing will be filled in this structure 
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - 0x4E60  -  Invalid Handle range 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_multiple_att_values_async(uint8_t *dev_addr,
                                              uint8_t num_of_handlers,
                                              const uint16_t *handles,
                                              rsi_ble_resp_att_value_t *p_att_vals);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_get_long_att_value_async(uint8_t *dev_addr,
 *                                                      uint16_t handle,
 *                                                      uint16_t offset,
 *                                                      rsi_ble_resp_att_value_t *p_att_vals)
 * @brief      Get the long attribute value by using handle and offset.
 *             The \ref rsi_ble_on_event_read_resp_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_read_resp_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute handle
 * @param[in]  offset   - offset within the attribute value
 * @param[out] p_att_vals - attribute value filled in this structure, refer to rsi_ble_resp_att_value_s structure for more information.
 * @note    p_att_vals structure should be passed as NULL because nothing would be filled in this structure 
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4E60  -  Invalid Handle range 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_get_long_att_value_async(uint8_t *dev_addr,
                                         uint16_t handle,
                                         uint16_t offset,
                                         rsi_ble_resp_att_value_t *p_att_vals);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_set_att_value_async(uint8_t *dev_addr, uint16_t handle,
 *                                                 uint8_t data_len, const uint8_t *p_data)
 * @brief      Set the attribute value of the remote device. The \ref rsi_ble_on_event_write_resp_t
 *                 callback function is called after the attribute set action is completed. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_write_resp_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute value handle
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4E60  -  Invalid Handle range 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_set_att_value_async(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_prepare_write_async(uint8_t *dev_addr,
 *                                                 uint16_t handle,
 *                                                 uint16_t offset,
 *                                                 uint8_t data_len,
 *                                                 const uint8_t *p_data)
 * @brief      Prepare the attribute value. The \ref rsi_ble_on_event_prepare_write_resp_t
 *                 callback function is called after the prepare attribute write action is completed. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_prepare_write_resp_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API
 * @param[in]  dev_addr - remote device address
 * @param[in]  handle   - attribute handle
 * @param[in]  offset   - attribute value offset
 * @param[in]  data_len - attribute value length
 * @param[in]  p_data   - attribute value
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - 0x4E60  -  Invalid Handle range 
 *             - 0x4E62  -  Invalid Parameters 
 *             - 0x4D04  -  BLE not connected 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_prepare_write_async(uint8_t *dev_addr,
                                    uint16_t handle,
                                    uint16_t offset,
                                    uint8_t data_len,
                                    const uint8_t *p_data);

/*==============================================*/
/**
 * @fn         int32_t rsi_ble_execute_write_async(uint8_t *dev_addr, uint8_t exe_flag)
 * @brief      Execute the prepared attribute values. The \ref rsi_ble_on_event_write_resp_t
 *                 callback function is called after the execute attribute write action is completed. This is a blocking API and can unblock the application
 *             on the reception of the callback functions either \ref rsi_ble_on_event_write_resp_t or \ref rsi_ble_on_gatt_error_resp_t.
 * @pre Pre-conditions:
 *        \ref rsi_ble_connect() API needs to be called before this API.
 * @param[in]  dev_addr - remote device address
 * @param[in]  exe_flag - execute flag to write, possible values mentioned below
 *   - 0 - BLE_ATT_EXECUTE_WRITE_CANCEL 
 *   - 1 - BLE_ATT_EXECUTE_PENDING_WRITES_IMMEDIATELY 
 * @return The following values are returned:
 *             - 0      -   Success 
 *             - Non-Zero Value -   Failure 
 *             - 0x4D05  -  BLE Socket not available 
 * @note       Refer to the Status Codes section for the above error codes at [additional-status-codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) .
 */
int32_t rsi_ble_execute_write_async(uint8_t *dev_addr, uint8_t exe_flag);
/** @} */

/*==============================================*/

/**
 * @fn uint32_t rsi_ble_cbfc_connreq(uint8_t *dev_addr, uint16_t psm)
 * @brief Sends a connection request to a remote device using the Credit Based Flow Control (CBFC) mechanism.
 *
 * This function sends a connection request to a remote device using the CBFC mechanism. It takes the device address and the Protocol Service Multiplexer (PSM) as input parameters.
 *
 * @param dev_addr Pointer to the device address of the remote device.
 * @param psm The Protocol Service Multiplexer (PSM) value.
 *
 * @return Returns a 32-bit unsigned integer indicating the status of the connection request.
 *         - 0: If the connection request is successful.
 *         - Non-zero: If there is an error in sending the connection request.
 */
uint32_t rsi_ble_cbfc_connreq(uint8_t *dev_addr, uint16_t psm);

/**
 * @fn uint32_t rsi_ble_cbfc_connresp(uint8_t *dev_addr, uint16_t lcid, uint8_t result)
 * @brief Sends a connection response for a credit-based flow control (CBFC) connection.
 *
 * This function is used to send a connection response for a CBFC connection in the Bluetooth Low Energy (BLE) module.
 *
 * @param dev_addr The device address of the remote device.
 * @param lcid The logical channel ID of the connection.
 * @param result The result of the connection response.
 *
 * @return The status of the operation. Returns a 32-bit unsigned integer.
 */
uint32_t rsi_ble_cbfc_connresp(uint8_t *dev_addr, uint16_t lcid, uint8_t result);

/**
 * @fn uint32_t rsi_ble_cbfc_data_tx(uint8_t *dev_addr, uint16_t lcid, uint16_t len, uint8_t *p_data)
 * @brief Transmits data over a Connection-Based Flow Control (CBFC) channel in the Bluetooth Low Energy (BLE) module.
 *
 * This function is used to transmit data over a CBFC channel in the BLE module. It takes the device address, logical channel ID (LCID),
 * length of the data, and a pointer to the data as input parameters. The function returns a 32-bit unsigned integer as the status of the transmission.
 *
 * @param dev_addr Pointer to the device address of the BLE module.
 * @param lcid Logical channel ID of the CBFC channel.
 * @param len Length of the data to be transmitted.
 * @param p_data Pointer to the data to be transmitted.
 *
 * @return 32-bit unsigned integer representing the status of the transmission.
 */
uint32_t rsi_ble_cbfc_data_tx(uint8_t *dev_addr, uint16_t lcid, uint16_t len, uint8_t *p_data);

/**
 * @fn uint32_t rsi_ble_cbfc_disconnect(uint8_t *dev_addr, uint16_t lcid)
 * @brief Disconnects a Connection-Based Flow Control (CBFC) connection with the specified device address and logical channel ID.
 *
 * This function is used to disconnect a CBFC connection with the specified device address and logical channel ID.
 *
 * @param dev_addr The device address of the remote device.
 * @param lcid The logical channel ID of the CBFC connection.
 *
 * @return The status code indicating the success or failure of the operation.
 *         - Returns 0 on success.
 *         - Returns a non-zero value on failure.
 */
uint32_t rsi_ble_cbfc_disconnect(uint8_t *dev_addr, uint16_t lcid);

/******************************************************
 * *       BLE GAP Callbacks Declarations
 * ******************************************************/
/** @addtogroup BT-LOW-ENERGY8
* @{
*/
/**
 * @typedef    void (*rsi_ble_on_adv_report_event_t)(rsi_ble_event_adv_report_t *rsi_ble_event_adv);
 * @brief      Callback function advertise event report from the module.
 *             This  callback function is called whenever an advertise event report is received from the module.
 *             It has to registered using the `rsi_ble_gap_register_callbacks` API.               
 * @param[out]  rsi_ble_event_adv contains the advertise report information. Refer to rsi_ble_event_adv_report_s for more information.
 * @return The following values are returned:
 *      void
 */
typedef void (*rsi_ble_on_adv_report_event_t)(rsi_ble_event_adv_report_t *rsi_ble_event_adv);

/**
 * @typedef   void (*rsi_ble_on_connect_t)(rsi_ble_event_conn_status_t *rsi_ble_event_conn);
 * @brief Callback function for the BLE connection status from the module.
 *
 * This callback function is called whenever the BLE connection status is received from the module.
 * For BLE 4.1 and lower versions, this callback will be called.
 * It has to be registered using the `rsi_ble_gap_register_callbacks` API.
 * @param[out]  rsi_ble_event_conn contains the BLE connection status. Refer rsi_ble_event_conn_status_s for more information.
 * @return The following values are returned:
 *      void
 */
typedef void (*rsi_ble_on_connect_t)(rsi_ble_event_conn_status_t *rsi_ble_event_conn);

/**
 * @typedef    void (*rsi_ble_on_enhance_connect_t)(rsi_ble_event_enhance_conn_status_t *rsi_ble_event_enhance_conn);
 * @brief Callback function for the BLE connection status from the module.
 *
 * This callback function is called whenever the BLE connection status is received from the module.
 * For BLE 4.2 and above versions, this callback will be called.
 * It has to be registered using the `rsi_ble_gap_register_callbacks` API.
 * @param[out]  rsi_ble_event_enhance_conn contains the BLE connection status. Refer to rsi_ble_event_enhance_conn_status_s for more info.
 * @return The following values are returned:
 *      void
 */
typedef void (*rsi_ble_on_enhance_connect_t)(rsi_ble_event_enhance_conn_status_t *rsi_ble_event_enhance_conn);

/**
 * @typedef void (*rsi_ble_on_disconnect_t)(rsi_ble_event_disconnect_t *rsi_ble_event_disconnect, uint16_t reason);
 * @brief Callback function for the disconnect status event from the module.
 *
 * This callback function is called whenever the disconnect status event is received from the module.
 * It has to be registered using the `rsi_ble_gap_register_callbacks` API.
 * @param[out]  rsi_ble_event_disconnect contains the disconnect status. Refer to rsi_ble_event_disconnect_s for more information.
 * @param[out]  reason contains reason for failure. 
 * @note        Few reason for failure are given below 
 *              0x4E13  Remote user terminated connection 
 *              0x4E14  Remote device terminated connection due to low resources 
 *              0x4E15  Remote device terminated connection due to power off 
 *              0x4E3D  Connection terminated due to MIC failure 
 *              0x4E3E  Connection Failed to be Established 
 *              0x4E60  Invalid Handle Range
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_disconnect_t)(rsi_ble_event_disconnect_t *rsi_ble_event_disconnect, uint16_t reason);

/**
 * @typedef void (*rsi_ble_on_le_ping_payload_timeout_t)(rsi_ble_event_le_ping_time_expired_t *rsi_ble_event_timeout_expired);
 * @brief Callback function for the LE ping time expired event from the module.
 *
 * This callback function is called whenever the LE ping time expired event is received from the module.
 * It has to be registered using the `rsi_ble_gap_register_callbacks` API.
 * @param[out]  rsi_ble_event_timeout_expired contains the disconnect status. See rsi_ble_event_le_ping_time_expired_s for more information.
 * @return The following values are returned:
 *      void
 */
typedef void (*rsi_ble_on_le_ping_payload_timeout_t)(
  rsi_ble_event_le_ping_time_expired_t *rsi_ble_event_timeout_expired);

/**
 * @typedef    void (*rsi_ble_on_le_ltk_req_event_t)(rsi_bt_event_le_ltk_request_t *rsi_ble_event_le_ltk_request);
 * @brief Callback function for the LE LTK request event from the module.
 *
 * This callback function is called whenever the LE LTK request event is received from the module.
 * It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @param[out]  rsi_ble_event_le_ltk_request contains the LTK request info. See rsi_bt_event_le_ltk_request_s for more information.
 * @return The following values are returned:
 *      void
 */
typedef void (*rsi_ble_on_le_ltk_req_event_t)(rsi_bt_event_le_ltk_request_t *rsi_ble_event_le_ltk_request);

/**
 * @typedef    void (*rsi_ble_on_le_security_keys_t)(rsi_bt_event_le_security_keys_t *rsi_ble_event_le_security_keys);
 * @brief Callback function for the LE security keys event from the module.
 *        This callback function is called whenever the LE security keys event is received from the module.
 *        It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out]  rsi_ble_event_le_security_keys contains security keys. See rsi_bt_event_le_security_keys_s for more information.
 */
typedef void (*rsi_ble_on_le_security_keys_t)(rsi_bt_event_le_security_keys_t *rsi_ble_event_le_security_keys);
/** @} */

/******************************************************
 * *       BLE SMP EVENT Callbacks Declarations
 * ******************************************************/
/** @addtogroup BT-LOW-ENERGY8
* @{
*/
/**
 * @typedef    void (*rsi_ble_on_smp_request_t)(rsi_bt_event_smp_req_t *remote_dev_address);
 * @brief Callback function for SMP request in central mode from the remote device.
 *        This callback function is called whenever an SMP request is received in central mode from the remote device.
 *        It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] remote_dev_address contains the smp requested device address. See rsi_bt_event_smp_req_s for more information.
 */
typedef void (*rsi_ble_on_smp_request_t)(rsi_bt_event_smp_req_t *remote_dev_address);

/*==============================================*/
/**
 * @typedef    void (*rsi_ble_on_smp_response_t)(rsi_bt_event_smp_resp_t *remote_dev_address);
 * @brief Callback function for SMP request in peripheral mode from the remote device.
 *        This callback function is called whenever an SMP request is received in peripheral mode from the remote device.
 *        It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] remote_dev_address contains the smp resp information. See rsi_bt_event_smp_resp_s for more information.
 * @return The following values are returned:
 *     void  
 * 
 */
typedef void (*rsi_ble_on_smp_response_t)(rsi_bt_event_smp_resp_t *remote_dev_address);

/*==============================================*/
/**
 * @typedef    void (*rsi_ble_on_smp_passkey_t)(rsi_bt_event_smp_passkey_t *remote_dev_address);
 * @brief Callback function for SMP passkey event from the module.
 *        This callback function is called whenever an SMP passkey event is received from the module.
 *        It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] remote_dev_address contains the remote device address. See rsi_bt_event_smp_passkey_s for more information.
 */
typedef void (*rsi_ble_on_smp_passkey_t)(rsi_bt_event_smp_passkey_t *remote_dev_address);

/*==============================================*/
/**
 * @typedef    void (*rsi_ble_on_smp_passkey_display_t)(rsi_bt_event_smp_passkey_display_t *smp_passkey_display);
 * @brief Callback function for SMP passkey display event from the module.
 *        This callback function is called whenever an SMP passkey display event is received from the module.
 *        It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] smp_passkey_display contains the smp passkey display information. See rsi_bt_event_smp_passkey_display_s for more information.
 */
typedef void (*rsi_ble_on_smp_passkey_display_t)(rsi_bt_event_smp_passkey_display_t *smp_passkey_display);

/*==============================================*/
/**
 * @typedef    void (*rsi_ble_on_smp_failed_t)(uint16_t resp_status, rsi_bt_event_smp_failed_t *remote_dev_address);
 * @brief Callback function for SMP failed event from the module.
 *        This callback function will be called if the  smp process is failed with remote device.
 *        It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] resp_status contains the response status (Success or Error code) 
 * @note       Error codes for SMP FAILED are given below: 
 *              0x4B01  SMP Passkey entry failed  
 *              0x4B02  SMP OOB not available 
 *              0x4B03  SMP Authentication Requirements 
 *              0x4B04  SMP confirm value failed 
 *              0x4B05  SMP Pairing not supported 
 *              0x4B06  SMP Encryption key size insufficient 
 *              0x4B07  SMP command not supported 
 *              0x4B08  SMP Unspecified Reason 
 *              0x4B09  SMP repeated attempts 
 *              0x4B0C  SMP Numeric Comparison Failed 
 *              0x4B0B DHKEY Check Failed
 * @param[out] remote_dev_address contains the remote device address. See rsi_bt_event_smp_failed_s for more information.
 */
typedef void (*rsi_ble_on_smp_failed_t)(uint16_t resp_status, rsi_bt_event_smp_failed_t *remote_dev_address);

/*==============================================*/
/**
 * @typedef   void (*rsi_ble_on_sc_method_t)(rsi_bt_event_sc_method_t *scmethod);
 * @brief Callback function for a security method event from the module.
 *        This callback function will be called if the SC method is done with remote device.
 *        It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] scmethod contains Security Method 1 means Just works or 2 means Passkey. See rsi_bt_event_sc_method_s for more information.
 */
typedef void (*rsi_ble_on_sc_method_t)(rsi_bt_event_sc_method_t *scmethod);

/*==============================================*/
/**
 * @typedef    void (*rsi_ble_on_encrypt_started_t)(uint16_t resp_status, rsi_bt_event_encryption_enabled_t *enc_enabled);
 * @brief Callback function an encrypted event from the module.
 *        This callback function will be called if the encryption process is started with remote device.
 *        It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] resp_status contains the response status (Success or Error code)
 * @param[out] enc_enabled contains encryption information. See rsi_bt_event_encryption_enabled_s for more information. 
 */
typedef void (*rsi_ble_on_encrypt_started_t)(uint16_t resp_status, rsi_bt_event_encryption_enabled_t *enc_enabled);

/*==============================================*/
/**
 * @typedef void (*rsi_ble_on_sc_passkey_t)(rsi_bt_event_sc_passkey_t *sc_passkey);
 * @brief Callback function for a BLE Secure Connection passkey event from the module.
 *        This callback function is called whenever a BLE Secure Connection passkey event is received from the module.
 *        It has to be registered using the `rsi_ble_smp_register_callbacks` API.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[out] sc_passkey contains LE SC Passkey information. See rsi_bt_event_encryption_enabled_s for more information.
 */
typedef void (*rsi_ble_on_sc_passkey_t)(rsi_bt_event_sc_passkey_t *sc_passkey);

/**
 * @typedef    void (*rsi_ble_on_phy_update_complete_t)(rsi_ble_event_phy_update_t *rsi_ble_event_phy_update_complete);
 * @brief Callback function for receiving the PHY update complete event.
 *
 * This callback function is called whenever the PHY update complete event is received.
 * It has to be registered using the `rsi_ble_gap_register_callbacks` API.
 * @param[out] rsi_ble_event_phy_update_complete  contains the controller support PHY information. See rsi_ble_event_phy_update_s for more information.
 * @return The following values are returned:
 *      void
 * 
 *  
 * 
 */
typedef void (*rsi_ble_on_phy_update_complete_t)(rsi_ble_event_phy_update_t *rsi_ble_event_phy_update_complete);

/**
 * @typedef void (*rsi_ble_on_conn_update_complete_t)(rsi_ble_event_conn_update_t *rsi_ble_event_conn_update_complete,
                                                  uint16_t resp_status);
 * @brief Callback function for a connection update complete event from the module.
 *        This callback function is called whenever the connection update complete event is received. 
 *        \ref rsi_ble_event_conn_update_s contains connection information.
 *        It has to be registered using the `rsi_ble_gap_register_callbacks` API.                                                
 * @param[out] rsi_ble_event_conn_update_complete contains the connection information. See \ref rsi_ble_event_conn_update_s for more information.
 * @param[out] resp_status contains the response status (Success or Error code)
 */
typedef void (*rsi_ble_on_conn_update_complete_t)(rsi_ble_event_conn_update_t *rsi_ble_event_conn_update_complete,
                                                  uint16_t resp_status);
/**
 * @typedef void (*rsi_ble_on_remote_conn_params_request_t)(
 *                              rsi_ble_event_remote_conn_param_req_t *rsi_ble_event_remote_conn_param,
 *                              uint16_t resp_status);
 * @brief Callback function for remote connection parameters request.
 *
 * This callback function is called whenever a remote connection parameters request is received.
 * It has to be registered using the `rsi_ble_gap_register_callbacks` API.
 * @param[out] resp_status contains the response status (Success or Error code)
 * @param[out] rsi_ble_event_remote_conn_param contains the remote device connection parameters. See rsi_ble_event_remote_conn_param_req_s for more information.
 * @return The following values are returned:
 *      void
 * 
 * 
 */
typedef void (*rsi_ble_on_remote_conn_params_request_t)(
  rsi_ble_event_remote_conn_param_req_t *rsi_ble_event_remote_conn_param,
  uint16_t resp_status);

/**
 * @typedef void (*rsi_ble_on_remote_features_t)(rsi_ble_event_remote_features_t *rsi_ble_event_remote_features);
 * @brief      Callback function for supported features of remote device
 *             This callback function will be called when LE remote features event is received.
 *             it has to be registered using rsi_ble_gap_extended_register_callbacks API.
 * @param[out] rsi_ble_event_remote_features contains the remote device supported features. See \ref rsi_ble_event_remote_features_s for more information.
 */
typedef void (*rsi_ble_on_remote_features_t)(rsi_ble_event_remote_features_t *rsi_ble_event_remote_features);

/**
 * @typedef    void (*rsi_ble_on_le_more_data_req_t)(rsi_ble_event_le_dev_buf_ind_t *rsi_ble_more_data_evt);
 * @brief Callback function for the LE more data event.
 *
 * This callback function is called whenever an LE more data event is received.
 * It has to be registered using the `rsi_ble_gap_extended_register_callbacks` API.
 * @param[out] rsi_ble_more_data_evt contains the LE Device Buffer Indication information. See rsi_ble_event_le_dev_buf_ind_s for more infomation.
 * @return The following values are returned:
 *     void
 * 
 * 
 * 
 */
typedef void (*rsi_ble_on_le_more_data_req_t)(rsi_ble_event_le_dev_buf_ind_t *rsi_ble_more_data_evt);

/*==============================================*/
/**
 * @typedef    void (*rsi_ble_on_data_length_update_t)(rsi_ble_event_data_length_update_t *remote_dev_address);
 * @brief Callback function for the data length update complete event.
 *        This callback function is called whenever the data length update complete event is received. \ref rsi_ble_event_data_length_update_s type variable remote_dev_address
 *        contains information about dev_addr - Device address of the remote device , MaxTxOctets - Maximum TX Octets to be transmitted , MaxTxTime - Maximum TX time to transmit the MaxTxOctets ,
 *        MaxRxOctets - Maximum Rx Octets to be received , MaxRxTime - Maximum Rx time to receive the MaxRxOctets
 *        It has to be registered using the `rsi_ble_gap_register_callbacks` API.
 * @param[out] remote_dev_address contains the controller support TX and RX length and transmission time information. See \ref rsi_ble_event_data_length_update_s for more information.
 */
typedef void (*rsi_ble_on_data_length_update_t)(rsi_ble_event_data_length_update_t *remote_dev_address);

/**
 * @typedef    void (*rsi_ble_on_directed_adv_report_event_t)(rsi_ble_event_directedadv_report_t *rsi_ble_event_directed);
 * @brief Callback function for a directed advertise report event from the module.
 * This callback function is called whenever a directed advertise report event is received from the module.
 * It has to be registered using the `rsi_ble_gap_register_callbacks` API.
 * @param[in]  rsi_ble_event_directed contains the advertise report information
 * 
 */
typedef void (*rsi_ble_on_directed_adv_report_event_t)(rsi_ble_event_directedadv_report_t *rsi_ble_event_directed);
/** @} */

/** @addtogroup BT-LOW-ENERGY7
* @{
*/
/*==============================================*/
/**
 * @brief      Register GAP callbacks.
 * @param[in]  ble_on_adv_report_event                  - Callback function for Advertise events
 * @param[in]  ble_on_conn_status_event                 - Callback function for Connect events
 * @param[in]  ble_on_disconnect_event                  - Callback function for Disconnect events
 * @param[in]  timeout_expired_event                    - Callback function for LE ping timeout events
 * @param[in]  ble_on_phy_update_complete_event         - Callback function for PHY update complete events
 * @param[in]  ble_on_data_length_update_complete_event - Callback function for data length update events
 * @param[in]  ble_on_enhance_conn_status_event         - Callback function for enhanced connection status events
 * @param[in]  ble_on_directed_adv_report_event         - Callback function for directed advertising report events
 * @param[in]  ble_on_conn_update_complete_event        - Callback function for connection update complete events
 * @param[in]  ble_on_remote_conn_params_request_event  - Callback function to remote connection params request events
 * 
 */
void rsi_ble_gap_register_callbacks(rsi_ble_on_adv_report_event_t ble_on_adv_report_event,
                                    rsi_ble_on_connect_t ble_on_conn_status_event,
                                    rsi_ble_on_disconnect_t ble_on_disconnect_event,
                                    rsi_ble_on_le_ping_payload_timeout_t timeout_expired_event,
                                    rsi_ble_on_phy_update_complete_t ble_on_phy_update_complete_event,
                                    rsi_ble_on_data_length_update_t ble_on_data_length_update_complete_event,
                                    rsi_ble_on_enhance_connect_t ble_on_enhance_conn_status_event,
                                    rsi_ble_on_directed_adv_report_event_t ble_on_directed_adv_report_event,
                                    rsi_ble_on_conn_update_complete_t ble_on_conn_update_complete_event,
                                    rsi_ble_on_remote_conn_params_request_t ble_on_remote_conn_params_request_event);

/*==============================================*/
/**
 * @brief      Register GAP Extended responses/events callbacks.
 * @pre Pre-conditions:
 *        Call [sl_wifi_init()](../wiseconnect-api-reference-guide-wi-fi/wifi-common-api#sl-wifi-init) before calling this API.
 * @param[in]  ble_on_remote_features_event  - Call back function for Remote feature request
 * @param[in]  ble_on_le_more_data_req_event - Call back function for LE More data request
 * @note        For more information about each callback, see the GAP Extended callbacks description section.
 * 
 */

void rsi_ble_gap_extended_register_callbacks(rsi_ble_on_remote_features_t ble_on_remote_features_event,
                                             rsi_ble_on_le_more_data_req_t ble_on_le_more_data_req_event);

/**
 * @fn uint32_t rsi_ble_enhanced_gap_extended_register_callbacks(uint16_t callback_id,
 *                                   void (*callback_handler_ptr)(uint16_t status,
 *                                                  uint8_t *buffer));
 * @brief Registers a callback function for the Enhanced GAP Extended feature in the RSI BLE module.
 *
 * This function allows you to register a callback function to handle events related to the Enhanced GAP Extended feature.
 * The callback function will be called when an event occurs, providing the status and a buffer containing additional data.
 *
 * @param callback_id The ID of the callback to register.
 * @param callback_handler_ptr A pointer to the callback function that will handle the events.
 *
 * @return The status of the registration process. Possible values are defined by the uint16_t data type.
 * 
 * @note Ensure that the callback function is implemented to handle the specific events you are interested in.
 *       The callback function should match the signature specified in the function parameters.
 *       This function should be called during the initialization phase of your application to ensure that
 *       the callbacks are registered before any events occur.
 */
uint32_t rsi_ble_enhanced_gap_extended_register_callbacks(uint16_t callback_id,
                                                          void (*callback_handler_ptr)(uint16_t status,
                                                                                       uint8_t *buffer));

/*==============================================*/
/**
 * 
 */
/**
 * @fn         int32_t rsi_ble_adv_ext_events_register_callbacks(uint16_t callback_id,
 *                                       void (*callback_handler_ptr)(uint16_t status, uint8_t *buffer));
 * @brief Registers callback functions for extended advertising events in the BLE module.
 *
 * This function allows the application to register callback functions to handle extended advertising events
 * in the BLE module. The callback functions will be invoked when an extended advertising event occurs.
 *
 * @param callback_id The ID of the callback function to register.
 * @param callback_handler_ptr A pointer to the callback function that will handle the extended advertising events.
 *                             The callback function should have the following signature:
 *                             void callback_handler(uint16_t status, uint8_t *buffer)
 *                             - status: The status of the extended advertising event.
 *                             - buffer: A pointer to the buffer containing the extended advertising event data.
 *
 * @return Returns 0 on success, or a negative error code on failure.
 */
int32_t rsi_ble_adv_ext_events_register_callbacks(uint16_t callback_id,
                                                  void (*callback_handler_ptr)(uint16_t status, uint8_t *buffer));

/*==============================================*/
/**
 * @brief         Register the SMP callbacks
 * @param[in]     ble_on_smp_request_event           - smp request callback
 * @param[in]     ble_on_smp_response_event          - smp response callback
 * @param[in]     ble_on_smp_passkey_event           - smp passkey callback
 * @param[in]     ble_on_smp_fail_event            - smp failed callback
 * @param[in]     rsi_ble_on_encrypt_started_event               - encryption enabled callback
 * @param[in]     ble_on_smp_passkey_display_event   - smp passkey display callback
 * @param[in]     ble_sc_passkey_event               - sc passkey display callback
 * @param[in]     ble_on_le_ltk_req_event            - This is the SMP LTK request callback
 * @param[in]     ble_on_le_security_keys_event      -  This is the SMP security keys callback
 * @param[in]     ble_on_cli_smp_response_event        -  This is the client smp response callback    - 
 * @param[in]   ble_on_sc_method_event                    - sc method display callback
 * 
 */
void rsi_ble_smp_register_callbacks(rsi_ble_on_smp_request_t ble_on_smp_request_event,
                                    rsi_ble_on_smp_response_t ble_on_smp_response_event,
                                    rsi_ble_on_smp_passkey_t ble_on_smp_passkey_event,
                                    rsi_ble_on_smp_failed_t ble_on_smp_fail_event,
                                    rsi_ble_on_encrypt_started_t rsi_ble_on_encrypt_started_event,
                                    rsi_ble_on_smp_passkey_display_t ble_on_smp_passkey_display_event,
                                    rsi_ble_on_sc_passkey_t ble_sc_passkey_event,
                                    rsi_ble_on_le_ltk_req_event_t ble_on_le_ltk_req_event,
                                    rsi_ble_on_le_security_keys_t ble_on_le_security_keys_event,
                                    rsi_ble_on_smp_response_t ble_on_cli_smp_response_event,
                                    rsi_ble_on_sc_method_t ble_on_sc_method_event);

/** @} */

/******************************************************
 * *       BLE GATT Response Callbacks Declarations
 * ******************************************************/
/** @addtogroup BT-LOW-ENERGY8
* @{
*/
/**
 * @typedef    void (*rsi_ble_on_gatt_error_resp_t)(uint16_t event_status, rsi_ble_event_error_resp_t *rsi_ble_gatt_error);
 * @brief Callback function for a GATT error event from the module.
 *
 * This callback function is called whenever a GATT error event is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the error response  
 *              Non-Zero Value  -   Failure 
 *              Attribute protocol error codes 
 *              0x4A01  -  Invalid Handle 
 *              0x4A06  -  Request not supported 
 *              0x4A0A  -  Attribute not found 
 *              0x4A05  -  Insufficient authentication 
 *              0x4A08  -  Insufficient authorization 
 *              0x4A0C  -  Insufficient encryption key size 
 *              0x4A0F  -  Insufficient encryption 
 *                    0x4A02  -  Read not permitted 
 *              0x4A03  -  Write not permitted 
 *              0x4A07  -  Invalid offset 
 *              0x4A0B  -  Attribute not Long       attribute value has a fixed length that is less than or equal to (ATT_MTU - 1) octets in length , refer to Bluetooth Spec 5.4 for further details.
 * @param[out]  rsi_ble_gatt_error contains the GATT error information. Please refer rsi_ble_event_error_resp_s for more info
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_gatt_error_resp_t)(uint16_t event_status, rsi_ble_event_error_resp_t *rsi_ble_gatt_error);
/**
 * @typedef void (*rsi_ble_on_gatt_desc_val_event_t)(uint16_t event_status,
                                                 rsi_ble_event_gatt_desc_t *rsi_ble_gatt_desc_val);
 * @brief Callback function for an attribute descriptors event from the module.
 *
 * This callback function is called whenever an attribute descriptors event is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the response status 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 *
 * @param[out]  rsi_ble_gatt_desc_val contains the profiles list event information. Refer to rsi_ble_event_gatt_desc_s for more information.
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_gatt_desc_val_event_t)(uint16_t event_status,
                                                 rsi_ble_event_gatt_desc_t *rsi_ble_gatt_desc_val);

/**
 * @typedef void (*rsi_ble_on_event_profiles_list_t)(uint16_t event_status,
                                                 rsi_ble_event_profiles_list_t *rsi_ble_event_profiles);
 * @brief Callback function for a profiles list response from the module.
 *
 * This callback function is called whenever a profiles list response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 *
 * @param[out]  rsi_ble_event_profiles contains the profiles list event information. Refer to rsi_ble_event_profiles_list_s for more information.
 * @return The following values are returned:
 *      void
 * 
 *  
 * 
 */
typedef void (*rsi_ble_on_event_profiles_list_t)(uint16_t event_status,
                                                 rsi_ble_event_profiles_list_t *rsi_ble_event_profiles);

/**
 * @typedef void (*rsi_ble_on_event_profile_by_uuid_t)(uint16_t event_status,
                                                   rsi_ble_event_profile_by_uuid_t *rsi_ble_event_profile);
 * @brief Callback function for a profile response from the module.
 *
 * This callback function is called whenever a profile response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 *
 * @param[out]  rsi_ble_event_profile contains the profile response information. Refer to rsi_ble_event_profile_by_uuid_s for more information.
 * @return The following values are returned:
 *      void
 * 
 *  
 * 
 */
typedef void (*rsi_ble_on_event_profile_by_uuid_t)(uint16_t event_status,
                                                   rsi_ble_event_profile_by_uuid_t *rsi_ble_event_profile);
/**
 * @typedef void (*rsi_ble_on_event_read_by_char_services_t)(uint16_t event_status,
                                                         rsi_ble_event_read_by_type1_t *rsi_ble_event_read_type1);
 * @brief      This callback function will be called if the characteristic services list response is received from the module.
 * @param[out]  event_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @param[out]  rsi_ble_event_read_type1 contains the char services event information. Refer to rsi_ble_event_read_by_type1_s for more information.
 * @return The following values are returned:
 *      void
 * 
 * 
 */
typedef void (*rsi_ble_on_event_read_by_char_services_t)(uint16_t event_status,
                                                         rsi_ble_event_read_by_type1_t *rsi_ble_event_read_type1);

/**
 * @typedef void (*rsi_ble_on_event_read_by_inc_services_t)(uint16_t event_status,
                                                        rsi_ble_event_read_by_type2_t *rsi_ble_event_read_type2);
 * @brief Callback function for an include services list response from the module.
 *
 * This callback function is called whenever an include services list response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @param[out]  rsi_ble_event_read_type2 contains the inc services information. Refer to rsi_ble_event_read_by_type2_s for more information.
 * @return The following values are returned:
 *      void
 * 
 *  
 *
 * 
 */
typedef void (*rsi_ble_on_event_read_by_inc_services_t)(uint16_t event_status,
                                                        rsi_ble_event_read_by_type2_t *rsi_ble_event_read_type2);
/**
 * @typedef void (*rsi_ble_on_event_read_att_value_t)(uint16_t event_status,
                                                  rsi_ble_event_read_by_type3_t *rsi_ble_event_read_type3);
 * @brief Callback function for an attribute value response from the module.
 *
 * This callback function is called whenever an attribute value response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @param[out]  rsi_ble_event_read_type3 contains the char services event information. Refer to rsi_ble_event_read_by_type3_s for more information.
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_event_read_att_value_t)(uint16_t event_status,
                                                  rsi_ble_event_read_by_type3_t *rsi_ble_event_read_type3);

/**
 * @typedef void (*rsi_ble_on_event_read_resp_t)(uint16_t event_status, rsi_ble_event_att_value_t *rsi_ble_event_att_val);
 * @brief Callback function for an attribute value from the module.
 *
 * This callback function is called whenever an attribute value is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @param[out]  rsi_ble_event_att_val contains the profile response information. Refer to rsi_ble_event_att_value_s for more information.
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_event_read_resp_t)(uint16_t event_status, rsi_ble_event_att_value_t *rsi_ble_event_att_val);

/**
 * @typedef    void (*rsi_ble_on_event_write_resp_t)(uint16_t event_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp);
 * @brief Callback function for a GATT write response from the module.
 *
 * This callback function is called whenever a GATT write response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 *
 * @param[out]  rsi_ble_event_set_att_rsp contains the profile response information. Refer to rsi_ble_set_att_resp_t for more information.
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_event_write_resp_t)(uint16_t event_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp);
/**
 * @typedef void (*rsi_ble_on_event_indicate_confirmation_t)(uint16_t event_status,
                                                         rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp);
 * @brief      Callback function for indication confirmation event
 *
 * This callback function is called whenever an indication confirmation response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @param[out]  rsi_ble_event_set_att_rsp contains the profile response information. Refer to rsi_ble_set_att_resp_s for more information.
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_event_indicate_confirmation_t)(uint16_t event_status,
                                                         rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp);
/**
 * @typedef void (*rsi_ble_on_event_prepare_write_resp_t)(uint16_t event_status,
                                                      rsi_ble_prepare_write_resp_t *rsi_ble_event_prepare_write);
 * @brief Callback function for a GATT prepare response from the module.
 *
 * This callback function is called whenever a GATT prepare response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_status contains the response status 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @param[out]  rsi_ble_event_prepare_write contains the char services event information. Refer to rsi_ble_prepare_write_resp_s for more information.
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_event_prepare_write_resp_t)(uint16_t event_status,
                                                      rsi_ble_prepare_write_resp_t *rsi_ble_event_prepare_write);

/**
 * @typedef void (*rsi_ble_on_profiles_list_resp_t)(uint16_t resp_status,
                                                rsi_ble_resp_profiles_list_t *rsi_ble_resp_profiles);
 * @brief Callback function for a profiles list response from the module.
 *
 * This callback function is called whenever a profiles list response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  resp_status contains the response status 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @note        Attribute protocol error codes 
 *              0x4A01  -  Invalid Handle 
 *              0x4A0A  -  Attribute not found 
 * @param[out]  rsi_ble_resp_profiles contains the profiles list response information. Refer to rsi_ble_resp_profiles_list_s for more information.
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_profiles_list_resp_t)(uint16_t resp_status,
                                                rsi_ble_resp_profiles_list_t *rsi_ble_resp_profiles);

/**
 * @typedef void (*rsi_ble_on_profile_resp_t)(uint16_t resp_status, profile_descriptors_t *rsi_ble_resp_profile);
 * @brief Callback function for a profile response from the module.
 *
 * This callback function is called whenever a profile response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  resp_status contains the response status 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @note        Attribute protocol error codes 
 *              0x4A01  -  Invalid Handle 
 *              0x4A06  -  Request not supported 
 *              0x4A0A  -  Attribute not found 
 * @param[out]  rsi_ble_resp_profile contains the profile response information. Refer to profile_descriptors_s for more information.
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_profile_resp_t)(uint16_t resp_status, profile_descriptors_t *rsi_ble_resp_profile);

/**
 * @typedef void (*rsi_ble_on_char_services_resp_t)(uint16_t resp_status,
                                                rsi_ble_resp_char_services_t *rsi_ble_resp_char_serv);
 * @brief Callback function for a service characteristics response from the module.
 *
 * This callback function is called whenever a service characteristics response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  resp_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @note        Attribute protocol error codes 
 *              0x4A01  -  Invalid Handle 
 *              0x4A06  -  Request not supported 
 *              0x4A0A  -  Attribute not found 
 *              0x4A05  -  Insufficient authentication 
 *              0x4A08  -  Insufficient authorization 
 *              0x4A0C  -  Insufficient encryption key size 
 *              0x4A0F  -  Insufficient encryption 
 *                    0x4A02  -  Read not permitted 
 * @param[out]  rsi_ble_resp_char_serv contains the service characteristics response information. Please refer rsi_ble_resp_char_services_s for more info
 * @return The following values are returned:
 *      void
 */
typedef void (*rsi_ble_on_char_services_resp_t)(uint16_t resp_status,
                                                rsi_ble_resp_char_services_t *rsi_ble_resp_char_serv);

/**
 * @typedef void (*rsi_ble_on_inc_services_resp_t)(uint16_t resp_status,
                                               rsi_ble_resp_inc_services_t *rsi_ble_resp_inc_serv);
 * @brief Callback function for an include service response from the module.
 *
 * This callback function is called whenever an include service response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  resp_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @note        Attribute protocol error codes 
 *              0x4A01  -  Invalid Handle 
 *              0x4A06  -  Request not supported 
 *              0x4A0A  -  Attribute not found 
 *              0x4A05  -  Insufficient authentication 
 *              0x4A08  -  Insufficient authorization 
 *              0x4A0C  -  Insufficient encryption key size 
 *              0x4A0F  -  Insufficient encryption 
 *                    0x4A02  -  Read not permitted 
 * @param[out]  rsi_ble_resp_inc_serv contains the include services response information. Please refer rsi_ble_resp_inc_services_s for more info
 * @return The following values are returned:
 *      void
 * 
 *  
 *
 */
typedef void (*rsi_ble_on_inc_services_resp_t)(uint16_t resp_status,
                                               rsi_ble_resp_inc_services_t *rsi_ble_resp_inc_serv);

/**
 * @typedef     void (*rsi_ble_on_att_desc_resp_t)(uint16_t resp_status, rsi_ble_resp_att_descs_t *rsi_ble_resp_att_desc);
 * @brief Callback function for an attribute descriptors response from the module.
 *
 * This callback function is called whenever an attribute descriptors response is received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  resp_status contains the response status 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @note        Attribute protocol error codes 
 *              0x4A01  -  Invalid Handle 
 *              0x4A0A  -  Attribute not found 
 *              0x4A05  -  Insufficient authentication 
 *              0x4A08  -  Insufficient authorization 
 *              0x4A0C  -  Insufficient encryption key size 
 *              0x4A0F  -  Insufficient encryption 
 *                    0x4A02  -  Read not permitted 
 * @param[out]  rsi_ble_resp_att_desc contains the attribute descriptors response information. Refer to rsi_ble_resp_att_descs_s for more information. 
 * @return The following values are returned:
 *      void
 * 
 */
typedef void (*rsi_ble_on_att_desc_resp_t)(uint16_t resp_status, rsi_ble_resp_att_descs_t *rsi_ble_resp_att_desc);

/**
 * @typedef void (*rsi_ble_on_read_resp_t)(uint16_t resp_status,
                                       uint16_t resp_id,
                                       rsi_ble_resp_att_value_t *rsi_ble_resp_att_val);
 * @brief Callback function for receiving an attribute value from the module.
 *
 * This callback function is called upon receiving an attribute value from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  resp_status contains the response status 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @note        Attribute protocol error codes 
 *              0x4A01  -  Invalid Handle 
 *              0x4A0A  -  Attribute not found 
 *              0x4A05  -  Insufficient authentication 
 *              0x4A08  -  Insufficient authorization 
 *              0x4A0C  -  Insufficient encryption key size 
 *              0x4A0F  -  Insufficient encryption 
 *                    0x4A02  -  Read not permitted 
 *              0x4A06  -  Request not supported 
 *              0x4A07  -  Invalid offset 
 *              0x4A0B  -  Attribute not Long     attribute value has a fixed length that is less than or equal to (ATT_MTU - 1) octets in length , refer to Bluetooth Spec 5.4 for further details.
 * @param[out]  resp_id contains the response id because of which, this callback is called
 *                      response ids: (RSI_BLE_RSP_READ_VAL, RSI_BLE_RSP_READ_BY_UUID, RSI_BLE_RSP_LONG_READ, RSI_BLE_RSP_MULTIPLE_READ)
 * @param[out]  rsi_ble_resp_att_val contains the attribute value. Please refer rsi_ble_resp_att_value_s for more information
 * @return The following values are returned:
 *      void
 * 
 * 
 */
typedef void (*rsi_ble_on_read_resp_t)(uint16_t resp_status,
                                       uint16_t resp_id,
                                       rsi_ble_resp_att_value_t *rsi_ble_resp_att_val);

/**
 * @typedef void (*rsi_ble_on_write_resp_t)(uint16_t resp_status, uint16_t resp_id);
 * @brief Callback function for attribute set/prepare/execute action completion.
 *
 * This callback function is called when an attribute set, prepare, or execute action is completed.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  resp_status contains the response status 
 * 
 *              - 0 - Success 
 *              - Non-Zero Value    -   Failure 
 * @note        Attribute protocol error codes 
 *              0x4A01  -  Invalid Handle
 *              0x4A0A  -  Attribute not found 
 *              0x4A05  -  Insufficient authentication 
 *              0x4A08  -  Insufficient authorization 
 *              0x4A0C  -  Insufficient encryption key size 
 *              0x4A0F  -  Insufficient encryption 
 *                    0x4A03  -  Write not permitted 
 *              0x4A07  -  Invalid offset  
 *              0x4A0D  -  Invalid attribute value length 
 * @param[out]  resp_id contains the response id because of which, this callback is called
 *                      response ids: (RSI_BLE_RSP_WRITE, RSI_BLE_RSP_WRITE_NO_ACK, RSI_BLE_RSP_LONG_WRITE, RSI_BLE_RSP_EXECUTE_WRITE)
 * 
 */
typedef void (*rsi_ble_on_write_resp_t)(uint16_t resp_status, uint16_t resp_id);
/** @} */

/******************************************************
 * *       BLE GATT Event Callbacks Declarations
 * ******************************************************/
/** @addtogroup BT-LOW-ENERGY8
* @{
*/
/**
 * @typedef void (*rsi_ble_on_gatt_write_event_t)(uint16_t event_id, rsi_ble_event_write_t *rsi_ble_write);
 * @brief Callback function for GATT write, notify, or indicate events from the module.
 *
 * This callback function is called when GATT write, notify, or indicate events are received from the module.
 * It has to be registered using the `rsi_ble_gatt_register_callbacks` API.
 * @param[out]  event_id contains the gatt_write event id (RSI_BLE_EVENT_GATT_WRITE) 
 * @param[out]  rsi_ble_write  contains the GATT event information. Refer to rsi_ble_event_write_s for more information.
 * 
 */
typedef void (*rsi_ble_on_gatt_write_event_t)(uint16_t event_id, rsi_ble_event_write_t *rsi_ble_write);

/**
 * @typedef void (*rsi_ble_on_gatt_prepare_write_event_t)(uint16_t event_id, rsi_ble_event_prepare_write_t *rsi_ble_write);
 * @brief      This callback function will be called if the GATT write/notify/indicate events are received
 *             This callback has to be registered using rsi_ble_gatt_register_callbacks API.
 * @param[in]  event_id contains the event id (RSI_BLE_EVENT_GATT_NOTIFICATION,  RSI_BLE_EVENT_GATT_INDICATION, RSI_BLE_EVENT_GATT_WRITE)
 * @param[in]  rsi_ble_write  Pointer to a \ref rsi_ble_event_prepare_write_s structure containing detailed information
 *                            about the GATT prepare write event. This includes the remote device address, attribute handle, 
 *                            value offset, length of the value, and the attribute value itself. Please refer \ref rsi_ble_event_prepare_write_s for more information.
 * 
 */
typedef void (*rsi_ble_on_gatt_prepare_write_event_t)(uint16_t event_id, rsi_ble_event_prepare_write_t *rsi_ble_write);

/**
 * @typedef void (*rsi_ble_on_execute_write_event_t)(uint16_t event_id, rsi_ble_execute_write_t *rsi_ble_execute_write);
 * @brief      The callback function will be called if the GATT write execute events are received.
 *             This callback has to be registered using rsi_ble_gatt_register_callbacks API.
 * @param[out]  event_id contains the gatt_execute_write event id (RSI_BLE_EVENT_EXECUTE_WRITE) 
 *
 * @param[out]  rsi_ble_execute_write Pointer to a \ref rsi_ble_execute_write_s structure containing details
 *                                    about the execute write request. This includes the remote device address 
 *                                    and the execute write flag.
 */
typedef void (*rsi_ble_on_execute_write_event_t)(uint16_t event_id, rsi_ble_execute_write_t *rsi_ble_execute_write);

/**
 * @typedef    void (*rsi_ble_on_read_req_event_t)(uint16_t event_id, rsi_ble_read_req_t *rsi_ble_read_req);
 * @brief      The callback function will be called if the GATT read request events are received.
 *             This callback has to be registered using rsi_ble_gatt_register_callbacks API.
 * @param[out]  event_id contains the gatt_read_req_event id (RSI_BLE_EVENT_READ_REQ) 
 * @param[out]  rsi_ble_read_req Pointer to a \ref rsi_ble_read_req_s structure containing details about the
 *                               GATT read request. This includes the remote device address, attribute handle, 
 *                               request type, and the offset of the attribute value.
 * 
 */
typedef void (*rsi_ble_on_read_req_event_t)(uint16_t event_id, rsi_ble_read_req_t *rsi_ble_read_req);

/**
 * @typedef void (*rsi_ble_on_mtu_event_t)(rsi_ble_event_mtu_t *rsi_ble_event_mtu);
 * @brief      The callback function will be called if MTU size request is received. 
 *             The MTU size negotiation occurs after establishing a connection, and the callback provides
 *             the updated MTU size information.
 * @param[out]  rsi_ble_event_mtu  contains the MTU size information. Please refer \ref rsi_ble_event_mtu_s for more information.
 * 
 */
typedef void (*rsi_ble_on_mtu_event_t)(rsi_ble_event_mtu_t *rsi_ble_event_mtu);

/**
 * @typedef    void (*rsi_ble_on_mtu_exchange_info_t)(rsi_ble_event_mtu_exchange_information_t *rsi_ble_event_mtu_exchange_info);
 * @brief      Callback function called to indicate MTU exchange details.
 *             This callback provides information about the MTU size negotiation and indicates
 *             the initiator of the MTU exchange process (local or remote device).
 *             It is triggered during the MTU exchange process after establishing a BLE connection.
 *             This callback has to be registered using rsi_ble_gatt_extended_register_callbacks API.
 * @param[out]  rsi_ble_event_mtu_exchange_info contains the MTU exchange information. Please refer \ref rsi_ble_event_mtu_exchange_information_s for more information.
 * @note        When services are maintained on the host, this API need to be triggered by the application.
 * 
 */
typedef void (*rsi_ble_on_mtu_exchange_info_t)(
  rsi_ble_event_mtu_exchange_information_t *rsi_ble_event_mtu_exchange_info);

/**
 * @typedef    void (*rsi_ble_on_remote_device_info_t)(uint16_t status, rsi_ble_event_remote_device_info_t *resp_buffer);
 * @brief      Callback function to retrieve remote device information.it provides the version and manufacturer-specific details of a remote device.
 *             This callback has to be registered using rsi_ble_enhanced_gap_extended_register_callbacks API.
 * @param[out]  status contains the response status (Success or Error code) 
 *               - 0 - SUCCESS 
 *               - Non-Zero Value - ErrorCodes
 * @note        Refer Bluetooth Generic Error Codes section  up to 0x4FF8 from error-codes.
 * @param[out] resp_buffer Pointer to a \ref rsi_ble_event_remote_device_info_s structure containing 
 *                         remote device version information, including the version, company ID, 
 *                         and sub-version.
 *
 */
typedef void (*rsi_ble_on_remote_device_info_t)(uint16_t status, rsi_ble_event_remote_device_info_t *resp_buffer);
/**
 * @file rsi_ble_apis.h
 * @brief This file contains the declarations of the BLE API functions.
 */

/**
 * @typedef void (*rsi_ble_on_rcp_resp_rcvd_t)(uint16_t status, rsi_ble_event_rcp_rcvd_info_t *resp_buffer);
 * @brief Callback function type for receiving RCP response events.
 * @param status The status of the RCP response event.
 * @param resp_buffer Pointer to the buffer containing the RCP response information.
 * 
 */
typedef void (*rsi_ble_on_rcp_resp_rcvd_t)(uint16_t status, rsi_ble_event_rcp_rcvd_info_t *resp_buffer);

/** @} */

/*********************************************************************************
 * * BLE L2CAP Credit based flow control(CBFC) Callbacks register function Declarations
 * *******************************************************************************/

/**
 * @typedef void (*rsi_ble_on_cbfc_conn_req_event_t)(rsi_ble_event_cbfc_conn_req_t *rsi_ble_cbfc_conn_req);
 * @brief      Callback function to handle an L2CAP CBFC connection request event.
 *             This callback function is called when a Circular Buffer Flow Control (CBFC) 
 *             connection request is received from a remote BLE device. It provides the 
 *             necessary connection parameters to process the request.
 *             This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
 * @param[in]  rsi_ble_cbfc_conn_req  contains the connection request information , see \ref rsi_ble_event_cbfc_conn_req_s for more information.
 *
 */
typedef void (*rsi_ble_on_cbfc_conn_req_event_t)(rsi_ble_event_cbfc_conn_req_t *rsi_ble_cbfc_conn_req);

/**
 * @typedef void (*rsi_ble_on_cbfc_conn_complete_event_t)(rsi_ble_event_cbfc_conn_complete_t *rsi_ble_cbfc_conn_complete,
 *                                                     uint16_t status);
 * @brief      Callback function to indicate L2CAP CBFC connection complete status. 
 *             This callback function will be called when Circular Buffer Flow Control (CBFC) connection
 *             has been successfully established or when the connection attempt fails. The function
 *             provides detailed information about the connection parameters and the status of the operation. 
 *             This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
 * @param[in]  status The status of the connection operation:
 *                     - **0**: SUCCESS
 *                     - **Non-Zero Value**: Error code indicating the reason for the failure.
 * @param[in]  rsi_ble_cbfc_conn_complete  contains the connection completed information such as psm , mtu , mps , lcid refer \ref rsi_ble_event_cbfc_conn_complete_s for more information.
 * 
 * 
 * 
 */
typedef void (*rsi_ble_on_cbfc_conn_complete_event_t)(rsi_ble_event_cbfc_conn_complete_t *rsi_ble_cbfc_conn_complete,
                                                      uint16_t status);

/**
 * @typedef void (*rsi_ble_on_cbfc_rx_data_event_t)(rsi_ble_event_cbfc_rx_data_t *rsi_ble_cbfc_rx_data);
 * @brief      Callback function to indicate L2CAP CBFC RX data event. 
 *             This callback function will be called when data is received over a Circular Buffer Flow Control (CBFC)
 *             connection from a remote device.
 *             This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
 * @param[in]  rsi_ble_cbfc_rx_data  contains the received data information , see \ref rsi_ble_event_cbfc_rx_data_s
 * 
 */
typedef void (*rsi_ble_on_cbfc_rx_data_event_t)(rsi_ble_event_cbfc_rx_data_t *rsi_ble_cbfc_rx_data);

/**
 * @typedef void (*rsi_ble_on_cbfc_disconn_event_t)(rsi_ble_event_cbfc_disconn_t *rsi_ble_cbfc_disconn);
 * @brief      Callback function to indicate L2CAP CBFC disconnection event.
 *             This callback function will be called whenever a Circular Buffer Flow Control (CBFC) 
 *             disconnection event occurs.
 *             This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
 * @param[in]  rsi_ble_cbfc_disconn  contains the disconnect device information , see \ref rsi_ble_event_cbfc_disconn_s.
 */
typedef void (*rsi_ble_on_cbfc_disconn_event_t)(rsi_ble_event_cbfc_disconn_t *rsi_ble_cbfc_disconn);

/**
 * @fn void rsi_ble_l2cap_cbsc_register_callbacks(rsi_ble_on_cbfc_conn_req_event_t ble_on_cbsc_conn_req,
 *                       rsi_ble_on_cbfc_conn_complete_event_t ble_on_cbsc_conn_complete,
 *                       rsi_ble_on_cbfc_rx_data_event_t ble_on_cbsc_rx_data,
 *                       rsi_ble_on_cbfc_disconn_event_t ble_on_cbsc_disconn);
 * @brief Register callbacks for BLE L2CAP Credit Based Flow Control (CBFC) events.
 *
 * This function is used to register callbacks for various CBFC events in BLE L2CAP.
 * The registered callbacks will be invoked when the corresponding events occur.
 *
 * @param ble_on_cbsc_conn_req Callback function to handle CBFC connection request event.
 * @param ble_on_cbsc_conn_complete Callback function to handle CBFC connection complete event.
 * @param ble_on_cbsc_rx_data Callback function to handle CBFC receive data event.
 * @param ble_on_cbsc_disconn Callback function to handle CBFC disconnection event.
 */
void rsi_ble_l2cap_cbsc_register_callbacks(rsi_ble_on_cbfc_conn_req_event_t ble_on_cbsc_conn_req,
                                           rsi_ble_on_cbfc_conn_complete_event_t ble_on_cbsc_conn_complete,
                                           rsi_ble_on_cbfc_rx_data_event_t ble_on_cbsc_rx_data,
                                           rsi_ble_on_cbfc_disconn_event_t ble_on_cbsc_disconn);

/**
 * @typedef void (*chip_ble_buffers_stats_handler_t)(chip_ble_buffers_stats_t *chip_ble_buffers_stats);
 * @brief Typedef for the chip_ble_buffers_stats_handler_t function pointer.
 *
 * This function pointer type is used to define a callback function that handles
 * the statistics of the BLE buffers in the chip.
 *
 * @param chip_ble_buffers_stats Pointer to the chip_ble_buffers_stats_t structure
 *                               that contains the statistics of the BLE buffers.
 */
typedef void (*chip_ble_buffers_stats_handler_t)(chip_ble_buffers_stats_t *chip_ble_buffers_stats);

/**
 * @typedef    void (*rsi_ble_ae_report_complete_t)(uint16_t resp_status, rsi_ble_ae_adv_report_t *rsi_ble_event_ae_report);
 * @brief      Callback function to report the AE Advertisements.
 *             This callback function will be called when AE adv report event is received.
 *             This callback has to be registered using rsi_ble_ae_events_register_callbacks API.
 * @param[out] rsi_ble_event_ae_report  A pointer to the structure containing AE Adv packets information.
 *                                      It contains important information such PHY rate, Set ID (SID) , event type etc. see \ref rsi_ble_ae_adv_report_s for more information.
 * @param[out] resp_status Status of the event response:
 *                         - 0: SUCCESS
 *                         - Non-zero: Error code
 */
typedef void (*rsi_ble_ae_report_complete_t)(uint16_t resp_status, rsi_ble_ae_adv_report_t *rsi_ble_event_ae_report);

/**
 * @typedef    void (*rsi_ble_ae_per_adv_sync_estbl_t)(uint16_t resp_status,
 *                                                     rsi_ble_per_adv_sync_estbl_t *rsi_ble_event_per_adv_sync_estbl);
 * @brief      Callback function to report the AE periodic sync established event.
 *             This callback function will be called when AE periodic sync established event is received.
 *             This callback has to be registered using rsi_ble_ae_events_register_callbacks API.
 * @param[out] rsi_ble_event_per_adv_sync_estbl  A pointer to the structure containing AE periodic sync established information.
 *                                               Such as status of sync indicating whether Periodic Advertising is successful or not see \ref rsi_ble_per_adv_sync_estbl_s for more information.
 * @param[out] resp_status Status of the event response:
 *                         - 0: SUCCESS
 *                         - Non-zero: Error code
 */
typedef void (*rsi_ble_ae_per_adv_sync_estbl_t)(uint16_t resp_status,
                                                rsi_ble_per_adv_sync_estbl_t *rsi_ble_event_per_adv_sync_estbl);

/**
 * @typedef   void (*rsi_ble_ae_per_adv_report_t)(uint16_t resp_status,
 *                                          rsi_ble_per_adv_report_t *rsi_ble_event_per_adv_report);
 * @brief      Callback function to report the AE periodic advertisement event
 *             This callback function will be called when AE periodic advertisement event is received
 *             This callback has to be registered using rsi_ble_ae_events_register_callbacks API
 * @param[out] rsi_ble_event_per_adv_report A pointer to the structure containing AE periodic advertisement, report information such as sync_handle, tx_power, RSSI, data etc. Refer to \ref rsi_ble_per_adv_report_s for more information.
 * @param[out] resp_status Status of the event response:
 *                         - 0: SUCCESS
 *                         - Non-zero: Error code
 */
typedef void (*rsi_ble_ae_per_adv_report_t)(uint16_t resp_status,
                                            rsi_ble_per_adv_report_t *rsi_ble_event_per_adv_report);

/**
 * @typedef   void (*rsi_ble_ae_per_adv_sync_lost_t)(uint16_t resp_status,
 *                                                   rsi_ble_per_adv_sync_lost_t *rsi_ble_event_per_adv_sync_lost);
 * @brief      Callback function to report the AE periodic sync lost event
 *             This callback function will be called when AE periodic sync lost event is received
 *             This callback has to be registered using rsi_ble_ae_events_register_callbacks API
 * @param[out] rsi_ble_event_per_adv_sync_lost  A pointer to the structure containing AE periodic sync lost information of sync handle on which adv sync is lost , see  \ref rsi_ble_per_adv_sync_lost_s for more information.
 * @param[out] resp_status Status of the event response:
 *                         - 0: SUCCESS
 *                         - Non-zero: Error code
 */
typedef void (*rsi_ble_ae_per_adv_sync_lost_t)(uint16_t resp_status,
                                               rsi_ble_per_adv_sync_lost_t *rsi_ble_event_per_adv_sync_lost);

/**
 * @typedef    void (*rsi_ble_ae_scan_timeout_t)(uint16_t resp_status, rsi_ble_scan_timeout_t *rsi_ble_event_scan_timeout);
 * @brief      Callback function to report the AE scan timeout event
 *             This callback function will be called when AE scan timeout event is received
 *             This callback has to be registered using rsi_ble_ae_events_register_callbacks API
 * @param[out] rsi_ble_event_scan_timeout  A pointer to the structure containing AE scan timeout information.
 *                                         Such as status indicating that scanning has ended because the duration has expired, see \ref rsi_ble_scan_timeout_s for more information.
 * @param[out] resp_status Status of the event response:
 *                         - 0: SUCCESS
 *                         - Non-zero: Error code
 */
typedef void (*rsi_ble_ae_scan_timeout_t)(uint16_t resp_status, rsi_ble_scan_timeout_t *rsi_ble_event_scan_timeout);

/**
 * @typedef    void (*rsi_ble_ae_adv_set_terminated_t)(uint16_t resp_status,
 *                                                     rsi_ble_adv_set_terminated_t *rsi_ble_event_adv_set_terminated);
 * @brief      Callback function to report the AE advertising set terminated event
 *             This callback function will be called when AE advertising set terminated is received.
 *             This callback has to be registered using rsi_ble_ae_events_register_callbacks API.
 * @param[out] rsi_ble_event_adv_set_terminated  A pointer to the structure containing the AE advertising set terminated information about status on advertisement termination,
 *                                               adv handle, connection handle, number of AE events see \ref rsi_ble_adv_set_terminated_s for more information.
 * @param[out] resp_status Status of the event response:
 *                         - 0: SUCCESS
 *                         - Non-zero: Error code 
 */
typedef void (*rsi_ble_ae_adv_set_terminated_t)(uint16_t resp_status,
                                                rsi_ble_adv_set_terminated_t *rsi_ble_event_adv_set_terminated);

/**
 * @typedef    void (*rsi_ble_ae_scan_req_recvd_t)(uint16_t resp_status,
 *                                                rsi_ble_scan_req_recvd_t *rsi_ble_event_scan_req_recvd);
 * @brief      Callback function to report the AE scan request received event
 *             This callback function will be called when AE scan request is received. it provides AE scan request information.
 *             This callback has to be registered using rsi_ble_ae_events_register_callbacks API
 * @param[out] rsi_ble_event_scan_req_recvd A pointer to the structure containing AE scan request information about the received scan request, including the advertising set
 *             handle and scanner details. Refer to \ref rsi_ble_scan_req_recvd_s for detailed information
 *                                          
 * @param[out] resp_status Status of the event response:
 *                         - 0: SUCCESS
 *                         - Non-zero: Error code
 */
typedef void (*rsi_ble_ae_scan_req_recvd_t)(uint16_t resp_status,
                                            rsi_ble_scan_req_recvd_t *rsi_ble_event_scan_req_recvd);

/******************************************************
 * * BLE GATT Callbacks register function Declarations
 * ******************************************************/
/** @addtogroup BT-LOW-ENERGY7
* @{
*/
/*==============================================*/
/**
 * @brief       Register the GATT callbacks.
 * @param[in]   ble_on_profiles_list_resp          - Callback for rsi_ble_get_profiles command.
 * @param[in]   ble_on_profile_resp                - Callback for rsi_ble_get_profile command.
 * @param[in]   ble_on_char_services_resp          - Callback for rsi_ble_get_char_services command.
 * @param[in]   ble_on_inc_services_resp           - Callback for rsi_ble_get_inc_services command.
 * @param[in]   ble_on_att_desc_resp               - Callback for rsi_ble_get_att_descriptors command.
 * @param[in]   ble_on_read_resp                   - Callback for all read requests command.
 * @param[in]   ble_on_write_resp                  - Callback for all write commands.
 * @param[in]   ble_on_gatt_event                  - Callback for all GATT events.
 * @param[in]   ble_on_gatt_prepare_write_event    - Callback for GATT prepare write events.
 * @param[in]   ble_on_execute_write_event         - Callback for GATT execute write events.
 * @param[in]   ble_on_read_req_event              - Callback for read request events.
 * @param[in]   ble_on_mtu_event                   - Callback for MTU events.
 * @param[in]   ble_on_gatt_error_resp_event       - Callback for GATT error events.
 * @param[in]   ble_on_gatt_desc_val_resp_event    - Callback for GATT descriptor value events.
 * @param[in]   ble_on_profiles_list_event         - Callback for profiles list events.
 * @param[in]   ble_on_profile_by_uuid_event       - Callback for profile by UUID events.
 * @param[in]   ble_on_read_by_char_services_event - Callback for read by characteristic services events.
 * @param[in]   ble_on_read_by_inc_services_event  - Callback for read by included services events.
 * @param[in]   ble_on_read_att_value_event        - Callback for read attribute value events.
 * @param[in]   ble_on_read_resp_event             - Callback for read response events.
 * @param[in]   ble_on_write_resp_event            - Callback for write response events.
 * @param[in]   ble_on_indicate_confirmation_event - Callback for indication confirmation events.
 * @param[in]   ble_on_prepare_write_resp_event    - Callback for prepare write response events.
 * 
 */
void rsi_ble_gatt_register_callbacks(rsi_ble_on_profiles_list_resp_t ble_on_profiles_list_resp,
                                     rsi_ble_on_profile_resp_t ble_on_profile_resp,
                                     rsi_ble_on_char_services_resp_t ble_on_char_services_resp,
                                     rsi_ble_on_inc_services_resp_t ble_on_inc_services_resp,
                                     rsi_ble_on_att_desc_resp_t ble_on_att_desc_resp,
                                     rsi_ble_on_read_resp_t ble_on_read_resp,
                                     rsi_ble_on_write_resp_t ble_on_write_resp,
                                     rsi_ble_on_gatt_write_event_t ble_on_gatt_event,
                                     rsi_ble_on_gatt_prepare_write_event_t ble_on_gatt_prepare_write_event,
                                     rsi_ble_on_execute_write_event_t ble_on_execute_write_event,
                                     rsi_ble_on_read_req_event_t ble_on_read_req_event,
                                     rsi_ble_on_mtu_event_t ble_on_mtu_event,
                                     rsi_ble_on_gatt_error_resp_t ble_on_gatt_error_resp_event,
                                     rsi_ble_on_gatt_desc_val_event_t ble_on_gatt_desc_val_resp_event,
                                     rsi_ble_on_event_profiles_list_t ble_on_profiles_list_event,
                                     rsi_ble_on_event_profile_by_uuid_t ble_on_profile_by_uuid_event,
                                     rsi_ble_on_event_read_by_char_services_t ble_on_read_by_char_services_event,
                                     rsi_ble_on_event_read_by_inc_services_t ble_on_read_by_inc_services_event,
                                     rsi_ble_on_event_read_att_value_t ble_on_read_att_value_event,
                                     rsi_ble_on_event_read_resp_t ble_on_read_resp_event,
                                     rsi_ble_on_event_write_resp_t ble_on_write_resp_event,
                                     rsi_ble_on_event_indicate_confirmation_t ble_on_indicate_confirmation_event,
                                     rsi_ble_on_event_prepare_write_resp_t ble_on_prepare_write_resp_event);

/*==============================================*/
/**
 * @brief       Register the GATT Extended responses/events callbacks.
 * @param[in]   ble_on_mtu_exchange_info_event         ble_on_mtu_exchange_info_event         - Call back function for MTU Exchange information Event
 * 
 *
 */
void rsi_ble_gatt_extended_register_callbacks(rsi_ble_on_mtu_exchange_info_t ble_on_mtu_exchange_info_event);
/** @} */
/** @} */

#ifdef __cplusplus
}
#endif
#endif

Modules#

rsi_ble_event_adv_report_s

rsi_ble_event_conn_status_s

rsi_ble_event_enhnace_conn_status_s

rsi_ble_event_disconnect_s

rsi_ble_event_le_ping_time_expired_s

rsi_bt_event_le_ltk_request_s

rsi_bt_event_le_security_keys_s

rsi_bt_event_encryption_enabled_s

rsi_bt_event_smp_req_s

rsi_bt_event_smp_resp_s

rsi_bt_event_smp_passkey_s

rsi_bt_event_smp_passkey_display_s

rsi_bt_event_sc_passkey_s

rsi_bt_event_smp_failed_s

rsi_bt_event_sc_method_s

rsi_bt_event_ctkd_s

rsi_ble_event_phy_update_s

rsi_ble_event_conn_update_s

rsi_ble_event_remote_conn_param_req_s

rsi_ble_event_remote_features_s

rsi_ble_event_le_dev_buf_ind_s

rsi_ble_event_data_length_update_s

uuid128_s

uuid_s

uuid_s::uuid_t

profile_descriptor_s

att_desc_s

char_serv_data_s

char_serv_s

inc_serv_data_s

inc_serv_s

rsi_ble_req_add_att_s

rsi_ble_presentation_format

rsi_ble_event_error_resp_s

rsi_ble_event_gatt_desc_s

rsi_ble_event_profiles_list_s

rsi_ble_event_profile_by_uuid_s

rsi_ble_event_read_by_type1_s

rsi_ble_event_read_by_type2_s

rsi_ble_event_read_by_type3_s

rsi_ble_event_att_value_s

rsi_ble_set_att_resp_s

rsi_ble_prepare_write_resp_s

rsi_ble_resp_profiles_list_s

rsi_ble_resp_query_profile_descriptor_s

rsi_ble_resp_char_serv_s

rsi_ble_resp_inc_serv

rsi_ble_resp_att_value_t

rsi_ble_resp_att_descs_s

rsi_ble_resp_add_serv_s

rsi_ble_resp_local_att_value_s

rsi_ble_event_remote_device_info_s

rsi_ble_event_rcp_rcvd_info_s

rsi_ble_event_write_s

rsi_ble_event_prepare_write_s

rsi_ble_execute_write_s

rsi_ble_read_req_s

rsi_ble_event_mtu_s

rsi_ble_event_mtu_exchange_information_s

rsi_ble_event_directedadv_report_s

rsi_ble_event_cbfc_conn_req_s

rsi_ble_event_cbfc_conn_complete_s

rsi_ble_event_cbfc_rx_data_s

rsi_ble_event_cbfc_disconn_s

rsi_ble_set_smp_pairing_capabilty_data

rsi_ble_resp_read_phy_s

rsi_ble_resp_read_max_data_length_s

rsi_ble_per_transmit_s

rsi_ble_per_receive_s

rsi_ble_ae_adv_report_s

rsi_ble_per_adv_sync_estbl_s

rsi_ble_per_adv_report_s

rsi_ble_per_adv_sync_lost_s

rsi_ble_scan_timeout_s

rsi_ble_adv_set_terminated_s

rsi_ble_scan_req_recvd_s

chip_ble_buffers_stats_s

Macros#

#define

Maximum number of response list for BLE.

#define

Maximum size of an advertising report.

#define

Size of the BLE passkey.

#define

Defines the output power front end loss for BLE.

#define

Host descriptor length.

#define

BLE write command event.

#define

BLE write request event.

#define

BLE notification event.

#define

BLE indication event.

#define

Indicates that the Maximum Transmission Unit (MTU) exchange was initiated by the peer device.

#define

Indicates that the MTU exchange was initiated by the local device.

#define

The maximum length of advertising data.

#define

Length of the device address in bytes.

Typedefs#

Structure representing a BLE advertising report event.

Structure representing the connection status event in the BLE module.

Structure representing the enhanced connection status event in the BLE module.

Disconnection event structure for BLE.

Structure representing the BLE event for LE ping time expiration.

Structure representing a Bluetooth Low Energy (LE) Long Term Key (LTK) request event.

Structure representing the Bluetooth Low Energy (BLE) event for security keys.

Structure to hold the event data for encryption enabled event.

typedef struct rsi_bt_event_smp_req_s

Structure to hold the Security Manager Protocol (SMP) request event.

Structure to hold the SMP response event data.

Structure to hold the SMP passkey event data.

Structure to hold the SMP passkey display event.

Structure to hold the Secure Connections (SC) passkey event.

Structure to hold the information related to a Bluetooth Low Energy (BLE) Security Manager Protocol (SMP) failed event.

Structure to define the Bluetooth event security method.

typedef struct rsi_bt_event_ctkd_s

Structure representing the BLE event for Cross Transport Key Derivation (CTKD).

Structure to hold the BLE PHY update event information.

Structure to hold the data of the BLE connection update event.

Structure representing the parameters of a remote connection parameter request event in BLE.

Structure to hold the data of the remote features event.

Structure to hold the BLE event LE device buffer indication.

Structure representing the data for the BLE length update event.

typedef struct uuid128_s

Structure representing a 128-bit Universal Unique IDentifier (UUID).

typedef uint16_t

16 bit UUID format structure

typedef uint32_t

32 bit UUID format structure

typedef struct uuid_s

Structure representing a Universally Unique Identifier (UUID).

typedef struct profile_descriptor_s

Represents the data of the particular profile descriptor.

typedef struct att_desc_s

Structure representing an attribute descriptor.

typedef struct char_serv_data_s

Structure representing characteristic service data.

typedef struct char_serv_s

Structure representing a characteristic service.

typedef struct inc_serv_data_s

Structure representing the included service data.

typedef struct inc_serv_s

Structure representing an included service attribute in a GATT server.

typedef struct rsi_ble_req_add_att_s

Structure representing a request to add an attribute in the BLE stack.

Structure representing the presentation format of a Bluetooth Low Energy (BLE) device.

Structure representing the response for a BLE event error.

Structure representing a GATT descriptor event.

Structure representing the BLE event profiles list.

Structure to hold the BLE event profile by UUID.

Structure representing the BLE event for reading characteristic services by type.

Structure for BLE event read by type 2.

Structure definition for the BLE event "Read By Type 3" response.

Structure representing the BLE ATT value event.

typedef struct rsi_ble_set_att_resp_s

Structure to hold the response for the BLE set attribute request.

Structure representing the response for the prepare write operation in BLE.

Structure representing the list of received profiles, The maximum value is 5.

Structure representing the list of received profile descriptor of a particular profile, The maximum value is 5.

Structure to hold the response of characteristic services.

typedef struct rsi_ble_resp_inc_serv

Structure representing the list of received included service attributes for a particular included service.

Structure representing the response for an Attribute Protocol (ATT) value in Bluetooth Low Energy (BLE).

Structure representing the list of received attribute descriptors, The maximum value is 5.

Structure representing the response for adding a service in BLE.

Structure representing the response for local attribute value in BLE.

Structure representing the BLE event for remote device information.

Structure representing the BLE event for received Remote Control Protocol (RCP) information.

typedef struct rsi_ble_event_write_s

Structure representing a BLE write event.

Structure definition for preparing a write operation in BLE event.

Structure representing the BLE execute write request.

typedef struct rsi_ble_read_req_s

Structure representing the BLE read request.

typedef struct rsi_ble_event_mtu_s

Structure to hold the BLE MTU event information.

Structure to hold the MTU exchange information for a BLE event.

Structure to hold the information of a directed advertising report event.

Structure representing the BLE event for CBFC connection request.

Structure representing the BLE event for CBFC connection complete.

Structure representing the BLE event for CBFC received data.

Structure representing the BLE event for CBFC disconnection.

Structure for setting SMP pairing capability data.

Structure to hold the response for the BLE read PHY command.

Structure representing the response for reading the maximum data length in BLE.

typedef struct rsi_ble_per_transmit_s

Structure to hold the parameters for BLE periodic advertising transmission.

typedef struct rsi_ble_per_receive_s

Structure representing the parameters for BLE periodic receive operation.

ae adv report event

ae periodic sync establishment report event

ae periodic adv report event

ae periodic sync lost report event

typedef struct rsi_ble_scan_timeout_s

ae scan timeout report event

ae adv set terminated report event

ae scan request recvd report event

Structure representing the BLE buffer statistics.

typedef void(*
rsi_ble_on_adv_report_event_t)(rsi_ble_event_adv_report_t *rsi_ble_event_adv)

Callback function advertise event report from the module.

typedef void(*
rsi_ble_on_connect_t)(rsi_ble_event_conn_status_t *rsi_ble_event_conn)

Callback function for the BLE connection status from the module.

typedef void(*
rsi_ble_on_enhance_connect_t)(rsi_ble_event_enhance_conn_status_t *rsi_ble_event_enhance_conn)

Callback function for the BLE connection status from the module.

typedef void(*
rsi_ble_on_disconnect_t)(rsi_ble_event_disconnect_t *rsi_ble_event_disconnect, uint16_t reason)

Callback function for the disconnect status event from the module.

typedef void(*
rsi_ble_on_le_ping_payload_timeout_t)(rsi_ble_event_le_ping_time_expired_t *rsi_ble_event_timeout_expired)

Callback function for the LE ping time expired event from the module.

typedef void(*
rsi_ble_on_le_ltk_req_event_t)(rsi_bt_event_le_ltk_request_t *rsi_ble_event_le_ltk_request)

Callback function for the LE LTK request event from the module.

typedef void(*
rsi_ble_on_le_security_keys_t)(rsi_bt_event_le_security_keys_t *rsi_ble_event_le_security_keys)

Callback function for the LE security keys event from the module.

typedef void(*
rsi_ble_on_smp_request_t)(rsi_bt_event_smp_req_t *remote_dev_address)

Callback function for SMP request in central mode from the remote device.

typedef void(*
rsi_ble_on_smp_response_t)(rsi_bt_event_smp_resp_t *remote_dev_address)

Callback function for SMP request in peripheral mode from the remote device.

typedef void(*
rsi_ble_on_smp_passkey_t)(rsi_bt_event_smp_passkey_t *remote_dev_address)

Callback function for SMP passkey event from the module.

typedef void(*
rsi_ble_on_smp_passkey_display_t)(rsi_bt_event_smp_passkey_display_t *smp_passkey_display)

Callback function for SMP passkey display event from the module.

typedef void(*
rsi_ble_on_smp_failed_t)(uint16_t resp_status, rsi_bt_event_smp_failed_t *remote_dev_address)

Callback function for SMP failed event from the module.

typedef void(*
rsi_ble_on_sc_method_t)(rsi_bt_event_sc_method_t *scmethod)

Callback function for a security method event from the module.

typedef void(*
rsi_ble_on_encrypt_started_t)(uint16_t resp_status, rsi_bt_event_encryption_enabled_t *enc_enabled)

Callback function an encrypted event from the module.

typedef void(*
rsi_ble_on_sc_passkey_t)(rsi_bt_event_sc_passkey_t *sc_passkey)

Callback function for a BLE Secure Connection passkey event from the module.

typedef void(*
rsi_ble_on_phy_update_complete_t)(rsi_ble_event_phy_update_t *rsi_ble_event_phy_update_complete)

Callback function for receiving the PHY update complete event.

typedef void(*
rsi_ble_on_conn_update_complete_t)(rsi_ble_event_conn_update_t *rsi_ble_event_conn_update_complete, uint16_t resp_status)

Callback function for a connection update complete event from the module.

typedef void(*
rsi_ble_on_remote_conn_params_request_t)(rsi_ble_event_remote_conn_param_req_t *rsi_ble_event_remote_conn_param, uint16_t resp_status)

Callback function for remote connection parameters request.

typedef void(*
rsi_ble_on_remote_features_t)(rsi_ble_event_remote_features_t *rsi_ble_event_remote_features)

Callback function for supported features of remote device This callback function will be called when LE remote features event is received.

typedef void(*
rsi_ble_on_le_more_data_req_t)(rsi_ble_event_le_dev_buf_ind_t *rsi_ble_more_data_evt)

Callback function for the LE more data event.

typedef void(*
rsi_ble_on_data_length_update_t)(rsi_ble_event_data_length_update_t *remote_dev_address)

Callback function for the data length update complete event.

typedef void(*
rsi_ble_on_directed_adv_report_event_t)(rsi_ble_event_directedadv_report_t *rsi_ble_event_directed)

Callback function for a directed advertise report event from the module.

typedef void(*
rsi_ble_on_gatt_error_resp_t)(uint16_t event_status, rsi_ble_event_error_resp_t *rsi_ble_gatt_error)

Callback function for a GATT error event from the module.

typedef void(*
rsi_ble_on_gatt_desc_val_event_t)(uint16_t event_status, rsi_ble_event_gatt_desc_t *rsi_ble_gatt_desc_val)

Callback function for an attribute descriptors event from the module.

typedef void(*
rsi_ble_on_event_profiles_list_t)(uint16_t event_status, rsi_ble_event_profiles_list_t *rsi_ble_event_profiles)

Callback function for a profiles list response from the module.

typedef void(*
rsi_ble_on_event_profile_by_uuid_t)(uint16_t event_status, rsi_ble_event_profile_by_uuid_t *rsi_ble_event_profile)

Callback function for a profile response from the module.

typedef void(*
rsi_ble_on_event_read_by_char_services_t)(uint16_t event_status, rsi_ble_event_read_by_type1_t *rsi_ble_event_read_type1)

This callback function will be called if the characteristic services list response is received from the module.

typedef void(*
rsi_ble_on_event_read_by_inc_services_t)(uint16_t event_status, rsi_ble_event_read_by_type2_t *rsi_ble_event_read_type2)

Callback function for an include services list response from the module.

typedef void(*
rsi_ble_on_event_read_att_value_t)(uint16_t event_status, rsi_ble_event_read_by_type3_t *rsi_ble_event_read_type3)

Callback function for an attribute value response from the module.

typedef void(*
rsi_ble_on_event_read_resp_t)(uint16_t event_status, rsi_ble_event_att_value_t *rsi_ble_event_att_val)

Callback function for an attribute value from the module.

typedef void(*
rsi_ble_on_event_write_resp_t)(uint16_t event_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp)

Callback function for a GATT write response from the module.

typedef void(*
rsi_ble_on_event_indicate_confirmation_t)(uint16_t event_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp)

Callback function for indication confirmation event.

typedef void(*
rsi_ble_on_event_prepare_write_resp_t)(uint16_t event_status, rsi_ble_prepare_write_resp_t *rsi_ble_event_prepare_write)

Callback function for a GATT prepare response from the module.

typedef void(*
rsi_ble_on_profiles_list_resp_t)(uint16_t resp_status, rsi_ble_resp_profiles_list_t *rsi_ble_resp_profiles)

Callback function for a profiles list response from the module.

typedef void(*
rsi_ble_on_profile_resp_t)(uint16_t resp_status, profile_descriptors_t *rsi_ble_resp_profile)

Callback function for a profile response from the module.

typedef void(*
rsi_ble_on_char_services_resp_t)(uint16_t resp_status, rsi_ble_resp_char_services_t *rsi_ble_resp_char_serv)

Callback function for a service characteristics response from the module.

typedef void(*
rsi_ble_on_inc_services_resp_t)(uint16_t resp_status, rsi_ble_resp_inc_services_t *rsi_ble_resp_inc_serv)

Callback function for an include service response from the module.

typedef void(*
rsi_ble_on_att_desc_resp_t)(uint16_t resp_status, rsi_ble_resp_att_descs_t *rsi_ble_resp_att_desc)

Callback function for an attribute descriptors response from the module.

typedef void(*
rsi_ble_on_read_resp_t)(uint16_t resp_status, uint16_t resp_id, rsi_ble_resp_att_value_t *rsi_ble_resp_att_val)

Callback function for receiving an attribute value from the module.

typedef void(*
rsi_ble_on_write_resp_t)(uint16_t resp_status, uint16_t resp_id)

Callback function for attribute set/prepare/execute action completion.

typedef void(*
rsi_ble_on_gatt_write_event_t)(uint16_t event_id, rsi_ble_event_write_t *rsi_ble_write)

Callback function for GATT write, notify, or indicate events from the module.

typedef void(*
rsi_ble_on_gatt_prepare_write_event_t)(uint16_t event_id, rsi_ble_event_prepare_write_t *rsi_ble_write)

This callback function will be called if the GATT write/notify/indicate events are received This callback has to be registered using rsi_ble_gatt_register_callbacks API.

typedef void(*
rsi_ble_on_execute_write_event_t)(uint16_t event_id, rsi_ble_execute_write_t *rsi_ble_execute_write)

The callback function will be called if the GATT write execute events are received.

typedef void(*
rsi_ble_on_read_req_event_t)(uint16_t event_id, rsi_ble_read_req_t *rsi_ble_read_req)

The callback function will be called if the GATT read request events are received.

typedef void(*
rsi_ble_on_mtu_event_t)(rsi_ble_event_mtu_t *rsi_ble_event_mtu)

The callback function will be called if MTU size request is received.

typedef void(*
rsi_ble_on_mtu_exchange_info_t)(rsi_ble_event_mtu_exchange_information_t *rsi_ble_event_mtu_exchange_info)

Callback function called to indicate MTU exchange details.

typedef void(*
rsi_ble_on_remote_device_info_t)(uint16_t status, rsi_ble_event_remote_device_info_t *resp_buffer)

Callback function to retrieve remote device information.it provides the version and manufacturer-specific details of a remote device.

typedef void(*
rsi_ble_on_rcp_resp_rcvd_t)(uint16_t status, rsi_ble_event_rcp_rcvd_info_t *resp_buffer)

Callback function type for receiving RCP response events.

typedef void(*
rsi_ble_on_cbfc_conn_req_event_t)(rsi_ble_event_cbfc_conn_req_t *rsi_ble_cbfc_conn_req)

Callback function to handle an L2CAP CBFC connection request event.

typedef void(*
rsi_ble_on_cbfc_conn_complete_event_t)(rsi_ble_event_cbfc_conn_complete_t *rsi_ble_cbfc_conn_complete, uint16_t status)

Callback function to indicate L2CAP CBFC connection complete status.

typedef void(*
rsi_ble_on_cbfc_rx_data_event_t)(rsi_ble_event_cbfc_rx_data_t *rsi_ble_cbfc_rx_data)

Callback function to indicate L2CAP CBFC RX data event.

typedef void(*
rsi_ble_on_cbfc_disconn_event_t)(rsi_ble_event_cbfc_disconn_t *rsi_ble_cbfc_disconn)

Callback function to indicate L2CAP CBFC disconnection event.

typedef void(*
chip_ble_buffers_stats_handler_t)(chip_ble_buffers_stats_t *chip_ble_buffers_stats)

Typedef for the chip_ble_buffers_stats_handler_t function pointer.

typedef void(*
rsi_ble_ae_report_complete_t)(uint16_t resp_status, rsi_ble_ae_adv_report_t *rsi_ble_event_ae_report)

Callback function to report the AE Advertisements.

typedef void(*
rsi_ble_ae_per_adv_sync_estbl_t)(uint16_t resp_status, rsi_ble_per_adv_sync_estbl_t *rsi_ble_event_per_adv_sync_estbl)

Callback function to report the AE periodic sync established event.

typedef void(*
rsi_ble_ae_per_adv_report_t)(uint16_t resp_status, rsi_ble_per_adv_report_t *rsi_ble_event_per_adv_report)

Callback function to report the AE periodic advertisement event This callback function will be called when AE periodic advertisement event is received This callback has to be registered using rsi_ble_ae_events_register_callbacks API.

typedef void(*
rsi_ble_ae_per_adv_sync_lost_t)(uint16_t resp_status, rsi_ble_per_adv_sync_lost_t *rsi_ble_event_per_adv_sync_lost)

Callback function to report the AE periodic sync lost event This callback function will be called when AE periodic sync lost event is received This callback has to be registered using rsi_ble_ae_events_register_callbacks API.

typedef void(*
rsi_ble_ae_scan_timeout_t)(uint16_t resp_status, rsi_ble_scan_timeout_t *rsi_ble_event_scan_timeout)

Callback function to report the AE scan timeout event This callback function will be called when AE scan timeout event is received This callback has to be registered using rsi_ble_ae_events_register_callbacks API.

typedef void(*
rsi_ble_ae_adv_set_terminated_t)(uint16_t resp_status, rsi_ble_adv_set_terminated_t *rsi_ble_event_adv_set_terminated)

Callback function to report the AE advertising set terminated event This callback function will be called when AE advertising set terminated is received.

typedef void(*
rsi_ble_ae_scan_req_recvd_t)(uint16_t resp_status, rsi_ble_scan_req_recvd_t *rsi_ble_event_scan_req_recvd)

Callback function to report the AE scan request received event This callback function will be called when AE scan request is received.

Functions#

uint8_t
rsi_convert_db_to_powindex(int8_t tx_power_in_dBm)

Converts the given transmit power in dBm to power index.

int32_t

Request the local device to set a random address.

int32_t

Request the local device to set a given random address.

int32_t

Request the local device to start advertising.

int32_t
rsi_ble_start_advertising_with_values(const void *rsi_ble_adv)

Request the local device to start advertising with specified values.

int32_t
rsi_ble_encrypt(const uint8_t *key, const uint8_t *data, uint8_t *resp)

Encrypt the plain text data fed by the user using the key provided, it uses the AES-128 bit block cypher a logo to generate encrypted data, refer to Bluetooth Spec 5.4 for further details.

int32_t

Stop advertising, this is a Blocking API.

int32_t
rsi_ble_set_advertise_data(const uint8_t *data, uint16_t data_len)

Set the advertising data.

int32_t
rsi_ble_set_scan_response_data(const uint8_t *data, uint16_t data_len)

Request the local device to set the scan response data, this is a Blocking API.

int32_t

Start scanning, this is a Blocking API A received event rsi_ble_on_adv_report_event_t indicates advertise report of remote device received.

int32_t
rsi_ble_start_scanning_with_values(void *rsi_ble_scan_params)

Start scanning with values.

int32_t

Stop scanning.

int32_t
rsi_ble_connect_with_params(uint8_t remote_dev_addr_type, const int8_t *remote_dev_addr, uint16_t scan_interval, uint16_t scan_window, uint16_t conn_interval_max, uint16_t conn_interval_min, uint16_t conn_latency, uint16_t supervision_tout)

Connect to the remote BLE device with the user configured parameters.

int32_t
rsi_ble_connect(uint8_t remote_dev_addr_type, const int8_t *remote_dev_addr)

Connect to the remote BLE device.

int32_t
rsi_ble_enhance_connect_with_params(void *ble_enhance_conn_params)

Connect to the remote BLE device with the user configured parameters.

int32_t
rsi_ble_connect_cancel(const int8_t *remote_dev_address)

Cancel the connection to the remote BLE device.

int32_t
rsi_ble_disconnect(const int8_t *remote_dev_address)

Disconnect with the remote BLE device.

int32_t

Get the local device state.

int32_t
rsi_ble_set_smp_pairing_cap_data(rsi_ble_set_smp_pairing_capabilty_data_t *smp_pair_cap_data)

Set the SMP Pairing Capability of local device.

int32_t
rsi_ble_set_local_irk_value(const uint8_t *l_irk)

Set the IRK value to the local device.

int32_t
rsi_ble_conn_param_resp(const uint8_t *remote_dev_address, uint8_t status)

Give the response for the remote device connection parameter request.

int32_t
rsi_ble_smp_pair_request(uint8_t *remote_dev_address, uint8_t io_capability, uint8_t mitm_req)

Request the SMP pairing process with the remote device.

int32_t
rsi_ble_smp_pair_failed(uint8_t *remote_dev_address, uint8_t reason)

Send SMP pairing failure reason to the remote device.

int32_t
rsi_ble_ltk_req_reply(uint8_t *remote_dev_address, uint8_t reply_type, const uint8_t *ltk)

Send the local long term key of its associated local EDIV and local Rand.

int32_t
rsi_ble_smp_pair_response(uint8_t *remote_dev_address, uint8_t io_capability, uint8_t mitm_req)

Send SMP pairing response during the process of pairing with the remote device.

int32_t
rsi_ble_smp_passkey(uint8_t *remote_dev_address, uint32_t passkey)

Send SMP passkey during SMP pairing process with the remote device.

int32_t
rsi_ble_get_le_ping_timeout(uint8_t *remote_dev_address, uint16_t *time_out)

Get the timeout value of the LE ping.

int32_t
rsi_ble_set_le_ping_timeout(uint8_t *remote_dev_address, uint16_t time_out)

Set the timeout value of the LE ping.

int32_t

Clear all the BD address present in accept list.

int32_t
rsi_ble_addto_acceptlist(const int8_t *dev_address, uint8_t dev_addr_type)

Add BD address to accept list.

int32_t
rsi_ble_deletefrom_acceptlist(const int8_t *dev_address, uint8_t dev_addr_type)

Delete particular BD address from accept list.

int32_t
rsi_ble_resolvlist(uint8_t process_type, uint8_t remote_dev_addr_type, uint8_t *remote_dev_address, const uint8_t *peer_irk, const uint8_t *local_irk)

Resolvlist API used for multiple purposes based on the process type.

int32_t

Request to get resolving list size.

int32_t
rsi_ble_set_addr_resolution_enable(uint8_t enable, uint16_t tout)

Request to enable address resolution, and to set resolvable private address timeout.

int32_t
rsi_ble_set_privacy_mode(uint8_t remote_dev_addr_type, uint8_t *remote_dev_address, uint8_t privacy_mode)

Request to set privacy mode for particular device, this is a Blocking API.

int32_t
rsi_ble_readphy(const int8_t *remote_dev_address, rsi_ble_resp_read_phy_t *resp)

Reads the TX and RX PHY rates of the Connection.

int32_t
rsi_ble_setphy(const int8_t *remote_dev_address, uint8_t tx_phy, uint8_t rx_phy, uint16_t coded_phy)

Set TX and RX PHY.

int32_t
rsi_ble_conn_params_update(const uint8_t *remote_dev_address, uint16_t min_int, uint16_t max_int, uint16_t latency, uint16_t timeout)

Requests the connection parameters change with the remote device, When the Silicon Labs device acts as a central, this API is used to update the connection parameters.

int32_t
rsi_ble_set_data_len(uint8_t *remote_dev_address, uint16_t tx_octets, uint16_t tx_time)

Sets the TX octets and the TX time of specified link (remote device connection), this is a Blocking API.

int32_t
rsi_ble_read_max_data_len(rsi_ble_read_max_data_length_t *blereaddatalen)

reads the max supported values of TX octets, TX time, RX octets and Rx time.

int32_t
rsi_ble_rx_test_mode(uint8_t rx_channel, uint8_t phy, uint8_t modulation)

Start the BLE RX test mode in controller.

int32_t
rsi_ble_tx_test_mode(uint8_t tx_channel, uint8_t phy, uint8_t tx_len, uint8_t mode)

Start the BLE TX test mode in controller.

int32_t
rsi_ble_end_test_mode(uint16_t *num_of_pkts)

Stop the BLE TX / RX test mode in controller.

int32_t
rsi_ble_per_transmit(struct rsi_ble_per_transmit_s *rsi_ble_per_tx)

Initiate the BLE transmit PER mode in the controller.

int32_t
rsi_ble_per_receive(struct rsi_ble_per_receive_s *rsi_ble_per_rx)

Initiate the BLE receive PER mode in the controller.

int32_t
rsi_ble_accept_list_using_adv_data(uint8_t enable, uint8_t data_compare_index, uint8_t len_for_compare_data, const uint8_t *payload)

Give vendor-specific command to set the acceptlist feature based on the advertisers advertising payload, this is a Blocking API.

void
BT_LE_ADPacketExtract(uint8_t *remote_name, const uint8_t *pbuf, uint8_t buf_len)

Used to extract remote Bluetooth device name from the received advertising report.

int32_t
rsi_ble_start_encryption(uint8_t *remote_dev_address, uint16_t ediv, const uint8_t *rand, const uint8_t *ltk)

Start the encryption process with the remote device.

int32_t
rsi_ble_set_ble_tx_power(int8_t tx_power)

Set TX power.

int32_t
rsi_ble_get_profiles(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_profiles_list_t *p_prof_list)

Get the supported profiles / services of the connected remote device.

int32_t
rsi_ble_get_profile(uint8_t *dev_addr, uuid_t profile_uuid, profile_descriptors_t *p_profile)

Get the specific profile / service of the connected remote device.

int32_t
rsi_ble_get_char_services(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_char_services_t *p_char_serv_list)

Get the service characteristic services of the connected remote device, rsi_ble_on_char_services_resp_t callback function is called after the characteristic service response is received, this is a non-blocking API, Still user need to wait until the callback rsi_ble_on_char_services_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

int32_t
rsi_ble_get_inc_services(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_inc_services_t *p_inc_serv_list)

Get the supported include services of the connected remote device.

int32_t
rsi_ble_get_char_value_by_uuid(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, uuid_t char_uuid, rsi_ble_resp_att_value_t *p_char_val)

Get the characteristic value by UUID (char_uuid).

int32_t
rsi_ble_get_att_descriptors(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_att_descs_t *p_att_desc)

Get the characteristic descriptors list from the remote device.

int32_t
rsi_ble_get_att_value(uint8_t *dev_addr, uint16_t handle, rsi_ble_resp_att_value_t *p_att_val)

Get the attribute by handle.

int32_t
rsi_ble_get_multiple_att_values(uint8_t *dev_addr, uint8_t num_of_handlers, const uint16_t *handles, rsi_ble_resp_att_value_t *p_att_vals)

Get the multiple attribute values by using multiple handles.

int32_t
rsi_ble_get_long_att_value(uint8_t *dev_addr, uint16_t handle, uint16_t offset, rsi_ble_resp_att_value_t *p_att_vals)

Get the long attribute value by using handle and offset.

int32_t
rsi_ble_set_att_value(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data)

Set the attribute value of the remote device, rsi_ble_on_write_resp_t callback function is called if the attribute set action is completed, this is a non-blocking API, Still user need to wait until the callback rsi_ble_on_write_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

int32_t
rsi_ble_set_att_cmd(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data)

Set the attribute value without waiting for an ACK from the remote device.

int32_t
rsi_ble_set_long_att_value(uint8_t *dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, const uint8_t *p_data)

Set the long attribute value of the remote device.

int32_t
rsi_ble_prepare_write(uint8_t *dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, const uint8_t *p_data)

Prepare the attribute value.

int32_t
rsi_ble_execute_write(uint8_t *dev_addr, uint8_t exe_flag)

Execute the prepared attribute values.

int32_t
rsi_ble_add_service(uuid_t service_uuid, rsi_ble_resp_add_serv_t *p_resp_serv)

Add a new service to the local GATT Server.

int32_t
rsi_ble_add_attribute(rsi_ble_req_add_att_t *p_attribute)

Add a new attribute to a specific service.

int32_t
rsi_ble_set_local_att_value(uint16_t handle, uint16_t data_len, const uint8_t *p_data)

Change the local attribute value.

int32_t
rsi_ble_set_wo_resp_notify_buf_info(const uint8_t *dev_addr, uint8_t buf_mode, uint8_t buf_cnt)

Configure the buf mode for Notify and WO response commands for the remote device.

int32_t
rsi_ble_notify_value(const uint8_t *dev_addr, uint16_t handle, uint16_t data_len, const uint8_t *p_data)

Notify the local value to the remote device.

int32_t
rsi_ble_indicate_value(const uint8_t *dev_addr, uint16_t handle, uint16_t data_len, const uint8_t *p_data)

Indicate the local value to the remote device.

int32_t
rsi_ble_indicate_value_sync(const uint8_t *dev_addr, uint16_t handle, uint16_t data_len, const uint8_t *p_data)

Indicate the local value to the remote device.

int32_t
rsi_ble_indicate_confirm(const uint8_t *dev_addr)

Send indicate confirmation to the remote device.

int32_t
rsi_ble_get_local_att_value(uint16_t handle, rsi_ble_resp_local_att_value_t *p_resp_local_att_val)

Get the local attribute value.

int32_t
rsi_ble_gatt_read_response(uint8_t *dev_addr, uint8_t read_type, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t *p_data)

Send the response for the read request received from the remote device This is a blocking API.

int32_t
rsi_ble_remove_gatt_service(uint32_t service_handler)

Remove the GATT service record.

int32_t
rsi_ble_remove_gatt_attibute(uint32_t service_handler, uint16_t att_hndl)

Remove the GATT attribute record.

int32_t
rsi_ble_att_error_response(uint8_t *dev_addr, uint16_t handle, uint8_t opcode, uint8_t err)

Send attribute error response for any of the att request.

int32_t
rsi_ble_mtu_exchange_event(uint8_t *dev_addr, uint8_t mtu_size)

Initiates the MTU exchange request with the remote device.

int32_t
rsi_ble_mtu_exchange_resp(uint8_t *dev_addr, uint8_t mtu_size)

This function (Exchange MTU Response) is sent in reply to a received Exchange MTU Request.

int32_t
rsi_ble_gatt_write_response(uint8_t *dev_addr, uint8_t type)

Send the response to the write request received from the remote device.

int32_t
rsi_ble_gatt_prepare_write_response(uint8_t *dev_addr, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t *data)

Send the response for the prepare write requests received from the remote device.

int32_t

Get maximum advertising data length.

int32_t

Get maximum number of advertising sets.

int32_t
rsi_ble_set_ae_set_random_address(uint8_t handle, const uint8_t *rand_addr)

Update AE random address.

int32_t
rsi_ble_set_ae_data(void *ble_ae_data)

Update AE advertiser data.

int32_t
rsi_ble_set_ae_params(void *ble_ae_params, int8_t *sel_tx_pwr)

Update AE parameters.

int32_t

Enable or disable AE advertising.

int32_t
rsi_ble_app_adv_set_clear_or_remove(uint8_t type, uint8_t handle)

request the local device to clear or remove the advertising sets based on the type specified This function requests the local device to clear or remove an advertising set from the controller based on the type specified

int32_t
rsi_ble_app_set_periodic_ae_params(void *periodic_adv_params)

Update periodic AE parameters.

int32_t
rsi_ble_app_set_periodic_ae_enable(uint8_t enable, uint8_t handle)

Enable periodic advertising.

int32_t
rsi_ble_ae_set_scan_params(void *ae_scan_params)

Update AE scan parameters.

int32_t
rsi_ble_ae_set_scan_enable(void *ae_scan_enable)

request the local device to enable scanning for both legacy and extended advertising PDUs

int32_t
rsi_ble_ae_set_periodic_sync(uint8_t type, void *periodic_sync_data)

Synchronize with a periodic advertising train from an advertiser and begin receiving periodic advertising packets.

int32_t

Manage a device in the periodic advertiser list This function adds a device to periodic advertiser list stored in the controller.

int32_t

Get periodic advertiser list size.

int32_t

Establish ACL connection to advertiser.

int32_t

Get supported transmit power range.

int32_t
rsi_ble_get_profiles_async(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_profiles_list_t *p_prof_list)

Get the supported profiles / services of the connected remote device asynchronously.

int32_t
rsi_ble_get_profile_async(uint8_t *dev_addr, uuid_t profile_uuid, profile_descriptors_t *p_profile)

Get the specific profile / service of the connected remote device.

int32_t
rsi_ble_get_char_services_async(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_char_services_t *p_char_serv_list)

Get the service characteristics of the connected remote device.

int32_t
rsi_ble_get_inc_services_async(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_inc_services_t *p_inc_serv_list)

Get the supported include services of the connected remote device.

int32_t
rsi_ble_get_char_value_by_uuid_async(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, uuid_t char_uuid, rsi_ble_resp_att_value_t *p_char_val)

Get the characteristic value by UUID (char_uuid).

int32_t
rsi_ble_get_att_descriptors_async(uint8_t *dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_att_descs_t *p_att_desc)

Get the characteristic descriptors list from the remote device.

int32_t
rsi_ble_get_att_value_async(uint8_t *dev_addr, uint16_t handle, rsi_ble_resp_att_value_t *p_att_val)

Get the attribute with a handle.

int32_t
rsi_ble_get_multiple_att_values_async(uint8_t *dev_addr, uint8_t num_of_handlers, const uint16_t *handles, rsi_ble_resp_att_value_t *p_att_vals)

Get the multiple attribute values by using multiple handles.

int32_t
rsi_ble_get_long_att_value_async(uint8_t *dev_addr, uint16_t handle, uint16_t offset, rsi_ble_resp_att_value_t *p_att_vals)

Get the long attribute value by using handle and offset.

int32_t
rsi_ble_set_att_value_async(uint8_t *dev_addr, uint16_t handle, uint8_t data_len, const uint8_t *p_data)

Set the attribute value of the remote device.

int32_t
rsi_ble_prepare_write_async(uint8_t *dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, const uint8_t *p_data)

Prepare the attribute value.

int32_t
rsi_ble_execute_write_async(uint8_t *dev_addr, uint8_t exe_flag)

Execute the prepared attribute values.

uint32_t
rsi_ble_cbfc_connreq(uint8_t *dev_addr, uint16_t psm)

Sends a connection request to a remote device using the Credit Based Flow Control (CBFC) mechanism.

uint32_t
rsi_ble_cbfc_connresp(uint8_t *dev_addr, uint16_t lcid, uint8_t result)

Sends a connection response for a credit-based flow control (CBFC) connection.

uint32_t
rsi_ble_cbfc_data_tx(uint8_t *dev_addr, uint16_t lcid, uint16_t len, uint8_t *p_data)

Transmits data over a Connection-Based Flow Control (CBFC) channel in the Bluetooth Low Energy (BLE) module.

uint32_t
rsi_ble_cbfc_disconnect(uint8_t *dev_addr, uint16_t lcid)

Disconnects a Connection-Based Flow Control (CBFC) connection with the specified device address and logical channel ID.

void
rsi_ble_gap_register_callbacks(rsi_ble_on_adv_report_event_t ble_on_adv_report_event, rsi_ble_on_connect_t ble_on_conn_status_event, rsi_ble_on_disconnect_t ble_on_disconnect_event, rsi_ble_on_le_ping_payload_timeout_t timeout_expired_event, rsi_ble_on_phy_update_complete_t ble_on_phy_update_complete_event, rsi_ble_on_data_length_update_t ble_on_data_length_update_complete_event, rsi_ble_on_enhance_connect_t ble_on_enhance_conn_status_event, rsi_ble_on_directed_adv_report_event_t ble_on_directed_adv_report_event, rsi_ble_on_conn_update_complete_t ble_on_conn_update_complete_event, rsi_ble_on_remote_conn_params_request_t ble_on_remote_conn_params_request_event)

Register GAP callbacks.

void
rsi_ble_gap_extended_register_callbacks(rsi_ble_on_remote_features_t ble_on_remote_features_event, rsi_ble_on_le_more_data_req_t ble_on_le_more_data_req_event)

Register GAP Extended responses/events callbacks.

uint32_t
rsi_ble_enhanced_gap_extended_register_callbacks(uint16_t callback_id, void(*callback_handler_ptr)(uint16_t status, uint8_t *buffer))

Registers a callback function for the Enhanced GAP Extended feature in the RSI BLE module.

int32_t
rsi_ble_adv_ext_events_register_callbacks(uint16_t callback_id, void(*callback_handler_ptr)(uint16_t status, uint8_t *buffer))

Registers callback functions for extended advertising events in the BLE module.

void
rsi_ble_smp_register_callbacks(rsi_ble_on_smp_request_t ble_on_smp_request_event, rsi_ble_on_smp_response_t ble_on_smp_response_event, rsi_ble_on_smp_passkey_t ble_on_smp_passkey_event, rsi_ble_on_smp_failed_t ble_on_smp_fail_event, rsi_ble_on_encrypt_started_t rsi_ble_on_encrypt_started_event, rsi_ble_on_smp_passkey_display_t ble_on_smp_passkey_display_event, rsi_ble_on_sc_passkey_t ble_sc_passkey_event, rsi_ble_on_le_ltk_req_event_t ble_on_le_ltk_req_event, rsi_ble_on_le_security_keys_t ble_on_le_security_keys_event, rsi_ble_on_smp_response_t ble_on_cli_smp_response_event, rsi_ble_on_sc_method_t ble_on_sc_method_event)

Register the SMP callbacks.

void
rsi_ble_l2cap_cbsc_register_callbacks(rsi_ble_on_cbfc_conn_req_event_t ble_on_cbsc_conn_req, rsi_ble_on_cbfc_conn_complete_event_t ble_on_cbsc_conn_complete, rsi_ble_on_cbfc_rx_data_event_t ble_on_cbsc_rx_data, rsi_ble_on_cbfc_disconn_event_t ble_on_cbsc_disconn)

Register callbacks for BLE L2CAP Credit Based Flow Control (CBFC) events.

void
rsi_ble_gatt_register_callbacks(rsi_ble_on_profiles_list_resp_t ble_on_profiles_list_resp, rsi_ble_on_profile_resp_t ble_on_profile_resp, rsi_ble_on_char_services_resp_t ble_on_char_services_resp, rsi_ble_on_inc_services_resp_t ble_on_inc_services_resp, rsi_ble_on_att_desc_resp_t ble_on_att_desc_resp, rsi_ble_on_read_resp_t ble_on_read_resp, rsi_ble_on_write_resp_t ble_on_write_resp, rsi_ble_on_gatt_write_event_t ble_on_gatt_event, rsi_ble_on_gatt_prepare_write_event_t ble_on_gatt_prepare_write_event, rsi_ble_on_execute_write_event_t ble_on_execute_write_event, rsi_ble_on_read_req_event_t ble_on_read_req_event, rsi_ble_on_mtu_event_t ble_on_mtu_event, rsi_ble_on_gatt_error_resp_t ble_on_gatt_error_resp_event, rsi_ble_on_gatt_desc_val_event_t ble_on_gatt_desc_val_resp_event, rsi_ble_on_event_profiles_list_t ble_on_profiles_list_event, rsi_ble_on_event_profile_by_uuid_t ble_on_profile_by_uuid_event, rsi_ble_on_event_read_by_char_services_t ble_on_read_by_char_services_event, rsi_ble_on_event_read_by_inc_services_t ble_on_read_by_inc_services_event, rsi_ble_on_event_read_att_value_t ble_on_read_att_value_event, rsi_ble_on_event_read_resp_t ble_on_read_resp_event, rsi_ble_on_event_write_resp_t ble_on_write_resp_event, rsi_ble_on_event_indicate_confirmation_t ble_on_indicate_confirmation_event, rsi_ble_on_event_prepare_write_resp_t ble_on_prepare_write_resp_event)

Register the GATT callbacks.

void
rsi_ble_gatt_extended_register_callbacks(rsi_ble_on_mtu_exchange_info_t ble_on_mtu_exchange_info_event)

Register the GATT Extended responses/events callbacks.

Macro Definition Documentation#

RSI_BLE_MAX_RESP_LIST#

#define RSI_BLE_MAX_RESP_LIST
Value:
0x05

Maximum number of response list for BLE.


Definition at line 43 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

RSI_MAX_ADV_REPORT_SIZE#

#define RSI_MAX_ADV_REPORT_SIZE
Value:
31

Maximum size of an advertising report.


Definition at line 45 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

BLE_PASSKEY_SIZE#

#define BLE_PASSKEY_SIZE
Value:
6

Size of the BLE passkey.


Definition at line 47 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

BLE_OUTPUT_POWER_FRONT_END_LOSS#

#define BLE_OUTPUT_POWER_FRONT_END_LOSS
Value:
0 /* db */

Defines the output power front end loss for BLE.


Definition at line 51 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

RSI_HOST_DESC_LENGTH#

#define RSI_HOST_DESC_LENGTH
Value:
16

Host descriptor length.


Definition at line 55 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

RSI_BLE_WRITE_CMD_EVENT#

#define RSI_BLE_WRITE_CMD_EVENT
Value:
0x01

BLE write command event.


Definition at line 1039 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

RSI_BLE_WRITE_REQUEST_EVENT#

#define RSI_BLE_WRITE_REQUEST_EVENT
Value:
0x02

BLE write request event.


Definition at line 1041 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

RSI_BLE_NOTIFICATION_EVENT#

#define RSI_BLE_NOTIFICATION_EVENT
Value:
0x03

BLE notification event.


Definition at line 1043 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

RSI_BLE_INDICATION_EVENT#

#define RSI_BLE_INDICATION_EVENT
Value:
0x04

BLE indication event.


Definition at line 1045 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

PEER_DEVICE_INITATED_MTU_EXCHANGE#

#define PEER_DEVICE_INITATED_MTU_EXCHANGE
Value:
  0x1

Indicates that the Maximum Transmission Unit (MTU) exchange was initiated by the peer device.


Definition at line 1131 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

LOCAL_DEVICE_INITATED_MTU_EXCHANGE#

#define LOCAL_DEVICE_INITATED_MTU_EXCHANGE
Value:
0x2

Indicates that the MTU exchange was initiated by the local device.


Definition at line 1133 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

ADV_DATA_LEN#

#define ADV_DATA_LEN
Value:
210

The maximum length of advertising data.


Definition at line 1686 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

DEVICE_ADDR_LEN#

#define DEVICE_ADDR_LEN
Value:
6

Length of the device address in bytes.


Definition at line 1688 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

Typedef Documentation#

rsi_ble_event_adv_report_t#

typedef struct rsi_ble_event_adv_report_s rsi_ble_event_adv_report_t

Structure representing a BLE advertising report event.


Definition at line 108 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_conn_status_t#

typedef struct rsi_ble_event_conn_status_s rsi_ble_event_conn_status_t

Structure representing the connection status event in the BLE module.


Definition at line 121 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_enhance_conn_status_t#

typedef struct rsi_ble_event_enhnace_conn_status_s rsi_ble_event_enhance_conn_status_t

Structure representing the enhanced connection status event in the BLE module.


Definition at line 149 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_disconnect_t#

typedef struct rsi_ble_event_disconnect_s rsi_ble_event_disconnect_t

Disconnection event structure for BLE.

This structure contains information about the disconnection event of a BLE device.


Definition at line 162 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_le_ping_time_expired_t#

typedef struct rsi_ble_event_le_ping_time_expired_s rsi_ble_event_le_ping_time_expired_t

Structure representing the BLE event for LE ping time expiration.


Definition at line 172 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_le_ltk_request_t#

typedef struct rsi_bt_event_le_ltk_request_s rsi_bt_event_le_ltk_request_t

Structure representing a Bluetooth Low Energy (LE) Long Term Key (LTK) request event.


Definition at line 187 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_le_security_keys_t#

typedef struct rsi_bt_event_le_security_keys_s rsi_bt_event_le_security_keys_t

Structure representing the Bluetooth Low Energy (BLE) event for security keys.


Definition at line 218 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_encryption_enabled_t#

typedef struct rsi_bt_event_encryption_enabled_s rsi_bt_event_encryption_enabled_t

Structure to hold the event data for encryption enabled event.


Definition at line 251 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_smp_req_t#

typedef struct rsi_bt_event_smp_req_s rsi_bt_event_smp_req_t

Structure to hold the Security Manager Protocol (SMP) request event.


Definition at line 263 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_smp_resp_t#

typedef struct rsi_bt_event_smp_resp_s rsi_bt_event_smp_resp_t

Structure to hold the SMP response event data.


Definition at line 317 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_smp_passkey_t#

typedef struct rsi_bt_event_smp_passkey_s rsi_bt_event_smp_passkey_t

Structure to hold the SMP passkey event data.


Definition at line 326 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_smp_passkey_display_t#

typedef struct rsi_bt_event_smp_passkey_display_s rsi_bt_event_smp_passkey_display_t

Structure to hold the SMP passkey display event.


Definition at line 337 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_sc_passkey_t#

typedef struct rsi_bt_event_sc_passkey_s rsi_bt_event_sc_passkey_t

Structure to hold the Secure Connections (SC) passkey event.


Definition at line 350 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_smp_failed_t#

typedef struct rsi_bt_event_smp_failed_s rsi_bt_event_smp_failed_t

Structure to hold the information related to a Bluetooth Low Energy (BLE) Security Manager Protocol (SMP) failed event.


Definition at line 359 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_bt_event_sc_method_t#

typedef struct rsi_bt_event_sc_method_s rsi_bt_event_sc_method_t

Structure to define the Bluetooth event security method.


Definition at line 372 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_ctkd_t#

typedef struct rsi_bt_event_ctkd_s rsi_ble_event_ctkd_t

Structure representing the BLE event for Cross Transport Key Derivation (CTKD).

This structure is used to define the parameters for the BLE event related to Cross Transport Key Derivation, including the remote device address and the derived key.


Definition at line 385 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_phy_update_t#

typedef struct rsi_ble_event_phy_update_s rsi_ble_event_phy_update_t

Structure to hold the BLE PHY update event information.


Definition at line 415 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_conn_update_t#

typedef struct rsi_ble_event_conn_update_s rsi_ble_event_conn_update_t

Structure to hold the data of the BLE connection update event.


Definition at line 432 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_remote_conn_param_req_t#

typedef struct rsi_ble_event_remote_conn_param_req_s rsi_ble_event_remote_conn_param_req_t

Structure representing the parameters of a remote connection parameter request event in BLE.


Definition at line 450 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_remote_features_t#

typedef struct rsi_ble_event_remote_features_s rsi_ble_event_remote_features_t

Structure to hold the data of the remote features event.


Definition at line 462 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_le_dev_buf_ind_t#

typedef struct rsi_ble_event_le_dev_buf_ind_s rsi_ble_event_le_dev_buf_ind_t

Structure to hold the BLE event LE device buffer indication.


Definition at line 473 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_data_length_update_t#

typedef struct rsi_ble_event_data_length_update_s rsi_ble_event_data_length_update_t

Structure representing the data for the BLE length update event.


Definition at line 491 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

uuid128_t#

typedef struct uuid128_s uuid128_t

Structure representing a 128-bit Universal Unique IDentifier (UUID).


Definition at line 509 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

uuid16_t#

typedef uint16_t uuid16_t

16 bit UUID format structure


Definition at line 512 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

uuid32_t#

typedef uint32_t uuid32_t

32 bit UUID format structure


Definition at line 515 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

uuid_t#

typedef struct uuid_s uuid_t

Structure representing a Universally Unique Identifier (UUID).

This structure encapsulates a UUID, which can be of varying sizes— 16, 32, or 128-bits. It includes the size of the UUID, a reserved field, and a union to hold the value of one of the three types of UUIDs.


Definition at line 571 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

profile_descriptors_t#

typedef struct profile_descriptor_s profile_descriptors_t

Represents the data of the particular profile descriptor.


Definition at line 587 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

att_desc_t#

typedef struct att_desc_s att_desc_t

Structure representing an attribute descriptor.

This structure is used to define the parameters for an attribute descriptor, including the attribute handle, reserved field, and attribute UUID.


Definition at line 606 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

char_serv_data_t#

typedef struct char_serv_data_s char_serv_data_t

Structure representing characteristic service data.

This structure is used to define the parameters for characteristic service data, including the characteristic value property, handle, and UUID.


Definition at line 625 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

char_serv_t#

typedef struct char_serv_s char_serv_t

Structure representing a characteristic service.

This structure is used to define the parameters for a characteristic service, including the attribute handle, reserved space for future use, and the characteristic service attribute value.


Definition at line 642 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

inc_serv_data_t#

typedef struct inc_serv_data_s inc_serv_data_t

Structure representing the included service data.


Definition at line 656 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

inc_serv_t#

typedef struct inc_serv_s inc_serv_t

Structure representing an included service attribute in a GATT server.


Definition at line 670 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_req_add_att_t#

typedef struct rsi_ble_req_add_att_s rsi_ble_req_add_att_t

Structure representing a request to add an attribute in the BLE stack.


Definition at line 698 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_pesentation_format_t#

typedef struct rsi_ble_presentation_format rsi_ble_pesentation_format_t

Structure representing the presentation format of a Bluetooth Low Energy (BLE) device.


Definition at line 719 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_error_resp_t#

typedef struct rsi_ble_event_error_resp_s rsi_ble_event_error_resp_t

Structure representing the response for a BLE event error.


Definition at line 736 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_gatt_desc_t#

typedef struct rsi_ble_event_gatt_desc_s rsi_ble_event_gatt_desc_t

Structure representing a GATT descriptor event.


Definition at line 752 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_profiles_list_t#

typedef struct rsi_ble_event_profiles_list_s rsi_ble_event_profiles_list_t

Structure representing the BLE event profiles list.

This structure is used to define the parameters for the BLE event profiles list, including the remote device address, number of profiles found, and the list of found profiles.


Definition at line 771 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_profile_by_uuid_t#

typedef struct rsi_ble_event_profile_by_uuid_s rsi_ble_event_profile_by_uuid_t

Structure to hold the BLE event profile by UUID.


Definition at line 785 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_read_by_type1_t#

typedef struct rsi_ble_event_read_by_type1_s rsi_ble_event_read_by_type1_t

Structure representing the BLE event for reading characteristic services by type.

This structure is used to represent the BLE event RSI_BLE_EVENT_GATT_READ_CHAR_SERVS with event ID 0x1503. It provides information related to the read operation of characteristic services.


Definition at line 804 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_read_by_type2_t#

typedef struct rsi_ble_event_read_by_type2_s rsi_ble_event_read_by_type2_t

Structure for BLE event read by type 2.


Definition at line 820 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_read_by_type3_t#

typedef struct rsi_ble_event_read_by_type3_s rsi_ble_event_read_by_type3_t

Structure definition for the BLE event "Read By Type 3" response.


Definition at line 836 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_att_value_t#

typedef struct rsi_ble_event_att_value_s rsi_ble_event_att_value_t

Structure representing the BLE ATT value event.


Definition at line 850 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_att_resp_t#

typedef struct rsi_ble_set_att_resp_s rsi_ble_set_att_resp_t

Structure to hold the response for the BLE set attribute request.


Definition at line 859 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_prepare_write_resp_t#

typedef struct rsi_ble_prepare_write_resp_s rsi_ble_prepare_write_resp_t

Structure representing the response for the prepare write operation in BLE.


Definition at line 877 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resp_profiles_list_t#

typedef struct rsi_ble_resp_profiles_list_s rsi_ble_resp_profiles_list_t

Structure representing the list of received profiles, The maximum value is 5.


Definition at line 892 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resp_query_profile_descriptor_t#

typedef struct rsi_ble_resp_query_profile_descriptor_s rsi_ble_resp_query_profile_descriptor_t

Structure representing the list of received profile descriptor of a particular profile, The maximum value is 5.


Definition at line 904 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resp_char_services_t#

typedef struct rsi_ble_resp_char_serv_s rsi_ble_resp_char_services_t

Structure to hold the response of characteristic services.


Definition at line 926 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resp_inc_services_t#

typedef struct rsi_ble_resp_inc_serv rsi_ble_resp_inc_services_t

Structure representing the list of received included service attributes for a particular included service.

The maximum value is 5.


Definition at line 941 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resp_att_value_t#

typedef struct rsi_ble_resp_att_value_t rsi_ble_resp_att_value_t

Structure representing the response for an Attribute Protocol (ATT) value in Bluetooth Low Energy (BLE).


Definition at line 954 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resp_att_descs_t#

typedef struct rsi_ble_resp_att_descs_s rsi_ble_resp_att_descs_t

Structure representing the list of received attribute descriptors, The maximum value is 5.


Definition at line 969 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resp_add_serv_t#

typedef struct rsi_ble_resp_add_serv_s rsi_ble_resp_add_serv_t

Structure representing the response for adding a service in BLE.


Definition at line 980 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resp_local_att_value_t#

typedef struct rsi_ble_resp_local_att_value_s rsi_ble_resp_local_att_value_t

Structure representing the response for local attribute value in BLE.


Definition at line 993 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_remote_device_info_t#

typedef struct rsi_ble_event_remote_device_info_s rsi_ble_event_remote_device_info_t

Structure representing the BLE event for remote device information.

This structure is used to define the parameters for a BLE event that provides information about a remote device.


Definition at line 1010 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_rcp_rcvd_info_t#

typedef struct rsi_ble_event_rcp_rcvd_info_s rsi_ble_event_rcp_rcvd_info_t

Structure representing the BLE event for received Remote Control Protocol (RCP) information.

This structure is used to define the parameters for a BLE event that involves receiving RCP information.


Definition at line 1021 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_write_t#

typedef struct rsi_ble_event_write_s rsi_ble_event_write_t

Structure representing a BLE write event.


Definition at line 1063 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_prepare_write_t#

typedef struct rsi_ble_event_prepare_write_s rsi_ble_event_prepare_write_t

Structure definition for preparing a write operation in BLE event.


Definition at line 1081 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_execute_write_t#

typedef struct rsi_ble_execute_write_s rsi_ble_execute_write_t

Structure representing the BLE execute write request.

This structure is used to define the parameters for an execute write request to a remote BLE device.


Definition at line 1094 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_read_req_t#

typedef struct rsi_ble_read_req_s rsi_ble_read_req_t

Structure representing the BLE read request.

This structure is used to define the parameters for a BLE read request, including the remote device address, attribute handle, request type, and offset.


Definition at line 1115 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_mtu_t#

typedef struct rsi_ble_event_mtu_s rsi_ble_event_mtu_t

Structure to hold the BLE MTU event information.


Definition at line 1127 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_mtu_exchange_information_t#

typedef struct rsi_ble_event_mtu_exchange_information_s rsi_ble_event_mtu_exchange_information_t

Structure to hold the MTU exchange information for a BLE event.


Definition at line 1152 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_directedadv_report_t#

typedef struct rsi_ble_event_directedadv_report_s rsi_ble_event_directedadv_report_t

Structure to hold the information of a directed advertising report event.


Definition at line 1172 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_cbfc_conn_req_t#

typedef struct rsi_ble_event_cbfc_conn_req_s rsi_ble_event_cbfc_conn_req_t

Structure representing the BLE event for CBFC connection request.

This structure is used to define the parameters for a BLE event that involves a Circular Buffer Flow Control (CBFC) connection request from a remote device.


Definition at line 1187 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_cbfc_conn_complete_t#

typedef struct rsi_ble_event_cbfc_conn_complete_s rsi_ble_event_cbfc_conn_complete_t

Structure representing the BLE event for CBFC connection complete.

This structure is used to define the parameters for a BLE event that indicates the completion of a Circular Buffer Flow Control (CBFC) connection with a remote device.


Definition at line 1206 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_cbfc_rx_data_t#

typedef struct rsi_ble_event_cbfc_rx_data_s rsi_ble_event_cbfc_rx_data_t

Structure representing the BLE event for CBFC received data.

This structure is used to define the parameters for a BLE event that involves receiving data over a Circular Buffer Flow Control (CBFC) connection from a remote device.


Definition at line 1223 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_event_cbfc_disconn_t#

typedef struct rsi_ble_event_cbfc_disconn_s rsi_ble_event_cbfc_disconn_t

Structure representing the BLE event for CBFC disconnection.

This structure is used to define the parameters for a BLE event that involves the disconnection of a Circular Buffer Flow Control (CBFC) connection with a remote device.


Definition at line 1236 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_smp_pairing_capabilty_data_t#

typedef struct rsi_ble_set_smp_pairing_capabilty_data rsi_ble_set_smp_pairing_capabilty_data_t

Structure for setting SMP pairing capability data.


Definition at line 1295 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resp_read_phy_t#

typedef struct rsi_ble_resp_read_phy_s rsi_ble_resp_read_phy_t

Structure to hold the response for the BLE read PHY command.


Definition at line 1325 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_read_max_data_length_t#

typedef struct rsi_ble_resp_read_max_data_length_s rsi_ble_read_max_data_length_t

Structure representing the response for reading the maximum data length in BLE.


Definition at line 1352 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_per_transmit_t#

typedef struct rsi_ble_per_transmit_s rsi_ble_per_transmit_t

Structure to hold the parameters for BLE periodic advertising transmission.


Definition at line 1584 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_per_receive_t#

typedef struct rsi_ble_per_receive_s rsi_ble_per_receive_t

Structure representing the parameters for BLE periodic receive operation.


Definition at line 1679 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_adv_report_t#

typedef struct rsi_ble_ae_adv_report_s rsi_ble_ae_adv_report_t

ae adv report event


Definition at line 1773 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_per_adv_sync_estbl_t#

typedef struct rsi_ble_per_adv_sync_estbl_s rsi_ble_per_adv_sync_estbl_t

ae periodic sync establishment report event


Definition at line 1818 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_per_adv_report_t#

typedef struct rsi_ble_per_adv_report_s rsi_ble_per_adv_report_t

ae periodic adv report event


Definition at line 1844 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_per_adv_sync_lost_t#

typedef struct rsi_ble_per_adv_sync_lost_s rsi_ble_per_adv_sync_lost_t

ae periodic sync lost report event


Definition at line 1850 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_scan_timeout_t#

typedef struct rsi_ble_scan_timeout_s rsi_ble_scan_timeout_t

ae scan timeout report event


Definition at line 1856 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_adv_set_terminated_t#

typedef struct rsi_ble_adv_set_terminated_s rsi_ble_adv_set_terminated_t

ae adv set terminated report event


Definition at line 1874 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_scan_req_recvd_t#

typedef struct rsi_ble_scan_req_recvd_s rsi_ble_scan_req_recvd_t

ae scan request recvd report event


Definition at line 1890 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

chip_ble_buffers_stats_t#

typedef struct chip_ble_buffers_stats_s chip_ble_buffers_stats_t

Structure representing the BLE buffer statistics.

This structure is used to define the parameters for BLE buffer statistics, including the utilization of Asynchronous Connection-Less (ACL) buffers and command packet buffers.


Definition at line 1906 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_adv_report_event_t#

void(* rsi_ble_on_adv_report_event_t)(rsi_ble_event_adv_report_t *rsi_ble_event_adv) )(rsi_ble_event_adv_report_t *rsi_ble_event_adv)

Callback function advertise event report from the module.

Parameters
[out]rsi_ble_event_adv

contains the advertise report information. Refer to rsi_ble_event_adv_report_s for more information.

This callback function is called whenever an advertise event report is received from the module. It has to registered using the rsi_ble_gap_register_callbacks API.
Returns

  • The following values are returned: void


Definition at line 4543 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_connect_t#

void(* rsi_ble_on_connect_t)(rsi_ble_event_conn_status_t *rsi_ble_event_conn) )(rsi_ble_event_conn_status_t *rsi_ble_event_conn)

Callback function for the BLE connection status from the module.

Parameters
[out]rsi_ble_event_conn

contains the BLE connection status. Refer rsi_ble_event_conn_status_s for more information.

This callback function is called whenever the BLE connection status is received from the module. For BLE 4.1 and lower versions, this callback will be called. It has to be registered using the rsi_ble_gap_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 4556 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_enhance_connect_t#

void(* rsi_ble_on_enhance_connect_t)(rsi_ble_event_enhance_conn_status_t *rsi_ble_event_enhance_conn) )(rsi_ble_event_enhance_conn_status_t *rsi_ble_event_enhance_conn)

Callback function for the BLE connection status from the module.

Parameters
[out]rsi_ble_event_enhance_conn

contains the BLE connection status. Refer to rsi_ble_event_enhance_conn_status_s for more info.

This callback function is called whenever the BLE connection status is received from the module. For BLE 4.2 and above versions, this callback will be called. It has to be registered using the rsi_ble_gap_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 4569 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_disconnect_t#

void(* rsi_ble_on_disconnect_t)(rsi_ble_event_disconnect_t *rsi_ble_event_disconnect, uint16_t reason) )(rsi_ble_event_disconnect_t *rsi_ble_event_disconnect, uint16_t reason)

Callback function for the disconnect status event from the module.

Parameters
[out]rsi_ble_event_disconnect

contains the disconnect status. Refer to rsi_ble_event_disconnect_s for more information.

[out]reason

contains reason for failure.

This callback function is called whenever the disconnect status event is received from the module. It has to be registered using the rsi_ble_gap_register_callbacks API. Note

  • Few reason for failure are given below 0x4E13 Remote user terminated connection 0x4E14 Remote device terminated connection due to low resources 0x4E15 Remote device terminated connection due to power off 0x4E3D Connection terminated due to MIC failure 0x4E3E Connection Failed to be Established 0x4E60 Invalid Handle Range

Returns

  • The following values are returned: void


Definition at line 4590 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_le_ping_payload_timeout_t#

void(* rsi_ble_on_le_ping_payload_timeout_t)(rsi_ble_event_le_ping_time_expired_t *rsi_ble_event_timeout_expired) )(rsi_ble_event_le_ping_time_expired_t *rsi_ble_event_timeout_expired)

Callback function for the LE ping time expired event from the module.

Parameters
[out]rsi_ble_event_timeout_expired

contains the disconnect status. See rsi_ble_event_le_ping_time_expired_s for more information.

This callback function is called whenever the LE ping time expired event is received from the module. It has to be registered using the rsi_ble_gap_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 4602 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_le_ltk_req_event_t#

void(* rsi_ble_on_le_ltk_req_event_t)(rsi_bt_event_le_ltk_request_t *rsi_ble_event_le_ltk_request) )(rsi_bt_event_le_ltk_request_t *rsi_ble_event_le_ltk_request)

Callback function for the LE LTK request event from the module.

Parameters
[out]rsi_ble_event_le_ltk_request

contains the LTK request info. See rsi_bt_event_le_ltk_request_s for more information.

This callback function is called whenever the LE LTK request event is received from the module. It has to be registered using the rsi_ble_smp_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 4615 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_le_security_keys_t#

void(* rsi_ble_on_le_security_keys_t)(rsi_bt_event_le_security_keys_t *rsi_ble_event_le_security_keys) )(rsi_bt_event_le_security_keys_t *rsi_ble_event_le_security_keys)

Callback function for the LE security keys event from the module.

Parameters
[out]rsi_ble_event_le_security_keys

contains security keys. See rsi_bt_event_le_security_keys_s for more information.

This callback function is called whenever the LE security keys event is received from the module. It has to be registered using the rsi_ble_smp_register_callbacks API.


Definition at line 4626 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_smp_request_t#

void(* rsi_ble_on_smp_request_t)(rsi_bt_event_smp_req_t *remote_dev_address) )(rsi_bt_event_smp_req_t *remote_dev_address)

Callback function for SMP request in central mode from the remote device.

Parameters
[out]remote_dev_address

contains the smp requested device address. See rsi_bt_event_smp_req_s for more information.

This callback function is called whenever an SMP request is received in central mode from the remote device. It has to be registered using the rsi_ble_smp_register_callbacks API.


Definition at line 4644 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_smp_response_t#

void(* rsi_ble_on_smp_response_t)(rsi_bt_event_smp_resp_t *remote_dev_address) )(rsi_bt_event_smp_resp_t *remote_dev_address)

Callback function for SMP request in peripheral mode from the remote device.

Parameters
[out]remote_dev_address

contains the smp resp information. See rsi_bt_event_smp_resp_s for more information.

This callback function is called whenever an SMP request is received in peripheral mode from the remote device. It has to be registered using the rsi_ble_smp_register_callbacks API.

Returns

  • The following values are returned: void


Definition at line 4659 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_smp_passkey_t#

void(* rsi_ble_on_smp_passkey_t)(rsi_bt_event_smp_passkey_t *remote_dev_address) )(rsi_bt_event_smp_passkey_t *remote_dev_address)

Callback function for SMP passkey event from the module.

Parameters
[out]remote_dev_address

contains the remote device address. See rsi_bt_event_smp_passkey_s for more information.

This callback function is called whenever an SMP passkey event is received from the module. It has to be registered using the rsi_ble_smp_register_callbacks API.


Definition at line 4671 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_smp_passkey_display_t#

void(* rsi_ble_on_smp_passkey_display_t)(rsi_bt_event_smp_passkey_display_t *smp_passkey_display) )(rsi_bt_event_smp_passkey_display_t *smp_passkey_display)

Callback function for SMP passkey display event from the module.

Parameters
[out]smp_passkey_display

contains the smp passkey display information. See rsi_bt_event_smp_passkey_display_s for more information.

This callback function is called whenever an SMP passkey display event is received from the module. It has to be registered using the rsi_ble_smp_register_callbacks API.


Definition at line 4683 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_smp_failed_t#

void(* rsi_ble_on_smp_failed_t)(uint16_t resp_status, rsi_bt_event_smp_failed_t *remote_dev_address) )(uint16_t resp_status, rsi_bt_event_smp_failed_t *remote_dev_address)

Callback function for SMP failed event from the module.

Parameters
[out]resp_status

contains the remote device address. See rsi_bt_event_smp_failed_s for more information.

This callback function will be called if the smp process is failed with remote device. It has to be registered using the rsi_ble_smp_register_callbacks API.

Note

  • Error codes for SMP FAILED are given below: 0x4B01 SMP Passkey entry failed
    0x4B02 SMP OOB not available 0x4B03 SMP Authentication Requirements 0x4B04 SMP confirm value failed 0x4B05 SMP Pairing not supported 0x4B06 SMP Encryption key size insufficient 0x4B07 SMP command not supported 0x4B08 SMP Unspecified Reason 0x4B09 SMP repeated attempts 0x4B0C SMP Numeric Comparison Failed 0x4B0B DHKEY Check Failed


Definition at line 4708 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_sc_method_t#

void(* rsi_ble_on_sc_method_t)(rsi_bt_event_sc_method_t *scmethod) )(rsi_bt_event_sc_method_t *scmethod)

Callback function for a security method event from the module.

Parameters
[out]scmethod

contains Security Method 1 means Just works or 2 means Passkey. See rsi_bt_event_sc_method_s for more information.

This callback function will be called if the SC method is done with remote device. It has to be registered using the rsi_ble_smp_register_callbacks API.


Definition at line 4720 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_encrypt_started_t#

void(* rsi_ble_on_encrypt_started_t)(uint16_t resp_status, rsi_bt_event_encryption_enabled_t *enc_enabled) )(uint16_t resp_status, rsi_bt_event_encryption_enabled_t *enc_enabled)

Callback function an encrypted event from the module.

Parameters
[out]resp_status

contains the response status (Success or Error code)

[out]enc_enabled

contains encryption information. See rsi_bt_event_encryption_enabled_s for more information.

This callback function will be called if the encryption process is started with remote device. It has to be registered using the rsi_ble_smp_register_callbacks API.


Definition at line 4733 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_sc_passkey_t#

void(* rsi_ble_on_sc_passkey_t)(rsi_bt_event_sc_passkey_t *sc_passkey) )(rsi_bt_event_sc_passkey_t *sc_passkey)

Callback function for a BLE Secure Connection passkey event from the module.

Parameters
[out]sc_passkey

contains LE SC Passkey information. See rsi_bt_event_encryption_enabled_s for more information.

This callback function is called whenever a BLE Secure Connection passkey event is received from the module. It has to be registered using the rsi_ble_smp_register_callbacks API.


Definition at line 4745 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_phy_update_complete_t#

void(* rsi_ble_on_phy_update_complete_t)(rsi_ble_event_phy_update_t *rsi_ble_event_phy_update_complete) )(rsi_ble_event_phy_update_t *rsi_ble_event_phy_update_complete)

Callback function for receiving the PHY update complete event.

Parameters
[out]rsi_ble_event_phy_update_complete

contains the controller support PHY information. See rsi_ble_event_phy_update_s for more information.

This callback function is called whenever the PHY update complete event is received. It has to be registered using the rsi_ble_gap_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 4760 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_conn_update_complete_t#

void(* rsi_ble_on_conn_update_complete_t)(rsi_ble_event_conn_update_t *rsi_ble_event_conn_update_complete, uint16_t resp_status) )(rsi_ble_event_conn_update_t *rsi_ble_event_conn_update_complete, uint16_t resp_status)

Callback function for a connection update complete event from the module.

Parameters
[out]rsi_ble_event_conn_update_complete

contains the connection information. See rsi_ble_event_conn_update_s for more information.

[out]resp_status

contains the response status (Success or Error code)

This callback function is called whenever the connection update complete event is received. rsi_ble_event_conn_update_s contains connection information. It has to be registered using the rsi_ble_gap_register_callbacks API.


Definition at line 4772 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_remote_conn_params_request_t#

void(* rsi_ble_on_remote_conn_params_request_t)(rsi_ble_event_remote_conn_param_req_t *rsi_ble_event_remote_conn_param, uint16_t resp_status) )(rsi_ble_event_remote_conn_param_req_t *rsi_ble_event_remote_conn_param, uint16_t resp_status)

Callback function for remote connection parameters request.

Parameters
[out]resp_status

contains the response status (Success or Error code)

[out]rsi_ble_event_remote_conn_param

contains the remote device connection parameters. See rsi_ble_event_remote_conn_param_req_s for more information.

This callback function is called whenever a remote connection parameters request is received. It has to be registered using the rsi_ble_gap_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 4789 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_remote_features_t#

void(* rsi_ble_on_remote_features_t)(rsi_ble_event_remote_features_t *rsi_ble_event_remote_features) )(rsi_ble_event_remote_features_t *rsi_ble_event_remote_features)

Callback function for supported features of remote device This callback function will be called when LE remote features event is received.

Parameters
[out]rsi_ble_event_remote_features

contains the remote device supported features. See rsi_ble_event_remote_features_s for more information.

it has to be registered using rsi_ble_gap_extended_register_callbacks API.


Definition at line 4800 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_le_more_data_req_t#

void(* rsi_ble_on_le_more_data_req_t)(rsi_ble_event_le_dev_buf_ind_t *rsi_ble_more_data_evt) )(rsi_ble_event_le_dev_buf_ind_t *rsi_ble_more_data_evt)

Callback function for the LE more data event.

Parameters
[out]rsi_ble_more_data_evt

contains the LE Device Buffer Indication information. See rsi_ble_event_le_dev_buf_ind_s for more infomation.

This callback function is called whenever an LE more data event is received. It has to be registered using the rsi_ble_gap_extended_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 4815 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_data_length_update_t#

void(* rsi_ble_on_data_length_update_t)(rsi_ble_event_data_length_update_t *remote_dev_address) )(rsi_ble_event_data_length_update_t *remote_dev_address)

Callback function for the data length update complete event.

Parameters
[out]remote_dev_address

contains the controller support TX and RX length and transmission time information. See rsi_ble_event_data_length_update_s for more information.

This callback function is called whenever the data length update complete event is received. rsi_ble_event_data_length_update_s type variable remote_dev_address contains information about dev_addr - Device address of the remote device , MaxTxOctets - Maximum TX Octets to be transmitted , MaxTxTime - Maximum TX time to transmit the MaxTxOctets , MaxRxOctets - Maximum Rx Octets to be received , MaxRxTime - Maximum Rx time to receive the MaxRxOctets It has to be registered using the rsi_ble_gap_register_callbacks API.


Definition at line 4827 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_directed_adv_report_event_t#

void(* rsi_ble_on_directed_adv_report_event_t)(rsi_ble_event_directedadv_report_t *rsi_ble_event_directed) )(rsi_ble_event_directedadv_report_t *rsi_ble_event_directed)

Callback function for a directed advertise report event from the module.

Parameters
[in]rsi_ble_event_directed

contains the advertise report information

This callback function is called whenever a directed advertise report event is received from the module. It has to be registered using the rsi_ble_gap_register_callbacks API.


Definition at line 4837 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_gatt_error_resp_t#

void(* rsi_ble_on_gatt_error_resp_t)(uint16_t event_status, rsi_ble_event_error_resp_t *rsi_ble_gatt_error) )(uint16_t event_status, rsi_ble_event_error_resp_t *rsi_ble_gatt_error)

Callback function for a GATT error event from the module.

Parameters
[out]event_status

contains the error response
Non-Zero Value - Failure Attribute protocol error codes 0x4A01 - Invalid Handle 0x4A06 - Request not supported 0x4A0A - Attribute not found 0x4A05 - Insufficient authentication 0x4A08 - Insufficient authorization 0x4A0C - Insufficient encryption key size 0x4A0F - Insufficient encryption 0x4A02 - Read not permitted 0x4A03 - Write not permitted 0x4A07 - Invalid offset 0x4A0B - Attribute not Long attribute value has a fixed length that is less than or equal to (ATT_MTU - 1) octets in length , refer to Bluetooth Spec 5.4 for further details.

[out]rsi_ble_gatt_error

contains the GATT error information. Please refer rsi_ble_event_error_resp_s for more info

This callback function is called whenever a GATT error event is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 4991 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_gatt_desc_val_event_t#

void(* rsi_ble_on_gatt_desc_val_event_t)(uint16_t event_status, rsi_ble_event_gatt_desc_t *rsi_ble_gatt_desc_val) )(uint16_t event_status, rsi_ble_event_gatt_desc_t *rsi_ble_gatt_desc_val)

Callback function for an attribute descriptors event from the module.

Parameters
[out]event_status

contains the response status

  • 0 - Success

  • Non-Zero Value - Failure

[out]rsi_ble_gatt_desc_val

contains the profiles list event information. Refer to rsi_ble_event_gatt_desc_s for more information.

This callback function is called whenever an attribute descriptors event is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 5008 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_event_profiles_list_t#

void(* rsi_ble_on_event_profiles_list_t)(uint16_t event_status, rsi_ble_event_profiles_list_t *rsi_ble_event_profiles) )(uint16_t event_status, rsi_ble_event_profiles_list_t *rsi_ble_event_profiles)

Callback function for a profiles list response from the module.

Parameters
[out]event_status

contains the response status

         - 0 - Success 
         - Non-Zero Value   -   Failure 
[out]rsi_ble_event_profiles

contains the profiles list event information. Refer to rsi_ble_event_profiles_list_s for more information.

This callback function is called whenever a profiles list response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 5030 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_event_profile_by_uuid_t#

void(* rsi_ble_on_event_profile_by_uuid_t)(uint16_t event_status, rsi_ble_event_profile_by_uuid_t *rsi_ble_event_profile) )(uint16_t event_status, rsi_ble_event_profile_by_uuid_t *rsi_ble_event_profile)

Callback function for a profile response from the module.

Parameters
[out]event_status

contains the response status

         - 0 - Success 
         - Non-Zero Value   -   Failure 
[out]rsi_ble_event_profile

contains the profile response information. Refer to rsi_ble_event_profile_by_uuid_s for more information.

This callback function is called whenever a profile response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 5052 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_event_read_by_char_services_t#

void(* rsi_ble_on_event_read_by_char_services_t)(uint16_t event_status, rsi_ble_event_read_by_type1_t *rsi_ble_event_read_type1) )(uint16_t event_status, rsi_ble_event_read_by_type1_t *rsi_ble_event_read_type1)

This callback function will be called if the characteristic services list response is received from the module.

Parameters
[out]event_status

contains the response status

         - 0 - Success 
         - Non-Zero Value   -   Failure 
[out]rsi_ble_event_read_type1

contains the char services event information. Refer to rsi_ble_event_read_by_type1_s for more information.

Returns

  • The following values are returned: void


Definition at line 5068 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_event_read_by_inc_services_t#

void(* rsi_ble_on_event_read_by_inc_services_t)(uint16_t event_status, rsi_ble_event_read_by_type2_t *rsi_ble_event_read_type2) )(uint16_t event_status, rsi_ble_event_read_by_type2_t *rsi_ble_event_read_type2)

Callback function for an include services list response from the module.

Parameters
[out]event_status

contains the response status

         - 0 - Success 
         - Non-Zero Value   -   Failure 
[out]rsi_ble_event_read_type2

contains the inc services information. Refer to rsi_ble_event_read_by_type2_s for more information.

This callback function is called whenever an include services list response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 5090 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_event_read_att_value_t#

void(* rsi_ble_on_event_read_att_value_t)(uint16_t event_status, rsi_ble_event_read_by_type3_t *rsi_ble_event_read_type3) )(uint16_t event_status, rsi_ble_event_read_by_type3_t *rsi_ble_event_read_type3)

Callback function for an attribute value response from the module.

Parameters
[out]event_status

contains the response status

         - 0 - Success 
         - Non-Zero Value   -   Failure 
[out]rsi_ble_event_read_type3

contains the char services event information. Refer to rsi_ble_event_read_by_type3_s for more information.

This callback function is called whenever an attribute value response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 5108 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_event_read_resp_t#

void(* rsi_ble_on_event_read_resp_t)(uint16_t event_status, rsi_ble_event_att_value_t *rsi_ble_event_att_val) )(uint16_t event_status, rsi_ble_event_att_value_t *rsi_ble_event_att_val)

Callback function for an attribute value from the module.

Parameters
[out]event_status

contains the response status

         - 0 - Success 
         - Non-Zero Value   -   Failure 
[out]rsi_ble_event_att_val

contains the profile response information. Refer to rsi_ble_event_att_value_s for more information.

This callback function is called whenever an attribute value is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 5126 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_event_write_resp_t#

void(* rsi_ble_on_event_write_resp_t)(uint16_t event_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp) )(uint16_t event_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp)

Callback function for a GATT write response from the module.

Parameters
[out]event_status

contains the response status

         - 0 - Success 
         - Non-Zero Value   -   Failure 
[out]rsi_ble_event_set_att_rsp

contains the profile response information. Refer to rsi_ble_set_att_resp_t for more information.

This callback function is called whenever a GATT write response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 5144 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_event_indicate_confirmation_t#

void(* rsi_ble_on_event_indicate_confirmation_t)(uint16_t event_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp) )(uint16_t event_status, rsi_ble_set_att_resp_t *rsi_ble_event_set_att_rsp)

Callback function for indication confirmation event.

Parameters
[out]event_status

contains the response status

         - 0 - Success 
         - Non-Zero Value   -   Failure 
[out]rsi_ble_event_set_att_rsp

contains the profile response information. Refer to rsi_ble_set_att_resp_s for more information.

This callback function is called whenever an indication confirmation response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 5161 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_event_prepare_write_resp_t#

void(* rsi_ble_on_event_prepare_write_resp_t)(uint16_t event_status, rsi_ble_prepare_write_resp_t *rsi_ble_event_prepare_write) )(uint16_t event_status, rsi_ble_prepare_write_resp_t *rsi_ble_event_prepare_write)

Callback function for a GATT prepare response from the module.

Parameters
[out]event_status

contains the response status

  • 0 - Success

  • Non-Zero Value - Failure

[out]rsi_ble_event_prepare_write

contains the char services event information. Refer to rsi_ble_prepare_write_resp_s for more information.

This callback function is called whenever a GATT prepare response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Returns

  • The following values are returned: void


Definition at line 5178 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_profiles_list_resp_t#

void(* rsi_ble_on_profiles_list_resp_t)(uint16_t resp_status, rsi_ble_resp_profiles_list_t *rsi_ble_resp_profiles) )(uint16_t resp_status, rsi_ble_resp_profiles_list_t *rsi_ble_resp_profiles)

Callback function for a profiles list response from the module.

Parameters
[out]resp_status

contains the profiles list response information. Refer to rsi_ble_resp_profiles_list_s for more information.

This callback function is called whenever a profiles list response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Note

  • Attribute protocol error codes 0x4A01 - Invalid Handle 0x4A0A - Attribute not found

Returns

  • The following values are returned: void


Definition at line 5199 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_profile_resp_t#

void(* rsi_ble_on_profile_resp_t)(uint16_t resp_status, profile_descriptors_t *rsi_ble_resp_profile) )(uint16_t resp_status, profile_descriptors_t *rsi_ble_resp_profile)

Callback function for a profile response from the module.

Parameters
[out]resp_status

contains the profile response information. Refer to profile_descriptors_s for more information.

This callback function is called whenever a profile response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Note

  • Attribute protocol error codes 0x4A01 - Invalid Handle 0x4A06 - Request not supported 0x4A0A - Attribute not found

Returns

  • The following values are returned: void


Definition at line 5220 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_char_services_resp_t#

void(* rsi_ble_on_char_services_resp_t)(uint16_t resp_status, rsi_ble_resp_char_services_t *rsi_ble_resp_char_serv) )(uint16_t resp_status, rsi_ble_resp_char_services_t *rsi_ble_resp_char_serv)

Callback function for a service characteristics response from the module.

Parameters
[out]resp_status

contains the service characteristics response information. Please refer rsi_ble_resp_char_services_s for more info

This callback function is called whenever a service characteristics response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Note

  • Attribute protocol error codes 0x4A01 - Invalid Handle 0x4A06 - Request not supported 0x4A0A - Attribute not found 0x4A05 - Insufficient authentication 0x4A08 - Insufficient authorization 0x4A0C - Insufficient encryption key size 0x4A0F - Insufficient encryption 0x4A02 - Read not permitted

Returns

  • The following values are returned: void


Definition at line 5246 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_inc_services_resp_t#

void(* rsi_ble_on_inc_services_resp_t)(uint16_t resp_status, rsi_ble_resp_inc_services_t *rsi_ble_resp_inc_serv) )(uint16_t resp_status, rsi_ble_resp_inc_services_t *rsi_ble_resp_inc_serv)

Callback function for an include service response from the module.

Parameters
[out]resp_status

contains the include services response information. Please refer rsi_ble_resp_inc_services_s for more info

This callback function is called whenever an include service response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Note

  • Attribute protocol error codes 0x4A01 - Invalid Handle 0x4A06 - Request not supported 0x4A0A - Attribute not found 0x4A05 - Insufficient authentication 0x4A08 - Insufficient authorization 0x4A0C - Insufficient encryption key size 0x4A0F - Insufficient encryption 0x4A02 - Read not permitted

Returns

  • The following values are returned: void


Definition at line 5276 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_att_desc_resp_t#

void(* rsi_ble_on_att_desc_resp_t)(uint16_t resp_status, rsi_ble_resp_att_descs_t *rsi_ble_resp_att_desc) )(uint16_t resp_status, rsi_ble_resp_att_descs_t *rsi_ble_resp_att_desc)

Callback function for an attribute descriptors response from the module.

Parameters
[out]resp_status

contains the attribute descriptors response information. Refer to rsi_ble_resp_att_descs_s for more information.

This callback function is called whenever an attribute descriptors response is received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Note

  • Attribute protocol error codes 0x4A01 - Invalid Handle 0x4A0A - Attribute not found 0x4A05 - Insufficient authentication 0x4A08 - Insufficient authorization 0x4A0C - Insufficient encryption key size 0x4A0F - Insufficient encryption 0x4A02 - Read not permitted

Returns

  • The following values are returned: void


Definition at line 5301 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_read_resp_t#

void(* rsi_ble_on_read_resp_t)(uint16_t resp_status, uint16_t resp_id, rsi_ble_resp_att_value_t *rsi_ble_resp_att_val) )(uint16_t resp_status, uint16_t resp_id, rsi_ble_resp_att_value_t *rsi_ble_resp_att_val)

Callback function for receiving an attribute value from the module.

Parameters
[out]resp_status

contains the response id because of which, this callback is called response ids: (RSI_BLE_RSP_READ_VAL, RSI_BLE_RSP_READ_BY_UUID, RSI_BLE_RSP_LONG_READ, RSI_BLE_RSP_MULTIPLE_READ)

[out]rsi_ble_resp_att_val

contains the attribute value. Please refer rsi_ble_resp_att_value_s for more information

This callback function is called upon receiving an attribute value from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API. Note

  • Attribute protocol error codes 0x4A01 - Invalid Handle 0x4A0A - Attribute not found 0x4A05 - Insufficient authentication 0x4A08 - Insufficient authorization 0x4A0C - Insufficient encryption key size 0x4A0F - Insufficient encryption 0x4A02 - Read not permitted 0x4A06 - Request not supported 0x4A07 - Invalid offset 0x4A0B - Attribute not Long attribute value has a fixed length that is less than or equal to (ATT_MTU - 1) octets in length , refer to Bluetooth Spec 5.4 for further details.

Returns

  • The following values are returned: void


Definition at line 5333 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_write_resp_t#

void(* rsi_ble_on_write_resp_t)(uint16_t resp_status, uint16_t resp_id) )(uint16_t resp_status, uint16_t resp_id)

Callback function for attribute set/prepare/execute action completion.

Parameters
[out]resp_status

contains the response id because of which, this callback is called response ids: (RSI_BLE_RSP_WRITE, RSI_BLE_RSP_WRITE_NO_ACK, RSI_BLE_RSP_LONG_WRITE, RSI_BLE_RSP_EXECUTE_WRITE)

This callback function is called when an attribute set, prepare, or execute action is completed. It has to be registered using the rsi_ble_gatt_register_callbacks API. Note

  • Attribute protocol error codes 0x4A01 - Invalid Handle 0x4A0A - Attribute not found 0x4A05 - Insufficient authentication 0x4A08 - Insufficient authorization 0x4A0C - Insufficient encryption key size 0x4A0F - Insufficient encryption 0x4A03 - Write not permitted 0x4A07 - Invalid offset
    0x4A0D - Invalid attribute value length


Definition at line 5361 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_gatt_write_event_t#

void(* rsi_ble_on_gatt_write_event_t)(uint16_t event_id, rsi_ble_event_write_t *rsi_ble_write) )(uint16_t event_id, rsi_ble_event_write_t *rsi_ble_write)

Callback function for GATT write, notify, or indicate events from the module.

Parameters
[out]event_id

contains the gatt_write event id (RSI_BLE_EVENT_GATT_WRITE)

[out]rsi_ble_write

contains the GATT event information. Refer to rsi_ble_event_write_s for more information.

This callback function is called when GATT write, notify, or indicate events are received from the module. It has to be registered using the rsi_ble_gatt_register_callbacks API.


Definition at line 5380 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_gatt_prepare_write_event_t#

void(* rsi_ble_on_gatt_prepare_write_event_t)(uint16_t event_id, rsi_ble_event_prepare_write_t *rsi_ble_write) )(uint16_t event_id, rsi_ble_event_prepare_write_t *rsi_ble_write)

This callback function will be called if the GATT write/notify/indicate events are received This callback has to be registered using rsi_ble_gatt_register_callbacks API.

Parameters
[in]event_id

contains the event id (RSI_BLE_EVENT_GATT_NOTIFICATION, RSI_BLE_EVENT_GATT_INDICATION, RSI_BLE_EVENT_GATT_WRITE)

[in]rsi_ble_write

Pointer to a rsi_ble_event_prepare_write_s structure containing detailed information about the GATT prepare write event. This includes the remote device address, attribute handle, value offset, length of the value, and the attribute value itself. Please refer rsi_ble_event_prepare_write_s for more information.


Definition at line 5392 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_execute_write_event_t#

void(* rsi_ble_on_execute_write_event_t)(uint16_t event_id, rsi_ble_execute_write_t *rsi_ble_execute_write) )(uint16_t event_id, rsi_ble_execute_write_t *rsi_ble_execute_write)

The callback function will be called if the GATT write execute events are received.

Parameters
[out]event_id

contains the gatt_execute_write event id (RSI_BLE_EVENT_EXECUTE_WRITE)

[out]rsi_ble_execute_write

Pointer to a rsi_ble_execute_write_s structure containing details about the execute write request. This includes the remote device address and the execute write flag.

This callback has to be registered using rsi_ble_gatt_register_callbacks API.


Definition at line 5404 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_read_req_event_t#

void(* rsi_ble_on_read_req_event_t)(uint16_t event_id, rsi_ble_read_req_t *rsi_ble_read_req) )(uint16_t event_id, rsi_ble_read_req_t *rsi_ble_read_req)

The callback function will be called if the GATT read request events are received.

Parameters
[out]event_id

contains the gatt_read_req_event id (RSI_BLE_EVENT_READ_REQ)

[out]rsi_ble_read_req

Pointer to a rsi_ble_read_req_s structure containing details about the GATT read request. This includes the remote device address, attribute handle, request type, and the offset of the attribute value.

This callback has to be registered using rsi_ble_gatt_register_callbacks API.


Definition at line 5416 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_mtu_event_t#

void(* rsi_ble_on_mtu_event_t)(rsi_ble_event_mtu_t *rsi_ble_event_mtu) )(rsi_ble_event_mtu_t *rsi_ble_event_mtu)

The callback function will be called if MTU size request is received.

Parameters
[out]rsi_ble_event_mtu

contains the MTU size information. Please refer rsi_ble_event_mtu_s for more information.

The MTU size negotiation occurs after establishing a connection, and the callback provides the updated MTU size information.


Definition at line 5426 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_mtu_exchange_info_t#

void(* rsi_ble_on_mtu_exchange_info_t)(rsi_ble_event_mtu_exchange_information_t *rsi_ble_event_mtu_exchange_info) )(rsi_ble_event_mtu_exchange_information_t *rsi_ble_event_mtu_exchange_info)

Callback function called to indicate MTU exchange details.

Parameters
[out]rsi_ble_event_mtu_exchange_info

contains the MTU exchange information. Please refer rsi_ble_event_mtu_exchange_information_s for more information.

This callback provides information about the MTU size negotiation and indicates the initiator of the MTU exchange process (local or remote device). It is triggered during the MTU exchange process after establishing a BLE connection. This callback has to be registered using rsi_ble_gatt_extended_register_callbacks API. Note

  • When services are maintained on the host, this API need to be triggered by the application.


Definition at line 5439 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_remote_device_info_t#

void(* rsi_ble_on_remote_device_info_t)(uint16_t status, rsi_ble_event_remote_device_info_t *resp_buffer) )(uint16_t status, rsi_ble_event_remote_device_info_t *resp_buffer)

Callback function to retrieve remote device information.it provides the version and manufacturer-specific details of a remote device.

Parameters
[out]status

Pointer to a rsi_ble_event_remote_device_info_s structure containing remote device version information, including the version, company ID, and sub-version.

This callback has to be registered using rsi_ble_enhanced_gap_extended_register_callbacks API. Note

  • Refer Bluetooth Generic Error Codes section up to 0x4FF8 from error-codes.


Definition at line 5455 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_rcp_resp_rcvd_t#

void(* rsi_ble_on_rcp_resp_rcvd_t)(uint16_t status, rsi_ble_event_rcp_rcvd_info_t *resp_buffer) )(uint16_t status, rsi_ble_event_rcp_rcvd_info_t *resp_buffer)

Callback function type for receiving RCP response events.

Parameters
N/Astatus

The status of the RCP response event.

N/Aresp_buffer

Pointer to the buffer containing the RCP response information.


Definition at line 5468 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_cbfc_conn_req_event_t#

void(* rsi_ble_on_cbfc_conn_req_event_t)(rsi_ble_event_cbfc_conn_req_t *rsi_ble_cbfc_conn_req) )(rsi_ble_event_cbfc_conn_req_t *rsi_ble_cbfc_conn_req)

Callback function to handle an L2CAP CBFC connection request event.

Parameters
[in]rsi_ble_cbfc_conn_req

contains the connection request information , see rsi_ble_event_cbfc_conn_req_s for more information.

This callback function is called when a Circular Buffer Flow Control (CBFC) connection request is received from a remote BLE device. It provides the necessary connection parameters to process the request. This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.


Definition at line 5486 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_cbfc_conn_complete_event_t#

void(* rsi_ble_on_cbfc_conn_complete_event_t)(rsi_ble_event_cbfc_conn_complete_t *rsi_ble_cbfc_conn_complete, uint16_t status) )(rsi_ble_event_cbfc_conn_complete_t *rsi_ble_cbfc_conn_complete, uint16_t status)

Callback function to indicate L2CAP CBFC connection complete status.

Parameters
[in]status

The status of the connection operation:

  • 0: SUCCESS

  • Non-Zero Value: Error code indicating the reason for the failure.

[in]rsi_ble_cbfc_conn_complete

contains the connection completed information such as psm , mtu , mps , lcid refer rsi_ble_event_cbfc_conn_complete_s for more information.

This callback function will be called when Circular Buffer Flow Control (CBFC) connection has been successfully established or when the connection attempt fails. The function provides detailed information about the connection parameters and the status of the operation. This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.


Definition at line 5504 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_cbfc_rx_data_event_t#

void(* rsi_ble_on_cbfc_rx_data_event_t)(rsi_ble_event_cbfc_rx_data_t *rsi_ble_cbfc_rx_data) )(rsi_ble_event_cbfc_rx_data_t *rsi_ble_cbfc_rx_data)

Callback function to indicate L2CAP CBFC RX data event.

Parameters
[in]rsi_ble_cbfc_rx_data

contains the received data information , see rsi_ble_event_cbfc_rx_data_s

This callback function will be called when data is received over a Circular Buffer Flow Control (CBFC) connection from a remote device. This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.


Definition at line 5516 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_on_cbfc_disconn_event_t#

void(* rsi_ble_on_cbfc_disconn_event_t)(rsi_ble_event_cbfc_disconn_t *rsi_ble_cbfc_disconn) )(rsi_ble_event_cbfc_disconn_t *rsi_ble_cbfc_disconn)

Callback function to indicate L2CAP CBFC disconnection event.

Parameters
[in]rsi_ble_cbfc_disconn

contains the disconnect device information , see rsi_ble_event_cbfc_disconn_s.

This callback function will be called whenever a Circular Buffer Flow Control (CBFC) disconnection event occurs. This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.


Definition at line 5526 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

chip_ble_buffers_stats_handler_t#

void(* chip_ble_buffers_stats_handler_t)(chip_ble_buffers_stats_t *chip_ble_buffers_stats) )(chip_ble_buffers_stats_t *chip_ble_buffers_stats)

Typedef for the chip_ble_buffers_stats_handler_t function pointer.

Parameters
N/Achip_ble_buffers_stats

Pointer to the chip_ble_buffers_stats_t structure that contains the statistics of the BLE buffers.

This function pointer type is used to define a callback function that handles the statistics of the BLE buffers in the chip.


Definition at line 5558 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_report_complete_t#

void(* rsi_ble_ae_report_complete_t)(uint16_t resp_status, rsi_ble_ae_adv_report_t *rsi_ble_event_ae_report) )(uint16_t resp_status, rsi_ble_ae_adv_report_t *rsi_ble_event_ae_report)

Callback function to report the AE Advertisements.

Parameters
[out]rsi_ble_event_ae_report

A pointer to the structure containing AE Adv packets information. It contains important information such PHY rate, Set ID (SID) , event type etc. see rsi_ble_ae_adv_report_s for more information.

[out]resp_status

Status of the event response:

  • 0: SUCCESS

  • Non-zero: Error code

This callback function will be called when AE adv report event is received. This callback has to be registered using rsi_ble_ae_events_register_callbacks API.


Definition at line 5571 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_per_adv_sync_estbl_t#

void(* rsi_ble_ae_per_adv_sync_estbl_t)(uint16_t resp_status, rsi_ble_per_adv_sync_estbl_t *rsi_ble_event_per_adv_sync_estbl) )(uint16_t resp_status, rsi_ble_per_adv_sync_estbl_t *rsi_ble_event_per_adv_sync_estbl)

Callback function to report the AE periodic sync established event.

Parameters
[out]rsi_ble_event_per_adv_sync_estbl

A pointer to the structure containing AE periodic sync established information. Such as status of sync indicating whether Periodic Advertising is successful or not see rsi_ble_per_adv_sync_estbl_s for more information.

[out]resp_status

Status of the event response:

  • 0: SUCCESS

  • Non-zero: Error code

This callback function will be called when AE periodic sync established event is received. This callback has to be registered using rsi_ble_ae_events_register_callbacks API.


Definition at line 5585 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_per_adv_report_t#

void(* rsi_ble_ae_per_adv_report_t)(uint16_t resp_status, rsi_ble_per_adv_report_t *rsi_ble_event_per_adv_report) )(uint16_t resp_status, rsi_ble_per_adv_report_t *rsi_ble_event_per_adv_report)

Callback function to report the AE periodic advertisement event This callback function will be called when AE periodic advertisement event is received This callback has to be registered using rsi_ble_ae_events_register_callbacks API.

Parameters
[out]rsi_ble_event_per_adv_report

A pointer to the structure containing AE periodic advertisement, report information such as sync_handle, tx_power, RSSI, data etc. Refer to rsi_ble_per_adv_report_s for more information.

[out]resp_status

Status of the event response:

  • 0: SUCCESS

  • Non-zero: Error code


Definition at line 5599 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_per_adv_sync_lost_t#

void(* rsi_ble_ae_per_adv_sync_lost_t)(uint16_t resp_status, rsi_ble_per_adv_sync_lost_t *rsi_ble_event_per_adv_sync_lost) )(uint16_t resp_status, rsi_ble_per_adv_sync_lost_t *rsi_ble_event_per_adv_sync_lost)

Callback function to report the AE periodic sync lost event This callback function will be called when AE periodic sync lost event is received This callback has to be registered using rsi_ble_ae_events_register_callbacks API.

Parameters
[out]rsi_ble_event_per_adv_sync_lost

A pointer to the structure containing AE periodic sync lost information of sync handle on which adv sync is lost , see rsi_ble_per_adv_sync_lost_s for more information.

[out]resp_status

Status of the event response:

  • 0: SUCCESS

  • Non-zero: Error code


Definition at line 5613 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_scan_timeout_t#

void(* rsi_ble_ae_scan_timeout_t)(uint16_t resp_status, rsi_ble_scan_timeout_t *rsi_ble_event_scan_timeout) )(uint16_t resp_status, rsi_ble_scan_timeout_t *rsi_ble_event_scan_timeout)

Callback function to report the AE scan timeout event This callback function will be called when AE scan timeout event is received This callback has to be registered using rsi_ble_ae_events_register_callbacks API.

Parameters
[out]rsi_ble_event_scan_timeout

A pointer to the structure containing AE scan timeout information. Such as status indicating that scanning has ended because the duration has expired, see rsi_ble_scan_timeout_s for more information.

[out]resp_status

Status of the event response:

  • 0: SUCCESS

  • Non-zero: Error code


Definition at line 5627 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_adv_set_terminated_t#

void(* rsi_ble_ae_adv_set_terminated_t)(uint16_t resp_status, rsi_ble_adv_set_terminated_t *rsi_ble_event_adv_set_terminated) )(uint16_t resp_status, rsi_ble_adv_set_terminated_t *rsi_ble_event_adv_set_terminated)

Callback function to report the AE advertising set terminated event This callback function will be called when AE advertising set terminated is received.

Parameters
[out]rsi_ble_event_adv_set_terminated

A pointer to the structure containing the AE advertising set terminated information about status on advertisement termination, adv handle, connection handle, number of AE events see rsi_ble_adv_set_terminated_s for more information.

[out]resp_status

Status of the event response:

  • 0: SUCCESS

  • Non-zero: Error code

This callback has to be registered using rsi_ble_ae_events_register_callbacks API.


Definition at line 5641 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_scan_req_recvd_t#

void(* rsi_ble_ae_scan_req_recvd_t)(uint16_t resp_status, rsi_ble_scan_req_recvd_t *rsi_ble_event_scan_req_recvd) )(uint16_t resp_status, rsi_ble_scan_req_recvd_t *rsi_ble_event_scan_req_recvd)

Callback function to report the AE scan request received event This callback function will be called when AE scan request is received.

Parameters
[out]rsi_ble_event_scan_req_recvd

A pointer to the structure containing AE scan request information about the received scan request, including the advertising set handle and scanner details. Refer to rsi_ble_scan_req_recvd_s for detailed information

[out]resp_status

Status of the event response:

  • 0: SUCCESS

  • Non-zero: Error code

it provides AE scan request information. This callback has to be registered using rsi_ble_ae_events_register_callbacks API


Definition at line 5657 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

Function Documentation#

rsi_convert_db_to_powindex#

uint8_t rsi_convert_db_to_powindex (int8_t tx_power_in_dBm)

Converts the given transmit power in dBm to power index.

Parameters
N/Atx_power_in_dBm

The transmit power in dBm.

This function takes a transmit power value in dBm and converts it to a power index value. The power index is used to set the transmit power level in the BLE module.

Returns

  • The power index corresponding to the given transmit power.


Definition at line 1926 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_random_address#

int32_t rsi_ble_set_random_address (void )

Request the local device to set a random address.

Parameters
N/A

This is a blocking API.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command

Note


Definition at line 1944 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_random_address_with_value#

int32_t rsi_ble_set_random_address_with_value (uint8_t * random_addr)

Request the local device to set a given random address.

Parameters
[in]random_addr

- random address of the device to be set

This is a blocking API.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command

Note


Definition at line 1960 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_start_advertising#

int32_t rsi_ble_start_advertising (void )

Request the local device to start advertising.

Parameters
N/A

This is a blocking API. A received event rsi_ble_on_enhance_connect_t/ rsi_ble_on_connect_t indicates remote device given ble connect command and got connected

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments

Note


Definition at line 1979 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_start_advertising_with_values#

int32_t rsi_ble_start_advertising_with_values (const void * rsi_ble_adv)

Request the local device to start advertising with specified values.

Parameters
[in]rsi_ble_adv

- This structure pointer holds the information of advertising values. This variable is the pointer of the rsi_ble_req_adv_s structure.

This is a blocking API. A received event rsi_ble_on_enhance_connect_t/ rsi_ble_on_connect_t indicates remote device given ble connect command and got connected

  • Pre-condition: Call sl_wifi_init() before calling this API, this is a blocking API.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments

Note


Definition at line 1998 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_encrypt#

int32_t rsi_ble_encrypt (const uint8_t * key, const uint8_t * data, uint8_t * resp)

Encrypt the plain text data fed by the user using the key provided, it uses the AES-128 bit block cypher a logo to generate encrypted data, refer to Bluetooth Spec 5.4 for further details.

Parameters
[in]key

- 16 Bytes key for Encryption of data.

[in]data

- 16 Bytes of Data request to encrypt.

[out]resp

- Encrypted data

  • Pre-conditions: Call sl_wifi_init() before calling this API, this is a blocking API.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command

Note


Definition at line 2016 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_stop_advertising#

int32_t rsi_ble_stop_advertising (void )

Stop advertising, this is a Blocking API.

Parameters
N/A

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments

Note


Definition at line 2033 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_advertise_data#

int32_t rsi_ble_set_advertise_data (const uint8_t * data, uint16_t data_len)

Set the advertising data.

Parameters
[in]data

- Advertising data.

[in]data_len

- Total length of advertising data.

This is a blocking API.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes .

  • The maximum length of advertising data payload is 31 bytes.

  • The basic format of advertising payload record contains length and data.


Definition at line 2052 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_scan_response_data#

int32_t rsi_ble_set_scan_response_data (const uint8_t * data, uint16_t data_len)

Request the local device to set the scan response data, this is a Blocking API.

Parameters
[in]data

- Data about to be sent

[in]data_len

- Length of data, which is about to be sent

  • Pre-conditions: Call sl_wifi_init() before calling this API, this is a Blocking API.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command

Note


Definition at line 2069 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_start_scanning#

int32_t rsi_ble_start_scanning (void )

Start scanning, this is a Blocking API A received event rsi_ble_on_adv_report_event_t indicates advertise report of remote device received.

Parameters
N/A
  • Pre-condition: Call sl_wifi_init() before calling this API, this is a Blocking API.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments

Note


Definition at line 2087 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_start_scanning_with_values#

int32_t rsi_ble_start_scanning_with_values (void * rsi_ble_scan_params)

Start scanning with values.

Parameters
[in]rsi_ble_scan_params

- BLE scan parameters structure please refer rsi_ble_req_scan_s structure for more info

This is a blocking API. A received event rsi_ble_on_adv_report_event_t indicates the advertise report of a remote device received.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure 0x4E0C - Command disallowed 0x4046 - Invalid Arguments

Note


Definition at line 2104 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_stop_scanning#

int32_t rsi_ble_stop_scanning (void )

Stop scanning.

Parameters
N/A

This is a blocking API

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed

Note


Definition at line 2120 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_connect_with_params#

int32_t rsi_ble_connect_with_params (uint8_t remote_dev_addr_type, const int8_t * remote_dev_addr, uint16_t scan_interval, uint16_t scan_window, uint16_t conn_interval_max, uint16_t conn_interval_min, uint16_t conn_latency, uint16_t supervision_tout)

Connect to the remote BLE device with the user configured parameters.

Parameters
[in]remote_dev_addr_type

- AddressType - Specifies the type of the address mentioned in BD Address

  • 0 - Public Address

  • 1 - Random Address

[in]remote_dev_addr

- This parameter describes the device address of remote device

[in]scan_interval

- LE Scan Interval : N=0xXXXX

  • It is defined as the time interval from when the Controller started its last LE scan until it begins the subsequent LE scan.

  • Range: 0x0004 to 0x4000

  • Time = N * 0.625 msec

  • Time Range: 2.5 msec to 10 . 24 seconds

[in]scan_window

- LE Scan Window : N=0xXXXX

  • Amount of time for the duration of the LE scan. LE_Scan_Window must be less than or equal to LE_Scan_Interval

  • Range: 0x0004 to 0x4000

  • Time = N * 0.625 msec

  • Time Range: 2.5 msec to 10 . 24 seconds

[in]conn_interval_max

- Max Connection Interval : N=0xXXXX

  • Minimum value for the connection event interval, which must be greater than or equal to Conn_Interval_Min.

  • Range: 0x0006 to 0x0C80

  • Time = N * 1.25 msec

  • Time Range: 7.5 msec to 4 seconds.

  • 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use

[in]conn_interval_min

- Min Connection Interval : N=0xXXXX

  • Minimum value for the connection event interval, which must be greater than or equal to Conn_Interval_Max.

  • Range: 0x0006 to 0x0C80

  • Time = N * 1.25 msec

  • Time Range: 7.5 msec to 4 seconds.

  • 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use

[in]conn_latency

- Connection Latency : N = 0xXXXX

  • Peripheral latency for the connection in number of connection events.

  • Range: 0x0000 to 0x01F4

[in]supervision_tout

- Supervision Timeout : N = 0xXXXX

  • Supervision timeout for the LE Link.

  • Range: 0x000A to 0x0C80

  • Time = N * 10 msec

  • Time Range: 100 msec to 32 seconds

  • 0x0000 - 0x0009 and 0x0C81 - 0xFFFF - Reserved for future use

This is a blocking API, a received event rsi_ble_on_enhance_connect_t / rsi_ble_on_connect_t indicates that the connection successful and a received event rsi_ble_on_disconnect_t indicates that connection failures have occurred.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E0C - Command disallowed

    • 0x4046 - Invalid Arguments

Note

  • If a connection can't be established, for example, the remote device has gone out of range, has entered into deep sleep, or is not advertising, the stack will try to connect forever. In this case, the application will not get an event related to the connection request.

  • To recover from this situation, the application can implement a timeout and call rsi_ble_connect_cancel() to cancel the connection request. Subsequent calls of this command have to wait for the ongoing command to complete.

  • Refer to the Status Codes section for the above error codes at additional-status-codes .


Definition at line 2187 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_connect#

int32_t rsi_ble_connect (uint8_t remote_dev_addr_type, const int8_t * remote_dev_addr)

Connect to the remote BLE device.

Parameters
[in]remote_dev_addr_type

- This parameter describes the address type of the remote device

[in]remote_dev_addr

- This parameter describes the device address of the remote device

This is a blocking API, a received event rsi_ble_on_enhance_connect_t/ rsi_ble_on_connect_t indicates that the connection successful and a received event rsi_ble_on_disconnect_t indicates that connection failures have occurred.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure 0x4E0C - Command disallowed 0x4046 - Invalid Arguments

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes .

  • If a connection can't be established, for example, the remote device has gone out of range, has entered into deep sleep, or is not advertising,

  • The stack will try to connect forever. In this case, the application will not get an event related to the connection request.

  • To recover from this situation, the application can implement a timeout and call rsi_ble_connect_cancel() to cancel the connection request.

  • Subsequent calls of this command have to wait for the ongoing command to complete.


Definition at line 2217 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_enhance_connect_with_params#

int32_t rsi_ble_enhance_connect_with_params (void * ble_enhance_conn_params)

Connect to the remote BLE device with the user configured parameters.

Parameters
[in]ble_enhance_conn_params

- BLE enhance connection parameter structure. See notes for the fields in this structure.

Returns

  • The following values are returned:

    • - 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 - Buffer not available to serve the command 0x4E0C - Command disallowed 0x4046 - Invalid Arguments

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes.

  • The following fields are included in the ble_enhance_conn_params parameter structure:

    • dev_addr_type - Address type of the device to connect.

      • 0 - Public Address

      • 1 - Random Address

    • dev_addr - Address of the device to connect.

    • filter_policy - Policy used to determine whether the filter accept list is used.

      • 0 - Filter accept list is not used to determine which advertiser to connect to.

      • 1 - Filter accept list is used to determine which advertiser to connect to.

    • own_addr_type - Own address type

    • le_scan_interval - The time interval from when the Controller started its last LE scan until it begins the subsequent LE scan.

      • Range: 0x0004 to 0x4000

      • Time = le_scan_interval * 0.625 msec

      • Time Range: 2.5 msec to 10 . 24 seconds

    • le_scan_window - Amount of time for the duration of the LE scan. This must be less than or equal to le_scan_interval.

      • Range: 0x0004 to 0x4000

      • Time = le_scan_window * 0.625 msec

      • Time Range: 2.5 msec to 10.24 seconds

    • conn_interval_min - Minimum value for the connection event interval. This must be greater than or equal to conn_interval_max.

      • Range: 0x0006 to 0x0C80

      • Time = conn_interval_min * 1.25 msec

      • Time Range: 7.5 msec to 4 seconds.

      • 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use

    • conn_interval_max - Maximum value for the connection event interval. This must be greater than or equal to conn_interval_min.

      • Range: 0x0006 to 0x0C80

      • Time = conn_interval_max * 1.25 msec

      • Time Range: 7.5 msec to 4 seconds.

      • 0x0000 - 0x0005 and 0x0C81 - 0xFFFF - Reserved for future use

    • conn_latency - Peripheral latency for the connection in number of connection events.

      • Range: 0x0000 to 0x01F4

    • supervision_tout - Supervision timeout for the LE Link.

      • Range: 0x000A to 0x0C80

      • Time = N * 10 msec

      • Time Range: 100 msec to 32 seconds

      • 0x0000 - 0x0009 and 0x0C81 - 0xFFFF - Reserved for future use

    • min_ce_length - Minimum length of connection event recommended for this LE connection.

      • Range: 0x0000 to 0xFFFF

      • Time = N * 0.625 msec

    • max_ce_length - Maximum length of connection event recommended for this LE connection.

      • Range: 0x0000 to 0xFFFF

      • Time = N * 0.625 msec


Definition at line 2275 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_connect_cancel#

int32_t rsi_ble_connect_cancel (const int8_t * remote_dev_address)

Cancel the connection to the remote BLE device.

Parameters
[in]remote_dev_address

- This parameter describes the device address of the remote device

This is a blocking API, A received event rsi_ble_on_disconnect_t indicates disconnect complete.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E0C - Command disallowed

    • 0x4046 - Invalid Arguments

    • 0x4E02 - Unknown Connection Identifier

Note


Definition at line 2293 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_disconnect#

int32_t rsi_ble_disconnect (const int8_t * remote_dev_address)

Disconnect with the remote BLE device.

Parameters
[in]remote_dev_address

- This parameter describes the device address of the remote device

This is a blocking API.

Returns

  • The following values are returned: 0 - Success Non-Zero Value - Failure 0x4E0C - Command disallowed 0x4D05 - BLE socket not available 0x4E62 - Invalid Parameters 0x4D04- BLE not connected

Note


Definition at line 2311 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_device_state#

int32_t rsi_ble_get_device_state (uint8_t * resp)

Get the local device state.

Parameters
[out]resp

- This is an output parameter which consists of local device state. This is a 1-byte value. The possible states are described below: BIT(0) Advertising state BIT(1) Scanning state BIT(2) Initiating state BIT(3) Connected state BIT(4) Extended Advertising state BIT(5) Extended Scanning state BIT(6) Extended Initiating state

This is a blocking API. The state value is filled in "resp".

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

Note


Definition at line 2335 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_smp_pairing_cap_data#

int32_t rsi_ble_set_smp_pairing_cap_data (rsi_ble_set_smp_pairing_capabilty_data_t * smp_pair_cap_data)

Set the SMP Pairing Capability of local device.

Parameters
[in]smp_pair_cap_data

- This structure pointer holds the information of the SMP capability data values please refer rsi_ble_set_smp_pairing_capabilty_data structure for more info

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

Note


Definition at line 2352 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_local_irk_value#

int32_t rsi_ble_set_local_irk_value (const uint8_t * l_irk)

Set the IRK value to the local device.

Parameters
[in]l_irk

- l_irk Pointer to local_irk

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 2366 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_conn_param_resp#

int32_t rsi_ble_conn_param_resp (const uint8_t * remote_dev_address, uint8_t status)

Give the response for the remote device connection parameter request.

Parameters
[in]remote_dev_address

- remote device address

[in]status

- accept or reject the connection parameters update request

  • 0 - ACCEPT,

  • 1 - REJECT

This is a blocking API. A received event rsi_ble_on_conn_update_complete_t indicates connection update procedure is successful.

  • Pre-conditions: rsi_ble_connect() API needs to be called before this API. rsi_ble_on_remote_conn_params_request_event should be called by the application.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E0C - Command disallowed

    • 0x4046 - Invalid Arguments

    • 0x4E02 - Unknown Connection Identifier

Note


Definition at line 2388 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_smp_pair_request#

int32_t rsi_ble_smp_pair_request (uint8_t * remote_dev_address, uint8_t io_capability, uint8_t mitm_req)

Request the SMP pairing process with the remote device.

Parameters
[in]remote_dev_address

- MITM enable/disable

  • 0 - Disable

  • 1 - Enable

[in]io_capability

- This is the device input output capability

N/Amitm_req

This is a blocking API.

  • A received event rsi_ble_on_smp_request_t indicated remote device is given Security Request and need to respond back with rsi_ble_smp_pair_request

  • A received event rsi_ble_on_smp_response_t indicated remote device is given SMP Pair Request and need to respond back with rsi_ble_smp_pair_response

  • A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed

  • 0x00 - Display Only

  • 0x01 - Display Yes/No

  • 0x02 - Keyboard Only

  • 0x03 - No Input No Output Returns

    • The following values are returned:

  • 0 - Success

  • Non-Zero Value - Failure

  • If the return value is less than 0

  • -4 - Buffer not available to serve the command

  • 0x4D05 BLE socket not available

  • 0x4E62 Invalid Parameters

  • 0x4D04 BLE not connected Note


Definition at line 2418 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_smp_pair_failed#

int32_t rsi_ble_smp_pair_failed (uint8_t * remote_dev_address, uint8_t reason)

Send SMP pairing failure reason to the remote device.

Parameters
[in]remote_dev_address

- This is the remote device address

[in]reason

- This is the reason for SMP Pairing Failure

  • 0x05 - Pairing Not Supported

  • 0x08 - Unspecified Reason

  • 0x09 - Repeated Attempts

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command


Definition at line 2437 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ltk_req_reply#

int32_t rsi_ble_ltk_req_reply (uint8_t * remote_dev_address, uint8_t reply_type, const uint8_t * ltk)

Send the local long term key of its associated local EDIV and local Rand.

Parameters
[in]remote_dev_address

- remote device address

[in]reply_type

- 0 - Negative reply

  • BIT(0) - Positive Reply (Encryption Enabled)

  • BIT(1) - Un authenticated LTK or STK-based Encryption Enabled

  • BIT(2) - Authenticated LTK or STK-based Encryption Enabled

  • BIT(3) - Authenticated LTK with LE Secure Connections based Encryption Enabled

  • BIT(4) to BIT(6) - Reserved for Future use

  • BIT(7) - LE Secure Connection Enabled

[in]ltk

- Long Term Key 16 bytes

This is a blocking API.

  • A received event rsi_ble_on_encrypt_started_t indicated encrypted event is received from module

  • A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed Returns

    • The following values are returned:

  • 0 - Success

  • Non-Zero Value - Failure

  • If the return value is less than 0

  • -4 - Buffer not available to serve the command

  • 0x4D05 BLE socket not available

  • 0x4E62 Invalid Parameters

  • 0x4D04 BLE not connected Note


Definition at line 2465 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_smp_pair_response#

int32_t rsi_ble_smp_pair_response (uint8_t * remote_dev_address, uint8_t io_capability, uint8_t mitm_req)

Send SMP pairing response during the process of pairing with the remote device.

Parameters
[in]remote_dev_address

- This is the remote device address

[in]io_capability

- This is the device input output capability 0x00 - Display Only 0x01 - Display Yes/No 0x02 - Keyboard Only 0x03 - No Input No Output

[in]mitm_req

- MITM Request info

  • 0 - Disable

  • 1 - Enable

This is a blocking API.


Definition at line 2496 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_smp_passkey#

int32_t rsi_ble_smp_passkey (uint8_t * remote_dev_address, uint32_t passkey)

Send SMP passkey during SMP pairing process with the remote device.

Parameters
[in]remote_dev_address

- This is the remote device address

[in]passkey

- This is the key required in pairing process

This is a Blocking API A received event rsi_ble_on_encrypt_started_t indicated encrypted event is received from module A received event rsi_ble_on_le_security_keys_t indicates exchange of security keys completed after encryption A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

    • 0x4D05 BLE socket not available

    • 0x4E62 Invalid Parameters

    • 0x4D04 BLE not connected

Note


Definition at line 2520 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_le_ping_timeout#

int32_t rsi_ble_get_le_ping_timeout (uint8_t * remote_dev_address, uint16_t * time_out)

Get the timeout value of the LE ping.

Parameters
[in]remote_dev_address

- This is the remote device address

[out]time_out

- This a response parameter which holds timeout value for authentication payload command.

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

    • 0x4D05 BLE socket not available

    • 0x4E62 Invalid Parameters

    • 0x4D04 BLE not connected

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes .

  • Currently Get ping is not supported.


Definition at line 2542 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_le_ping_timeout#

int32_t rsi_ble_set_le_ping_timeout (uint8_t * remote_dev_address, uint16_t time_out)

Set the timeout value of the LE ping.

Parameters
[in]remote_dev_address

- This is the remote device address

[out]time_out

- This input parameter sets timeout value for authentication payload command.(in milliseconds)

This is a blocking API. A received event of rsi_ble_on_le_ping_payload_timeout_t indicates LE ping payload timeout expired

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

    • 0x4D05 BLE socket not available

    • 0x4E62 Invalid Parameters

    • 0x4D04 BLE not connected

Note


Definition at line 2564 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_clear_acceptlist#

int32_t rsi_ble_clear_acceptlist (void )

Clear all the BD address present in accept list.

Parameters
N/A

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

Note


Definition at line 2579 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_addto_acceptlist#

int32_t rsi_ble_addto_acceptlist (const int8_t * dev_address, uint8_t dev_addr_type)

Add BD address to accept list.

Parameters
[in]dev_address

- Address of the device which is going to add in accept list

[in]dev_addr_type

- address type of BD address

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

Note

  • Maximum number of device address that firmware can store is 10. Refer to the Status Codes section for the above error codes at additional-status-codes .


Definition at line 2597 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_deletefrom_acceptlist#

int32_t rsi_ble_deletefrom_acceptlist (const int8_t * dev_address, uint8_t dev_addr_type)

Delete particular BD address from accept list.

Parameters
[in]dev_address

- Address of the device which is going to delete from accept list

[in]dev_addr_type

- address type of BD address

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

Note


Definition at line 2614 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_resolvlist#

int32_t rsi_ble_resolvlist (uint8_t process_type, uint8_t remote_dev_addr_type, uint8_t * remote_dev_address, const uint8_t * peer_irk, const uint8_t * local_irk)

Resolvlist API used for multiple purposes based on the process type.

Parameters
[in]process_type

- Indicates which type of process this is, as follows: 1 - add a device to the resolve list 2 - remove a device from the resolve list 3 - clear the entire resolve list

[in]remote_dev_addr_type

- typr of the remote device address

[in]remote_dev_address

- remote device address 0 - Public identity address 1 - Random (static) identity address

[in]peer_irk

- 16-byte IRK of the peer device

[in]local_irk

- 16-byte IRK of the local device

It will be used to add/remove/clear a device to/from the list. This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

Note


Definition at line 2642 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_resolving_list_size#

int32_t rsi_ble_get_resolving_list_size (uint8_t * resp)

Request to get resolving list size.

Parameters
[out]resp

- output parameter which consists of supported resolving the list size.

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 : Buffer not available to serve the command

Note


Definition at line 2662 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_addr_resolution_enable#

int32_t rsi_ble_set_addr_resolution_enable (uint8_t enable, uint16_t tout)

Request to enable address resolution, and to set resolvable private address timeout.

Parameters
[in]enable

- the period for changing address of our local device in seconds Value ranges from 0x0001 to 0xA1B8 (1 s to approximately 11.5 hours)

N/Atout

This is a blocking API.

  • 0 - disables address resolution Returns

    • The following values are returned:

      • 0 - Success

      • Non-Zero Value - Failure

      • If the return value is less than 0

      • -4 : Buffer not available to serve the command


Definition at line 2680 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_privacy_mode#

int32_t rsi_ble_set_privacy_mode (uint8_t remote_dev_addr_type, uint8_t * remote_dev_address, uint8_t privacy_mode)

Request to set privacy mode for particular device, this is a Blocking API.

Parameters
[in]remote_dev_addr_type

- type of the remote device address 0 - Public Identity Address 1 - Random (static) Identity Address

[in]remote_dev_address

- remote device address

[in]privacy_mode

- type of the privacy mode 0 - Network privacy mode 1 - Device privacy mode

Returns

  • The following values are returned: 0 - Success Non-Zero Value - Failure If the return value is less than 0 -4 : Buffer not available to serve the command

Note


Definition at line 2702 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_readphy#

int32_t rsi_ble_readphy (const int8_t * remote_dev_address, rsi_ble_resp_read_phy_t * resp)

Reads the TX and RX PHY rates of the Connection.

Parameters
[in]remote_dev_address

- remote device address

[out]resp

- pointer to store the response please refer rsi_ble_resp_read_phy_s structure for more info.

This is a blocking API.

Returns

  • The following values are returned: 0 - Success Non-Zero Value - Failure

Note


Definition at line 2717 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_setphy#

int32_t rsi_ble_setphy (const int8_t * remote_dev_address, uint8_t tx_phy, uint8_t rx_phy, uint16_t coded_phy)

Set TX and RX PHY.

Parameters
[in]remote_dev_address

- remote device address

[in]tx_phy

- transmit PHY rate BIT(0) - Host prefers to use the LE 1M transmitter PHY (possibly among others)

  • BIT(1) - Host prefers to use the LE 2M transmitter PHY (possibly among others)

  • BIT(2) - Host prefers to use the LE Coded transmitter PHY (possibly among others)

  • BIT(3) - BIT(7) Reserved for future use

[in]rx_phy

- receive PHY rate BIT(0) - Host prefers to use the LE 1M receiver PHY (possibly among others)

  • BIT(1) - Host prefers to use the LE 2M receiver PHY (possibly among others)

  • BIT(2) - Host prefers to use the LE Coded receiver PHY (possibly among others)

  • BIT(3) - BIT(7) Reserved for future use

[in]coded_phy

- TX/RX coded PHY rate

  • 0 = Host has no preferred coding when transmitting on the LE Coded PHY

This is a blocking API. A received event rsi_ble_on_phy_update_complete_t indicates PHY rate update complete.

  • 1 = Host prefers that S=2 coding be used when transmitting on the LE Coded PHY

  • 2 = Host prefers that S=8 coding be used when transmitting on the LE Coded PHY

  • 3 = Reserved for future use Returns

    • The following values are returned: 0 - Success Non-Zero Value - Failure 0x4D05 BLE socket not available 0x4E62 Invalid Parameters 0x4D04 BLE not connected

    Note


Definition at line 2751 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_conn_params_update#

int32_t rsi_ble_conn_params_update (const uint8_t * remote_dev_address, uint16_t min_int, uint16_t max_int, uint16_t latency, uint16_t timeout)

Requests the connection parameters change with the remote device, When the Silicon Labs device acts as a central, this API is used to update the connection parameters.

Parameters
[in]remote_dev_address

- remote device address

[in]min_int

- minimum value for the connection interval. this shall be less than or equal to max_int .

[in]max_int

- maximum value for the connection interval. this shall be greater than or equal to min_int.

[in]latency

- peripheral latency for the connection in number of connection events. Ranges from 0 to 499

[in]timeout

- supervision timeout for the LE Link. Ranges from 10 to 3200 (Time = N * 10 ms, Time Range: 100 ms to 32 s)

When the Silicon Labs device acts as a peripheral, this API is used to request the central to initiate the connection update procedure. This is a blocking API. A received event rsi_ble_on_conn_update_complete_t indicates connection parameters update complete.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D05 BLE socket not available

    • 0x4E62 Invalid Parameters

    • 0x4D04 BLE not connected

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes.

  • min_int and max_int values ranges from 6 to 3200 (Time = N * 1.25 ms, Time Range: 7.5 ms to 4 s) latency : If latency value is greater than 32 ,Limiting the peripheral latency value to 32 Max supported peripheral latency is 32 when Device is in peripheral Role.


Definition at line 2787 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_data_len#

int32_t rsi_ble_set_data_len (uint8_t * remote_dev_address, uint16_t tx_octets, uint16_t tx_time)

Sets the TX octets and the TX time of specified link (remote device connection), this is a Blocking API.

Parameters
[in]remote_dev_address

- remote device device

[in]tx_octets

- preferred maximum number of payload octets that the local Controller should include in a single Link Layer packet on this connection.

[in]tx_time

- preferred maximum number of microseconds that the local Controller should use to transmit a single Link Layer packet on this connection.

A received event rsi_ble_on_data_length_update_t indicates data length update complete.

Returns

  • The following values are returned:

    • 0 - LE_Set_Data_Length command succeeded.

    • Non-Zero Value - Failure

    • 0x4D05 BLE socket not available

    • 0x4E62 Invalid Parameters

    • 0x4D04 BLE not connected

Note


Definition at line 2813 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_read_max_data_len#

int32_t rsi_ble_read_max_data_len (rsi_ble_read_max_data_length_t * blereaddatalen)

reads the max supported values of TX octets, TX time, RX octets and Rx time.

Parameters
[out]blereaddatalen

- pointer to structure variable, Please refer rsi_ble_resp_read_max_data_length_s structure for more info.

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - command success

    • Non-Zero Value - Failure

Note


Definition at line 2828 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_rx_test_mode#

int32_t rsi_ble_rx_test_mode (uint8_t rx_channel, uint8_t phy, uint8_t modulation)

Start the BLE RX test mode in controller.

Parameters
[in]rx_channel

- Channel in which packet have to be received (0 - 39)

[in]phy

- 0x00 Reserved for future use 0x01 Receiver set to use the LE 1M PHY 0x02 Receiver set to use the LE 2M PHY 0x03 Receiver set to use the LE Coded PHY (0x04 - 0xFF) Reserved for future use.

[in]modulation

- 0x00 Assume transmitter would have a standard standard modulation index 0x01 Assume transmitter would have a stable modulation index (0x02 - 0xFF) Reserved for future use

This is a blocking API. Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 2853 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_tx_test_mode#

int32_t rsi_ble_tx_test_mode (uint8_t tx_channel, uint8_t phy, uint8_t tx_len, uint8_t mode)

Start the BLE TX test mode in controller.

Parameters
[in]tx_channel

- RF Channel (0-39).

[in]phy

- 0x00 Reserved for future use

  • 0x01 Transmitter set to use the LE 1M PHY

  • 0x02 Transmitter set to use the LE 2M PHY

  • 0x03 Transmitter set to use the LE Coded PHY with S = 8 data coding

  • 0x04 Transmitter set to use the LE Coded PHY with S = 2 data coding

  • (0x05 - 0xFF) Reserved for future use.

[in]tx_len

- Length in bytes of payload data in each packet ( 1 - 251 bytes).

[in]mode

- 0x00 PRBS9 sequence '11111111100000111101...'

  • 0x01 Repeated '11110000'

  • 0x02 Repeated '10101010'

  • 0x03 PRBS15

  • 0x04 Repeated '11111111'

  • 0x05 Repeated '00000000'

    • 0x06 Repeated '00001111'

    • 0x07 Repeated '01010101'

  • 0x08 - 0xFF Reserved for future use

This is a blocking API. Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 2882 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_end_test_mode#

int32_t rsi_ble_end_test_mode (uint16_t * num_of_pkts)

Stop the BLE TX / RX test mode in controller.

Parameters
[out]num_of_pkts

- Number of RX packets received are displayed when RX test is stopped

This is a blocking API. Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 2894 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_per_transmit#

int32_t rsi_ble_per_transmit (struct rsi_ble_per_transmit_s * rsi_ble_per_tx)

Initiate the BLE transmit PER mode in the controller.

Parameters
[in]rsi_ble_per_tx

- This parameter is the buffer to hold the structure values This is a structure variable of struct rsi_ble_per_transmit_s

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 2909 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_per_receive#

int32_t rsi_ble_per_receive (struct rsi_ble_per_receive_s * rsi_ble_per_rx)

Initiate the BLE receive PER mode in the controller.

Parameters
[in]rsi_ble_per_rx

- This parameter is the buffer to hold the structure values This is a structure variable of struct rsi_ble_per_receive_s

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 2924 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_accept_list_using_adv_data#

int32_t rsi_ble_accept_list_using_adv_data (uint8_t enable, uint8_t data_compare_index, uint8_t len_for_compare_data, const uint8_t * payload)

Give vendor-specific command to set the acceptlist feature based on the advertisers advertising payload, this is a Blocking API.

Parameters
[in]enable

- enable/disable

[in]data_compare_index

- the starting index of the data to compare

[in]len_for_compare_data

- total length of data to compare

[in]payload

- Payload

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

    • 0x4E62 Invalid Parameters

Note


Definition at line 2952 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

BT_LE_ADPacketExtract#

void BT_LE_ADPacketExtract (uint8_t * remote_name, const uint8_t * pbuf, uint8_t buf_len)

Used to extract remote Bluetooth device name from the received advertising report.

Parameters
[in]remote_name

- device name

[in]pbuf

- advertise data packet buffer pointer

[in]buf_len

- buffer length


Definition at line 2968 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_start_encryption#

int32_t rsi_ble_start_encryption (uint8_t * remote_dev_address, uint16_t ediv, const uint8_t * rand, const uint8_t * ltk)

Start the encryption process with the remote device.

Parameters
[in]remote_dev_address

- Remote BD address in string format

[in]ediv

- remote device ediv value.

[in]rand

- remote device rand value.

[in]ltk

- remote device ltk value.

This is a blocking API. A received event rsi_ble_on_encrypt_started_t indicated encrypted event is received from module. A received event rsi_ble_on_le_security_keys_t indicates exchange of security keys completed after encryption. A received event rsi_ble_on_smp_failed_t indicated SMP procedure have failed.

  • Pre-conditions:

    • Encryption enabled event should come before calling this API for second time SMP connection.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

    • -4 - Buffer not available to serve the command

    • 0x4D05 BLE socket not available

    • 0x4E62 Invalid Parameters

    • 0x4D04 BLE not connected

Note


Definition at line 2994 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_ble_tx_power#

int32_t rsi_ble_set_ble_tx_power (int8_t tx_power)

Set TX power.

Parameters
[in]tx_power

Power value

Returns

  • The following values are returned:

    • 0 - Success

    • Non-zero value - Failure

    • 0x4E02 - Unknown connection identifier

    • 0x4E01 - Unknown HCI command

    • 0x4E0C - Command disallowed

    • 0x4046 - Invalid arguments

    • 0x4D04 - BLE not connected

    • 0x4D14 - BLE parameter out of mandatory range

    • 0x4D15 - Unsuported power index for 915

Note

  • This is a Blocking API.

  • Refer to the Status Codes section for the above error codes at additional-status-codes.

  • The higher power will be backed off based on country region.

  • Use the following setting to indicate tx_power as an index: #define RSI_BLE_PWR_INX 30 Default value for power index is 31. Valid values for power index range from 1 to 31 and 33 to 127:

    • 1 to 31: BLE - 0 dBm mode.

    • 33 to 63: BLE - 10 dBm mode.

    • 64 to 82: BLE - 1 dBm - 18 dBm HP mode in the resolution of 1 dBm.

    • 104 to 126: BLE - 0.5d Bm - 11 dBm HP mode in the resolution of 0.5 dbm.

    • 127: BLE HP Mode, max power supported.

  • Use the following setting to indicate tx_power in dBm (-8 to 18 dBm): #define RSI_BLE_PWR_INX_DBM 1

  • When switching between HP mode and LP mode, ensure that no protocol activity is running.

  • For the LP Chain - Power index vs output power in dBm in E2E mode:

    Power Index

    Output Power in dBm

    1

    -22.3054959

    2

    -16.59332574

    3

    -13.38278365

    4

    -11.19804718

    5

    -9.576522466

    6

    -8.312070432

    7

    -7.294640362

    8

    -6.458448154

    9

    -5.760963318

    10

    -5.173042366

    11

    -4.673788189

    12

    -4.247653993

    13

    -3.882708784

    14

    -3.569545894

    15

    -3.300567503

    16

    -3.069499167

    17

    -2.871050592

    18

    -2.700672503

    19

    -2.554378603

    20

    -2.428612817

    21

    -2.32014891

    22

    -2.226013876

    23

    -2.143429275

    24

    -2.069766557

    25

    -2.002513642

    26

    -1.939250859

    27

    -1.87763493

    28

    -1.815390046

    29

    -1.750305305

    30

    -1.680237892

    31

    -1.603121401

    32

    N/A

    33

    -10.4822997

    34

    -4.9531679

    35

    -1.931961022

    36

    0.057132993

    37

    1.476764101

    38

    2.5332116

    39

    3.336771823

    40

    3.953605265

    41

    4.426779615

    42

    4.786171523

    43

    5.053647759

    44

    5.246007208

    45

    5.37676618

    46

    5.457304255

    47

    5.497635316

    48

    5.506945838

    49

    5.493978354

    50

    5.467302132

    51

    5.435491631

    52

    5.407220119

    53

    5.391268248

    54

    5.396444507

    55

    5.431416481

    56

    5.504458826

    57

    5.62313521

    58

    5.793945208

    59

    6.02197959

    60

    6.310634089

    61

    6.661428559

    62

    7.073964236

    63

    7.546029076

  • For the HP Chain - Power index vs output power in dBm in E2E mode:

    Power Index

    Output Power in dBm

    64

    1

    65

    2

    66

    3

    67

    4

    68

    5

    69

    6

    70

    7

    71

    8

    72

    9

    73

    10

    74

    11

    75

    12

    76

    13

    77

    14

    78

    15

    -

    -

    -

    -

    104

    0.5

    105

    1

    106

    1.5

    107

    2

    108

    2.5

    109

    3

    110

    3.5

    111

    4

    -

    -

    126

    10.5

    127

    Max Power Supported by Country region


Definition at line 3122 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_profiles#

int32_t rsi_ble_get_profiles (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_profiles_list_t * p_prof_list)

Get the supported profiles / services of the connected remote device.

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[out]p_prof_list

- profiles/services information will be filled in this structure after retrieving from the remote device, refer to rsi_ble_resp_profiles_list_s structure for more info.

The rsi_ble_on_profiles_list_resp_t callback function will be called after the profiles list response is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_profiles_list_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3157 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_profile#

int32_t rsi_ble_get_profile (uint8_t * dev_addr, uuid_t profile_uuid, profile_descriptors_t * p_profile)

Get the specific profile / service of the connected remote device.

Parameters
[in]dev_addr

- remote device address

[in]profile_uuid

- services/profiles which are searched using profile_uuid

[out]p_profile

- profile / service information filled in this structure after retrieving from the remote device. See profile_descriptor_s structure for more info.

The rsi_ble_on_profile_resp_t callback function is called after the service characteristics response is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_profile_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3184 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_char_services#

int32_t rsi_ble_get_char_services (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_char_services_t * p_char_serv_list)

Get the service characteristic services of the connected remote device, rsi_ble_on_char_services_resp_t callback function is called after the characteristic service response is received, this is a non-blocking API, Still user need to wait until the callback rsi_ble_on_char_services_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[out]p_char_serv_list

- service characteristics details are filled in this structure, refer to rsi_ble_resp_char_serv_s structure for more info.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3209 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_inc_services#

int32_t rsi_ble_get_inc_services (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_inc_services_t * p_inc_serv_list)

Get the supported include services of the connected remote device.

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[out]p_inc_serv_list

- include service characteristics details are filled in this structure, refer to rsi_ble_resp_inc_serv structure for more info.

The rsi_ble_on_inc_services_resp_t callback function is called after the include service response is received. This is a non-blocking API. Still user need to wait until the callback rsi_ble_on_inc_services_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3237 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_char_value_by_uuid#

int32_t rsi_ble_get_char_value_by_uuid (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, uuid_t char_uuid, rsi_ble_resp_att_value_t * p_char_val)

Get the characteristic value by UUID (char_uuid).

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[in]char_uuid

- UUID of the characteristic

[out]p_char_val

- Characteristic value is filled in this structure. See rsi_ble_resp_att_value_s structure for more info.

The rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API. Still user need to wait until the callback rsi_ble_on_read_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • If the return value is less than 0

Note


Definition at line 3267 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_att_descriptors#

int32_t rsi_ble_get_att_descriptors (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_att_descs_t * p_att_desc)

Get the characteristic descriptors list from the remote device.

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[out]p_att_desc

- pointer to characteristic descriptor structure, refer to rsi_ble_resp_att_descs_s structure for more info.

The rsi_ble_on_att_desc_resp_t callback function is called after the attribute descriptors response is received. This is a non-blocking API. Still user need to wait until the callback rsi_ble_on_att_desc_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3295 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_att_value#

int32_t rsi_ble_get_att_value (uint8_t * dev_addr, uint16_t handle, rsi_ble_resp_att_value_t * p_att_val)

Get the attribute by handle.

Parameters
[in]dev_addr

- remote device address

[in]handle

- handle value of the attribute

[out]p_att_val

- attribute value is filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.

The rsi_ble_on_read_resp_t callback function is called upon receiving the attribute value. This is a non-blocking API. Still user need to wait until the callback rsi_ble_on_read_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3318 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_multiple_att_values#

int32_t rsi_ble_get_multiple_att_values (uint8_t * dev_addr, uint8_t num_of_handlers, const uint16_t * handles, rsi_ble_resp_att_value_t * p_att_vals)

Get the multiple attribute values by using multiple handles.

Parameters
[in]dev_addr

- remote device address

[in]num_of_handlers

- number of handles in the list

[in]handles

- list of attribute handles

[out]p_att_vals

- attribute values filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.

The rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API, Still user need to wait until the callback rsi_ble_on_read_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3341 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_long_att_value#

int32_t rsi_ble_get_long_att_value (uint8_t * dev_addr, uint16_t handle, uint16_t offset, rsi_ble_resp_att_value_t * p_att_vals)

Get the long attribute value by using handle and offset.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute handle

[in]offset

- offset within the attribute value

[out]p_att_vals

- attribute value filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.

The rsi_ble_on_read_resp_t callback function is called after the attribute value is received. This is a non-blocking API. Still user need to wait until the callback rsi_ble_on_read_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3367 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_att_value#

int32_t rsi_ble_set_att_value (uint8_t * dev_addr, uint16_t handle, uint8_t data_len, const uint8_t * p_data)

Set the attribute value of the remote device, rsi_ble_on_write_resp_t callback function is called if the attribute set action is completed, this is a non-blocking API, Still user need to wait until the callback rsi_ble_on_write_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute value handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3391 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_att_cmd#

int32_t rsi_ble_set_att_cmd (uint8_t * dev_addr, uint16_t handle, uint8_t data_len, const uint8_t * p_data)

Set the attribute value without waiting for an ACK from the remote device.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute value handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

This is a blocking API. If the API returns RSI_ERROR_BLE_DEV_BUF_FULL (-31) error then wait until the rsi_ble_on_le_more_data_req_t event gets received from the module.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

    • 0x4E65 - Invalid Attribute Length When Small Buffer Mode is Configured

Note


Definition at line 3415 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_long_att_value#

int32_t rsi_ble_set_long_att_value (uint8_t * dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, const uint8_t * p_data)

Set the long attribute value of the remote device.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute handle

[in]offset

- attribute value offset

[in]data_len

- attribute value length

[in]p_data

- attribute value

The rsi_ble_on_write_resp_t callback function is called after the attribute set action is completed. This is a non-blocking API. Still user need to wait until the callback rsi_ble_on_write_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3440 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_prepare_write#

int32_t rsi_ble_prepare_write (uint8_t * dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, const uint8_t * p_data)

Prepare the attribute value.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute handle

[in]offset

- attribute value offset

[in]data_len

- attribute value length

[in]p_data

- attribute value

The rsi_ble_on_write_resp_t callback function is called after the prepare attribute write action is completed. This is a non-blocking API. Still user need to wait until the callback rsi_ble_on_write_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3467 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_execute_write#

int32_t rsi_ble_execute_write (uint8_t * dev_addr, uint8_t exe_flag)

Execute the prepared attribute values.

Parameters
[in]dev_addr

- remote device address

[in]exe_flag

- execute flag to write, possible values mentioned below

  • 0 - BLE_ATT_EXECUTE_WRITE_CANCEL

  • 1 - BLE_ATT_EXECUTE_PENDING_WRITES_IMMEDIATELY

The rsi_ble_on_write_resp_t callback function is called after the execute attribute write action is completed. This is a non-blocking API. Still user need to wait until the callback rsi_ble_on_write_resp_t is received from the device, to initiate further attribute related transactions on this remote device address.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

Note


Definition at line 3491 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_add_service#

int32_t rsi_ble_add_service (uuid_t service_uuid, rsi_ble_resp_add_serv_t * p_resp_serv)

Add a new service to the local GATT Server.

Parameters
[in]service_uuid

- new service UUID value, refer to uuid_s structure for more info.

[out]p_resp_serv

- new service handler filled in this structure, refer to rsi_ble_resp_add_serv_s structure for more info.

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4046 - Invalid Arguments

    • 0x4D08 - Profile record full

Note


Definition at line 3516 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_add_attribute#

int32_t rsi_ble_add_attribute (rsi_ble_req_add_att_t * p_attribute)

Add a new attribute to a specific service.

Parameters
[in]p_attribute

- add a new attribute to the service, refer to rsi_ble_req_add_att_s structure for more info.

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4046 - Invalid Arguments

    • 0x4D09 - Attribute record full

Note


Definition at line 3532 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_local_att_value#

int32_t rsi_ble_set_local_att_value (uint16_t handle, uint16_t data_len, const uint8_t * p_data)

Change the local attribute value.

Parameters
[in]handle

- attribute value handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4046 - Invalid Arguments

    • 0x4D06 - Attribute record not found

    • 0x4E60 - Invalid Handle Range

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes .

  • This API can only be used if the service is maintained inside the firmware.

  • The services which are maintained by firmware must follow the below rules.

  • Rule 1: The attribute_data_size is less than 20 bytes during the service_creation

  • Rule 2: while creating the service, don't use the RSI_BLE_ATT_MAINTAIN_IN_HOST bit in the RSI_BLE_ATT_CONFIG_BITMAP macro.

  • Rule 3: The data_len must be less than or equal to the dat_length mentioned while creating the service/attribute

  • Rule 4: If the services are maintained in the Application/Host, then need to use rsi_ble_notify_value() API to send the notifications to the remote devices.


Definition at line 3561 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_wo_resp_notify_buf_info#

int32_t rsi_ble_set_wo_resp_notify_buf_info (const uint8_t * dev_addr, uint8_t buf_mode, uint8_t buf_cnt)

Configure the buf mode for Notify and WO response commands for the remote device.

Parameters
[in]dev_addr

- remote device address

[in]buf_mode

- buffer mode configuration

  • 0 - BLE_SMALL_BUFF_MODE

  • 1 - BLE_BIG_BUFF_MODE

[in]buf_cnt

- no of buffers to be configured only value 1 and 2 are supported in BLE_SMALL_BUFF_MODE
in BLE_BIG_BUFF_MODE, buffers allocated based on the below notations. intial available_buf_cnt = RSI_BLE_NUM_CONN_EVENTS, a) When connection 1 is formed, the possible range of buffers is (available_buf_cnt - remaining possible number of connections) b) After allocating X buffers using rsi_ble_set_wo_resp_notify_buf_info to the 1st connection remaining available_buf_cnt = (available_buf_cnt - X )

This is a blocking API. Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4046 - Invalid Arguments

    • 0x4D05 - BLE socket not available

    • 0x4D06 - Attribute record not found

    • 0x4E60 - Invalid Handle Range

    • 0x4E63 - BLE Buffer Count Exceeded

    • 0x4E64 - BLE Buffer already in use

Note


Definition at line 3589 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_notify_value#

int32_t rsi_ble_notify_value (const uint8_t * dev_addr, uint16_t handle, uint16_t data_len, const uint8_t * p_data)

Notify the local value to the remote device.

Parameters
[in]dev_addr

- remote device address

[in]handle

- local attribute handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

This is a blocking API. If the API returns RSI_ERROR_BLE_DEV_BUF_FULL (-31) error then wait until the rsi_ble_on_le_more_data_req_t event gets received from the module.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4046 - Invalid Arguments

    • 0x4A0D - Invalid attribute value length

    • 0x4D05 - BLE socket not available

    • 0x4D06 - Attribute record not found

    • 0x4E60 - Invalid Handle Range

    • 0x4E65 - Invalid Attribute Length When Small Buffer Mode is Configured

Note


Definition at line 3617 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_indicate_value#

int32_t rsi_ble_indicate_value (const uint8_t * dev_addr, uint16_t handle, uint16_t data_len, const uint8_t * p_data)

Indicate the local value to the remote device.

Parameters
[in]dev_addr

- remote device address

[in]handle

- local attribute handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_indicate_confirmation_t.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D05 - BLE socket not available

    • 0x4E60 - Invalid Handle Range

Note


Definition at line 3638 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_indicate_value_sync#

int32_t rsi_ble_indicate_value_sync (const uint8_t * dev_addr, uint16_t handle, uint16_t data_len, const uint8_t * p_data)

Indicate the local value to the remote device.

Parameters
[in]dev_addr

- remote device address

[in]handle

- local attribute handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

This is a blocking API.

        This will not send any confirmation event to the application instead 

        send the status as success on receiving confirmation from remote side.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D05 - BLE socket not available

    • 0x4E60 - Invalid Handle Range

Note


Definition at line 3667 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_indicate_confirm#

int32_t rsi_ble_indicate_confirm (const uint8_t * dev_addr)

Send indicate confirmation to the remote device.

Parameters
[in]dev_addr

- remote device address

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D05 - BLE socket not available

Note


Definition at line 3682 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_local_att_value#

int32_t rsi_ble_get_local_att_value (uint16_t handle, rsi_ble_resp_local_att_value_t * p_resp_local_att_val)

Get the local attribute value.

Parameters
[in]handle

- local attribute handle

[out]p_resp_local_att_val

- local attribute value filled in this structure, see rsi_ble_resp_local_att_value_s structure for more info.

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4046 - Invalid Arguments

    • 0x4D06 - Attribute record not found

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes

  • This API can only be used if the service is maintained inside the firmware. The services which are maintained by firmware must follow the below rules.

  • Rule 1: The attribute_data_size is less than 20 bytes during the service_creation

  • Rule 2: While creating the service, don't use the RSI_BLE_ATT_MAINTAIN_IN_HOST bit in the RSI_BLE_ATT_CONFIG_BITMAP macro.


Definition at line 3709 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_gatt_read_response#

int32_t rsi_ble_gatt_read_response (uint8_t * dev_addr, uint8_t read_type, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t * p_data)

Send the response for the read request received from the remote device This is a blocking API.

Parameters
[in]dev_addr

- remote device Address

[in]read_type

- read value type

  • 0 - Read response

  • 1 - Read blob response

[in]handle

- attribute value handle

[in]offset

- attribute value offset

[in]length

- attribute value length

[in]p_data

- attribute value

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D04 - BLE not connected

Note


Definition at line 3736 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_remove_gatt_service#

int32_t rsi_ble_remove_gatt_service (uint32_t service_handler)

Remove the GATT service record.

Parameters
[in]service_handler

- GATT service record handle

This is a blocking API.

  • Pre-conditions: GATT database needs to be present, GATT Database value can be modified at any point following its creation.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D0A - BLE profile not found (profile handler invalid)

Note


Definition at line 3756 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_remove_gatt_attibute#

int32_t rsi_ble_remove_gatt_attibute (uint32_t service_handler, uint16_t att_hndl)

Remove the GATT attribute record.

Parameters
[in]service_handler

- GATT service record handle

[in]att_hndl

- attribute handle

This is a blocking API.

  • Pre-conditions: GATT database needs to be present, GATT Database value can be modified at any point following its creation.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D06 - Attribute record not found

Note


Definition at line 3772 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_att_error_response#

int32_t rsi_ble_att_error_response (uint8_t * dev_addr, uint16_t handle, uint8_t opcode, uint8_t err)

Send attribute error response for any of the att request.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute handle

[in]opcode

- error response opcode

[in]err

- specific error related Gatt

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D04 - BLE not Connected

    • 0x4E62 - Invalid Parameters

Note


Definition at line 3792 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_mtu_exchange_event#

int32_t rsi_ble_mtu_exchange_event (uint8_t * dev_addr, uint8_t mtu_size)

Initiates the MTU exchange request with the remote device.

Parameters
[in]dev_addr

- remote device address

[in]mtu_size

- requested MTU value


This is a blocking API and will receive a callback event rsi_ble_on_mtu_event_t as the response for this API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D04 - BLE not Connected

    • 0x4E62 - Invalid Parameters

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes

  • When services are maintained on the host, this API need to be triggered by the application.


Definition at line 3816 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_mtu_exchange_resp#

int32_t rsi_ble_mtu_exchange_resp (uint8_t * dev_addr, uint8_t mtu_size)

This function (Exchange MTU Response) is sent in reply to a received Exchange MTU Request.

Parameters
[in]dev_addr

- Remote Device Address

[in]mtu_size

- requested MTU value

Returns

  • The following values are returned:

    • 0 - Success

    • 0x4D0C - When RSI_BLE_MTU_EXCHANGE_FROM_HOST BIT is not SET.

    • 0x4D05 - BLE Socket Not Available.

    • Non-Zero Value - Failure

Note


Definition at line 3833 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_gatt_write_response#

int32_t rsi_ble_gatt_write_response (uint8_t * dev_addr, uint8_t type)

Send the response to the write request received from the remote device.

Parameters
[in]dev_addr

- remote device address

[in]type

- response type

  • 0 - write response,

  • 1 - execute write response.

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4046 - Invalid Arguments

    • 0x4D04 - BLE not Connected

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes

  • When services are maintained on the host, this API need to be triggered by the application.


Definition at line 3858 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_gatt_prepare_write_response#

int32_t rsi_ble_gatt_prepare_write_response (uint8_t * dev_addr, uint16_t handle, uint16_t offset, uint16_t length, const uint8_t * data)

Send the response for the prepare write requests received from the remote device.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute value handle

[in]offset

- attribute value offset

[in]length

- attribute value length

[in]data

- attribute value

This is a blocking API.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4046 - Invalid Arguments

    • 0x4D04 - BLE not Connected

Note

  • Refer to the Status Codes section for the above error codes at additional-status-codes

  • When services are maintained on the host, this API need to be triggered by the application.


Definition at line 3883 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_max_adv_data_len#

int32_t rsi_ble_get_max_adv_data_len (uint8_t * resp)

Get maximum advertising data length.

Parameters
[out]resp

Maximum supported advertising data length returned by the controller. Possible values range from 0x001F to 0x0672.

Returns

  • The following values are returned:

    • 0 = success

  • The following values are returned:

    • !0 = failure

Note

  • This function requests the controller to return the maximum supported advertising data length.


Definition at line 3903 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_max_no_of_supp_adv_sets#

int32_t rsi_ble_get_max_no_of_supp_adv_sets (uint8_t * resp)

Get maximum number of advertising sets.

Parameters
[out]resp

Number of supported advertising sets returned by the controller. Possible values range from 0x01 to 0xF0.

Returns

  • The following values are returned: 0 = success

  • The following values are returned: !0 = failure

Note

  • This function requests the controller to return the maximum number of supporting advertising sets.

  • The number of supported advertising sets can be configured through the operating modes.


Definition at line 3917 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_ae_set_random_address#

rsi_ble_set_ae_set_random_address (uint8_t handle, const uint8_t * rand_addr)

Update AE random address.

Parameters
[in]handle

The advertising handle used to identify an advertising set

[in]rand_addr

Random device address set to either a static or private address

Returns

  • The following values are returned:

    • 0 = success

  • The following values are returned:

    • !0 = failure


Definition at line 3930 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_ae_data#

int32_t rsi_ble_set_ae_data (void * ble_ae_data)

Update AE advertiser data.

Parameters
[in]ble_ae_data

Extended Advertising data to be updated

Returns

  • The following values are returned: 0 = success

  • The following values are returned: !0 = failure

Note

  • This function sets the AE advertiser data used in advertising PDUs.

  • Refer to Bluetooth specification 5.3 for possible combinations ae_adv/scanresp data can be set for .


Definition at line 3944 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_ae_params#

int32_t rsi_ble_set_ae_params (void * ble_ae_params, int8_t * sel_tx_pwr)

Update AE parameters.

Parameters
[in]ble_ae_params

Extended Advertising parameters to be updated

[out]sel_tx_pwr

Output transmit power in dBm, ranging from -127 to +20.

Returns

  • The following values are returned: 0 = success

  • The following values are returned: !0 = failure


Definition at line 3957 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_start_ae_advertising#

int32_t rsi_ble_start_ae_advertising (void * adv_enable)

Enable or disable AE advertising.

Parameters
[in]adv_enable

Parameters to enable or disable specific advertising sets identified by advertising handle

Returns

  • The following values are returned: 0 = success

  • The following values are returned: !0 = failure


Definition at line 3969 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_app_adv_set_clear_or_remove#

int32_t rsi_ble_app_adv_set_clear_or_remove (uint8_t type, uint8_t handle)

request the local device to clear or remove the advertising sets based on the type specified This function requests the local device to clear or remove an advertising set from the controller based on the type specified

Parameters
[in]type

- Specifies whether to remove or clear the advertising sets. {1} - clear {2} - remove

[in]handle

- Advertising_Handle - Used to identify an Advertising set. Possible Values : 0x00 to 0xEF

Returns

  • 0 = success
    !0 = failure


Definition at line 3983 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_app_set_periodic_ae_params#

int32_t rsi_ble_app_set_periodic_ae_params (void * periodic_adv_params)

Update periodic AE parameters.

Parameters
[in]periodic_adv_params

Periodic advertising parameters to be updated

Returns

  • The following values are returned: 0 = success

  • The following values are returned: !0 = failure


Definition at line 3995 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_app_set_periodic_ae_enable#

int32_t rsi_ble_app_set_periodic_ae_enable (uint8_t enable, uint8_t handle)

Enable periodic advertising.

Parameters
[in]enable

Configure the "enable" parameter to 0 to enable ae periodic advertisement on specified set, or 1 to include the ADI field in AUX_SYNC_IND PDUs

[in]handle

Advertising handle of the advertising set to enable or disable

Returns

  • The following values are returned: 0 = success: !0 = failure

Note

  • This function requests the controller to enable or disable periodic advertising for the specified advertising set.


Definition at line 4009 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_set_scan_params#

int32_t rsi_ble_ae_set_scan_params (void * ae_scan_params)

Update AE scan parameters.

Parameters
[in]ae_scan_params

Extended scan parameters to be updated

Returns

  • The following values are returned: 0 = success

  • The following values are returned: !0 = failure

Note

  • This function sets the extended scan parameters to be used on the physical advertising channels.


Definition at line 4023 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_set_scan_enable#

int32_t rsi_ble_ae_set_scan_enable (void * ae_scan_enable)

request the local device to enable scanning for both legacy and extended advertising PDUs

Parameters
[in]ae_scan_enable

- Extended Scan Enable command Parameters would be filled here

Returns

  • 0 = success
    !0 = failure


Definition at line 4033 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_set_periodic_sync#

int32_t rsi_ble_ae_set_periodic_sync (uint8_t type, void * periodic_sync_data)

Synchronize with a periodic advertising train from an advertiser and begin receiving periodic advertising packets.

Parameters
[in]type

- Configure the "type" parameter to values 1 to begin, 2 to cancel and 3 to terminate the periodic advertising sync

[in]periodic_sync_data

Parameters for starting a perodic advertising sync operation

Returns

  • The following values are returned: 0 = success 0x4E42 = unknown advertising identifier 0x4E0C = command not permitted

Note

  • The operation is either started, cancelled or terminated depending on the type parameter.

  • "Sync Terminate" to be used when synchronization has already been established, and operation needs to be stopped. "Sync Cancel" to be used when synchronization is still in progress, and process is no longer intended to be completed.


Definition at line 4051 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_dev_to_periodic_list#

int32_t rsi_ble_ae_dev_to_periodic_list (void * dev_to_list)

Manage a device in the periodic advertiser list This function adds a device to periodic advertiser list stored in the controller.

Parameters
[in]dev_to_list

Details of a device to be added to the periodic advertiser list

Returns

  • The following values are returned: 0 = success !0 = failure


Definition at line 4063 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_ae_read_periodic_adv_list_size#

int32_t rsi_ble_ae_read_periodic_adv_list_size (uint8_t * resp)

Get periodic advertiser list size.

Parameters
[out]resp

Periodic advertiser list size returned by the controller

Returns

  • The following values are returned: 0 = success

  • The following values are returned: !0 = failure


Definition at line 4075 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_extended_connect_with_params#

int32_t rsi_ble_extended_connect_with_params (void * ble_extended_conn_params)

Establish ACL connection to advertiser.

Parameters
[in]ble_extended_conn_params

Connection parameters

Returns

  • The following values are returned: 0 = success

  • The following values are returned: !0 = failure

Note

  • This function establishes an ACL connection to an advertiser, with the local device in the BLE central role.


Definition at line 4089 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_read_transmit_power#

int32_t rsi_ble_read_transmit_power (void * resp)

Get supported transmit power range.

Parameters
[out]resp

Minimum and maximum supported transmit power, returned by the controller. Power ranges from -127 dBm to +20 dBm.

Returns

  • The following values are returned: 0 = success

  • The following values are returned: !0 = failure

Note

  • This function requests the controller to return the minimum and maximum supported transmit power.


Definition at line 4103 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_profiles_async#

int32_t rsi_ble_get_profiles_async (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_profiles_list_t * p_prof_list)

Get the supported profiles / services of the connected remote device asynchronously.

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[out]p_prof_list

- Profiles/services information will be filled in this structure after retrieving from the remote device. See the rsi_ble_resp_profiles_list_s structure for more info.

The rsi_ble_on_event_profiles_list_t callback function will be called after the profiles list event is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_profiles_list_t or rsi_ble_on_gatt_error_resp_t.

Note

  • p_prof_list structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4146 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_profile_async#

int32_t rsi_ble_get_profile_async (uint8_t * dev_addr, uuid_t profile_uuid, profile_descriptors_t * p_profile)

Get the specific profile / service of the connected remote device.

Parameters
[in]dev_addr

- remote device address

[in]profile_uuid

- services/profiles which are searched using profile_uuid

[out]p_profile

- profile / service information filled in this structure after retrieving from the remote device, refer to profile_descriptor_s structure for more info.

The rsi_ble_one_event_profile_by_uuid_t callback function is called after the service characteristics response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_one_event_profile_by_uuid_t or rsi_ble_on_gatt_error_resp_t.

Note

  • p_profile structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4174 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_char_services_async#

rint32_t rsi_ble_get_char_services_async (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_char_services_t * p_char_serv_list)

Get the service characteristics of the connected remote device.

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[out]p_char_serv_list

- Service Characteristics details are filled in this structure. See rsi_ble_resp_char_serv_s structure for more info.

The rsi_ble_on_event_read_by_char_services_t callback function is called after the included service characteristics response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_by_char_services_t or rsi_ble_on_gatt_error_resp_t.

Note

  • p_char_services_list structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4204 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_inc_services_async#

int32_t rsi_ble_get_inc_services_async (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_inc_services_t * p_inc_serv_list)

Get the supported include services of the connected remote device.

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[out]p_inc_serv_list

- include service characteristics details are filled in this structure, refer to rsi_ble_resp_inc_serv structure for more info.

The rsi_ble_on_event_read_by_inc_services_t callback function is called after the service characteristics response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_by_inc_services_t or rsi_ble_on_gatt_error_resp_t.

Note

  • p_inc_serv_list structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4236 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_char_value_by_uuid_async#

int32_t rsi_ble_get_char_value_by_uuid_async (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, uuid_t char_uuid, rsi_ble_resp_att_value_t * p_char_val)

Get the characteristic value by UUID (char_uuid).

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[in]char_uuid

- UUID of the characteristic

[out]p_char_val

- characteristic value is filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.

The rsi_ble_on_event_read_att_value_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_att_value_t or rsi_ble_on_gatt_error_resp_t.

Note

  • p_char_val structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4269 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_att_descriptors_async#

int32_t rsi_ble_get_att_descriptors_async (uint8_t * dev_addr, uint16_t start_handle, uint16_t end_handle, rsi_ble_resp_att_descs_t * p_att_desc)

Get the characteristic descriptors list from the remote device.

Parameters
[in]dev_addr

- remote device address

[in]start_handle

- start handle (index) of the remote device's service records

[in]end_handle

- end handle (index) of the remote device's service records

[out]p_att_desc

- pointer to characteristic descriptor structure, refer to rsi_ble_resp_att_descs_s strcuture for more info.

    @note   p_att_desc structure should be passed as NULL because nothing will be filled in this structure 

The rsi_ble_on_gatt_desc_val_event_t callback function is called after the attribute descriptors response is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_gatt_desc_val_event_t or rsi_ble_on_gatt_error_resp_t.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4302 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_att_value_async#

int32_t rsi_ble_get_att_value_async (uint8_t * dev_addr, uint16_t handle, rsi_ble_resp_att_value_t * p_att_val)

Get the attribute with a handle.

Parameters
[in]dev_addr

- remote device address

[in]handle

- handle value of the attribute

[out]p_att_val

- attribute value is filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.

The rsi_ble_on_event_read_resp_t callback function is called upon receiving the attribute value. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_resp_t or rsi_ble_on_gatt_error_resp_t.

Note

  • p_att_val structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4329 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_multiple_att_values_async#

int32_t rsi_ble_get_multiple_att_values_async (uint8_t * dev_addr, uint8_t num_of_handlers, const uint16_t * handles, rsi_ble_resp_att_value_t * p_att_vals)

Get the multiple attribute values by using multiple handles.

Parameters
[in]dev_addr

- remote device address

[in]num_of_handlers

- number of handles in the list

[in]handles

- list of attribute handles

[out]p_att_vals

- attribute values filled in this structure, refer to rsi_ble_resp_att_value_s structure for more info.

The rsi_ble_on_event_read_resp_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_resp_t or rsi_ble_on_gatt_error_resp_t.

Note

  • p_att_vals structure should be passed as NULL because nothing will be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4355 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_get_long_att_value_async#

int32_t rsi_ble_get_long_att_value_async (uint8_t * dev_addr, uint16_t handle, uint16_t offset, rsi_ble_resp_att_value_t * p_att_vals)

Get the long attribute value by using handle and offset.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute handle

[in]offset

- offset within the attribute value

[out]p_att_vals

- attribute value filled in this structure, refer to rsi_ble_resp_att_value_s structure for more information.

The rsi_ble_on_event_read_resp_t callback function is called after the attribute value is received. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_read_resp_t or rsi_ble_on_gatt_error_resp_t.

Note

  • p_att_vals structure should be passed as NULL because nothing would be filled in this structure

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4385 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_set_att_value_async#

int32_t rsi_ble_set_att_value_async (uint8_t * dev_addr, uint16_t handle, uint8_t data_len, const uint8_t * p_data)

Set the attribute value of the remote device.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute value handle

[in]data_len

- attribute value length

[in]p_data

- attribute value

The rsi_ble_on_event_write_resp_t callback function is called after the attribute set action is completed. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_write_resp_t or rsi_ble_on_gatt_error_resp_t.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4412 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_prepare_write_async#

int32_t rsi_ble_prepare_write_async (uint8_t * dev_addr, uint16_t handle, uint16_t offset, uint8_t data_len, const uint8_t * p_data)

Prepare the attribute value.

Parameters
[in]dev_addr

- remote device address

[in]handle

- attribute handle

[in]offset

- attribute value offset

[in]data_len

- attribute value length

[in]p_data

- attribute value

The rsi_ble_on_event_prepare_write_resp_t callback function is called after the prepare attribute write action is completed. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_prepare_write_resp_t or rsi_ble_on_gatt_error_resp_t.

Returns

  • The following values are returned:

    • 0 - Success

    • 0x4E60 - Invalid Handle range

    • 0x4E62 - Invalid Parameters

    • 0x4D04 - BLE not connected

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4439 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_execute_write_async#

int32_t rsi_ble_execute_write_async (uint8_t * dev_addr, uint8_t exe_flag)

Execute the prepared attribute values.

Parameters
[in]dev_addr

- remote device address

[in]exe_flag

- execute flag to write, possible values mentioned below

  • 0 - BLE_ATT_EXECUTE_WRITE_CANCEL

  • 1 - BLE_ATT_EXECUTE_PENDING_WRITES_IMMEDIATELY

The rsi_ble_on_event_write_resp_t callback function is called after the execute attribute write action is completed. This is a blocking API and can unblock the application on the reception of the callback functions either rsi_ble_on_event_write_resp_t or rsi_ble_on_gatt_error_resp_t.

Returns

  • The following values are returned:

    • 0 - Success

    • Non-Zero Value - Failure

    • 0x4D05 - BLE Socket not available

Note


Definition at line 4463 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_cbfc_connreq#

uint32_t rsi_ble_cbfc_connreq (uint8_t * dev_addr, uint16_t psm)

Sends a connection request to a remote device using the Credit Based Flow Control (CBFC) mechanism.

Parameters
N/Adev_addr

Pointer to the device address of the remote device.

N/Apsm

The Protocol Service Multiplexer (PSM) value.

This function sends a connection request to a remote device using the CBFC mechanism. It takes the device address and the Protocol Service Multiplexer (PSM) as input parameters.

Returns

  • Returns a 32-bit unsigned integer indicating the status of the connection request.

    • 0: If the connection request is successful.

    • Non-zero: If there is an error in sending the connection request.


Definition at line 4481 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_cbfc_connresp#

uint32_t rsi_ble_cbfc_connresp (uint8_t * dev_addr, uint16_t lcid, uint8_t result)

Sends a connection response for a credit-based flow control (CBFC) connection.

Parameters
N/Adev_addr

The device address of the remote device.

N/Alcid

The logical channel ID of the connection.

N/Aresult

The result of the connection response.

This function is used to send a connection response for a CBFC connection in the Bluetooth Low Energy (BLE) module.

Returns

  • The status of the operation. Returns a 32-bit unsigned integer.


Definition at line 4495 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_cbfc_data_tx#

uint32_t rsi_ble_cbfc_data_tx (uint8_t * dev_addr, uint16_t lcid, uint16_t len, uint8_t * p_data)

Transmits data over a Connection-Based Flow Control (CBFC) channel in the Bluetooth Low Energy (BLE) module.

Parameters
N/Adev_addr

Pointer to the device address of the BLE module.

N/Alcid

Logical channel ID of the CBFC channel.

N/Alen

Length of the data to be transmitted.

N/Ap_data

Pointer to the data to be transmitted.

This function is used to transmit data over a CBFC channel in the BLE module. It takes the device address, logical channel ID (LCID), length of the data, and a pointer to the data as input parameters. The function returns a 32-bit unsigned integer as the status of the transmission.

Returns

  • 32-bit unsigned integer representing the status of the transmission.


Definition at line 4511 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_cbfc_disconnect#

uint32_t rsi_ble_cbfc_disconnect (uint8_t * dev_addr, uint16_t lcid)

Disconnects a Connection-Based Flow Control (CBFC) connection with the specified device address and logical channel ID.

Parameters
N/Adev_addr

The device address of the remote device.

N/Alcid

The logical channel ID of the CBFC connection.

This function is used to disconnect a CBFC connection with the specified device address and logical channel ID.

Returns

  • The status code indicating the success or failure of the operation.

    • Returns 0 on success.

    • Returns a non-zero value on failure.


Definition at line 4526 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_gap_register_callbacks#

void rsi_ble_gap_register_callbacks (rsi_ble_on_adv_report_event_t ble_on_adv_report_event, rsi_ble_on_connect_t ble_on_conn_status_event, rsi_ble_on_disconnect_t ble_on_disconnect_event, rsi_ble_on_le_ping_payload_timeout_t timeout_expired_event, rsi_ble_on_phy_update_complete_t ble_on_phy_update_complete_event, rsi_ble_on_data_length_update_t ble_on_data_length_update_complete_event, rsi_ble_on_enhance_connect_t ble_on_enhance_conn_status_event, rsi_ble_on_directed_adv_report_event_t ble_on_directed_adv_report_event, rsi_ble_on_conn_update_complete_t ble_on_conn_update_complete_event, rsi_ble_on_remote_conn_params_request_t ble_on_remote_conn_params_request_event)

Register GAP callbacks.

Parameters
[in]ble_on_adv_report_event

- Callback function for Advertise events

[in]ble_on_conn_status_event

- Callback function for Connect events

[in]ble_on_disconnect_event

- Callback function for Disconnect events

[in]timeout_expired_event

- Callback function for LE ping timeout events

[in]ble_on_phy_update_complete_event

- Callback function for PHY update complete events

[in]ble_on_data_length_update_complete_event

- Callback function for data length update events

[in]ble_on_enhance_conn_status_event

- Callback function for enhanced connection status events

[in]ble_on_directed_adv_report_event

- Callback function for directed advertising report events

[in]ble_on_conn_update_complete_event

- Callback function for connection update complete events

[in]ble_on_remote_conn_params_request_event

- Callback function to remote connection params request events


Definition at line 4858 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_gap_extended_register_callbacks#

void rsi_ble_gap_extended_register_callbacks (rsi_ble_on_remote_features_t ble_on_remote_features_event, rsi_ble_on_le_more_data_req_t ble_on_le_more_data_req_event)

Register GAP Extended responses/events callbacks.

Parameters
[in]ble_on_remote_features_event

- Call back function for Remote feature request

[in]ble_on_le_more_data_req_event

- Call back function for LE More data request

Note

  • For more information about each callback, see the GAP Extended callbacks description section.


Definition at line 4880 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_enhanced_gap_extended_register_callbacks#

uint32_t rsi_ble_enhanced_gap_extended_register_callbacks (uint16_t callback_id, void(*)(uint16_t status, uint8_t *buffer) callback_handler_ptr)

Registers a callback function for the Enhanced GAP Extended feature in the RSI BLE module.

Parameters
N/Acallback_id

The ID of the callback to register.

N/Acallback_handler_ptr

A pointer to the callback function that will handle the events.

This function allows you to register a callback function to handle events related to the Enhanced GAP Extended feature. The callback function will be called when an event occurs, providing the status and a buffer containing additional data.

Returns

  • The status of the registration process. Possible values are defined by the uint16_t data type.

Note

  • Ensure that the callback function is implemented to handle the specific events you are interested in. The callback function should match the signature specified in the function parameters. This function should be called during the initialization phase of your application to ensure that the callbacks are registered before any events occur.


Definition at line 4902 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_adv_ext_events_register_callbacks#

int32_t rsi_ble_adv_ext_events_register_callbacks (uint16_t callback_id, void(*)(uint16_t status, uint8_t *buffer) callback_handler_ptr)

Registers callback functions for extended advertising events in the BLE module.

Parameters
N/Acallback_id

The ID of the callback function to register.

N/Acallback_handler_ptr

A pointer to the callback function that will handle the extended advertising events. The callback function should have the following signature: void callback_handler(uint16_t status, uint8_t *buffer)

  • status: The status of the extended advertising event.

  • buffer: A pointer to the buffer containing the extended advertising event data.

This function allows the application to register callback functions to handle extended advertising events in the BLE module. The callback functions will be invoked when an extended advertising event occurs.

Returns

  • Returns 0 on success, or a negative error code on failure.


Definition at line 4927 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_smp_register_callbacks#

void rsi_ble_smp_register_callbacks (rsi_ble_on_smp_request_t ble_on_smp_request_event, rsi_ble_on_smp_response_t ble_on_smp_response_event, rsi_ble_on_smp_passkey_t ble_on_smp_passkey_event, rsi_ble_on_smp_failed_t ble_on_smp_fail_event, rsi_ble_on_encrypt_started_t rsi_ble_on_encrypt_started_event, rsi_ble_on_smp_passkey_display_t ble_on_smp_passkey_display_event, rsi_ble_on_sc_passkey_t ble_sc_passkey_event, rsi_ble_on_le_ltk_req_event_t ble_on_le_ltk_req_event, rsi_ble_on_le_security_keys_t ble_on_le_security_keys_event, rsi_ble_on_smp_response_t ble_on_cli_smp_response_event, rsi_ble_on_sc_method_t ble_on_sc_method_event)

Register the SMP callbacks.

Parameters
[in]ble_on_smp_request_event

- smp request callback

[in]ble_on_smp_response_event

- smp response callback

[in]ble_on_smp_passkey_event

- smp passkey callback

[in]ble_on_smp_fail_event

- smp failed callback

[in]rsi_ble_on_encrypt_started_event

- encryption enabled callback

[in]ble_on_smp_passkey_display_event

- smp passkey display callback

[in]ble_sc_passkey_event

- sc passkey display callback

[in]ble_on_le_ltk_req_event

- This is the SMP LTK request callback

[in]ble_on_le_security_keys_event

- This is the SMP security keys callback

[in]ble_on_cli_smp_response_event

- This is the client smp response callback -

[in]ble_on_sc_method_event

- sc method display callback


Definition at line 4946 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_l2cap_cbsc_register_callbacks#

void rsi_ble_l2cap_cbsc_register_callbacks (rsi_ble_on_cbfc_conn_req_event_t ble_on_cbsc_conn_req, rsi_ble_on_cbfc_conn_complete_event_t ble_on_cbsc_conn_complete, rsi_ble_on_cbfc_rx_data_event_t ble_on_cbsc_rx_data, rsi_ble_on_cbfc_disconn_event_t ble_on_cbsc_disconn)

Register callbacks for BLE L2CAP Credit Based Flow Control (CBFC) events.

Parameters
N/Able_on_cbsc_conn_req

Callback function to handle CBFC connection request event.

N/Able_on_cbsc_conn_complete

Callback function to handle CBFC connection complete event.

N/Able_on_cbsc_rx_data

Callback function to handle CBFC receive data event.

N/Able_on_cbsc_disconn

Callback function to handle CBFC disconnection event.

This function is used to register callbacks for various CBFC events in BLE L2CAP. The registered callbacks will be invoked when the corresponding events occur.


Definition at line 5543 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_gatt_register_callbacks#

void rsi_ble_gatt_register_callbacks (rsi_ble_on_profiles_list_resp_t ble_on_profiles_list_resp, rsi_ble_on_profile_resp_t ble_on_profile_resp, rsi_ble_on_char_services_resp_t ble_on_char_services_resp, rsi_ble_on_inc_services_resp_t ble_on_inc_services_resp, rsi_ble_on_att_desc_resp_t ble_on_att_desc_resp, rsi_ble_on_read_resp_t ble_on_read_resp, rsi_ble_on_write_resp_t ble_on_write_resp, rsi_ble_on_gatt_write_event_t ble_on_gatt_event, rsi_ble_on_gatt_prepare_write_event_t ble_on_gatt_prepare_write_event, rsi_ble_on_execute_write_event_t ble_on_execute_write_event, rsi_ble_on_read_req_event_t ble_on_read_req_event, rsi_ble_on_mtu_event_t ble_on_mtu_event, rsi_ble_on_gatt_error_resp_t ble_on_gatt_error_resp_event, rsi_ble_on_gatt_desc_val_event_t ble_on_gatt_desc_val_resp_event, rsi_ble_on_event_profiles_list_t ble_on_profiles_list_event, rsi_ble_on_event_profile_by_uuid_t ble_on_profile_by_uuid_event, rsi_ble_on_event_read_by_char_services_t ble_on_read_by_char_services_event, rsi_ble_on_event_read_by_inc_services_t ble_on_read_by_inc_services_event, rsi_ble_on_event_read_att_value_t ble_on_read_att_value_event, rsi_ble_on_event_read_resp_t ble_on_read_resp_event, rsi_ble_on_event_write_resp_t ble_on_write_resp_event, rsi_ble_on_event_indicate_confirmation_t ble_on_indicate_confirmation_event, rsi_ble_on_event_prepare_write_resp_t ble_on_prepare_write_resp_event)

Register the GATT callbacks.

Parameters
[in]ble_on_profiles_list_resp

- Callback for rsi_ble_get_profiles command.

[in]ble_on_profile_resp

- Callback for rsi_ble_get_profile command.

[in]ble_on_char_services_resp

- Callback for rsi_ble_get_char_services command.

[in]ble_on_inc_services_resp

- Callback for rsi_ble_get_inc_services command.

[in]ble_on_att_desc_resp

- Callback for rsi_ble_get_att_descriptors command.

[in]ble_on_read_resp

- Callback for all read requests command.

[in]ble_on_write_resp

- Callback for all write commands.

[in]ble_on_gatt_event

- Callback for all GATT events.

[in]ble_on_gatt_prepare_write_event

- Callback for GATT prepare write events.

[in]ble_on_execute_write_event

- Callback for GATT execute write events.

[in]ble_on_read_req_event

- Callback for read request events.

[in]ble_on_mtu_event

- Callback for MTU events.

[in]ble_on_gatt_error_resp_event

- Callback for GATT error events.

[in]ble_on_gatt_desc_val_resp_event

- Callback for GATT descriptor value events.

[in]ble_on_profiles_list_event

- Callback for profiles list events.

[in]ble_on_profile_by_uuid_event

- Callback for profile by UUID events.

[in]ble_on_read_by_char_services_event

- Callback for read by characteristic services events.

[in]ble_on_read_by_inc_services_event

- Callback for read by included services events.

[in]ble_on_read_att_value_event

- Callback for read attribute value events.

[in]ble_on_read_resp_event

- Callback for read response events.

[in]ble_on_write_resp_event

- Callback for write response events.

[in]ble_on_indicate_confirmation_event

- Callback for indication confirmation events.

[in]ble_on_prepare_write_resp_event

- Callback for prepare write response events.


Definition at line 5694 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h

rsi_ble_gatt_extended_register_callbacks#

void rsi_ble_gatt_extended_register_callbacks (rsi_ble_on_mtu_exchange_info_t ble_on_mtu_exchange_info_event)

Register the GATT Extended responses/events callbacks.

Parameters
[in]ble_on_mtu_exchange_info_event

ble_on_mtu_exchange_info_event - Call back function for MTU Exchange information Event


Definition at line 5725 of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h