public void EnumerateDevices() { // var newDeviceList = HitachiBio.EnumerateDevices(); if (DateTime.Now - LastTime > TimeSpan.FromSeconds(1.0)) { LastTime = DateTime.Now; } else { return; } var removeList = ActiveDevices.OfType <DeviceHi>().Where(dev => !dev.IsOnline).ToList(); foreach (var device in removeList) { device.Dispose(); ActiveDevices.Remove(device); } foreach (var device in ActiveDevices) { device.Dispatch(COMMAND.SINGLECAPTURE_STOP); } var newDevicesInfo = HitachiBio.EnumerateDevices(); foreach (var deviceInfo in newDevicesInfo) { if (!ActiveDevices.OfType <DeviceHi>().Any(dev => dev.Uid == deviceInfo.UnitId.ToString())) { ActiveDevices.Add(new DeviceHi(deviceInfo)); } } }
internal int Match(FingerTemplate template,IEnumerable <FingerTemplate> candidates,out List <FingerTemplate> matches) { Attach(); int res = HitachiBio.Match(handle,template,candidates,out matches); //Detach(); return(res); }
private void Detach() { if (_isAttached) { HitachiBio.Detach(handle); _isAttached = false; } }
public void Dispose() { foreach (var device in ActiveDevices) { device.Dispose(); } HitachiBio.Dispose(); }
private bool Attach() { if (!_isAttached) { if (HitachiBio.Attach(unitinfo,ref handle,streamingCallBack,stateCallBack)) { _isAttached = true; return(true); } else { return(false); } } return(false); }
public void Initialize() { ActiveDevices = new List <IFingerDevice>(); HitachiBio.Initialize(); EnumerateDevices(); }