GAP#

Functions#

int32_t
rsi_bt_set_local_class_of_device(uint32_t class_of_device)

Sets the local device COD (The Class_Of_Device parameter is used to indicate the capabilities of the local device to other device). This is a blocking API.

int32_t

Gets the local device COD (The Class_Of_Device parameter is used to indicate the capabilities of the local device to other device). This is a blocking API.

int32_t

Sets the BT Module discovery mode status to INQUIRY_SCAN. This is a blocking API.

int32_t

Request the local device to enter limited discovery mode. The device comes out of discovery mode after the time out. If the 'time_out_ms' is set to '0', the device will be in continuous discoverable mode. This is a blocking API.

int32_t
rsi_bt_write_current_iac_lap(uint8_t no_of_iaps, uint8_t *iap_lap_list)

Write the current iac lap to the controller. This is a blocking API.

int32_t

Clears INQUIRY_SCAN BIT from BT Module discovery mode. This is a blocking API.

int32_t

Gets the BT Module discovery mode status, whether INQUIRY_SCAN enabled/not. This is a blocking API.

int32_t

Sets the BT Module connectablity status to PAGE_SCAN. This is a blocking API.

int32_t
rsi_bt_set_afh_host_channel_classification(uint8_t enable, uint8_t *channel_map)

Sets the No.of channels to be used to Transmit or Receive the data/control packets between Local and Remote Devices. This is a blocking API.

int32_t

Reads the afh mode, whether it is enable/disable. This is a blocking API.

int32_t

Clears the PAGE_SCAN BIT in BT Module connectablity status. This is a blocking API.

int32_t

Gets the BT Module connectablity status, whether PAGE_SCAN enabled/not. This is a blocking API.

int32_t

If the local device requires to authenticate the remote device at connection setup (between the HCI_Create_Connection command or acceptance of an incoming ACL connection and the corresponding Connection Complete event).At connection setup, only the device(s) with the Authentication_Enable parameter enabled will try to authenticate the other device. This is a blocking API.

int32_t

If the local device doesn't requires to authenticate the remote device at connection setup (between the HCI_Create_Connection command or acceptance of an incoming ACL connection and the corresponding Connection Complete event). This is a blocking API.

int32_t

Reads the value from the Authentication_Enable configuration parameter, whether Authentication is Enabled/Disabled. This is a blocking API.

int32_t
rsi_bt_remote_name_request_async(uint8_t *remote_dev_addr, rsi_bt_event_remote_device_name_t *bt_event_remote_device_name)

Know the remote device name, if empty name present in the Inquired list during Inquiry. And also can call this API after bt connection. This is a blocking API. A received event rsi_bt_on_remote_name_resp_t has the name of the remote_dev_addr which is requested.

int32_t
rsi_bt_remote_name_request_cancel(uint8_t *remote_dev_addr)

The Remote Device name request which is initiated by rsi_bt_remote_name_request_async() api will be cancelled by using this API. This is a blocking API. A received event rsi_bt_on_remote_name_request_cancel_t indicates that remote name request has been cancelled.

int32_t
rsi_bt_inquiry(uint8_t inquiry_type, uint32_t inquiry_duration, uint8_t max_devices)

Starts the Inquiry procedure till duration specified in the inquiry_duration parameter and allowed maximum number of devices to be inquired is mentioned in max_devices parameter. This is a blocking API. A received event rsi_bt_on_scan_resp_t provides the Inquired devices information. A received event rsi_bt_on_inquiry_complete_t indicates that Inquiry has been completed .

int32_t

The Inquiry request which is initiated with rsi_bt_inquiry() api will be cancelled by using this API. This is a blocking API.

int32_t
rsi_bt_connect(uint8_t *remote_dev_addr)

To Initiate Connection Request to the Remote Device, need to call this API. This is a blocking API. A received event rsi_bt_on_connect_t indicates that the connection opened successfully.

int32_t
rsi_bt_cancel_connect(uint8_t *remote_dev_address)

The Connection request which is initiated with rsi_bt_connect() api will be cancelled by using this API. This is a blocking API.

int32_t
rsi_bt_disconnect(uint8_t *remote_dev_address)

