2023-01-29 16:55:07 +01:00
|
|
|
|
using Borepin.Service.NFC;
|
2023-01-29 22:14:39 +01:00
|
|
|
|
using NFC;
|
2023-01-29 16:55:07 +01:00
|
|
|
|
using NFC.Interfaces;
|
2023-01-29 22:14:39 +01:00
|
|
|
|
using NFC_PCSC;
|
2023-01-29 16:55:07 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Borepin.UWP.Services
|
|
|
|
|
{
|
|
|
|
|
public class NFCService : INFCService
|
|
|
|
|
{
|
2023-01-29 22:14:39 +01:00
|
|
|
|
#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)
|
2023-01-29 16:55:07 +01:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-29 22:14:39 +01:00
|
|
|
|
public void Disconnect()
|
2023-01-29 16:55:07 +01:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-29 22:14:39 +01:00
|
|
|
|
public APDUResponse Transmit(APDUCommand command)
|
2023-01-29 16:55:07 +01:00
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|