private void hidDeviceOnReceiveBytes(byte[] bytes) { bool isAuthenticated; var data = CommunicationProtocol.GetData(bytes, out isAuthenticated); if (data == null) { return; } var text = BytesConverter.GetString(data); var status = isAuthenticated ? ReceiveDataAuthenticatedStatus.Authenticated : ReceiveDataAuthenticatedStatus.NotAuthenticated; ReceiveText?.Invoke(text, status); }