To disconnect the established PHY Level COnnection, need to call this API. This is a blocking API. A received event rsi_bt_on_unbond_t/ rsi_bt_on_disconnect_t indicates that the BT PHY Level connection is disconnected successfully.

int32_t
rsi_bt_accept_ssp_confirm(uint8_t *remote_dev_address)

After LinkLevel Connection established between Local and Remote Device, the first level of authentication will occur by sharing the PASSKEY to the host to compare with the Remote Device. If the Local and Remote Devices has same PASSKEY, then need to call this API for confirmation. This is a blocking API.

int32_t
rsi_bt_reject_ssp_confirm(uint8_t *remote_dev_address)

After LinkLevel Connection established between Local and Remote Device, the first level of authentication will occur by sharing the PASSKEY to the host to compare with the Remote Device. If the Local and Remote Devices has different PASSKEY, then need to call this API for Rejection. This is a blocking API.

int32_t
rsi_bt_passkey(uint8_t *remote_dev_addr, uint32_t passkey, uint8_t reply_type)

Send the passkey with Positive Reply or rejects the incoming pass key request with Negative Reply. This is a blocking API.

int32_t
rsi_bt_pincode_request_reply(uint8_t *remote_dev_addr, uint8_t *pin_code, uint8_t reply_type)

Sends the pincode with the positive reply or rejects with negative reply to the incoming pincode request. This is a blocking API.

int32_t
rsi_bt_linkkey_request_reply(uint8_t *remote_dev_addr, uint8_t *linkkey, uint8_t reply_type)

If linkkey exists, sends positive (along with the link key), else negative reply to the incoming link key request. This is a blocking API.

int32_t
rsi_bt_get_local_device_role(uint8_t *remote_dev_addr, uint8_t *resp)

Gets the role of local device, whether it is MASTER/SLAVE. This is a blocking API.

int32_t
rsi_bt_set_local_device_role(uint8_t *remote_dev_addr, uint8_t set_role, uint8_t *resp)

Sets the role of local device, whether it is MASTER/SLAVE. This is a blocking API. A received event rsi_bt_on_role_change_t indicates that the device role changed successfully.

int32_t
rsi_bt_get_services_async(uint8_t *remote_dev_addr, rsi_bt_resp_query_services_t *bt_resp_query_services)

Queries the services supported by remote device. This is a blocking API.

int32_t
rsi_bt_search_service_async(uint8_t *remote_dev_addr, uint32_t service_uuid)

Search service of the given uuid from remote device. This is a blocking API.

int32_t
rsi_bt_sniff_mode(uint8_t *remote_dev_addr, uint16_t sniff_max_intv, uint16_t sniff_min_intv, uint16_t sniff_attempt, uint16_t sniff_tout)

Request the local device to enter into sniff mode. This is a blocking API.

int32_t
rsi_bt_sniff_exit_mode(uint8_t *remote_dev_addr)

Request the local device to exit from sniff/sniff subrating mode. This is a blocking API.

int32_t
rsi_bt_sniff_subrating_mode(uint8_t *remote_dev_addr, uint16_t max_latency, uint16_t min_remote_tout, uint16_t min_local_tout)

Requests the device entered into the sniff subrating mode. This is a blocking API.

int32_t
rsi_bt_set_ssp_mode(uint8_t pair_mode, uint8_t IOcapability)

Enables or disables Simple Secure Profile (SSP) mode and also updates the IOcapability, which is used for Authentication process. This is a blocking API.

int32_t
rsi_bt_set_eir_data(uint8_t *data, uint16_t data_len)

Sets the extended Inquiry Response data. This is a blocking API.

int32_t
rsi_bt_add_device_id(uint16_t spec_id, uint16_t vendor_id, uint16_t product_id, uint16_t version, int primary_rec, uint16_t vendor_id_source)

Add device Identification in SDP protocol. This is a blocking API.

int32_t
rsi_bt_change_pkt_type(uint8_t *remote_dev_addr, uint16_t pkt_type)

Change the packet types in the controller after connection only, can switch between 2DH3,2DH5,3DH3,3DH5. This is a blocking API.

int32_t
rsi_bt_ptt_req(uint8_t mode)

Configure the LP HP transitions in the controller. This is a blocking API.

