This file contains the declarations of the BLE API functions.
/*******************************************************************************
* @file rsi_ble_apis.h
* @brief
*******************************************************************************
* # License
* <b>Copyright 2020 Silicon Laboratories Inc. www.silabs.com</b>
*******************************************************************************
*
* The licensor of this software is Silicon Laboratories Inc. Your use of this
* software is governed by the terms of Silicon Labs Master Software License
* Agreement (MSLA) available at
* www.silabs.com/about-us/legal/master-software-license-agreement. This
* software is distributed to you in Source Code format and is governed by the
* sections of the MSLA applicable to Source Code.
*
******************************************************************************/
#ifndef RSI_BLE_APIS_H
#define RSI_BLE_APIS_H
#include "rsi_bt_common.h"
/******************************************************
* * Macros
* ******************************************************/
/// 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 connected device */
uint8_t dev_addr_type;
/** Address of the connected 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 disconnected device */
uint8_t dev_addr[RSI_DEV_ADDR_LEN];
/** The type of the disconnected 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 disconnected 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 Enc 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 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_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 disconnected 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 conn 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;
// remote features event
/**
* @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;
// LE Device Buffer Indication
/**
* @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;
// PHY update complete event
/**
* @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;
// Basic GATT structures
// 128 bit UUID format structure
/**
* @brief Structure representing a 128-bit 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-bit, 32-bit, or 128-bit.
* 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, please refer 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, please refer 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, please refer 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 to hold the response for the BLE profiles list command.
*/
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 response for querying profile descriptors in BLE.
*/
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>
/**
* @brief Structure to hold the response of characteristic services.
*/
typedef struct rsi_ble_resp_char_serv_s {
uint8_t num_of_services; /**< The number of profiles found */
uint8_t reserved[3]; /**< Reserved */
char_serv_t char_services[RSI_BLE_MAX_RESP_LIST]; /**< Characteristic service array. The maximum value is 5. */
} rsi_ble_resp_char_services_t;
#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 response for including a service in BLE.
*/
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 response for Attribute Descriptors in BLE.
*/
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;
/// 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;
#define PEER_DEVICE_INITATED_MTU_EXCHANGE 0x1 ///< Indicates that the 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;
// GATT Notification event structure
/**
* @brief Structure for BLE event notification.
*/
typedef struct rsi_ble_event_notify_s {
/**remote device address*/
uint8_t dev_addr[RSI_DEV_ADDR_LEN];
/**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_notify_t;
// GATT Indication event structure
/**
* @brief Structure representing the BLE event for an indication.
*
* This structure is used to define the parameters for a BLE event
* that involves an indication from a remote device.
*/
typedef struct rsi_ble_event_indication_s {
/** Remote device address */
uint8_t dev_addr[RSI_DEV_ADDR_LEN];
/** 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_indication_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) */
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 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 (0dBm Mode), 33 to 63 ( 10dBm 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;
/** @} */
///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 - 500ppm
0x01 - 250ppm
0x02 - 150ppm
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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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.0 for further details.
* @pre Pre-conditions:
* Call rsi_wireless_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() 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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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() 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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 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 rsi_wireless_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.
* @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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 will have a standard standard modulation index
* 0x01 Assume transmitter will 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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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 rsi_wireless_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
* @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 - 0dBm mode.
* - 33 to 63: BLE - 10dBm mode.
* - 64 to 82: BLE - 1dBm - 18dBm HP mode in the resolution of 1dBm.
* - 104 to 126: BLE - 0.5dBm - 11dBm HP mode in the resolution of 0.5dbm.
* - 127: BLE HP Mode, max power supported.
* @note Use the following setting to indicate tx_power in dBm (-8dBm to 18dBm): `#define RSI_BLE_PWR_INX_DBM 1`
* @note When switching between HP mode and LP mode, please 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,
please refer 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, please refer 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, please refer 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, Please refer 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, Please refer 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, please refer 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, please refer 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 rsi_wireless_init() before calling this API.
* @param[in] service_uuid - new service UUID value, please refer uuid_s structure for more info.
* @param[out] p_resp_serv - new service handler filled in this structure, please refer 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 rsi_wireless_init() before calling this API.
* @param[in] p_attribute - add a new attribute to the service, please refer 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:
* \ref rsi_ble_connect() API needs to be called before this API.
* @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:
* \ref rsi_ble_connect() API needs to be called before this API.
* @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)
*/
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)
*/
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)
*/
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 Clear or remove an advertising set
* @param[in] type Set to 1 to clear, or 2 to remove an advertising set
* @param[in] handle Advertising handle identifying the advertising set to remove or clear. Possible values range from 0x00 to 0xEF.
* @return The following values are returned:
* 0 = success
* @return The following values are returned:
* !0 = failure
*/
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 or disable periodic advertising
* @param[in] enable Set to 0 to enable, 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
* @return The following values are returned:
* !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 Enable or disable legacy and extended scanning
* @param[in] ae_scan_enable Parameters specify whether to enable or disable both legacy and extended advertising PDUs
* @return The following values are returned:
* 0 = success
* @return The following values are returned:
* !0 = failure
*/
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 periodic advertising with advertiser
* @param[in] type Set to 1 to begin, 2 to cancel, or 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
* @return The following values are returned:
* 0x4E42 = unknown advertising identifier
* @return The following values are returned:
* 0x4E0C = command not permitted
* @note
* This function performs an operation to synchronize with a periodic advertising train from an advertiser and begin receiving periodic advertising packets.
* @note
* The operation is either started, cancelled or terminated depending on the type parameter.
*/
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
* @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
* @return The following values are returned:
* !0 = failure
* @note
* This function adds, removes, or clears a device from the periodic advertiser list.
*/
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,
* please refer 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, please refer 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, please refer 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, Please refer 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, Please refer 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, please refer 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, please refer 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
* - 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. Please refer rsi_ble_event_adv_report_s for more info.
* @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. Please refer rsi_ble_event_conn_status_s for more info.
* @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. Please refer 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. Please refer 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.
* @param[out] rsi_ble_event_le_security_keys contains security keys. See rsi_bt_event_le_security_keys_s for more information.
* @return The following values are returned:
* void
*/
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.
* @param[out] remote_dev_address contains the smp requested device address. See rsi_bt_event_smp_req_s for more information.
* @return The following values are returned:
* void
*
*/
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.
* @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.
* @param[out] remote_dev_address contains the remote device address. See rsi_bt_event_smp_passkey_s for more information.
* @return The following values are returned:
* void
*
*
*/
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.
* @param[out] smp_passkey_display contains the smp passkey display information. See rsi_bt_event_smp_passkey_display_s for more information.
* @return The following values are returned:
* void
*
*/
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.
* @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.
* @return The following values are returned:
* void
*
*/
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.
* @param[out] scmethod contains Security Method 1 means Just works or 2 means Passkey. See rsi_bt_event_sc_method_s for more information.
* @return The following values are returned:
* void
*
*/
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.
* @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.
* @return The following values are returned:
* void
*
*/
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.
* @param[out] sc_passkey contains LE SC Passkey information. See rsi_bt_event_encryption_enabled_s for more information.
* @return The following values are returned:
* void
*
*
*
*/
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.
* It has to be registered using the `rsi_ble_gap_register_callbacks` API.
* @param[out] rsi_ble_event_conn_update_complete contains the controller support conn information. See rsi_ble_event_conn_update_s for more information.
* @param[out] resp_status contains the response status (Success or Error code)
* @return The following values are returned:
* void
*
*
*
*/
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 peer device supported features.
* This callback function will be called when conn update complete 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 rsi_ble_event_remote_features_s for more information.
* @return The following values are returned:
* void
*
*/
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.
* 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 information. See rsi_ble_event_data_length_update_s for more information.
* @return The following values are returned:
* void
*
*/
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 conn update complete events
* @param[in] ble_on_remote_conn_params_request_event - Callback function to remote conn 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 rsi_wireless_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
* @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. Please refer rsi_ble_event_gatt_desc_s for more info
* @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. Please refer rsi_ble_event_profiles_list_s for more info
* @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. Please refer rsi_ble_event_profile_by_uuid_s for more info.
* @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. Please refer rsi_ble_event_read_by_type1_s for more info.
* @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. Please refer rsi_ble_event_read_by_type2_s for more info.
* @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. Please refer rsi_ble_event_read_by_type3_s for more info.
* @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. Please refer rsi_ble_event_att_value_s for more info.
* @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. Please refer rsi_ble_set_att_resp_t for more info.
* @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. Please refer rsi_ble_set_att_resp_s for more info.
* @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. Please refer rsi_ble_prepare_write_resp_s for more info.
* @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. Please refer rsi_ble_resp_profiles_list_s for more info.
* @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. Please refer profile_descriptors_s for more info
* @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. Please refer rsi_ble_resp_att_descs_s for more info
* @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
* @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 info
* @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. Please refer rsi_ble_event_write_s for more info
*
*/
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 The callback function will be called if the GATT prepare events are received.
* This callback has to be registered using rsi_ble_gatt_register_callbacks API.
* @param[out] event_id contains the gatt_prepare_write event id (RSI_BLE_EVENT_PREPARE_WRITE)
* @param[out] rsi_ble_write contains the GATT prepare event information. Please refer rsi_ble_event_prepare_write_s for more info
*
*
*/
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 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 contains the GATT event information. Please refer rsi_ble_execute_write_s for more info.
*
*
*/
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 contains the GATT event information. Please refer rsi_ble_read_req_s for more info.
*
*/
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.
* This callback function will be called when connected to indicate MTU size.
* This callback has to be registered using rsi_ble_gatt_register_callbacks API.
* @param[out] rsi_ble_event_mtu contains the MTU size information. Please refer rsi_ble_event_mtu_s for more info.
*
*/
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 to indicate MTU size and who initiated MTU Exchange Request.
* This callback function will be called when connected, this event will contain MTU Exchange Information.
* 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 rsi_ble_event_mtu_exchange_information_s for more info.
*
*
*/
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 peer device information.This callback function will be called when conn update complete event is received
* 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 contains the remote device version information.
*
*
*
*/
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 indicate L2CAP CBFC connection request.This callback function will be called when connected to indicate connection 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
*
*
*
*/
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 connected to indicate connection complete status.
* This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
* @param[in] status
* @param[in] rsi_ble_cbfc_conn_complete contains the connection completed 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 connected to indicate received data.
* 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
*
*
*
*/
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 when connected to indicate disconnect l2cap connection.
* This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
* @param[in] rsi_ble_cbfc_disconn contains the disconnect device information
*
*
*
*/
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 contains the controller support AE Adv packets information
* @param[out] resp_status contains the response status (Success or 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 contains the controller support AE periodic sync established information
* @param[out] resp_status contains the response status (Success or 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
* @param[out] rsi_ble_event_per_adv_report contains the controller support AE periodic advertisement information
* @param[out] resp_status contains the response status (Success or Error code)
*
* 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_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
* @param[out] rsi_ble_event_per_adv_sync_lost contains the controller support AE periodic sync lost information
* @param[out] resp_status contains the response status (Success or Error code)
*
* 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_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
* @param[out] rsi_ble_event_scan_timeout contains the controller support AE scan timeout information
* @param[out] resp_status contains the response status (Success or Error code)
*
* This callback function will be called when AE scan timeout 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);
/**
* @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
* @param[out] rsi_ble_event_adv_set_terminated contains the controller support AE advertising set terminated information
* @param[out] resp_status contains the response status (Success or Error code)
*
*
* 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.
*
*/
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
* @param[out] rsi_ble_event_scan_req_recvd contains the controller support AE scan request received information
* @param[out] resp_status contains the response status (Success or Error code)
*
* This callback function will be called when AE scan request received is received
* This callback has to be registered using rsi_ble_ae_events_register_callbacks API
*/
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_enhnace_conn_status_s
rsi_ble_event_le_ping_time_expired_s
rsi_bt_event_le_security_keys_s
rsi_bt_event_encryption_enabled_s
rsi_bt_event_smp_passkey_display_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
rsi_ble_event_profile_by_uuid_s
rsi_ble_resp_query_profile_descriptor_s
rsi_ble_resp_local_att_value_s
rsi_ble_event_remote_device_info_s
rsi_ble_event_mtu_exchange_information_s
rsi_ble_event_directedadv_report_s
rsi_ble_event_cbfc_conn_complete_s
rsi_ble_set_smp_pairing_capabilty_data
rsi_ble_resp_read_max_data_length_s
Macros#
Maximum number of response list for BLE.
Maximum size of an advertising report.
Size of the BLE passkey.
Defines the output power front end loss for BLE.
Host descriptor length.
BLE write command event.
BLE write request event.
BLE notification event.
BLE indication event.
Indicates that the MTU exchange was initiated by the peer device.
Indicates that the MTU exchange was initiated by the local device.
The maximum length of advertising data.
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.
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.
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.
16 bit UUID format structure
32 bit UUID format structure
Represents the data of the particular profile descriptor.
Structure representing an attribute descriptor.
Structure representing characteristic service data.
Structure representing a characteristic service.
Structure representing the included service data.
Structure representing an included service attribute in a GATT server.
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.
Structure to hold the response for the BLE set attribute request.
Structure representing the response for the prepare write operation in BLE.
Structure to hold the response for the BLE profiles list command.
Structure representing the response for querying profile descriptors in BLE.
Structure to hold the response of characteristic services.
Structure representing the response for including a service in BLE.
Structure representing the response for an Attribute Protocol (ATT) value in Bluetooth Low Energy (BLE).
Structure representing the response for Attribute Descriptors in BLE.
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.
Structure representing a BLE write event.
Structure definition for preparing a write operation in BLE event.
Structure representing the BLE execute write request.
Structure representing the BLE read request.
Structure to hold the BLE MTU event information.
Structure to hold the MTU exchange information for a BLE event.
Structure for BLE event notification.
Structure representing the BLE event for an indication.
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.
Structure to hold the parameters for BLE periodic advertising transmission.
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
ae scan timeout report event
ae adv set terminated report event
ae scan request recvd report event
Structure representing the BLE buffer statistics.
Callback function advertise event report from the module.
Callback function for the BLE connection status from the module.
Callback function for the BLE connection status from the module.
Callback function for the disconnect status event from the module.
Callback function for the LE ping time expired event from the module.
Callback function for the LE LTK request event from the module.
Callback function for the LE security keys event from the module.
Callback function for SMP request in central mode from the remote device.
Callback function for SMP request in peripheral mode from the remote device.
Callback function for SMP passkey event from the module.
Callback function for SMP passkey display event from the module.
Callback function for SMP failed event from the module.
Callback function for a security method event from the module.
Callback function an encrypted event from the module.
Callback function for a BLE Secure Connection passkey event from the module.
Callback function for receiving the PHY update complete event.
Callback function for a connection update complete event from the module.
Callback function for remote connection parameters request.
Callback function for peer device supported features.
Callback function for the LE more data event.
Callback function for the data length update complete event.
Callback function for a directed advertise report event from the module.
Callback function for a GATT error event from the module.
Callback function for an attribute descriptors event from the module.
Callback function for a profiles list response from the module.
Callback function for a profile response from the module.
This callback function will be called if the characteristic services list response is received from the module.
Callback function for an include services list response from the module.
Callback function for an attribute value response from the module.
Callback function for an attribute value from the module.
Callback function for a GATT write response from the module.
Callback function for indication confirmation event.
Callback function for a GATT prepare response from the module.
Callback function for a profiles list response from the module.
Callback function for a profile response from the module.
Callback function for a service characteristics response from the module.
Callback function for an include service response from the module.
Callback function for an attribute descriptors response from the module.
Callback function for receiving an attribute value from the module.
Callback function for attribute set/prepare/execute action completion.
Callback function for GATT write, notify, or indicate events from the module.
The callback function will be called if the GATT prepare events are received.
The callback function will be called if the GATT execute events are received.
The callback function will be called if the GATT read request events are received.
The callback function will be called if MTU size request is received.
Callback function to indicate MTU size and who initiated MTU Exchange Request.
Callback function to peer device information.This callback function will be called when conn update complete event is received This callback has to be registered using rsi_ble_enhanced_gap_extended_register_callbacks API.
Callback function type for receiving RCP response events.
Callback function to indicate L2CAP CBFC connection request.This callback function will be called when connected to indicate connection request This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
Callback function to indicate L2CAP CBFC connection complete status.
Callback function to indicate L2CAP CBFC RX data event.
Callback function to indicate L2CAP CBFC disconnection event.
Typedef for the chip_ble_buffers_stats_handler_t function pointer.
Callback function to report the AE Advertisements.
Callback function to report the AE periodic sync established event.
Callback function to report the AE periodic advertisement event.
Callback function to report the AE periodic sync lost event.
Callback function to report the AE scan timeout event.
Callback function to report the AE advertising set terminated event.
Callback function to report the AE scan request received event.
Functions#
Converts the given transmit power in dBm to power index.
Request the local device to set a random address.
Request the local device to set a given random address.
Request the local device to start advertising.
Request the local device to start advertising with specified values.
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.0 for further details.
Stop advertising, this is a Blocking API.
Set the advertising data.
Request the local device to set the scan response data, this is a Blocking API.
Start scanning, this is a Blocking API A received event rsi_ble_on_adv_report_event_t indicates advertise report of remote device received.
Start scanning with values.
Stop scanning.
Connect to the remote BLE device with the user configured parameters.
Connect to the remote BLE device.
Connect to the remote BLE device with the user configured parameters.
Cancel the connection to the remote BLE device.
Disconnect with the remote BLE device.
Get the local device state.
Set the SMP Pairing Capability of local device.
Set the IRK value to the local device.
Give the response for the remote device connection parameter request.
Request the SMP pairing process with the remote device.
Send SMP pairing failure reason to the remote device.
Send the local long term key of its associated local EDIV and local Rand.
Send SMP pairing response during the process of pairing with the remote device.
Send SMP passkey during SMP pairing process with the remote device.
Get the timeout value of the LE ping.
Set the timeout value of the LE ping.
Clear all the BD address present in accept list.
Add BD address to accept list.
Delete particular BD address from accept list.
Resolvlist API used for multiple purposes based on the process type.
Request to get resolving list size.
Request to enable address resolution, and to set resolvable private address timeout.
Request to set privacy mode for particular device, this is a Blocking API.
Reads the TX and RX PHY rates of the Connection.
Set TX and RX PHY.
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.
Sets the TX octets and the TX time of specified link (remote device connection), this is a Blocking API.
reads the max supported values of TX octets, TX time, RX octets and Rx time.
Start the BLE RX test mode in controller.
Start the BLE TX test mode in controller.
Stop the BLE TX / RX test mode in controller.
Initiate the BLE transmit PER mode in the controller.
Initiate the BLE receive PER mode in the controller.
Give vendor-specific command to set the acceptlist feature based on the advertisers advertising payload, this is a Blocking API.
Used to extract remote Bluetooth device name from the received advertising report.
Start the encryption process with the remote device.
Set TX power.
Get the supported profiles / services of the connected remote device.
Get the specific profile / service of the connected remote device.
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.
Get the supported include services of the connected / remote device.
Get the characteristic value by UUID (char_uuid).
Get the characteristic descriptors list from the remote device.
Get the attribute by handle.
Get the multiple attribute values by using multiple handles.
Get the long attribute value by using handle and offset.
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.
Set the attribute value without waiting for an ACK from the remote device.
Set the long attribute value of the remote device.
Prepare the attribute value.
Execute the prepared attribute values.
Add a new service to the local GATT Server.
Add a new attribute to a specific service.
Change the local attribute value.
Configure the buf mode for Notify and WO response commands for the remote device.
Notify the local value to the remote device.
Indicate the local value to the remote device.
Indicate the local value to the remote device.
Send indicate confirmation to the remote device.
Get the local attribute value.
Send the response for the read request received from the remote device This is a blocking API.
Remove the GATT service record.
Remove the GATT attribute record.
Send attribute error response for any of the att request.
Initiates the MTU exchange request with the remote device.
This function (Exchange MTU Response) is sent in reply to a received Exchange MTU Request.
Send the response to the write request received from the remote device.
Send the response for the prepare write requests received from the remote device.
Get maximum advertising data length.
Get maximum number of advertising sets.
Update AE random address.
Update AE advertiser data.
Update AE parameters.
Enable or disable AE advertising.
Clear or remove an advertising set.
Update periodic AE parameters.
Enable or disable periodic advertising.
Update AE scan parameters.
Enable or disable legacy and extended scanning.
Synchronize periodic advertising with advertiser.
Manage a device in the periodic advertiser list.
Get periodic advertiser list size.
Establish ACL connection to advertiser.
Get supported transmit power range.
Get the supported profiles / services of the connected remote device asynchronously.
Get the specific profile / service of the connected remote device.
Get the service characteristics of the connected / remote device.
Get the supported include services of the connected / remote device.
Get the characteristic value by UUID (char_uuid).
Get the characteristic descriptors list from the remote device.
Get the attribute with a handle.
Get the multiple attribute values by using multiple handles.
Get the long attribute value by using handle and offset.
Set the attribute value of the remote device.
Prepare the attribute value.
Execute the prepared attribute values.
Sends a connection request to a remote device using the Credit Based Flow Control (CBFC) mechanism.
Sends a connection response for a credit-based flow control (CBFC) connection.
Transmits data over a Connection-Based Flow Control (CBFC) channel in the Bluetooth Low Energy (BLE) module.
Disconnects a Connection-Based Flow Control (CBFC) connection with the specified device address and logical channel ID.
Register GAP callbacks.
Register GAP Extended responses/events callbacks.
Registers a callback function for the Enhanced GAP Extended feature in the RSI BLE module.
Registers callback functions for extended advertising events in the BLE module.
Register the SMP callbacks.
Register callbacks for BLE L2CAP Credit Based Flow Control (CBFC) events.
Register the GATT callbacks.
Register the GATT Extended responses/events callbacks.
Macro Definition Documentation#
RSI_BLE_MAX_RESP_LIST#
#define RSI_BLE_MAX_RESP_LISTValue:
0x05
Maximum number of response list for BLE.
28
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
RSI_MAX_ADV_REPORT_SIZE#
#define RSI_MAX_ADV_REPORT_SIZEValue:
31
Maximum size of an advertising report.
30
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
BLE_PASSKEY_SIZE#
#define BLE_PASSKEY_SIZEValue:
6
Size of the BLE passkey.
32
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_LOSSValue:
0 /* db */
Defines the output power front end loss for BLE.
35
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
RSI_HOST_DESC_LENGTH#
#define RSI_HOST_DESC_LENGTHValue:
16
Host descriptor length.
38
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
RSI_BLE_WRITE_CMD_EVENT#
#define RSI_BLE_WRITE_CMD_EVENTValue:
0x01
BLE write command event.
1030
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
RSI_BLE_WRITE_REQUEST_EVENT#
#define RSI_BLE_WRITE_REQUEST_EVENTValue:
0x02
BLE write request event.
1032
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
RSI_BLE_NOTIFICATION_EVENT#
#define RSI_BLE_NOTIFICATION_EVENTValue:
0x03
BLE notification event.
1034
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
RSI_BLE_INDICATION_EVENT#
#define RSI_BLE_INDICATION_EVENTValue:
0x04
BLE indication event.
1036
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
PEER_DEVICE_INITATED_MTU_EXCHANGE#
#define PEER_DEVICE_INITATED_MTU_EXCHANGEValue:
0x1
Indicates that the MTU exchange was initiated by the peer device.
1119
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
LOCAL_DEVICE_INITATED_MTU_EXCHANGE#
#define LOCAL_DEVICE_INITATED_MTU_EXCHANGEValue:
0x2
Indicates that the MTU exchange was initiated by the local device.
1120
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
ADV_DATA_LEN#
#define ADV_DATA_LENValue:
210
The maximum length of advertising data.
1701
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
DEVICE_ADDR_LEN#
#define DEVICE_ADDR_LENValue:
6
Length of the device address in bytes.
1703
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.
89
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.
102
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.
130
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.
143
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.
153
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.
168
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.
199
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.
232
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.
244
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.
298
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.
307
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.
318
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.
331
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.
340
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.
353
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.
366
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.
396
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.
413
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.
431
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.
444
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.
456
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.
475
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 UUID.
496
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
499
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
502
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-bit, 32-bit, or 128-bit. 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.
558
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.
574
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.
593
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.
612
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.
629
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.
643
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.
657
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.
685
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.
706
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.
723
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.
739
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.
758
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.
772
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.
791
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.
807
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.
823
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.
837
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.
846
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.
864
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 to hold the response for the BLE profiles list command.
879
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 response for querying profile descriptors in BLE.
891
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.
922
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 response for including a service in BLE.
937
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).
950
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 response for Attribute Descriptors in BLE.
965
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.
976
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.
989
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.
1006
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.
1017
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.
1053
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.
1071
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.
1084
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.
1105
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.
1117
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.
1139
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_event_notify_t#
typedef struct rsi_ble_event_notify_s rsi_ble_event_notify_t
Structure for BLE event notification.
1154
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h
rsi_ble_event_indication_t#
typedef struct rsi_ble_event_indication_s rsi_ble_event_indication_t
Structure representing the BLE event for an indication.
This structure is used to define the parameters for a BLE event that involves an indication from a remote device.
1173
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.
1193
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.
1208
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.
1227
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.
1244
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.
1257
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.
1316
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.
1346
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.
1373
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.
1603
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.
1698
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
1788
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
1833
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
1859
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
1865
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
1871
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
1889
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
1905
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.
1921
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.
[out] | rsi_ble_event_adv | contains the advertise report information. Please refer rsi_ble_event_adv_report_s for more info. |
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
4558
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.
[out] | rsi_ble_event_conn | contains the BLE connection status. Please refer rsi_ble_event_conn_status_s for more info. |
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
4571
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.
[out] | rsi_ble_event_enhance_conn | contains the BLE connection status. Please refer 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
4584
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.
[out] | rsi_ble_event_disconnect | contains the disconnect status. Please refer 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
4605
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.
[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
4617
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.
[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
4630
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.
[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. Returns
The following values are returned: void
4642
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.
[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. Returns
The following values are returned: void
4662
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.
[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
4676
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.
[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. Returns
The following values are returned: void
4691
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.
[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. Returns
The following values are returned: void
4706
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.
[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
Returns
The following values are returned: void
4733
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.
[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. Returns
The following values are returned: void
4747
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.
[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. Returns
The following values are returned: void
4762
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.
[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. Returns
The following values are returned: void
4778
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.
[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
4793
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.
[out] | rsi_ble_event_conn_update_complete | contains the controller support conn 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. It has to be registered using the rsi_ble_gap_register_callbacks
API.
Returns
The following values are returned: void
4810
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.
[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
4827
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 peer device supported features.
[out] | rsi_ble_event_remote_features | contains the remote device supported features. See rsi_ble_event_remote_features_s for more information. |
This callback function will be called when conn update complete event is received. it has to be registered using rsi_ble_gap_extended_register_callbacks API. Returns
The following values are returned: void
4841
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.
[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
4856
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.
[out] | remote_dev_address | contains the controller support TX and RX length 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. It has to be registered using the rsi_ble_gap_register_callbacks
API. Returns
The following values are returned: void
4870
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.
[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.
4881
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.
[out] | event_status | contains the error response |
[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
5035
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_gatt_desc_val | contains the profiles list event information. Please refer rsi_ble_event_gatt_desc_s for more info |
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
5052
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_event_profiles | contains the profiles list event information. Please refer rsi_ble_event_profiles_list_s for more info |
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
5074
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_event_profile | contains the profile response information. Please refer rsi_ble_event_profile_by_uuid_s for more info. |
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
5096
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_event_read_type1 | contains the char services event information. Please refer rsi_ble_event_read_by_type1_s for more info. |
Returns
The following values are returned: void
5112
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_event_read_type2 | contains the inc services information. Please refer rsi_ble_event_read_by_type2_s for more info. |
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
5134
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_event_read_type3 | contains the char services event information. Please refer rsi_ble_event_read_by_type3_s for more info. |
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
5152
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_event_att_val | contains the profile response information. Please refer rsi_ble_event_att_value_s for more info. |
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
5170
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_event_set_att_rsp | contains the profile response information. Please refer rsi_ble_set_att_resp_t for more info. |
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
5188
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_event_set_att_rsp | contains the profile response information. Please refer rsi_ble_set_att_resp_s for more info. |
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
5205
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.
[out] | event_status | contains the response status
|
[out] | rsi_ble_event_prepare_write | contains the char services event information. Please refer rsi_ble_prepare_write_resp_s for more info. |
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
5222
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.
[out] | resp_status | contains the profiles list response information. Please refer rsi_ble_resp_profiles_list_s for more info. |
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
5243
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.
[out] | resp_status | contains the profile response information. Please refer profile_descriptors_s for more info |
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
5264
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.
[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
5290
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.
[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
5320
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.
[out] | resp_status | contains the attribute descriptors response information. Please refer rsi_ble_resp_att_descs_s for more info |
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
5345
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.
[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 info |
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
Returns
The following values are returned: void
5377
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.
[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
5405
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.
[out] | event_id | contains the gatt_write event id (RSI_BLE_EVENT_GATT_WRITE) |
[out] | rsi_ble_write | contains the GATT event information. Please refer rsi_ble_event_write_s for more info |
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.
5424
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)
The callback function will be called if the GATT prepare events are received.
[out] | event_id | contains the gatt_prepare_write event id (RSI_BLE_EVENT_PREPARE_WRITE) |
[out] | rsi_ble_write | contains the GATT prepare event information. Please refer rsi_ble_event_prepare_write_s for more info |
This callback has to be registered using rsi_ble_gatt_register_callbacks API.
5435
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 execute events are received.
[out] | event_id | contains the gatt_execute_write event id (RSI_BLE_EVENT_EXECUTE_WRITE) |
[out] | rsi_ble_execute_write | contains the GATT event information. Please refer rsi_ble_execute_write_s for more info. |
This callback has to be registered using rsi_ble_gatt_register_callbacks API.
5447
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.
[out] | event_id | contains the gatt_read_req_event id (RSI_BLE_EVENT_READ_REQ) |
[out] | rsi_ble_read_req | contains the GATT event information. Please refer rsi_ble_read_req_s for more info. |
This callback has to be registered using rsi_ble_gatt_register_callbacks API.
5457
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.
[out] | rsi_ble_event_mtu | contains the MTU size information. Please refer rsi_ble_event_mtu_s for more info. |
This callback function will be called when connected to indicate MTU size. This callback has to be registered using rsi_ble_gatt_register_callbacks API.
5467
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 to indicate MTU size and who initiated MTU Exchange Request.
[out] | rsi_ble_event_mtu_exchange_info | contains the MTU exchange information. Please refer rsi_ble_event_mtu_exchange_information_s for more info. |
This callback function will be called when connected, this event will contain MTU Exchange Information. This callback has to be registered using rsi_ble_gatt_extended_register_callbacks API.
5478
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 peer device information.This callback function will be called when conn update complete event is received This callback has to be registered using rsi_ble_enhanced_gap_extended_register_callbacks API.
[out] | status | contains the remote device version information. |
Note
Refer Bluetooth Generic Error Codes section up to 0x4FF8 from error-codes.
5494
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.
N/A | status | The status of the RCP response event. |
N/A | resp_buffer | Pointer to the buffer containing the RCP response information. |
5507
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 indicate L2CAP CBFC connection request.This callback function will be called when connected to indicate connection request This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
[in] | rsi_ble_cbfc_conn_req | contains the connection request information |
5524
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.
[in] | status | |
[in] | rsi_ble_cbfc_conn_complete | contains the connection completed information |
This callback function will be called when connected to indicate connection complete status. This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
5537
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.
[in] | rsi_ble_cbfc_rx_data | contains the received data information |
This callback function will be called when connected to indicate received data. This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
5549
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.
[in] | rsi_ble_cbfc_disconn | contains the disconnect device information |
This callback function will be called when connected to indicate disconnect l2cap connection. This callback has to be registered using rsi_ble_l2cap_cbfc_callbacks API.
5561
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.
N/A | chip_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.
5593
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.
[out] | rsi_ble_event_ae_report | contains the controller support AE Adv packets information |
[out] | resp_status | contains the response status (Success or 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.
5606
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.
[out] | rsi_ble_event_per_adv_sync_estbl | contains the controller support AE periodic sync established information |
[out] | resp_status | contains the response status (Success or 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.
5620
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.
[out] | rsi_ble_event_per_adv_report | contains the controller support AE periodic advertisement information |
[out] | resp_status | contains the response status (Success or Error code) |
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
5633
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.
[out] | rsi_ble_event_per_adv_sync_lost | contains the controller support AE periodic sync lost information |
[out] | resp_status | contains the response status (Success or Error code) |
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
5646
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.
[out] | rsi_ble_event_scan_timeout | contains the controller support AE scan timeout information |
[out] | resp_status | contains the response status (Success or Error code) |
This callback function will be called when AE scan timeout is received This callback has to be registered using rsi_ble_ae_events_register_callbacks API
5659
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.
[out] | rsi_ble_event_adv_set_terminated | contains the controller support AE advertising set terminated information |
[out] | resp_status | contains the response status (Success or Error code) |
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.
5673
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.
[out] | rsi_ble_event_scan_req_recvd | contains the controller support AE scan request received information |
[out] | resp_status | contains the response status (Success or Error code) |
This callback function will be called when AE scan request received is received This callback has to be registered using rsi_ble_ae_events_register_callbacks API
5686
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.
N/A | tx_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.
1941
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.
N/A |
This is a blocking API.
Pre-conditions: Call rsi_wireless_init() before calling this 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 .
1959
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.
[in] | random_addr | - random address of the device to be set |
This is a blocking API.
Pre-condition:
Call rsi_wireless_init() before calling this 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 .
1975
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.
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
Pre-condition: Call rsi_wireless_init() before calling this 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
Refer to the Status Codes section for the above error codes at additional-status-codes .
1994
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.
[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 rsi_wireless_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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2013
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.0 for further details.
[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 rsi_wireless_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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2031
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.
N/A |
Pre-conditions: Call rsi_ble_start_advertising() before calling this 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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2048
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.
[in] | data | - Advertising data. |
[in] | data_len | - Total length of advertising data. |
This is a blocking API.
Pre-condition: Call rsi_wireless_init() before calling this 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.
2067
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.
[in] | data | - Data about to be sent |
[in] | data_len | - Length of data, which is about to be sent |
Pre-conditions: Call rsi_wireless_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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2084
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.
N/A |
Pre-condition: Call rsi_wireless_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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2102
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.
[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.
Pre-condition:
Call rsi_wireless_init() before calling this API.
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 .
2119
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.
N/A |
This is a blocking API
Pre-conditions:
rsi_ble_start_scanning() API needs to be called before this 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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2135
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.
[in] | remote_dev_addr_type | - AddressType - Specifies the type of the address mentioned in BD Address
|
[in] | remote_dev_addr | - This parameter describes the device address of remote device |
[in] | scan_interval | - LE Scan Interval : N=0xXXXX
|
[in] | scan_window | - LE Scan Window : N=0xXXXX
|
[in] | conn_interval_max | - Max Connection Interval : N=0xXXXX
|
[in] | conn_interval_min | - Min Connection Interval : N=0xXXXX
|
[in] | conn_latency | - Connection Latency : N = 0xXXXX
|
[in] | supervision_tout | - Supervision Timeout : N = 0xXXXX
|
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.
Pre-conditions: Call rsi_wireless_init() before calling this API.
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 .
2202
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.
[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.
Pre-conditions: Call rsi_wireless_init() before calling this API.
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.
2232
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.
[in] | ble_enhance_conn_params | - BLE enhance connection parameter structure. See notes for the fields in this structure. |
Pre-conditions: Call rsi_wireless_init() before calling this 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
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
2290
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
2308
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.
[in] | remote_dev_address | - This parameter describes the device address of the remote device |
This is a blocking API.
Pre-conditions: rsi_ble_connect() API needs to be called before this 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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2326
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.
[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".
Pre-conditions:
Call rsi_wireless_init() before calling this 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 .
2350
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.
[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.
Pre-conditions: Call rsi_wireless_init() before calling this 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 .
2367
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.
[in] | l_irk | - l_irk Pointer to local_irk |
This is a blocking API.
Pre-conditions:
Call rsi_wireless_init() before calling this API.
Returns
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 .
2381
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.
[in] | remote_dev_address | - remote device address |
[in] | status | - accept or reject the connection parameters update request
|
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.
Returns
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 .
2402
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.
[in] | remote_dev_address | - MITM enable/disable
|
[in] | io_capability | - This is the device input output capability |
N/A | mitm_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
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2432
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.
[in] | remote_dev_address | - This is the remote device address |
[in] | reason | - This is the reason for SMP Pairing Failure
|
Pre-conditions: rsi_ble_connect() API needs to be called before this 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
2451
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.
[in] | remote_dev_address | - remote device address |
[in] | reply_type | - 0 - Negative reply
|
[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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2479
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.
[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
|
This is a blocking API.
A received event rsi_ble_on_smp_passkey_t indicated Legacy SMP passkey is received and need to respond back with rsi_ble_smp_passkey()
A received event rsi_ble_on_sc_passkey_t indicated BLE SC passkey is received and need to respond back with rsi_ble_smp_passkey()
A received event rsi_ble_on_smp_passkey_display_t indicates SMP passkey display is received from the module
A received event rsi_ble_on_smp_failed_t indicated SMP Failed event is received
Pre-condition: rsi_ble_connect() API needs to be called before this 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 .
2510
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.
[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
Pre-conditions: Call rsi_ble_smp_pair_request and rsi_ble_smp_pair_response before calling this 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 .
2534
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this 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.
2556
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.
[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
Pre-conditions:
rsi_ble_connect() API needs to be called before this 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 .
2578
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.
N/A |
This is a blocking API.
Pre-conditions: Call rsi_wireless_init() before calling this 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 .
2593
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.
[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.
Pre-conditions:
Call rsi_wireless_init() before calling this 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 .
2611
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.
[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.
Pre-conditions:
rsi_ble_addto_acceptlist() API needs to be called before this 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 .
2628
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.
[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.
Pre-conditions: Call rsi_wireless_init() before calling this 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 .
2656
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.
[out] | resp | - output parameter which consists of supported resolving the list size. |
This is a blocking API.
Pre-conditions:
Call rsi_wireless_init() before calling this 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 .
2676
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.
[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/A | tout |
This is a blocking API.
Pre-conditions:
Call rsi_wireless_init() before calling this 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
2694
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.
[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 |
Pre-conditions: Call rsi_wireless_init() before calling this 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 .
2716
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
2731
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.
[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)
|
[in] | rx_phy | - receive PHY rate BIT(0) - Host prefers to use the LE 1M receiver PHY (possibly among others)
|
[in] | coded_phy | - TX/RX coded PHY rate
|
This is a blocking API. A received event rsi_ble_on_phy_update_complete_t indicates PHY rate update complete.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2765
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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.
2801
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.
[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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2827
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.
[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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
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 .
2842
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.
[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 will have a standard standard modulation index 0x01 Assume transmitter will 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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2867
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.
[in] | tx_channel | - RF Channel (0-39). |
[in] | phy | - 0x00 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...'
|
This is a blocking API. Returns
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 .
2896
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.
[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
Refer to the Status Codes section for the above error codes at additional-status-codes .
2908
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.
[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.
Pre-conditions: Call rsi_wireless_init() before calling this API.
Returns
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 .
2923
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.
[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.
Pre-conditions: Call rsi_wireless_init() before calling this API.
Returns
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 .
2938
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.
[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 |
Pre-conditions: Call rsi_wireless_init() before calling this 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
0x4E62 Invalid Parameters
Note
Refer to the Status Codes section for the above error codes at additional-status-codes .
2966
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.
[in] | remote_name | - device name |
[in] | pbuf | - advertise data packet buffer pointer |
[in] | buf_len | - buffer length |
Pre-conditions: Call rsi_wireless_init() before calling this API.
2982
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.
[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
Refer to the Status Codes section for the above error codes at additional-status-codes.
3008
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.
[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
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 - 0dBm mode.
33 to 63: BLE - 10dBm mode.
64 to 82: BLE - 1dBm - 18dBm HP mode in the resolution of 1dBm.
104 to 126: BLE - 0.5dBm - 11dBm HP mode in the resolution of 0.5dbm.
127: BLE HP Mode, max power supported.
Use the following setting to indicate tx_power in dBm (-8dBm to 18dBm):
#define RSI_BLE_PWR_INX_DBM 1
When switching between HP mode and LP mode, please 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
3135
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.
[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, please refer 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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3170
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3197
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.
[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, please refer rsi_ble_resp_char_serv_s structure for more info. |
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3222
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.
[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, please refer 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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3250
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).
[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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3280
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.
[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, Please refer 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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3308
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.
[in] | dev_addr | - remote device address |
[in] | handle | - handle value of the attribute |
[out] | p_att_val | - attribute value is filled in this structure, Please refer 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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3331
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.
[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, please refer 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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3354
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.
[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, please refer 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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3380
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.
[in] | dev_addr | - remote device address |
[in] | handle | - attribute value handle |
[in] | data_len | - attribute value length |
[in] | p_data | - attribute value |
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3404
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
3428
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3453
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.
[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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3480
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.
[in] | dev_addr | - remote device address |
[in] | exe_flag | - execute flag to write, possible values mentioned below
|
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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
3504
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.
[in] | service_uuid | - new service UUID value, please refer uuid_s structure for more info. |
[out] | p_resp_serv | - new service handler filled in this structure, please refer rsi_ble_resp_add_serv_s structure for more info. |
This is a blocking API.
Pre-conditions:
Call rsi_wireless_init() before calling this API.
Returns
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 .
3529
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.
[in] | p_attribute | - add a new attribute to the service, please refer rsi_ble_req_add_att_s structure for more info. |
This is a blocking API.
Pre-conditions: Call rsi_wireless_init() before calling this API.
Returns
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 .
3545
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.
[in] | handle | - attribute value handle |
[in] | data_len | - attribute value length |
[in] | p_data | - attribute value |
This is a blocking API.
Pre-conditions: rsi_ble_connect() API needs to be called before this 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.
3574
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.
[in] | dev_addr | - remote device address |
[in] | buf_mode | - buffer mode configuration
|
[in] | buf_cnt | - no of buffers to be configured only value 1 and 2 are supported in BLE_SMALL_BUFF_MODE |
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
3602
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.
[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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes
If the services are maintained in the Application/Host, then need to use rsi_ble_notify_value() API instead of using rsi_ble_set_local_att_value() API to send the notifications to the remote devices.
3630
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.
[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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
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
3651
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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
3680
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.
[in] | dev_addr | - remote device address |
This is a blocking API.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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
3695
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this 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.
3722
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.
[in] | dev_addr | - remote device Address |
[in] | read_type | - read value type
|
[in] | handle | - attribute value handle |
[in] | offset | - attribute value offset |
[in] | length | - attribute value length |
[in] | p_data | - attribute value |
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
Returns
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
3749
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.
[in] | service_handler | - GATT service record handle |
This is a blocking API.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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
3769
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.
[in] | service_handler | - GATT service record handle |
[in] | att_hndl | - attribute handle |
This is a blocking API.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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
3785
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before 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
3805
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.
[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.
Pre-conditions:
rsi_ble_connect() API needs to be called before 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
3828
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.
[in] | dev_addr | - Remote Device Address |
[in] | mtu_size | - requested MTU value |
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes
3845
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.
[in] | dev_addr | - remote device address |
[in] | type | - response type
|
This is a blocking API.
Pre-conditions: rsi_ble_connect() API needs to be called before this 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
3869
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this 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
3893
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.
[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.
3913
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.
[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.
3927
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.
[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
3940
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.
[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 .
3954
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.
[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
3967
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.
[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
3979
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)
Clear or remove an advertising set.
[in] | type | Set to 1 to clear, or 2 to remove an advertising set |
[in] | handle | Advertising handle identifying the advertising set to remove or clear. Possible values range from 0x00 to 0xEF. |
Returns
The following values are returned: 0 = success
The following values are returned: !0 = failure
3992
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.
[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
4004
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 or disable periodic advertising.
[in] | enable | Set to 0 to enable, 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
The following values are returned: !0 = failure
Note
This function requests the controller to enable or disable periodic advertising for the specified advertising set.
4019
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.
[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.
4033
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)
Enable or disable legacy and extended scanning.
[in] | ae_scan_enable | Parameters specify whether to enable or disable both legacy and extended advertising PDUs |
Returns
The following values are returned: 0 = success
The following values are returned: !0 = failure
4045
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 periodic advertising with advertiser.
[in] | type | Set to 1 to begin, 2 to cancel, or 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
The following values are returned: 0x4E42 = unknown advertising identifier
The following values are returned: 0x4E0C = command not permitted
Note
This function performs an operation to synchronize with a periodic advertising train from an advertiser and begin receiving periodic advertising packets.
The operation is either started, cancelled or terminated depending on the type parameter.
4064
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.
[in] | dev_to_list | Details of a device to be added to the periodic advertiser list |
Returns
The following values are returned: 0 = success
The following values are returned: !0 = failure
Note
This function adds, removes, or clears a device from the periodic advertiser list.
4078
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.
[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
4090
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.
[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.
4104
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.
[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.
4118
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4161
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.
[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, please refer 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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4189
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4219
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.
[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, please refer 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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4251
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).
[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, please refer 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.
Pre-conditions:
rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4284
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.
[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, Please refer rsi_ble_resp_att_descs_s strcuture for more info.
|
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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4317
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.
[in] | dev_addr | - remote device address |
[in] | handle | - handle value of the attribute |
[out] | p_att_val | - attribute value is filled in this structure, Please refer 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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4344
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.
[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, please refer 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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4370
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.
[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, please refer 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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
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 .
4400
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4427
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.
[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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API
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
Refer to the Status Codes section for the above error codes at additional-status-codes .
4454
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.
[in] | dev_addr | - remote device address |
[in] | exe_flag | - execute flag to write, possible values mentioned below
|
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.
Pre-conditions: rsi_ble_connect() API needs to be called before this API.
Returns
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 .
4478
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.
N/A | dev_addr | Pointer to the device address of the remote device. |
N/A | psm | 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.
4496
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.
N/A | dev_addr | The device address of the remote device. |
N/A | lcid | The logical channel ID of the connection. |
N/A | result | 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.
4510
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.
N/A | dev_addr | Pointer to the device address of the BLE module. |
N/A | lcid | Logical channel ID of the CBFC channel. |
N/A | len | Length of the data to be transmitted. |
N/A | p_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.
4526
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.
N/A | dev_addr | The device address of the remote device. |
N/A | lcid | 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.
4541
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.
[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 conn update complete events |
[in] | ble_on_remote_conn_params_request_event | - Callback function to remote conn params request events |
4902
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.
[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 |
Pre-conditions: Call rsi_wireless_init() before calling this API.
Note
For more information about each callback, see the GAP Extended callbacks description section.
4924
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.
N/A | callback_id | The ID of the callback to register. |
N/A | callback_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.
4946
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.
N/A | callback_id | The ID of the callback function to register. |
N/A | 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)
|
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.
4971
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.
[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 |
4990
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.
N/A | ble_on_cbsc_conn_req | Callback function to handle CBFC connection request event. |
N/A | ble_on_cbsc_conn_complete | Callback function to handle CBFC connection complete event. |
N/A | ble_on_cbsc_rx_data | Callback function to handle CBFC receive data event. |
N/A | ble_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.
5578
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.
[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. |
5723
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.
[in] | ble_on_mtu_exchange_info_event | ble_on_mtu_exchange_info_event - Call back function for MTU Exchange information Event |
5754
of file components/device/silabs/si91x/wireless/ble/inc/rsi_ble_apis.h