diff --git a/src/PKOC.Net/PKOCControlPanel.cs b/src/PKOC.Net/PKOCControlPanel.cs index 1d5da3d..0d6eb53 100644 --- a/src/PKOC.Net/PKOCControlPanel.cs +++ b/src/PKOC.Net/PKOCControlPanel.cs @@ -21,7 +21,7 @@ public class PKOCControlPanel : IDisposable private readonly SemaphoreSlim _initializeLock = new SemaphoreSlim(1, 1); private readonly SemaphoreSlim _lock = new SemaphoreSlim(0, 1); private readonly ControlPanel _panel; - private readonly ConcurrentBag _deviceSettings = new ConcurrentBag(); + private readonly ConcurrentBag _deviceSettings = new(); /// /// Initialize a new instance of the class. @@ -66,7 +66,9 @@ public async Task InitializePKOC(PKOCDevice pkocDevice) _initializeLock.Release(); } } - + + + /// /// Sends an authentication request to a PKOC control panel. /// @@ -152,6 +154,11 @@ private void OnPanelOnManufacturerSpecificReplyReceived(object _, ProcessAuthenticationResponse( DataFragmentResponse.ParseData(eventArgs.ManufacturerSpecific.Data.Skip(1).ToArray()), deviceSettings); + Task.Run(async () => + { + await _panel.KeepReaderActive(deviceSettings.ConnectionId, deviceSettings.Address, + (ushort)deviceSettings.CardReadTimeout.TotalMilliseconds); + }); } else if (IdentifyMessage(eventArgs.ManufacturerSpecific.Data) == PKOCMessageIdentifier.ReaderErrorResponse) {