bt_br_page_scan_update_param

Function bt_br_page_scan_update_param 

Source
pub unsafe extern "C" fn bt_br_page_scan_update_param(
    param: *const bt_br_page_scan_param,
) -> i32
Expand description

@brief Update BR/EDR page scan parameters.

This function updates the page scan parameters of the local BR/EDR controller. Page scan parameters determine how the controller listens for incoming connection requests from remote devices.

The function validates the provided parameters, including the interval, window, and scan type, and sends the appropriate HCI commands to update the controller’s page scan activity and scan type.

The user can set custom page scan parameters using the helper macro BT_BR_PAGE_SCAN_PARAM() to define their own values. Alternatively, the user can use predefined standard parameters as defined in the Bluetooth specification:

  • @ref BT_BR_PAGE_SCAN_PARAM_R0 Default page scan parameters.
  • @ref BT_BR_PAGE_SCAN_PARAM_FAST_R1 Fast page scan parameters for R1.
  • @ref BT_BR_PAGE_SCAN_PARAM_MEDIUM_R1 Medium page scan parameters for R1.
  • @ref BT_BR_PAGE_SCAN_PARAM_SLOW_R1 Slow page scan parameters for R1.
  • @ref BT_BR_PAGE_SCAN_PARAM_FAST_R2 Fast page scan parameters for R2.
  • @ref BT_BR_PAGE_SCAN_PARAM_SLOW_R2 Slow page scan parameters for R2.

These predefined parameters are designed to meet common use cases and ensure compliance with the Bluetooth specification.

@param param Page scan parameters, including: - interval: Time between consecutive page scans (in 0.625 ms units). Must be in the range [0x0012, 0x1000]. - window: Duration of a single page scan (in 0.625 ms units). Must be in the range [0x0011, 0x1000]. - type: Page scan type (e.g., standard or interlaced).

@return 0 on success. @return -EINVAL if the provided parameters are invalid. @return -EAGAIN if the device is not ready. @return -ENOBUFS if memory allocation for HCI commands fails. @return Other negative error codes for internal failures.