int32_t
rsi_bt_request_authentication(int8_t *remote_dev_addr)

Usually Authentication procedure will starts from stack itself once PHY Level Connection completes, but if already authentication is in disable state and after PHY Level Connection if User needs Authetication, then firstly need to enable Authentication and secondly call this API. This is a blocking API.

int32_t
rsi_bt_encryption_enable_or_disable(int8_t *remote_dev_addr, uint8_t enable_or_disable)

Usually Encrytpion procedure will starts from stack itself once PHY Level Connection and authentication completed, but user can decide whether to enable/disable encryption from the host. This is a blocking API.

Function Documentation#

rsi_bt_set_local_class_of_device#

int32_t rsi_bt_set_local_class_of_device (uint32_t class_of_device)

Sets the local device COD (The Class_Of_Device parameter is used to indicate the capabilities of the local device to other device). This is a blocking API.

Parameters
[in]class_of_device

- name to be set to the local device COD

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 41 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_get_local_class_of_device#

int32_t rsi_bt_get_local_class_of_device (uint8_t * resp)

Gets the local device COD (The Class_Of_Device parameter is used to indicate the capabilities of the local device to other device). This is a blocking API.

Parameters
[out]resp

- response buffer to hold the response of this API

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 64 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_start_discoverable#

rsi_bt_start_discoverable (void )

Sets the BT Module discovery mode status to INQUIRY_SCAN. This is a blocking API.

Parameters
N/A

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 82 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_start_limited_discoverable#

int32_t rsi_bt_start_limited_discoverable (int32_t time_out_ms)

Request the local device to enter limited discovery mode. The device comes out of discovery mode after the time out. If the 'time_out_ms' is set to '0', the device will be in continuous discoverable mode. This is a blocking API.

Parameters
[in]time_out_ms

- Limited discovery mode time_out in ms.

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 107 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_write_current_iac_lap#

int32_t rsi_bt_write_current_iac_lap (uint8_t no_of_iaps, uint8_t * iap_lap_list)

Write the current iac lap to the controller. This is a blocking API.

Parameters
[in]no_of_iaps

- number of iap lap count

[in]iap_lap_list

- pointer to the iap laps list

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 130 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_stop_discoverable#

rsi_bt_stop_discoverable (void )

Clears INQUIRY_SCAN BIT from BT Module discovery mode. This is a blocking API.

Parameters
N/A

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 158 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_get_discoverable_status#

int32_t rsi_bt_get_discoverable_status (uint8_t * resp)

Gets the BT Module discovery mode status, whether INQUIRY_SCAN enabled/not. This is a blocking API.

Parameters
[out]resp

- response buffer to hold the response of this API

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 181 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_set_connectable#

rsi_bt_set_connectable (void )

Sets the BT Module connectablity status to PAGE_SCAN. This is a blocking API.

Parameters
N/A

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 198 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_set_afh_host_channel_classification#

int32_t rsi_bt_set_afh_host_channel_classification (uint8_t enable, uint8_t * channel_map)

Sets the No.of channels to be used to Transmit or Receive the data/control packets between Local and Remote Devices. This is a blocking API.

Parameters
[in]enable

- This parameter is used to enable or disable afh host channel classification. This parameter supports the following values. 0 - Disable 1 - Enable

[in]channel_map

- Array of channel mapping values. Channel map range: This parameter contains 80 1-bit fields. The nth such field (in the range 0 to 78 bits) contains the value for channel n: 0: channel n is bad 1: channel n is unknown

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND 0x4E12 - INVALID_HCI_COMMAND_PARAMETERS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 227 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_get_afh_host_channel_classification#

int32_t rsi_bt_get_afh_host_channel_classification (uint8_t * status)

Reads the afh mode, whether it is enable/disable. This is a blocking API.

Parameters
[out]status

- This parameter is to hold the response of this API.

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 252 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_set_non_connectable#

rsi_bt_set_non_connectable (void )

Clears the PAGE_SCAN BIT in BT Module connectablity status. This is a blocking API.

Parameters
N/A

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 275 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_get_connectable_status#

int32_t rsi_bt_get_connectable_status (uint8_t * resp)

Gets the BT Module connectablity status, whether PAGE_SCAN enabled/not. This is a blocking API.

