From 6e436b5c8c291a9e9fef21f353252aff97615bca Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Sun, 29 Jan 2023 16:55:07 +0100 Subject: [PATCH] Start with NFCService --- Borepin.sln | 26 +++++++++++++++ .../Borepin.Android/Borepin.Android.csproj | 5 +++ .../Borepin.Android/PlatformInitializer.cs | 2 ++ .../Borepin.Android/Services/NFCService.cs | 33 +++++++++++++++++++ Borepin/Borepin.UWP/Borepin.UWP.csproj | 5 +++ Borepin/Borepin.UWP/PlatformInitializer.cs | 2 ++ Borepin/Borepin.UWP/Services/NFCService.cs | 28 ++++++++++++++++ Borepin/Borepin.iOS/Borepin.iOS.csproj | 5 +++ Borepin/Borepin.iOS/PlatformInitializer.cs | 2 ++ Borepin/Borepin.iOS/Services/NFCService.cs | 29 ++++++++++++++++ Borepin/Borepin/Borepin.csproj | 1 + Borepin/Borepin/Service/NFC/INFCService.cs | 17 ++++++++++ 12 files changed, 155 insertions(+) create mode 100644 Borepin/Borepin.Android/Services/NFCService.cs create mode 100644 Borepin/Borepin.UWP/Services/NFCService.cs create mode 100644 Borepin/Borepin.iOS/Services/NFCService.cs create mode 100644 Borepin/Borepin/Service/NFC/INFCService.cs diff --git a/Borepin.sln b/Borepin.sln index 6019848..bd8951a 100644 --- a/Borepin.sln +++ b/Borepin.sln @@ -32,6 +32,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Borepin.GTK", "Borepin\Borepin.GTK\Borepin.GTK.csproj", "{61D956D2-5819-4736-BBD8-AD8208DE6A62}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NFC_PCSC", "external\NFC\NFC_PCSC\NFC_PCSC.csproj", "{75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -360,6 +362,30 @@ Global {61D956D2-5819-4736-BBD8-AD8208DE6A62}.Release|x64.Build.0 = Release|Any CPU {61D956D2-5819-4736-BBD8-AD8208DE6A62}.Release|x86.ActiveCfg = Release|Any CPU {61D956D2-5819-4736-BBD8-AD8208DE6A62}.Release|x86.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|ARM.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|ARM.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhone.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x64.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x64.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x86.ActiveCfg = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Debug|x86.Build.0 = Debug|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|Any CPU.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|ARM.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|ARM.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhone.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhone.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x64.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x64.Build.0 = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x86.ActiveCfg = Release|Any CPU + {75D6EADC-1F9E-45EF-A913-FF4FA6CD4B35}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Borepin/Borepin.Android/Borepin.Android.csproj b/Borepin/Borepin.Android/Borepin.Android.csproj index 9b97e58..6792bec 100644 --- a/Borepin/Borepin.Android/Borepin.Android.csproj +++ b/Borepin/Borepin.Android/Borepin.Android.csproj @@ -82,6 +82,7 @@ + @@ -93,6 +94,10 @@ + + {D53A98E8-48B5-4DCE-A98E-4623EE746E16} + NFC + {3251FCE9-FEA3-4662-8BEB-636BE6732D48} FabAccessAPI diff --git a/Borepin/Borepin.Android/PlatformInitializer.cs b/Borepin/Borepin.Android/PlatformInitializer.cs index 540b18b..419f107 100644 --- a/Borepin/Borepin.Android/PlatformInitializer.cs +++ b/Borepin/Borepin.Android/PlatformInitializer.cs @@ -1,6 +1,7 @@ using Borepin.Droid.Services; using Borepin.Service; using Borepin.Service.Browser; +using Borepin.Service.NFC; using Borepin.Service.Storage; using Borepin.Service.Versioning; using Prism; @@ -16,6 +17,7 @@ namespace Borepin.Droid containerRegistry.Register(); containerRegistry.Register(); containerRegistry.Register(); + containerRegistry.Register(); containerRegistry.RegisterSingleton(); } diff --git a/Borepin/Borepin.Android/Services/NFCService.cs b/Borepin/Borepin.Android/Services/NFCService.cs new file mode 100644 index 0000000..8fbc343 --- /dev/null +++ b/Borepin/Borepin.Android/Services/NFCService.cs @@ -0,0 +1,33 @@ +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; +using Borepin.Service.NFC; +using NFC.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Borepin.Droid.Services +{ + public class NFCService : INFCService + { + public ICard GetCard() + { + throw new NotImplementedException(); + } + + public IHardware GetHardware() + { + throw new NotImplementedException(); + } + + public IReader GetReader() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Borepin/Borepin.UWP/Borepin.UWP.csproj b/Borepin/Borepin.UWP/Borepin.UWP.csproj index 52680ed..aaf1abf 100644 --- a/Borepin/Borepin.UWP/Borepin.UWP.csproj +++ b/Borepin/Borepin.UWP/Borepin.UWP.csproj @@ -100,6 +100,7 @@ + @@ -190,6 +191,10 @@ {c587aac3-50a7-4871-a50d-7880b6f24ef6} Capnp.Net.Runtime + + {D53A98E8-48B5-4DCE-A98E-4623EE746E16} + NFC + {3251FCE9-FEA3-4662-8BEB-636BE6732D48} FabAccessAPI diff --git a/Borepin/Borepin.UWP/PlatformInitializer.cs b/Borepin/Borepin.UWP/PlatformInitializer.cs index 0818906..ba259ff 100644 --- a/Borepin/Borepin.UWP/PlatformInitializer.cs +++ b/Borepin/Borepin.UWP/PlatformInitializer.cs @@ -5,6 +5,7 @@ using Borepin.Service.Storage; using Borepin.Service.Versioning; using Borepin.Service; using Borepin.Service.Browser; +using Borepin.Service.NFC; namespace Borepin.UWP { @@ -16,6 +17,7 @@ namespace Borepin.UWP containerRegistry.Register(); containerRegistry.Register(); containerRegistry.Register(); + containerRegistry.Register(); containerRegistry.RegisterSingleton(); } diff --git a/Borepin/Borepin.UWP/Services/NFCService.cs b/Borepin/Borepin.UWP/Services/NFCService.cs new file mode 100644 index 0000000..3c651d2 --- /dev/null +++ b/Borepin/Borepin.UWP/Services/NFCService.cs @@ -0,0 +1,28 @@ +using Borepin.Service.NFC; +using NFC.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Borepin.UWP.Services +{ + public class NFCService : INFCService + { + public ICard GetCard() + { + throw new NotImplementedException(); + } + + public IHardware GetHardware() + { + throw new NotImplementedException(); + } + + public IReader GetReader() + { + throw new NotImplementedException(); + } + } +} diff --git a/Borepin/Borepin.iOS/Borepin.iOS.csproj b/Borepin/Borepin.iOS/Borepin.iOS.csproj index ba7a226..1e669f1 100644 --- a/Borepin/Borepin.iOS/Borepin.iOS.csproj +++ b/Borepin/Borepin.iOS/Borepin.iOS.csproj @@ -83,6 +83,7 @@ + @@ -194,6 +195,10 @@ + + {D53A98E8-48B5-4DCE-A98E-4623EE746E16} + NFC + {3251FCE9-FEA3-4662-8BEB-636BE6732D48} FabAccessAPI diff --git a/Borepin/Borepin.iOS/PlatformInitializer.cs b/Borepin/Borepin.iOS/PlatformInitializer.cs index ade1f95..8b4c5e8 100644 --- a/Borepin/Borepin.iOS/PlatformInitializer.cs +++ b/Borepin/Borepin.iOS/PlatformInitializer.cs @@ -1,6 +1,7 @@ using Borepin.iOS.Services; using Borepin.Service; using Borepin.Service.Browser; +using Borepin.Service.NFC; using Borepin.Service.Storage; using Borepin.Service.Versioning; using Prism; @@ -16,6 +17,7 @@ namespace Borepin.iOS containerRegistry.Register(); containerRegistry.Register(); containerRegistry.Register(); + containerRegistry.Register(); containerRegistry.RegisterSingleton(); } diff --git a/Borepin/Borepin.iOS/Services/NFCService.cs b/Borepin/Borepin.iOS/Services/NFCService.cs new file mode 100644 index 0000000..29f8224 --- /dev/null +++ b/Borepin/Borepin.iOS/Services/NFCService.cs @@ -0,0 +1,29 @@ +using Borepin.Service.NFC; +using Foundation; +using NFC.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UIKit; + +namespace Borepin.iOS.Services +{ + public class NFCService : INFCService + { + public ICard GetCard() + { + throw new NotImplementedException(); + } + + public IHardware GetHardware() + { + throw new NotImplementedException(); + } + + public IReader GetReader() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Borepin/Borepin/Borepin.csproj b/Borepin/Borepin/Borepin.csproj index a5f7eac..f8cce68 100644 --- a/Borepin/Borepin/Borepin.csproj +++ b/Borepin/Borepin/Borepin.csproj @@ -159,6 +159,7 @@ + diff --git a/Borepin/Borepin/Service/NFC/INFCService.cs b/Borepin/Borepin/Service/NFC/INFCService.cs new file mode 100644 index 0000000..e863c38 --- /dev/null +++ b/Borepin/Borepin/Service/NFC/INFCService.cs @@ -0,0 +1,17 @@ +using NFC.Interfaces; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Borepin.Service.NFC +{ + /// + /// Service to provide hardware specific NFC Interfaces + /// + public interface INFCService + { + IHardware GetHardware(); + IReader GetReader(); + ICard GetCard(); + } +}