Ejemplo n.º 1
0
 public BluetoothIO(IAdapter adapter, SerialIOSettings settings)
 {
     Settings = settings;
     _adapter = adapter;
     _adapter.DeviceConnectionLost += AdapterOnDeviceConnectionLost;
     _adapter.DeviceDisconnected   += AdapterOnDeviceDisconnected;
     _adapter.DeviceDiscovered     += Adapter_DeviceDiscovered;
     _adapter.ScanTimeout           = Settings.ScanTimeout;
 }
Ejemplo n.º 2
0
        public BluetoothIO(IBluetoothLE bluetoothLe, IBluetoothLogger logger, Platform platform)
        {
            _platform = platform;
            Settings  = new SerialIOSettings();
            bluetoothLe.StateChanged += BluetoothLeOnStateChanged;
            _logger = logger;

            _adapter = bluetoothLe.Adapter;
            _adapter.DeviceConnectionLost += AdapterOnDeviceConnectionLost;
            _adapter.DeviceDisconnected   += AdapterOnDeviceDisconnected;
            _adapter.DeviceDiscovered     += Adapter_DeviceDiscovered;
            _adapter.ScanTimeout           = Settings.ScanTimeout;
        }