Parameters
[out]resp

- response buffer to hold the response of this API

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 296 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_enable_authentication#

rsi_bt_enable_authentication (void )

If the local device requires to authenticate the remote device at connection setup (between the HCI_Create_Connection command or acceptance of an incoming ACL connection and the corresponding Connection Complete event).At connection setup, only the device(s) with the Authentication_Enable parameter enabled will try to authenticate the other device. This is a blocking API.

Parameters
N/A

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .

  • Changing this parameter does not affect existing connection.


Definition at line 319 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_disable_authentication#

rsi_bt_disable_authentication (void )

If the local device doesn't requires to authenticate the remote device at connection setup (between the HCI_Create_Connection command or acceptance of an incoming ACL connection and the corresponding Connection Complete event). This is a blocking API.

Parameters
N/A

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .

  • Changing this parameter does not affect existing connection.


Definition at line 342 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_get_authentication#

int32_t rsi_bt_get_authentication (uint8_t * resp)

Reads the value from the Authentication_Enable configuration parameter, whether Authentication is Enabled/Disabled. This is a blocking API.

Parameters
[out]resp

- response buffer to hold the response of this API

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 363 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_remote_name_request_async#

int32_t rsi_bt_remote_name_request_async (uint8_t * remote_dev_addr, rsi_bt_event_remote_device_name_t * bt_event_remote_device_name)

Know the remote device name, if empty name present in the Inquired list during Inquiry. And also can call this API after bt connection. This is a blocking API. A received event rsi_bt_on_remote_name_resp_t has the name of the remote_dev_addr which is requested.

Parameters
[in]remote_dev_addr

- remote device address

[out]bt_event_remote_device_name

- response buffer to hold the name of remote device Please refer rsi_bt_event_remote_device_name_s structure for more info.

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 382 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_remote_name_request_cancel#

int32_t rsi_bt_remote_name_request_cancel (uint8_t * remote_dev_addr)

The Remote Device name request which is initiated by rsi_bt_remote_name_request_async() api will be cancelled by using this API. This is a blocking API. A received event rsi_bt_on_remote_name_request_cancel_t indicates that remote name request has been cancelled.

Parameters
[in]remote_dev_addr

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E12 - INVALID_HCI_COMMAND_PARAMETERS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 411 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_inquiry#

int32_t rsi_bt_inquiry (uint8_t inquiry_type, uint32_t inquiry_duration, uint8_t max_devices)

Starts the Inquiry procedure till duration specified in the inquiry_duration parameter and allowed maximum number of devices to be inquired is mentioned in max_devices parameter. This is a blocking API. A received event rsi_bt_on_scan_resp_t provides the Inquired devices information. A received event rsi_bt_on_inquiry_complete_t indicates that Inquiry has been completed .

Parameters
[in]inquiry_type

- This is the Inquiry type. 0 - Standard Inquiry 1 - Inquiry with RSSI 2 - Extended Inquiry

[in]inquiry_duration

- duration of inquiry.

[in]max_devices

- This is the maximum number of devices allowed to inquiry from 1 to 10

Returns

  • 0 - Success Non-Zero Value - Failure

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 441 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_cancel_inquiry#

rsi_bt_cancel_inquiry (void )

The Inquiry request which is initiated with rsi_bt_inquiry() api will be cancelled by using this API. This is a blocking API.

Parameters
N/A

Returns

  • 0 - Success Non-Zero Value - Failure 0x4FF9 - ERROR_STATE_INVALID

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 473 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_connect#

int32_t rsi_bt_connect (uint8_t * remote_dev_addr)

To Initiate Connection Request to the Remote Device, need to call this API. This is a blocking API. A received event rsi_bt_on_connect_t indicates that the connection opened successfully.

Parameters
[in]remote_dev_addr

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure 0x4300 - ERR_BT_HCI_CONN_ALREADY_EXISTS 0x4059 - ERR_BT_HCI_CONNECTION_FAIL 0x4E0B - ERR_ACL_CONN_ALREADY_EXISTS 0x4E0D - ERR_LIMITED_RESOURCE 0x4E04 - ERR_PAGE_TIMEOUT

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 524 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_cancel_connect#

int32_t rsi_bt_cancel_connect (uint8_t * remote_dev_address)

