![]() |
nRF Connect SDK API 3.3.99
|
#include <ble_connectivity_manager.h>
Data Structures | |
| struct | ConnectionSecurityRequest |
| struct | ScannedDevice |
| struct | ScanResult |
Public Types | |
| enum | State : uint8_t { Start = 0 , Scanning = 0 , Pairing , LostDevice , Connected , Idle , Unknown , End } |
| using | StateChangedCallback = void (*)(State state) |
| Callback to indicate the bridge's Bluetooth LE connectivity state of the highest priority. | |
| using | DeviceConnectedCallback = CHIP_ERROR (*)(bool success, void *context) |
| using | ScanDoneCallback = void (*)(ScanResult &result, void *context) |
| using | ConnectionSecurityRequestCallback = void (*)(void *context) |
Public Member Functions | |
| CHIP_ERROR | Init (const bt_uuid **serviceUuids, uint8_t serviceUuidsCount) |
| Initialize BLEConnectivityManager instance. | |
| CHIP_ERROR | Scan (ScanDoneCallback callback, void *context, uint32_t scanTimeoutMs=kScanTimeoutMs) |
| Start scanning for Bluetooth LE peripheral devices advertising service UUIDs passed in Init method. | |
| CHIP_ERROR | StopScan () |
| Stop scanning operation. | |
| CHIP_ERROR | Connect (BLEBridgedDeviceProvider *provider, ConnectionSecurityRequest *request=nullptr) |
| Create connection to the Bluetooth LE device, managed by BLEBridgedDeviceProvider object. It is necessary to first add the provider to the manager's list using AddBLEProvider method. | |
| CHIP_ERROR | Reconnect (BLEBridgedDeviceProvider *provider) |
| Create connection to the first Bluetooth LE device on the mProvidersToRecover recovery list. | |
| BLEBridgedDeviceProvider * | FindBLEProvider (bt_addr_le_t address) |
| Get BLE provider that uses the specified connection object. | |
| CHIP_ERROR | AddBLEProvider (BLEBridgedDeviceProvider *provider) |
| Add the BLE provider's address to the manager's list. | |
| CHIP_ERROR | RemoveBLEProvider (bt_addr_le_t address) |
| Remove the BLE provider from the manager's list. | |
| CHIP_ERROR | GetScannedDeviceAddress (bt_addr_le_t *address, uint8_t index) |
| Gets Bluetooth LE address of a device that was scanned before. | |
| CHIP_ERROR | GetScannedDeviceUuid (uint16_t &uuid, uint8_t index) |
| Gets Bluetooth LE service UUID of a device that was scanned before. | |
| void | Recover (BLEBridgedDeviceProvider *provider) |
| Recover connection with the specified BLE provider. It is necessary to first add the provider to the manager's list using AddBLEProvider method. | |
| void | RegisterStateCallback (StateChangedCallback callback) |
| Register a callback to notify application about current status change. | |
| CHIP_ERROR | PrepareFilterForUuid () |
| CHIP_ERROR | PrepareFilterForAddress (bt_addr_le_t *addr) |
| void | SetPincode (bt_addr_le_t addr, unsigned int pincode) |
| Set authentication pincode to confirm the specific Bluetooth LE connection. | |
Static Public Member Functions | |
| static void | FilterMatch (bt_scan_device_info *device_info, bt_scan_filter_match *filter_match, bool connectable) |
| static void | ScanTimeoutCallback (k_timer *timer) |
| static void | ScanTimeoutHandle (intptr_t context) |
| static void | ConnectionHandler (bt_conn *conn, uint8_t conn_err) |
| static void | DisconnectionHandler (bt_conn *conn, uint8_t reason) |
| static void | DiscoveryCompletedHandler (bt_gatt_dm *dm, void *context) |
| static void | DiscoveryNotFound (bt_conn *conn, void *context) |
| static void | DiscoveryError (bt_conn *conn, int err, void *context) |
| static int | StartGattDiscovery (bt_conn *conn, BLEBridgedDeviceProvider *provider) |
| static void | SecurityChangedHandler (struct bt_conn *conn, bt_security_t level, enum bt_security_err err) |
| static void | AuthenticationCancel (struct bt_conn *conn) |
| static void | PasskeyEntry (struct bt_conn *conn) |
| static void | PairingComplete (struct bt_conn *conn, bool bonded) |
| static void | PairingFailed (struct bt_conn *conn, enum bt_security_err reason) |
| static BLEConnectivityManager & | Instance () |
| static void | ReScanCallback (ScanResult &result, void *context) |
Static Public Attributes | |
| static constexpr uint16_t | kScanTimeoutMs = CONFIG_BRIDGE_BT_SCAN_TIMEOUT_MS |
| static constexpr uint16_t | kMaxScannedDevices = CONFIG_BRIDGE_BT_MAX_SCANNED_DEVICES |
| static constexpr uint16_t | kMaxConnectedDevices = CONFIG_BT_MAX_CONN - 1 |
| static constexpr uint8_t | kMaxServiceUuids = 1 |