Esempio n. 1
0
        public BLEDevice(CBPeripheral device, int RSSI)
        {
            deviceTaskCompletitionSource = new DeviceTaskCompletitionSource();
            _centralManager     = new CBCentralManager(_centralManagerDelegate = new CentralManagerDelegate(deviceTaskCompletitionSource), DispatchQueue.CurrentQueue);
            _peripheralDelegate = new PeripheralDelegate(deviceTaskCompletitionSource);
            _device             = device;

            Guid = Guid.Parse(_device.Identifier?.AsString());
            Name = _device.Name?.ToString();
            Rssi = RSSI;
        }
Esempio n. 2
0
 public BLEAdapter(TimeSpan scanTimeout)
 {
     ScanTimeout             = scanTimeout;
     _centralManagerDelegate = new CentralManagerDelegate(ScanTimeout, _isScanning, _scanForDevicesTCS);
     _centralManager         = new CBCentralManager(_centralManagerDelegate, DispatchQueue.CurrentQueue);
 }