Some of the GAP event callback functions are listed below:

rsi_bt_on_role_change_t

Prototype                           typedef struct rsi_bt_event_role_change_s

{

uint8_t dev_addr[RSI_DEV_ADDR_LEN];

uint8_t role_change_status;

} rsi_bt_event_role_change_t;

 

typedef void (*rsi_bt_on_role_change_t) (uint16_t resp_status, rsi_bt_event_role_change_t *role_change_status);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

uint8_t role_change_status: Role change status whether success or failure

Description This callback function will be called if the role change status event is received from the module.

rsi_bt_on_connect_t

Prototype                           typedef struct rsi_bt_event_bond_response_s

{

uint8_t dev_addr[RSI_DEV_ADDR_LEN];

} rsi_bt_event_bond_t;

 

typedef void (*rsi_bt_on_connect_t) (uint16_t resp_status, rsi_bt_event_bond_t *bond_response);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

Description This callback function will be called if new connection complete is received from the module. This event will be given by module in the following two scenarios

In case of   slave mode, when the connection is initiated from the remote device. In case of Master mode, when the connect command is issued to connect to a remote device.

rsi_bt_on_disconnect_t

Prototype                           typedef struct rsi_bt_event_disconnect_s

{

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

} rsi_bt_event_disconnect_t;

 

typedef void (*rsi_bt_on_disconnect_t) (uint16_t resp_status, rsi_bt_event_disconnect_t *bt_disconnect);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

Description This callback is called when disconnection event is raised from module. This event will be given by module when either slave or master device may issue disconnect to the other.

rsi_bt_on_scan_resp_t

Prototype                           typedef struct rsi_bt_event_inquiry_response_s

{

uint8_t  inquiry_type;

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

uint8_t  name_length;

INT08   remote_device_name[RSI_BT_DEVICE_NAME_LEN];

uint8_t  cod[3];

uint8_t  rssi;

} rsi_bt_event_inquiry_response_t;

 

typedef void (*rsi_bt_on_scan_resp_t) (uint16_t resp_status, rsi_bt_event_inquiry_response_t *single_scan_resp);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t  inquiry_type : Type of inquiry whether standard, extended, extended with RSSI

uint8_t dev_addr : Remote device address

uint8_t  name_length : Length of remote device name

INT08   remote_device_name : Remote device name

uint8_t  cod : Class of device

uint8_t  rssi : RSSI of module from remote device

Description This callback function will be called if the single scan response is received from the module in response to inquiry command.

rsi_bt_on_remote_name_resp_t

Prototype                           typedef struct rsi_bt_event_remote_device_name_s

{

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

uint8_t  name_length;

INT08   remote_device_name[RSI_BT_DEVICE_NAME_LEN];

} rsi_bt_event_remote_device_name_t;

 

typedef void (*rsi_bt_on_remote_name_resp_t) (uint16_t resp_status, rsi_bt_event_remote_device_name_t *name_resp);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

uint8_t  name_length : Length of remote device name

INT08   remote_device_name : Remote device name

Description This callback function will be called if the remote name request command response is received from the module.

 

rsi_bt_on_passkey_display_t

Prototype                           typedef struct rsi_bt_event_user_passkey_display_s

{

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

uint8_t  passkey[4];

} rsi_bt_event_user_passkey_display_t;

 

typedef void (*rsi_bt_on_passkey_display_t) (uint16_t resp_status, rsi_bt_event_user_passkey_display_t *bt_event_user_passkey_display);

 

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

uint8_t  passkey : Passkey to be displayed on our module side

Description This callback function will be called if passkey display request is received from the module.

 

rsi_bt_on_remote_name_request_cancel_t

Prototype                           typedef struct rsi_bt_event_remote_name_request_cancel_s

{

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

} rsi_bt_event_remote_name_request_cancel_t;

 

typedef void (*rsi_bt_on_remote_name_request_cancel_t) (uint16_t resp_status, rsi_bt_event_remote_name_request_cancel_t *remote_name_request_cancel);

 

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

Description This callback function will be called if the remote name request canacel command response is received from the module.

 

rsi_bt_on_confirm_request_t

Prototype                           typedef struct rsi_bt_event_user_confirmation_request_s

{

uint8_t dev_addr[RSI_DEV_ADDR_LEN];

uint8_t confirmation_value[4];

} rsi_bt_event_user_confirmation_request_t;

 

typedef void (*rsi_bt_on_confirm_request_t) (uint16_t resp_status, rsi_bt_event_user_confirmation_request_t *user_confirmation_request);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

uint8_t confirmation_value : Passkey to be confirmed

Description This callback function will be called if user confirmation request is received from the module. User has to give rsi_bt_accept_ssp_confirm or rsi_bt_reject_ssp_confirm command upon reception of this event.

 

rsi_bt_on_pincode_request_t

Prototype                           typedef struct rsi_bt_event_user_pincode_request_s

{

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

} rsi_bt_event_user_pincode_request_t;

 

typedef void (*rsi_bt_on_pincode_request_t) (uint16_t resp_status,rsi_bt_event_user_pincode_request_t *user_pincode_request);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

Description This callback function will be called if pincode request is received from the module. User has to give rsi_bt_accept_pincode_request command upon reception of this event.

 

rsi_bt_on_passkey_request_t

Prototype                           typedef struct rsi_bt_event_user_passkey_request_s

{

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

} rsi_bt_event_user_passkey_request_t;

