diff --git a/Borepin/Borepin.iOS/Borepin.iOS.csproj b/Borepin/Borepin.iOS/Borepin.iOS.csproj index 52c9c8d..05c2243 100644 --- a/Borepin/Borepin.iOS/Borepin.iOS.csproj +++ b/Borepin/Borepin.iOS/Borepin.iOS.csproj @@ -1,6 +1,7 @@  + true Debug iPhoneSimulator 8.0.30703 @@ -26,7 +27,7 @@ prompt 4 x86_64 - Full + SdkOnly true iPhone Developer @@ -54,7 +55,6 @@ SdkOnly -all --optimize=experimental-xforms-product-type - iOS Team Provisioning Profile: org.fab-access.borepin none @@ -78,8 +78,8 @@ - + @@ -177,8 +177,10 @@ 8.0.0.1909 - + + 4.7.0.1351 + diff --git a/Borepin/Borepin.iOS/CNFC/Card.cs b/Borepin/Borepin.iOS/CNFC/Card.cs index 34a573f..a854481 100644 --- a/Borepin/Borepin.iOS/CNFC/Card.cs +++ b/Borepin/Borepin.iOS/CNFC/Card.cs @@ -1,67 +1,67 @@ -using System; -using System.Threading; -using CoreNFC; -using Foundation; -using NFC; -using NFC.ISO7816_4; +//using System; +//using System.Threading; +//using CoreNFC; +//using Foundation; +//using NFC; +//using NFC.ISO7816_4; -namespace Borepin.iOS.CNFC -{ - public class Card : ICard - { - private NFCTagReaderSession _session; - private INFCMiFareTag _tag; +//namespace Borepin.iOS.CNFC +//{ +// public class Card : ICard +// { +// private NFCTagReaderSession _session; +// private INFCMiFareTag _tag; - public Card(NFCTagReaderSession session, INFCMiFareTag tag) - { - _session = session; - _tag = tag; - } +// public Card(NFCTagReaderSession session, INFCMiFareTag tag) +// { +// _session = session; +// _tag = tag; +// } - public void Connect() - { - var counter = new CountdownEvent(1); - NSError err = null; +// public void Connect() +// { +// var counter = new CountdownEvent(1); +// NSError err = null; - _session.ConnectTo(_tag, (error) => - { - err = error; - counter.Signal(); - }); +// _session.ConnectTo(_tag, (error) => +// { +// err = error; +// counter.Signal(); +// }); - counter.Wait(); +// counter.Wait(); - if (err != null) - { - throw new Exception(err.LocalizedDescription); - } - } +// if (err != null) +// { +// throw new Exception(err.LocalizedDescription); +// } +// } - public void Disconnect() - { - // TODO: decide on which should be used - //_session.RestartPolling(); - _session.InvalidateSession("card disconnect"); - } +// public void Disconnect() +// { +// // TODO: decide on which should be used +// //_session.RestartPolling(); +// _session.InvalidateSession("card disconnect"); +// } - public APDUResponse Transmit(APDUCommand cmd) - { - var counter = new CountdownEvent(1); - byte[] buf = null; +// public APDUResponse Transmit(APDUCommand cmd) +// { +// var counter = new CountdownEvent(1); +// byte[] buf = null; - _tag.SendMiFareIso7816Command(new NFCIso7816Apdu(NSData.FromArray(cmd.Data)), (response, sw1, sw2, NSError) => - { - // reassembly the original apdu message - buf = new byte[response.Length + 2]; - response.ToArray().CopyTo(buf, 0); - buf[response.Length + 0] = sw1; - buf[response.Length + 1] = sw2; - counter.Signal(); - }); +// _tag.SendMiFareIso7816Command(new NFCIso7816Apdu(NSData.FromArray(cmd.Data)), (response, sw1, sw2, NSError) => +// { +// // reassembly the original apdu message +// buf = new byte[response.Length + 2]; +// response.ToArray().CopyTo(buf, 0); +// buf[response.Length + 0] = sw1; +// buf[response.Length + 1] = sw2; +// counter.Signal(); +// }); - counter.Wait(); +// counter.Wait(); - return new APDUResponse(buf); - } - } -} +// return new APDUResponse(buf); +// } +// } +//} diff --git a/Borepin/Borepin.iOS/CNFC/Hardware.cs b/Borepin/Borepin.iOS/CNFC/Hardware.cs index e523b9e..c3013a9 100644 --- a/Borepin/Borepin.iOS/CNFC/Hardware.cs +++ b/Borepin/Borepin.iOS/CNFC/Hardware.cs @@ -1,24 +1,24 @@ -using System; -using CoreNFC; -using NFC; +//using System; +//using CoreNFC; +//using NFC; -namespace Borepin.iOS.CNFC -{ - public class Hardware : IHardware - { - public bool IsAvailable() - { - return NFCReaderSession.ReadingAvailable; - } +//namespace Borepin.iOS.CNFC +//{ +// public class Hardware : IHardware +// { +// public bool IsAvailable() +// { +// return NFCReaderSession.ReadingAvailable; +// } - public String[] GetReaders() - { - return new String[] { "main" }; - } +// public String[] GetReaders() +// { +// return new String[] { "main" }; +// } - public IReader OpenReader(String readerID) - { - return new Reader(); - } - } -} +// public IReader OpenReader(String readerID) +// { +// return new Reader(); +// } +// } +//} diff --git a/Borepin/Borepin.iOS/CNFC/Reader.cs b/Borepin/Borepin.iOS/CNFC/Reader.cs index 992eb5e..8ed9671 100644 --- a/Borepin/Borepin.iOS/CNFC/Reader.cs +++ b/Borepin/Borepin.iOS/CNFC/Reader.cs @@ -1,66 +1,66 @@ -using System; -using CoreFoundation; -using CoreNFC; -using Foundation; -using NFC; +//using System; +//using CoreFoundation; +//using CoreNFC; +//using Foundation; +//using NFC; -namespace Borepin.iOS.CNFC -{ - public class Reader : NFCTagReaderSessionDelegate, IReader - { - public event ReaderEventHandler CardDiscovered; - public event ReaderEventHandler CardLost; +//namespace Borepin.iOS.CNFC +//{ +// public class Reader : NFCTagReaderSessionDelegate, IReader +// { +// public event ReaderEventHandler CardDiscovered; +// public event ReaderEventHandler CardLost; - private NFCReaderSession _session = null; - private DispatchQueue _queue; +// private NFCReaderSession _session = null; +// private DispatchQueue _queue; - public void Start() - { - _queue = new DispatchQueue("NFC Reader Queue", true); +// public void Start() +// { +// _queue = new DispatchQueue("NFC Reader Queue", true); - // sessions cannot be reused - _session = new NFCTagReaderSession(NFCPollingOption.Iso14443, this, _queue) - { - AlertMessage = "TODO", - }; +// // sessions cannot be reused +// _session = new NFCTagReaderSession(NFCPollingOption.Iso14443, this, _queue) +// { +// AlertMessage = "TODO", +// }; - if (_session == null) - { - Console.WriteLine("Oh no! The session is null!"); - } +// if (_session == null) +// { +// Console.WriteLine("Oh no! The session is null!"); +// } - _session.BeginSession(); - } +// _session.BeginSession(); +// } - public void Stop() - { - _session?.InvalidateSession(); - _session = null; - } +// public void Stop() +// { +// _session?.InvalidateSession(); +// _session = null; +// } - public override void DidDetectTags(NFCTagReaderSession session, INFCTag[] tags) - { - Console.WriteLine("Did detect tags"); +// public override void DidDetectTags(NFCTagReaderSession session, INFCTag[] tags) +// { +// Console.WriteLine("Did detect tags"); - Console.WriteLine(tags[0].Type); +// Console.WriteLine(tags[0].Type); - //INFCIso7816Tag tag = tags[0].GetNFCIso7816Tag(); - INFCMiFareTag tag = tags[0].GetNFCMiFareTag(); - if (tag != null) - { - Console.WriteLine("Card ist valid"); - CardDiscovered?.Invoke(this, new Card(session, tag)); - } - else - { - Console.WriteLine("Card is not ISO7816"); - } - } +// //INFCIso7816Tag tag = tags[0].GetNFCIso7816Tag(); +// INFCMiFareTag tag = tags[0].GetNFCMiFareTag(); +// if (tag != null) +// { +// Console.WriteLine("Card ist valid"); +// CardDiscovered?.Invoke(this, new Card(session, tag)); +// } +// else +// { +// Console.WriteLine("Card is not ISO7816"); +// } +// } - public override void DidInvalidate(NFCTagReaderSession session, NSError error) - { - // TODO: decide what to do - Console.WriteLine("reader session invalidated"); - } - } -} +// public override void DidInvalidate(NFCTagReaderSession session, NSError error) +// { +// // TODO: decide what to do +// Console.WriteLine("reader session invalidated"); +// } +// } +//}