mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 23:01:52 +01:00
83 lines
1.6 KiB
C#
83 lines
1.6 KiB
C#
using Borepin.Service.NFC;
|
|
using NFC;
|
|
using NFC.Interfaces;
|
|
using NFC_PCSC;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Borepin.UWP.Services
|
|
{
|
|
public class NFCService : INFCService
|
|
{
|
|
#region Private Members
|
|
IHardware _Hardware;
|
|
IReader _Reader;
|
|
ICard _Card;
|
|
#endregion
|
|
|
|
#region Constructors
|
|
public NFCService(IHardware hardware = null)
|
|
{
|
|
if(hardware == null)
|
|
{
|
|
_Hardware = new Hardware_PCSC();
|
|
}
|
|
else
|
|
{
|
|
_Hardware = hardware;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region Members
|
|
public bool IsAvailable
|
|
{
|
|
get
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
public bool IsEnabled
|
|
{
|
|
get
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public bool IsConnected
|
|
{
|
|
get
|
|
{
|
|
return _Reader != null && _Card != null;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region Methods
|
|
public IList<string> GetReaderIDs()
|
|
{
|
|
return new List<string>(_Hardware.GetReaders());
|
|
}
|
|
#endregion
|
|
|
|
public void Connect(string readerID)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void Disconnect()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public APDUResponse Transmit(APDUCommand command)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|