The Connection request which is initiated with rsi_bt_connect() api will be cancelled by using this API. This is a blocking API.

Parameters
[in]remote_dev_address

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER 0x4E0B - ERR_ACL_CONN_ALREADY_EXISTS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 554 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_disconnect#

int32_t rsi_bt_disconnect (uint8_t * remote_dev_address)

To disconnect the established PHY Level COnnection, need to call this API. This is a blocking API. A received event rsi_bt_on_unbond_t/ rsi_bt_on_disconnect_t indicates that the BT PHY Level connection is disconnected successfully.

Parameters
[in]remote_dev_address

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure 0x4061 - ERR_BT_NO_HCI_CONNECTION 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER 0x4E12 - INVALID_HCI_COMMAND_PARAMETERS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 582 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_accept_ssp_confirm#

int32_t rsi_bt_accept_ssp_confirm (uint8_t * remote_dev_address)

After LinkLevel Connection established between Local and Remote Device, the first level of authentication will occur by sharing the PASSKEY to the host to compare with the Remote Device. If the Local and Remote Devices has same PASSKEY, then need to call this API for confirmation. This is a blocking API.

Parameters
[in]remote_dev_address

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E0C - COMMAND_DISALLOWED 0x4046 - ERR_BT_INVALID_ARGS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 611 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_reject_ssp_confirm#

int32_t rsi_bt_reject_ssp_confirm (uint8_t * remote_dev_address)

After LinkLevel Connection established between Local and Remote Device, the first level of authentication will occur by sharing the PASSKEY to the host to compare with the Remote Device. If the Local and Remote Devices has different PASSKEY, then need to call this API for Rejection. This is a blocking API.

Parameters
[in]remote_dev_address

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E06 - COMMAND_DISALLOWED 0x4046 - ERR_BT_INVALID_ARGS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 643 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_passkey#

int32_t rsi_bt_passkey (uint8_t * remote_dev_addr, uint32_t passkey, uint8_t reply_type)

Send the passkey with Positive Reply or rejects the incoming pass key request with Negative Reply. This is a blocking API.

Parameters
[in]remote_dev_addr

- remote device address

[in]passkey

- This is the passkey input

[in]reply_type

-This is the positive or negative reply 0 - negative reply 1 - positive reply

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E06 - COMMAND_DISALLOWED 0x4046 - ERR_BT_INVALID_ARGS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 677 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_pincode_request_reply#

int32_t rsi_bt_pincode_request_reply (uint8_t * remote_dev_addr, uint8_t * pin_code, uint8_t reply_type)

Sends the pincode with the positive reply or rejects with negative reply to the incoming pincode request. This is a blocking API.

Parameters
[in]remote_dev_addr

- remote device address

[in]pin_code

- pin code input

[in]reply_type

- This is the positive or negative reply 0 - negative reply 1 - positive reply

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER 0x4039 - ERR_BT_PINCODE_REPLY_FOR_WRONG_BD_ADDRESS

Note

  • Refer Error Codes section for common error codes Error Codes .

  • This API need to issue during the legacy connection process.


Definition at line 713 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_linkkey_request_reply#

int32_t rsi_bt_linkkey_request_reply (uint8_t * remote_dev_addr, uint8_t * linkkey, uint8_t reply_type)

If linkkey exists, sends positive (along with the link key), else negative reply to the incoming link key request. This is a blocking API.

Parameters
[in]remote_dev_addr

- remote device address

[in]linkkey

- Linkkey input

[in]reply_type

- Positive or negative reply 0 - negative reply 1 - positive reply

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER 0x4039 - ERR_BT_PINCODE_REPLY_FOR_WRONG_BD_ADDRESS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 749 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_get_local_device_role#

int32_t rsi_bt_get_local_device_role (uint8_t * remote_dev_addr, uint8_t * resp)

Gets the role of local device, whether it is MASTER/SLAVE. This is a blocking API.

Parameters
[in]remote_dev_addr

- remote device address

[out]resp

- response buffer to hold the response of this API

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 780 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_set_local_device_role#

int32_t rsi_bt_set_local_device_role (uint8_t * remote_dev_addr, uint8_t set_role, uint8_t * resp)

