Functions | |
void | ble_gap_pair_enable (bool enable) |
Decide whether to support the pair feature. More... | |
uint16_t | ble_gap_addr_set (ble_gap_bdaddr_t const *p_addr) |
Set the device identity address (public or random static). More... | |
uint16_t | ble_gap_addr_get (ble_gap_bdaddr_t *p_addr) |
Get the device identity address (public or random static). More... | |
uint16_t | ble_gap_tx_power_set (ble_gap_actv_role_t role, uint8_t index, int8_t txpwr_dbm) |
Set the tx power. More... | |
uint16_t | ble_gap_tx_power_get (ble_gap_actv_role_t role, uint8_t index, int8_t *txpwr_dbm) |
Get the tx power. More... | |
uint16_t | ble_gap_irk_set (ble_gap_sec_key_t *p_irk) |
Set IRK used for resolvable random BD address generation (LSB first). More... | |
uint16_t | ble_gap_privacy_params_set (uint16_t renew_dur, bool enable_flag) |
Set privacy related parameters. More... | |
uint16_t | ble_gap_data_length_set (uint16_t sugg_max_tx_octet, uint16_t sugg_max_tx_time) |
Set suggested default LE data length. More... | |
uint16_t | ble_gap_l2cap_params_set (uint16_t max_mtu, uint16_t max_mps, uint8_t max_nb_lecb) |
Set L2CAP related parameters. More... | |
void | ble_gap_pref_phy_set (uint8_t tx_pref_phy, uint8_t rx_pref_phy) |
Set the preferred values for the transmitter PHY and receiver PHY. More... | |
uint16_t | ble_gap_path_compensation_set (int16_t tx_path_comp, int16_t rx_path_comp) |
Set the RF path gain or loss between the RF transceiver and the antenna contributed by intermediate components. More... | |
uint16_t | ble_gap_chnl_map_set (ble_gap_chnl_map_t *p_chnl_map) |
Set advertising channel map before advertising starts. More... | |
uint16_t | ble_gap_chnl_map_timer_set (bool enable_flag) |
Set ble channel map update timer enable or disable. More... | |
uint16_t | ble_gap_bond_devs_get (ble_gap_bond_dev_list_t *p_bond_list) |
Get all bonded devices. More... | |
uint16_t | ble_gap_bond_dev_addr_get (uint8_t conn_idx, ble_gap_bdaddr_t *p_peer_addr) |
Get BD address of the bonded device. More... | |
uint16_t | ble_gap_bond_devs_clear (void) |
Clear all bonded devices. More... | |
uint16_t | ble_gap_bond_dev_del (const ble_gap_bdaddr_t *p_peer_addr) |
Delete a bond device with the specified BD address. More... | |
uint16_t | ble_gap_whitelist_get (ble_gap_white_list_t *p_whitelist) |
Get the content of the whole white list. More... | |
uint16_t | ble_gap_whitelist_add (const ble_gap_white_list_t *p_whitelist) |
Add the devices into current white list. More... | |
uint16_t | ble_gap_whitelist_del (const ble_gap_white_list_t *p_whitelist) |
Delete the devices out of current white list. More... | |
uint16_t | ble_gap_whitelist_clear (void) |
Clear all the entries in the current white list. More... | |
uint16_t | ble_gap_per_adv_list_get (ble_gap_period_adv_list_t *p_pal_list) |
Get the content of the whole periodic advertising list. More... | |
uint16_t | ble_gap_per_adv_list_add (const ble_gap_period_adv_list_t *p_pal_list) |
Add the devices into current periodic advertising list. More... | |
uint16_t | ble_gap_per_adv_list_del (const ble_gap_period_adv_list_t *p_pal_list) |
Delete the devices out of periodic advertising list. More... | |
uint16_t | ble_gap_per_adv_list_clear (void) |
Clear all the entries in the current periodic advertising list. More... | |
uint16_t | ble_gap_rpa_list_get (ble_gap_ral_dev_list_t *p_rpa_list) |
Get the RPA list info. More... | |
uint16_t | ble_gap_dev_info_get (ble_gap_dev_info_get_type_t type) |
Get the device information according to param type. More... | |
uint16_t | ble_gap_adv_param_set (uint8_t adv_idx, ble_gap_own_addr_t own_addr_type, ble_gap_adv_param_t *p_adv_param) |
Set parameters for advertising. More... | |
uint16_t | ble_gap_ext_adv_param_set (uint8_t adv_idx, ble_gap_own_addr_t own_addr_type, ble_gap_ext_adv_param_t *p_adv_param) |
Set extended parameters for advertising. More... | |
uint16_t | ble_gap_adv_data_set (uint8_t adv_idx, ble_gap_adv_data_type_t type, const uint8_t *p_data, uint16_t length) |
Set Advertising Data, Scan Response Data and Periodic Advertising Data. More... | |
uint16_t | ble_gap_update_adv_data (uint8_t adv_idx, ble_gap_adv_data_type_t type, const uint8_t *p_data, uint16_t length) |
Update Advertising Data, Scan Response Data and Periodic Advertising Data. More... | |
uint16_t | ble_gap_adv_start (uint8_t adv_idx, ble_gap_adv_time_param_t *p_timeout) |
Start advertising. More... | |
uint16_t | ble_gap_adv_stop (uint8_t adv_idx) |
Stop advertising. More... | |
uint16_t | ble_gap_scan_param_set (ble_gap_own_addr_t own_addr_type, ble_gap_scan_param_t *p_scan_param) |
Set parameters for scanning. More... | |
uint16_t | ble_gap_ext_scan_param_set (ble_gap_own_addr_t own_addr_type, ble_gap_ext_scan_param_t *p_scan_param) |
Set extended parameters for scanning. More... | |
uint16_t | ble_gap_scan_start (void) |
Start scanning. More... | |
uint16_t | ble_gap_scan_stop (void) |
Stop scanning. More... | |
uint16_t | ble_gap_per_sync_param_set (uint8_t per_sync_idx, ble_gap_per_sync_param_t *p_per_sync_param) |
Set the parameters used for periodic sync. More... | |
uint16_t | ble_gap_per_sync_start (uint8_t per_sync_idx) |
Start to synchronize with periodic advertising from an advertiser and begin receiving periodic advertising packets. More... | |
uint16_t | ble_gap_per_sync_stop (uint8_t per_sync_idx) |
Stop periodic synchronization. More... | |
uint16_t | ble_gap_connect (ble_gap_own_addr_t own_addr_type, ble_gap_init_param_t *p_init_param) |
Start a legacy connection to a device. More... | |
uint16_t | ble_gap_ext_connect (ble_gap_own_addr_t own_addr_type, ble_gap_ext_init_param_t *p_init_param) |
Start an extended connection to a device. More... | |
uint16_t | ble_gap_connect_cancel (void) |
Cancel an initiated connection. More... | |
void | ble_gap_appearance_set (uint16_t appearance) |
Set GAP appearance value. More... | |
uint16_t | ble_gap_appearance_get (uint16_t *p_appearance) |
Get GAP appearance value. More... | |
void | ble_gap_ppcp_present_set (bool present_flag) |
Set GAP Peripheral Preferred Connection Parameters present flag. More... | |
uint16_t | ble_gap_ppcp_set (ble_gap_conn_param_t const *p_conn_params) |
Set GAP Peripheral Preferred Connection Parameters. More... | |
uint16_t | ble_gap_ppcp_get (ble_gap_conn_param_t *p_conn_params) |
Get GAP Peripheral Preferred Connection Parameters. More... | |
uint16_t | ble_gap_device_name_set (ble_gap_dev_name_write_perm_t write_perm, uint8_t const *p_dev_name, uint16_t length) |
Set GAP device name. More... | |
uint16_t | ble_gap_device_name_get (uint8_t *p_dev_name, uint16_t *p_length) |
Get GAP device name. More... | |
uint16_t | ble_gap_lepsm_register (ble_gap_lepsm_register_t *p_lepsm) |
Register a LE Protocol/Service Multiplexer. More... | |
uint16_t | ble_gap_lepsm_unregister (uint16_t le_psm) |
Unregister a LE Protocol/Service Multiplexer. More... | |
uint16_t | ble_gap_privacy_mode_set (ble_gap_bdaddr_t peer_addr, ble_gap_privacy_mode_t mode) |
Set privacy mode for peer device. More... | |
uint16_t | ble_gap_rslv_addr_read (ble_gap_rslv_addr_read_op_id_t op_code, ble_gap_bdaddr_t peer_iden_addr) |
Read peer or local resolvable address. More... | |
uint16_t | ble_gap_reslv_rpa_addr (uint8_t *reslv_addr, uint8_t src_info, ble_gap_reslv_rpa_addr_callback_t cb) |
Resolve the rpa address. More... | |
uint16_t | ble_gap_update_conn_param_method_set (uint8_t conn_idx, bool use_l2cap_flag) |
Set the method for updating connection parameter. More... | |
void | ble_gap_rpa_addr_report_cb_register (ble_gap_rpa_addr_report_callback_t cb) |
Set the cb for rpa address report. More... | |
uint16_t ble_gap_addr_get | ( | ble_gap_bdaddr_t * | p_addr | ) |
Get the device identity address (public or random static).
[in] | p_addr | The pointer for the returned identity address. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
uint16_t ble_gap_addr_set | ( | ble_gap_bdaddr_t const * | p_addr | ) |
Set the device identity address (public or random static).
[in] | p_addr | Provided public or static random address. If addr_type = 0, it means public address, If addr_type = 1, it means static random address. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_adv_data_set | ( | uint8_t | adv_idx, |
ble_gap_adv_data_type_t | type, | ||
const uint8_t * | p_data, | ||
uint16_t | length | ||
) |
Set Advertising Data, Scan Response Data and Periodic Advertising Data.
[in] | adv_idx | Advertising index, range is 0 to 4. |
[in] | type | Data type. |
[in] | p_data | The data pointer. |
[in] | length | Data length. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_ADV_IDX | Invalid advertising index supplied. |
SDK_ERR_INVALID_ADV_DATA_TYPE | Invalid advertising data type supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_adv_param_set | ( | uint8_t | adv_idx, |
ble_gap_own_addr_t | own_addr_type, | ||
ble_gap_adv_param_t * | p_adv_param | ||
) |
Set parameters for advertising.
Note that this function must be called prior to advertising started.
[in] | adv_idx | Advertising index, range is 0 to 4. |
[in] | own_addr_type | Own BD address source of the local device. |
[in] | p_adv_param | The advertising parameters. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_ADV_IDX | Invalid advertising index supplied. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_adv_start | ( | uint8_t | adv_idx, |
ble_gap_adv_time_param_t * | p_timeout | ||
) |
Start advertising.
[in] | adv_idx | Advertising index, range is 0 to 4. |
[in] | p_timeout | Advertising timing parameter. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_ADV_IDX | Invalid advertising index supplied. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_adv_stop | ( | uint8_t | adv_idx | ) |
Stop advertising.
[in] | adv_idx | Advertising index, range is 0 to 4. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_ADV_IDX | Invalid advertising index supplied. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
uint16_t ble_gap_appearance_get | ( | uint16_t * | p_appearance | ) |
Get GAP appearance value.
[out] | p_appearance | The pointer to appearance value. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
void ble_gap_appearance_set | ( | uint16_t | appearance | ) |
Set GAP appearance value.
[in] | appearance | Appearance value. |
uint16_t ble_gap_bond_dev_addr_get | ( | uint8_t | conn_idx, |
ble_gap_bdaddr_t * | p_peer_addr | ||
) |
Get BD address of the bonded device.
[in] | conn_idx | The index of connection. |
[in] | p_peer_addr | Pointer to the peer BD addrss |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_PARAM | The parameter is invalid. |
uint16_t ble_gap_bond_dev_del | ( | const ble_gap_bdaddr_t * | p_peer_addr | ) |
Delete a bond device with the specified BD address.
[in] | p_peer_addr | Pointer to the BD addrss. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_SDK_INTERNAL | SDK internal error. |
SDK_ERR_NVDS_NOT_INIT | NVDS is not initiated. |
SDK_ERR_LIST_ITEM_NOT_FOUND | Item not found in list. |
SDK_ERR_LIST_FULL | List is full. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
uint16_t ble_gap_bond_devs_clear | ( | void | ) |
Clear all bonded devices.
SDK_SUCCESS | Operation is successful. |
SDK_ERR_SDK_INTERNAL | SDK internal error. |
SDK_ERR_NVDS_NOT_INIT | NVDS is not initiated. |
SDK_ERR_LIST_ITEM_NOT_FOUND | Item not found in list. |
SDK_ERR_LIST_FULL | List is full. |
uint16_t ble_gap_bond_devs_get | ( | ble_gap_bond_dev_list_t * | p_bond_list | ) |
Get all bonded devices.
SDK_SUCCESS | Operation is successful. |
SDK_ERR_SDK_INTERNAL | SDK internal error. |
SDK_ERR_NVDS_NOT_INIT | NVDS is not initiated. |
SDK_ERR_LIST_ITEM_NOT_FOUND | Item not found in list. |
SDK_ERR_LIST_FULL | List is full. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
uint16_t ble_gap_chnl_map_set | ( | ble_gap_chnl_map_t * | p_chnl_map | ) |
Set advertising channel map before advertising starts.
[in] | p_chnl_map | Bitmask of LE channel map. See enum ble_gap_chnl_map_t for BT Core Spec version <= 4.2. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_chnl_map_timer_set | ( | bool | enable_flag | ) |
Set ble channel map update timer enable or disable.
[in] | enable_flag | timer enable flag . true is enable,false is disable. |
SDK_SUCCESS | Operation is successful. |
uint16_t ble_gap_connect | ( | ble_gap_own_addr_t | own_addr_type, |
ble_gap_init_param_t * | p_init_param | ||
) |
Start a legacy connection to a device.
[in] | own_addr_type | Own BD address source of the local device. |
[in] | p_init_param | Initiate parameters. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_connect_cancel | ( | void | ) |
Cancel an initiated connection.
SDK_SUCCESS | Operation is successful. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
uint16_t ble_gap_data_length_set | ( | uint16_t | sugg_max_tx_octet, |
uint16_t | sugg_max_tx_time | ||
) |
Set suggested default LE data length.
[in] | sugg_max_tx_octet | Suggested value for the Controller's maximum transmitted number of payload octets to be used, the range is 27~251. |
[in] | sugg_max_tx_time | Suggested value for the Controller's maximum packet transmission time to be used, the range is 328~2120. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
uint16_t ble_gap_dev_info_get | ( | ble_gap_dev_info_get_type_t | type | ) |
Get the device information according to param type.
[in] | type | Param type. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_device_name_get | ( | uint8_t * | p_dev_name, |
uint16_t * | p_length | ||
) |
Get GAP device name.
[out] | p_dev_name | The pointer to device name value, set to NULL to obtain the complete device name length. |
[in,out] | p_length | Length of the buffer pointed by p_dev_name, complete device name length on output. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_DATA_LENGTH | Invalid data size(s) supplied. |
uint16_t ble_gap_device_name_set | ( | ble_gap_dev_name_write_perm_t | write_perm, |
uint8_t const * | p_dev_name, | ||
uint16_t | length | ||
) |
Set GAP device name.
[in] | write_perm | Write permissions of the device name characteristic. |
[in] | p_dev_name | The pointer to device name value. If p_dev_name is NULL, this function will only set write permissions of the device name. |
[in] | length | Device name length. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
uint16_t ble_gap_ext_adv_param_set | ( | uint8_t | adv_idx, |
ble_gap_own_addr_t | own_addr_type, | ||
ble_gap_ext_adv_param_t * | p_adv_param | ||
) |
Set extended parameters for advertising.
Note that this function must be called prior to advertising.
[in] | adv_idx | Advertising index, range is 0 to 4. |
[in] | own_addr_type | Own BD address source of the local device. |
[in] | p_adv_param | The advertising parameters. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_ADV_IDX | Invalid advertising index supplied. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_ext_connect | ( | ble_gap_own_addr_t | own_addr_type, |
ble_gap_ext_init_param_t * | p_init_param | ||
) |
Start an extended connection to a device.
[in] | own_addr_type | Own BD address source of the local device. |
[in] | p_init_param | Initiate parameters. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_ext_scan_param_set | ( | ble_gap_own_addr_t | own_addr_type, |
ble_gap_ext_scan_param_t * | p_scan_param | ||
) |
Set extended parameters for scanning.
Note that this function must be called prior to scanning started.
[in] | own_addr_type | Own BD address source of the local device. |
[in] | p_scan_param | The scanning parameters. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_irk_set | ( | ble_gap_sec_key_t * | p_irk | ) |
Set IRK used for resolvable random BD address generation (LSB first).
[in] | p_irk | Device IRK (Identity Resolving Key). |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
uint16_t ble_gap_l2cap_params_set | ( | uint16_t | max_mtu, |
uint16_t | max_mps, | ||
uint8_t | max_nb_lecb | ||
) |
Set L2CAP related parameters.
[in] | max_mtu | Maximal MTU acceptable for device, the range is 65~512. |
[in] | max_mps | Maximal MPS Packet size acceptable for device (for COC SDU), the range is 65~max_mtu. |
[in] | max_nb_lecb | Maximum number of LE Credit based connection that can be established, this range is 0x00~0x20. The actual number is decided by resource available. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
uint16_t ble_gap_lepsm_register | ( | ble_gap_lepsm_register_t * | p_lepsm | ) |
Register a LE Protocol/Service Multiplexer.
[in] | p_lepsm | The lepsm information to be registerred. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_PSM_NUM | Invalid psm number. |
SDK_ERR_INVALID_PSM_EXCEEDED_MAX_PSM_NUM | The maximum psm number limit is exceeded. |
SDK_ERR_INVALID_PSM_ALREADY_REGISTERED | The psm number has been registered. |
uint16_t ble_gap_lepsm_unregister | ( | uint16_t | le_psm | ) |
Unregister a LE Protocol/Service Multiplexer.
[in] | le_psm | LE Protocol/Service Multiplexer (1 to 255). |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PSM_NUM | Invalid psm number. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
void ble_gap_pair_enable | ( | bool | enable | ) |
Decide whether to support the pair feature.
[in] | enable | Support flag. |
uint16_t ble_gap_path_compensation_set | ( | int16_t | tx_path_comp, |
int16_t | rx_path_comp | ||
) |
Set the RF path gain or loss between the RF transceiver and the antenna contributed by intermediate components.
[in] | tx_path_comp | RF TX Path Compensation value (from -128dB to 128dB, unit is 0.1dB). |
[in] | rx_path_comp | RF RX Path Compensation value (from -128dB to 128dB, unit is 0.1dB). |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PARAM | The parameter is invalid. |
uint16_t ble_gap_per_adv_list_add | ( | const ble_gap_period_adv_list_t * | p_pal_list | ) |
Add the devices into current periodic advertising list.
If periodic advertising list is full or there are duplicated entries, it will return error.
[in] | p_pal_list | Pointer to input periodic advertising list. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_LIST_ITEM_ALREADY_EXISTED | Item already existed in list. |
SDK_ERR_LIST_FULL | List is full. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_per_adv_list_clear | ( | void | ) |
Clear all the entries in the current periodic advertising list.
SDK_SUCCESS | Operation is successful. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
uint16_t ble_gap_per_adv_list_del | ( | const ble_gap_period_adv_list_t * | p_pal_list | ) |
Delete the devices out of periodic advertising list.
If the entries do not exist in the current list, an error will be returned.
[in] | p_pal_list | Pointer to input periodic advertising list. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_LIST_ITEM_NOT_FOUND | Item not found in list. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_per_adv_list_get | ( | ble_gap_period_adv_list_t * | p_pal_list | ) |
Get the content of the whole periodic advertising list.
[in] | p_pal_list | Pointer to the output periodic advertising list. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
uint16_t ble_gap_per_sync_param_set | ( | uint8_t | per_sync_idx, |
ble_gap_per_sync_param_t * | p_per_sync_param | ||
) |
Set the parameters used for periodic sync.
[in] | per_sync_idx | Periodic synchronization index (range is 0 to 4). |
[in] | p_per_sync_param | Periodic synchronization parameters. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_PER_SYNC_IDX | Invalid periodic syncronization index supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_per_sync_start | ( | uint8_t | per_sync_idx | ) |
Start to synchronize with periodic advertising from an advertiser and begin receiving periodic advertising packets.
[in] | per_sync_idx | Periodic synchronization index (range is 0 to 4). |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_PER_SYNC_IDX | Invalid periodic syncronization index supplied. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
uint16_t ble_gap_per_sync_stop | ( | uint8_t | per_sync_idx | ) |
Stop periodic synchronization.
[in] | per_sync_idx | Periodic synchronization index (range is 0 to 4). |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PER_SYNC_IDX | Invalid periodic syncronization index supplied. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
uint16_t ble_gap_ppcp_get | ( | ble_gap_conn_param_t * | p_conn_params | ) |
Get GAP Peripheral Preferred Connection Parameters.
[out] | p_conn_params | The pointer to PPCP values. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
void ble_gap_ppcp_present_set | ( | bool | present_flag | ) |
Set GAP Peripheral Preferred Connection Parameters present flag.
[in] | present_flag | Present or not. |
uint16_t ble_gap_ppcp_set | ( | ble_gap_conn_param_t const * | p_conn_params | ) |
Set GAP Peripheral Preferred Connection Parameters.
[in] | p_conn_params | The pointer to PPCP values. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
void ble_gap_pref_phy_set | ( | uint8_t | tx_pref_phy, |
uint8_t | rx_pref_phy | ||
) |
Set the preferred values for the transmitter PHY and receiver PHY.
[in] | tx_pref_phy | A bit field that indicates the transmitter PHYs that the Host prefers the Controller to use(see GAP PHY OPTIONS (bitmask)). |
[in] | rx_pref_phy | A bit field that indicates the receiver PHYs that the Host prefers the Controller to use(see GAP PHY OPTIONS (bitmask)). |
uint16_t ble_gap_privacy_mode_set | ( | ble_gap_bdaddr_t | peer_addr, |
ble_gap_privacy_mode_t | mode | ||
) |
Set privacy mode for peer device.
[in] | peer_addr | The peer address. |
[in] | mode | Privacy mode. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_privacy_params_set | ( | uint16_t | renew_dur, |
bool | enable_flag | ||
) |
Set privacy related parameters.
[in] | renew_dur | Duration before regenerating a device address when privacy is enabled in seconds. Range: 0x0001 (1s) ~ 0xA1B8 (11.5 hr). The suggested time is 900s(15 minutes). |
[in] | enable_flag | Indicate the controller privacy is enabled or disabled. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
uint16_t ble_gap_reslv_rpa_addr | ( | uint8_t * | reslv_addr, |
uint8_t | src_info, | ||
ble_gap_reslv_rpa_addr_callback_t | cb | ||
) |
Resolve the rpa address.
[in] | reslv_addr | rpa address. |
[in] | src_info | Information used retrieve requester (src_info >= 10). |
[in] | cb | Function that will handle the resolved result. |
SDK_SUCCESS | Operation is Success. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
void ble_gap_rpa_addr_report_cb_register | ( | ble_gap_rpa_addr_report_callback_t | cb | ) |
Set the cb for rpa address report.
[in] | cb | the cb for rpa address report. |
uint16_t ble_gap_rpa_list_get | ( | ble_gap_ral_dev_list_t * | p_rpa_list | ) |
Get the RPA list info.
[in] | p_rpa_list | Pointer to the output RPA list. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
uint16_t ble_gap_rslv_addr_read | ( | ble_gap_rslv_addr_read_op_id_t | op_code, |
ble_gap_bdaddr_t | peer_iden_addr | ||
) |
Read peer or local resolvable address.
[in] | op_code | The operation code (see ble_gap_rslv_addr_read_op_id_t). |
[in] | peer_iden_addr | The peer identity address. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
uint16_t ble_gap_scan_param_set | ( | ble_gap_own_addr_t | own_addr_type, |
ble_gap_scan_param_t * | p_scan_param | ||
) |
Set parameters for scanning.
Note that this function must be called prior to scanning started.
[in] | own_addr_type | Own BD address source of the local device. |
[in] | p_scan_param | The scanning parameters. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_scan_start | ( | void | ) |
Start scanning.
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
uint16_t ble_gap_scan_stop | ( | void | ) |
Stop scanning.
SDK_SUCCESS | Operation is successful. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
uint16_t ble_gap_tx_power_get | ( | ble_gap_actv_role_t | role, |
uint8_t | index, | ||
int8_t * | txpwr_dbm | ||
) |
Get the tx power.
[in] | role | Select the role to Get tx power. ble_gap_actv_role_t for possible roles. |
[in] | index | The idx parameter is interpreted on role. -If role is BLE_GAP_ACTIVITY_ROLE_ADV, it's the index of Advertising. -If role is BLE_GAP_ACTIVITY_ROLE_CON, it's the index of connection. -For all other roles, it should be ignored. |
[in] | txpwr_dbm | The value of the tx power, Range: -20dbm to 7dbm. |
SDK_SUCCESS | Operation is Success. |
SDK_ERR_INVALID_CONN_IDX | Invalid connection index supplied. |
SDK_ERR_INVALID_ADV_IDX | Invalid advertising index supplied. |
SDK_ERR_INVALID_HANDLE | Invalid handle supplied. |
uint16_t ble_gap_tx_power_set | ( | ble_gap_actv_role_t | role, |
uint8_t | index, | ||
int8_t | txpwr_dbm | ||
) |
Set the tx power.
[in] | role | Select the role to set tx power. ble_gap_actv_role_t for possible roles. |
[in] | index | The idx parameter is interpreted on role. -If role is BLE_GAP_ACTIVITY_ROLE_ADV, it's the index of Advertising. -If role is BLE_GAP_ACTIVITY_ROLE_CON, it's the index of connection. -For all other roles, it should be ignored. |
[in] | txpwr_dbm | The value of the tx power, Range: -20dbm to 7dbm. |
SDK_SUCCESS | Operation is Success. |
SDK_ERR_INVALID_CONN_IDX | Invalid connection index supplied. |
SDK_ERR_INVALID_ADV_IDX | Invalid advertising index supplied. |
SDK_ERR_INVALID_HANDLE | Invalid handle supplied. |
uint16_t ble_gap_update_adv_data | ( | uint8_t | adv_idx, |
ble_gap_adv_data_type_t | type, | ||
const uint8_t * | p_data, | ||
uint16_t | length | ||
) |
Update Advertising Data, Scan Response Data and Periodic Advertising Data.
[in] | adv_idx | Advertising index, range is 0 to 4. |
[in] | type | Data type. |
[in] | p_data | The data pointer. |
[in] | length | Data length. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_INVALID_ADV_IDX | Invalid advertising index supplied. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_update_conn_param_method_set | ( | uint8_t | conn_idx, |
bool | use_l2cap_flag | ||
) |
Set the method for updating connection parameter.
[in] | conn_idx | Connection index. |
[in] | use_l2cap_flag | Preferred to use l2cap to update connection parameter. |
SDK_SUCCESS | Operation is Success. |
SDK_ERR_INVALID_CONN_IDX | Invalid connection index supplied. |
uint16_t ble_gap_whitelist_add | ( | const ble_gap_white_list_t * | p_whitelist | ) |
Add the devices into current white list.
If white list is full or there are duplicated entries, it will return error.
[in] | p_whitelist | Pointer to input white list. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_LIST_ITEM_ALREADY_EXISTED | Item already existed in list. |
SDK_ERR_LIST_FULL | List is full. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_whitelist_clear | ( | void | ) |
Clear all the entries in the current white list.
SDK_SUCCESS | Operation is successful. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_whitelist_del | ( | const ble_gap_white_list_t * | p_whitelist | ) |
Delete the devices out of current white list.
If the entries do not exist in the current white list, it will return error.
[in] | p_whitelist | Pointer to input white list. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |
SDK_ERR_LIST_ITEM_NOT_FOUND | Item not found in list. |
SDK_ERR_DISALLOWED | Operation is disallowed. |
SDK_ERR_INVALID_PARAM | Invalid parameter supplied. |
SDK_ERR_NO_RESOURCES | Not enough resources. |
uint16_t ble_gap_whitelist_get | ( | ble_gap_white_list_t * | p_whitelist | ) |
Get the content of the whole white list.
[in] | p_whitelist | Pointer to the output white list. |
SDK_SUCCESS | Operation is successful. |
SDK_ERR_POINTER_NULL | Invalid pointer supplied. |