Exemplo n.º 1
0
        private CrossBleRadioPeripheral CacheGetPeripheral(IDevice bleDevice)
        {
            CrossBleRadioPeripheral peripheral;

            if (PeripheralCache.ContainsKey(bleDevice.Uuid))
            {
                peripheral = PeripheralCache[bleDevice.Uuid];

                if (!ReferenceEquals(peripheral.BleDevice, bleDevice))
                {
                    peripheral.SetDevice(bleDevice);
                }
            }
            else
            {
                peripheral = new CrossBleRadioPeripheral(bleDevice);
            }

            PeripheralCache[bleDevice.Uuid] = peripheral;
            return(peripheral);
        }
Exemplo n.º 2
0
 public CrossBlePeripheralLease(CrossBleRadioPeripheral crossBleRadioPeripheral)
 {
     CrossPeripheral = crossBleRadioPeripheral;
 }