Sets the role of local device, whether it is MASTER/SLAVE. This is a blocking API. A received event rsi_bt_on_role_change_t indicates that the device role changed successfully.

Parameters
[in]remote_dev_addr

- remote device address

[in]set_role

- This paramets sets either Master/Slave Role 0 Master Role 1 Slave Role

[out]resp

- response buffer to hold the response of this API

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E06 - COMMAND_DISALLOWED 0x4046 - ERR_BT_INVALID_ARGS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 811 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_get_services_async#

int32_t rsi_bt_get_services_async (uint8_t * remote_dev_addr, rsi_bt_resp_query_services_t * bt_resp_query_services)

Queries the services supported by remote device. This is a blocking API.

Parameters
[in]remote_dev_addr

- Remote device address

[out]bt_resp_query_services

- Response struct to hold the response of this API, please refer rsi_bt_resp_query_services_s structure for more info.

Returns

  • 0 - Success Non-Zero Value - Failure 0x4100 - ERR_BT_INVALID_PDU 0x4102 - ERR_BT_SDP_SERVICE_NOT_FOUND 0x4101 - ERR_BT_INVALID_PDU_DATA_ELEMENT 0x4049 - ERR_BT_SOCK_STATE_INVALID

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 844 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_search_service_async#

int32_t rsi_bt_search_service_async (uint8_t * remote_dev_addr, uint32_t service_uuid)

Search service of the given uuid from remote device. This is a blocking API.

Parameters
[in]remote_dev_addr

- remote device address

[in]service_uuid

- uuid of the service for search

Returns

  • 0 - Success Non-Zero Value - Failure 0x4100 - ERR_BT_INVALID_PDU 0x4102 - ERR_BT_SDP_SERVICE_NOT_FOUND 0x4101 - ERR_BT_INVALID_PDU_DATA_ELEMENT 0x4049 - ERR_BT_SOCK_STATE_INVALID

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 872 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_sniff_mode#

int32_t rsi_bt_sniff_mode (uint8_t * remote_dev_addr, uint16_t sniff_max_intv, uint16_t sniff_min_intv, uint16_t sniff_attempt, uint16_t sniff_tout)

Request the local device to enter into sniff mode. This is a blocking API.

Parameters
[in]remote_dev_addr

- remote device address

[in]sniff_max_intv

- Sniff maximum Interval

[in]sniff_min_intv

- Sniff Minimum Interval

[in]sniff_attempt

- Sniff Attempt

[in]sniff_tout

- Sniff timeout

Returns

  • 0 - Success Non-Zero Value - Failure 0x4061 - ERR_BT_NO_HCI_CONNECTION 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER 0x4E06 - COMMAND_DISALLOWED

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 908 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_sniff_exit_mode#

int32_t rsi_bt_sniff_exit_mode (uint8_t * remote_dev_addr)

Request the local device to exit from sniff/sniff subrating mode. This is a blocking API.

Parameters
[in]remote_dev_addr

- remote device address

Returns

  • 0 - Success Non-Zero Value - Failure 0x4046 - ERR_BT_INVALID_ARGS 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER 0x4E06 - COMMAND_DISALLOWED

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 944 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_sniff_subrating_mode#

int32_t rsi_bt_sniff_subrating_mode (uint8_t * remote_dev_addr, uint16_t max_latency, uint16_t min_remote_tout, uint16_t min_local_tout)

Requests the device entered into the sniff subrating mode. This is a blocking API.

Parameters
[in]remote_dev_addr

- remote device address

[in]max_latency

- Maximum Latency

[in]min_remote_tout

- Minimum remote timeout

[in]min_local_tout

- Minimum local timeout

Returns

  • 0 - Success Non-Zero Value - Failure 0x4046 - ERR_BT_INVALID_ARGS 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 975 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_set_ssp_mode#

int32_t rsi_bt_set_ssp_mode (uint8_t pair_mode, uint8_t IOcapability)

Enables or disables Simple Secure Profile (SSP) mode and also updates the IOcapability, which is used for Authentication process. This is a blocking API.

Parameters
[in]pair_mode

- This parameter is used to enable or disable SSP mode. This parameters supports the following values. 0 - Disable 1 - Enable

