BLE Peer Manager Central#

Peer Manager for Bluetooth Low Energy. Responsible for scanning and creating connections. Filters can be used for setting Bluetooth specific parameters.

Functions#

sl_status_t
ble_peer_manager_central_set_scanner(sl_bt_gap_phy_coding_t scanning_phy, sl_bt_scanner_discover_mode_t scan_discovery_mode, sl_bt_scanner_scan_mode_t scan_mode, uint8_t scan_interval, uint8_t scan_window)
sl_status_t
ble_peer_manager_central_open_connection(bd_addr *address, uint8_t address_type)
sl_status_t

Function Documentation#

ble_peer_manager_central_init#

void ble_peer_manager_central_init (void )
Parameters
N/A

Initialize the Peer Manager.

Set default values for scanner, reset filters, set state to IDLE and create an emtpy connection array.


Definition at line 47 of file common/ble_peer_manager/central/inc/ble_peer_manager_central.h

ble_peer_manager_central_set_scanner#

sl_status_t ble_peer_manager_central_set_scanner (sl_bt_gap_phy_coding_t scanning_phy, sl_bt_scanner_discover_mode_t scan_discovery_mode, sl_bt_scanner_scan_mode_t scan_mode, uint8_t scan_interval, uint8_t scan_window)
Parameters
[in]scanning_phy

PHY to use for scanning.

[in]scan_discovery_mode

Discovery mode to use for scanning.

[in]scan_mode

Scan mode to use for scanning (active or passive).

[in]scan_interval

Scan interval to use for scanning.

[in]scan_window

Scan window to use for scanning.

Set scanner parameters.

Set the scanner parameters if the Peer Manager is in IDLE state. Call this function before starting the scanner.


Definition at line 64 of file common/ble_peer_manager/central/inc/ble_peer_manager_central.h

ble_peer_manager_central_create_connection#

sl_status_t ble_peer_manager_central_create_connection ()

Create a central connection.

The Peer Manager will start the scanner. If a connection opened event is received, and the connection handle is the same as in the sl_bt_connection_open() function, the Peer Manager will stop the scanner and save the connection.


Definition at line 80 of file common/ble_peer_manager/central/inc/ble_peer_manager_central.h

ble_peer_manager_central_open_connection#

sl_status_t ble_peer_manager_central_open_connection (bd_addr * address, uint8_t address_type)
Parameters
[in]address

Address of the peripheral device.

[in]address_type

Address type of the peripheral device.

Open a connection as a central.


Definition at line 90 of file common/ble_peer_manager/central/inc/ble_peer_manager_central.h

ble_peer_manager_central_close_connection#

sl_status_t ble_peer_manager_central_close_connection (uint8_t conn_handle)
Parameters
[in]conn_handle

Connection handle of the connection which needs to be closed.

Close connection.


Definition at line 102 of file common/ble_peer_manager/central/inc/ble_peer_manager_central.h

Macro Definition Documentation#

BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCANNING_PHY#

#define BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCANNING_PHY
Value:
sl_bt_gap_phy_coding_1m_uncoded

Definition at line 47 of file common/ble_peer_manager/central/config/ble_peer_manager_central_config.h

BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_DISCOVERY_MODE#

#define BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_DISCOVERY_MODE
Value:
sl_bt_scanner_discover_generic

Definition at line 56 of file common/ble_peer_manager/central/config/ble_peer_manager_central_config.h

BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_MODE#

#define BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_MODE
Value:
sl_bt_scanner_scan_mode_passive

Definition at line 64 of file common/ble_peer_manager/central/config/ble_peer_manager_central_config.h

BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_INTERVAL#

#define BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_INTERVAL
Value:
16

Definition at line 73 of file common/ble_peer_manager/central/config/ble_peer_manager_central_config.h

BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_WINDOW#

#define BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_WINDOW
Value:
16

Definition at line 82 of file common/ble_peer_manager/central/config/ble_peer_manager_central_config.h