Exemplo n.º 1
0
        private void DeviceDiscoveredHandler(IBleAdapter sender, BleDeviceEventArgs args)
        {
            var device   = args.Device;
            var deviceId = device.Id;
            var pd       = new ProxiedBleDevice(sender, device);

            _cachingProvider.Set(GetDeviceCacheKey(deviceId), pd, DiscoveredDeviceCachingTime);
        }
Exemplo n.º 2
0
        private void DeviceConnectedHandler(IBleAdapter sender, BleDeviceEventArgs args)
        {
            var device   = args.Device;
            var deviceId = device.Id;

            lock (lockObject)
            {
                if (!Devices.ContainsKey(deviceId))
                {
                    Devices[deviceId] = new ProxiedBleDevice(sender, device);
                }
            }
        }