typedef void (*rsi_bt_on_passkey_request_t) (uint16_t resp_status, rsi_bt_event_user_passkey_request_t *user_passkey_request);

 

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

Description This callback function will be called if passkey request is received from the module. User has to give rsi_bt_passkey command upon reception of this event.

 

rsi_bt_on_inquiry_complete_t

Prototype                           typedef void (*rsi_bt_on_inquiry_complete_t) (uint16_t resp_status);
Input Arguments uint16_t resp_status : Response status whether success or failure
Description This callback function will be called if inquiry complete status is received from the module. This event will be given by module when inquiry command is completely executed.

 

rsi_bt_on_auth_complete_t

Prototype                           typedef struct rsi_bt_event_auth_complete_s

{

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

} rsi_bt_event_auth_complete_t;

typedef void (*rsi_bt_on_auth_complete_t) (uint16_t resp_status, rsi_bt_event_auth_complete_t *auth_complete);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

Description This callback function will be called if authentication complete indication is received from the module.

 

rsi_bt_on_linkkey_request_t

Prototype                           typedef struct rsi_bt_event_user_linkkey_request_s

{

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

} rsi_bt_event_user_linkkey_request_t;

typedef void (*rsi_bt_on_linkkey_request_t) (uint16_t resp_status,     rsi_bt_event_user_linkkey_request_t *user_linkkey_request);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

Description This callback function will be called if linkkey request is received from the module. User has to give linkkey reply command upon reception of this event

 

rsi_bt_on_ssp_complete_t

Prototype                           typedef struct rsi_bt_event_ssp_complete_s

{

uint8_t   dev_addr[RSI_DEV_ADDR_LEN];

uint8_t   status;

} rsi_bt_event_ssp_complete_t;

typedef void (*rsi_bt_on_ssp_complete_t) (uint16_t resp_status, rsi_bt_event_ssp_complete_t *ssp_complete);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

uint8_t   status : SSP mode connection with remote device is success or failure.

Description This callback function will be called if SSP complete status is received from the module.

 

rsi_bt_on_linkkey_save_t

Prototype                           typedef struct rsi_bt_event_user_linkkey_save_s {

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

uint8_t  linkKey[RSI_LINK_KEY_LEN];

} rsi_bt_event_user_linkkey_save_t;

typedef void (*rsi_bt_on_linkkey_save_t) (uint16_t resp_status, rsi_bt_event_user_linkkey_save_t *user_linkkey_save);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t dev_addr : Remote device address

uint8_t  linkKey: Linkkey to be saved

Description This callback function will be called if linkkey save is received from the module.

 

rsi_bt_on_get_services_t

Prototype                           typedef struct rsi_bt_resp_query_services_s

{

uint8_t  num_of_services;

uint8_t  reserved[3];

uint32_t  uuid[32];

} rsi_bt_resp_query_services_t;

typedef void (*rsi_bt_on_get_services_t) (uint16_t resp_status, rsi_bt_resp_query_services_t  *service_list);

Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t  num_of_services: Number of services fetched

uint8_t  reserved: Reserved

uint32_t  uuid : Service uuid

Description This callback function will be called if the get services command response is received from the module.

 

rsi_bt_on_search_service_t

Prototype                           typedef void (*rsi_bt_on_search_service_t) (uint16_t resp_status, uint8_t *remote_dev_addr, uint8_t status);
Input Arguments uint16_t resp_status : Response status whether success or failure

uint8_t *remote_dev_addr: Remote device address

uint8_t status : Search service status whether success or failure

Description This callback function will be called if the search service command response is received from the module.

 

rsi_bt_on_mode_change_t

Prototype                           typedef struct rsi_bt_event_mode_change_s

{

uint8_t  dev_addr[RSI_DEV_ADDR_LEN];

uint8_t  current_mode;

uint8_t  reserved;

uint16_t  mode_interval;

} rsi_bt_event_mode_change_t;

typedef void (*rsi_bt_on_mode_chnage_t) (uint16_t resp_status,   rsi_bt_event_mode_change_t  *mode_change);

Input Arguments uint16_t resp_status  : Response status whether success or failure

uint8_t *remote_dev_addr : Remote device address

uint8_t  current_mode : Indicates the current state of connection between the local device and the remote device i.e., Active mode/ Sniff mode

uint8_t  reserved : Reserved

uint16_t  mode_interval : Specify a time amount specific to each mode

Description This callback function will be called when the local device enters/exits the Sniff mode.

 

rsi_bt_on_sniff_subrating_t

Prototype                           typedef struct rsi_bt_event_sniff_subrating_s

{

uint8_t   dev_addr[RSI_DEV_ADDR_LEN];

uint16_t  max_tx_latency;

uint16_t  min_remote_timeout;

uint16_t  min_local_timeout;

} rsi_bt_event_sniff_subrating_t;

typedef void (*rsi_bt_on_sniff_subrating_t) (uint16_t resp_status, rsi_bt_event_sniff_subrating_t  *mode_change);

Input Arguments uint16_t resp_status  : Response status whether success or failure

uint8_t *remote_dev_addr : Remote device address

uint16_t max_tx_latency: Maximum latency for data being transmitted from the local device to the remote device.

uint16_t  min_remote_timeout: The base sniff subrate timeout in

baseband slots that the remote device shall use.

uint16_t min_local_timeout: The base sniff subrate timeout in baseband slots that the local device shall use.

Description This callback function will be called when Sniff subrating is enabled or the parameters are negotiated with the remote deivce.