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#
Macros#
Function Documentation#
ble_peer_manager_central_init#
void ble_peer_manager_central_init (void )
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
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)
Type | Direction | Argument Name | Description |
---|---|---|---|
uint8_t | [in] | conn_handle | Connection handle of the connection which needs to be closed. |
Close connection.