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

Macros#

#define
BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCANNING_PHY sl_bt_gap_phy_coding_1m_uncoded
#define
BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_DISCOVERY_MODE sl_bt_scanner_discover_generic
#define
BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_MODE sl_bt_scanner_scan_mode_passive
#define
BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_INTERVAL 16
#define
BLE_PEER_MANAGER_CENTRAL_CONFIG_DEFAULT_SCAN_WINDOW 16

Function Documentation#

ble_peer_manager_central_init#

void ble_peer_manager_central_init (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Initialize the Peer Manager.

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


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
TypeDirectionArgument NameDescription
sl_bt_gap_phy_coding_t[in]scanning_phy

PHY to use for scanning.

sl_bt_scanner_discover_mode_t[in]scan_discovery_mode

Discovery mode to use for scanning.

sl_bt_scanner_scan_mode_t[in]scan_mode

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

uint8_t[in]scan_interval

Scan interval to use for scanning.

uint8_t[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.


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.


ble_peer_manager_central_open_connection#

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

Address of the peripheral device.

uint8_t[in]address_type

Address type of the peripheral device.

Open a connection as a central.


ble_peer_manager_central_close_connection#

sl_status_t ble_peer_manager_central_close_connection (uint8_t conn_handle)
Parameters
TypeDirectionArgument NameDescription
uint8_t[in]conn_handle

Connection handle of the connection which needs to be closed.

Close connection.