[in]IOcapability

- This is the IO capability request for SSP mode. This parameter supports the following values. 0 - DisplayOnly 1 - DisplayYesNo 2 - KeyboardOnly 3 - NoInputNoOutput

Returns

  • 0 - Success Non-Zero Value - Failure 0x4046 - ERR_BT_INVALID_ARGS 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 1018 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_set_eir_data#

int32_t rsi_bt_set_eir_data (uint8_t * data, uint16_t data_len)

Sets the extended Inquiry Response data. This is a blocking API.

Parameters
[in]data

- Pointer to the EIR data buffer which is an array that can store data upto 200 Bytes

[in]data_len

- length of the eir data

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .

  • Currently EIR data supports upto 200 bytes.


Definition at line 1043 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_add_device_id#

int32_t rsi_bt_add_device_id (uint16_t spec_id, uint16_t vendor_id, uint16_t product_id, uint16_t version, int primary_rec, uint16_t vendor_id_source)

Add device Identification in SDP protocol. This is a blocking API.

Parameters
[in]spec_id

- Version number of the Bluetooth Device ID Profile specification supported by the device.

[in]vendor_id

- Uniquely identify the vendor of the device.

[in]product_id

- To distinguish between different products made by the vendor

[in]version

- A numeric expression identifying the device release number in Binary-Coded Decimal

[in]primary_rec

- Set to TRUE in the case single Device ID Service Record exists in the device. If multiple Device ID Service Records exist, and no primary record has been defined, set to FALSE.

[in]vendor_id_source

- This attribute designates which organization assigned the VendorID attribute, 0x201.

Returns

  • 0 - Success Non-Zero Value - Failure 0x4105 - ERR_BT_SDP_PNP_SERVICE_ALREADY_EXISTS 0x4046 - ERR_BT_INVALID_ARGS

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 1153 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_change_pkt_type#

int32_t rsi_bt_change_pkt_type (uint8_t * remote_dev_addr, uint16_t pkt_type)

Change the packet types in the controller after connection only, can switch between 2DH3,2DH5,3DH3,3DH5. This is a blocking API.

Parameters
[in]remote_dev_addr

- Remote device address

[in]pkt_type

- change the packet types in the controller

Returns

  • 0 - Success Non-Zero Value - Failure 0x4061 - ERR_BT_NO_HCI_CONNECTION 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 1189 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_ptt_req#

int32_t rsi_bt_ptt_req (uint8_t mode)

Configure the LP HP transitions in the controller. This is a blocking API.

Parameters
[in]mode

- BR/EDR mode 0 - BR Mode 1 - EDR Mode

Returns

  • 0 - Success Non-Zero Value - Failure 0x4E01 - UNKNOWN_HCI_COMMAND

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 1222 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_request_authentication#

int32_t rsi_bt_request_authentication (int8_t * remote_dev_addr)

Usually Authentication procedure will starts from stack itself once PHY Level Connection completes, but if already authentication is in disable state and after PHY Level Connection if User needs Authetication, then firstly need to enable Authentication and secondly call this API. This is a blocking API.

Parameters
[in]remote_dev_addr

- Remote device address

Returns

  • 0 - Success Non-Zero Value - Failure 0x4061 - ERR_BT_NO_HCI_CONNECTION 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 1247 of file bluetooth/rsi_bt_gap_apis.c

rsi_bt_encryption_enable_or_disable#

int32_t rsi_bt_encryption_enable_or_disable (int8_t * remote_dev_addr, uint8_t enable_or_disable)

Usually Encrytpion procedure will starts from stack itself once PHY Level Connection and authentication completed, but user can decide whether to enable/disable encryption from the host. This is a blocking API.

Parameters
[in]remote_dev_addr

- Remote device address

[in]enable_or_disable

- To enable/disable the encryption. 1 - Enable 0 - Disable

Returns

  • 0 - Success Non-Zero Value - Failure 0x4061 - ERR_BT_NO_HCI_CONNECTION 0x4E02 - UNKNOWN_CONNECTION_IDENTIFIER 0x4E11 - UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE

Note

  • Refer Error Codes section for common error codes Error Codes .


Definition at line 1282 of file bluetooth/rsi_bt_gap_apis.c