// It registers bluetooth receiver - for scanning and discovery of classic bluetooth devices private void SubscribeToBluetooth() { if (_receiver == null) { _receiver = new BluetoothReceiver(); } RegisterReceiver(_receiver, new IntentFilter(BluetoothDevice.ActionFound)); }
// It registers bluetooth receiver - for scanning and discovery of classic bluetooth devices private void SubscribeToBluetooth() { if (_receiver == null) { _receiver = new BluetoothReceiver(); } RegisterReceiver(_receiver, new IntentFilter(BluetoothDevice.ActionFound)); RegisterReceiver(_receiver, new IntentFilter(BluetoothAdapter.ActionDiscoveryStarted)); RegisterReceiver(_receiver, new IntentFilter(BluetoothAdapter.ActionDiscoveryFinished)); }
// It unregisters listeners and resets the classic bluetooth receiver private void UnsubscribeFromBluetooth() { cancelScanning(); if (_receiver != null) { UnregisterReceiver(_receiver); } _receiver = null; devices = null; }