From d0a202146884efe35d81f185d04bfcc7842db544 Mon Sep 17 00:00:00 2001 From: Mark Lopez Date: Sun, 3 Sep 2017 21:06:51 -0500 Subject: [PATCH 1/8] Updated .gitignore and .gitattributes to VS2017 defaults. --- .gitattributes | 79 ++++++++++++---- .gitignore | 249 ++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 287 insertions(+), 41 deletions(-) diff --git a/.gitattributes b/.gitattributes index 412eeda..1ff0c42 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,22 +1,63 @@ -# Auto detect text files and perform LF normalization +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### * text=auto -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index c0075d1..1c9a181 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,242 @@ -# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results [Dd]ebug/ +[Dd]ebugPublic/ [Rr]elease/ -x64/ -build/ +[Rr]eleases/ +[Xx]64/ +[Xx]86/ +[Bb]uild/ +bld/ [Bb]in/ [Oo]bj/ -# mstest test results -TestResults +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ -# user files -**.user -**.suo -**.sdf -*.sln.docstates +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* -# resharper -/_[Rr]e[Ss]harper.* -*.[Rr]e[Ss]harper.* -*.[Rr]e[Ss]harper -_[Rr]e[Ss]harper.* +# NUNIT +*.VisualState.xml +TestResult.xml - -# OS generated files -**/[Tt]humbs.db -**/[Dd]esktop.ini +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c -# Nuget packages -packages/* -!packages/repositories.config +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db # Visual Studio profiler *.psess *.vsp *.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml + +# TODO: Un-comment the next line if you do not want to checkin +# your web deploy settings because they may include unencrypted +# passwords +#*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# LightSwitch generated files +GeneratedArtifacts/ +ModelManifest.xml + +# Paket dependency manager +.paket/paket.exe +# FAKE - F# Make +.fake/ From 93a32e829537d393d1cd931566968e6049bbf137 Mon Sep 17 00:00:00 2001 From: Mark Lopez Date: Sun, 3 Sep 2017 21:07:31 -0500 Subject: [PATCH 2/8] Prototyped migration of Raspberry.IO to new SDK. --- Raspberry.IO/Raspberry.IO.csproj | 58 +++----------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/Raspberry.IO/Raspberry.IO.csproj b/Raspberry.IO/Raspberry.IO.csproj index e58e755..f512ec3 100644 --- a/Raspberry.IO/Raspberry.IO.csproj +++ b/Raspberry.IO/Raspberry.IO.csproj @@ -1,62 +1,12 @@ - - - + - Debug - AnyCPU - {ACE64F17-87E5-43E7-97A0-BDDE19059C61} - {ACE64F17-87E5-43E7-97A0-BDDE19059C61} - Library - Properties - Raspberry.IO - Raspberry.IO - v4.0 - 512 + net40 + false + true - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Raspberry.IO.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Raspberry.IO.XML - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - From bc1080164ffe89624adaf43486422b9e40739929 Mon Sep 17 00:00:00 2001 From: Mark Lopez Date: Sun, 3 Sep 2017 21:34:41 -0500 Subject: [PATCH 3/8] Prototyped migration of project libraries. --- .../Raspberry.IO.Components.csproj | 200 ++---------------- .../Raspberry.IO.GeneralPurpose.csproj | 105 +-------- ...Raspberry.IO.InterIntegratedCircuit.csproj | 71 +------ .../Raspberry.IO.Interop.csproj | 62 +----- ...pberry.IO.SerialPeripheralInterface.csproj | 95 +-------- 5 files changed, 44 insertions(+), 489 deletions(-) diff --git a/Raspberry.IO.Components/Raspberry.IO.Components.csproj b/Raspberry.IO.Components/Raspberry.IO.Components.csproj index e875fb8..4a228d0 100644 --- a/Raspberry.IO.Components/Raspberry.IO.Components.csproj +++ b/Raspberry.IO.Components/Raspberry.IO.Components.csproj @@ -1,196 +1,24 @@ - - + - Debug - AnyCPU - {8388CFCA-E3DB-43F7-B049-2CB195211CE8} - Library - Properties - Raspberry.IO.Components - Raspberry.IO.Components - v4.0 - 512 - ..\ - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + net40 + false + true - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - - - - - - $(SolutionDir)packages\Common.Logging.Core.3.3.1\lib\net40\Common.Logging.Core.dll - - - $(SolutionDir)packages\Common.Logging.3.3.1\lib\net40\Common.Logging.dll - - - $(SolutionDir)packages\UnitsNet.3.46.1\lib\net35\UnitsNet.dll - True - + + + + + + + + + + Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {63B8403E-BC56-43F9-A045-F61ECC3871F3} - Raspberry.IO.InterIntegratedCircuit - - - {689CB6C4-3D23-45DA-8E00-87C28AEA32D0} - Raspberry.IO.Interop - - - {326342E5-0411-40E8-9F2D-563D6B192568} - Raspberry.IO.SerialPeripheralInterface - - - {281C71ED-C36D-408E-8BAA-75C381DC17E7} - Raspberry.IO.GeneralPurpose - - - {ACE64F17-87E5-43E7-97A0-BDDE19059C61} - Raspberry.IO - - - - - - - - - - - \ No newline at end of file diff --git a/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj b/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj index cabdaa4..b4b862e 100644 --- a/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj +++ b/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj @@ -1,106 +1,19 @@ - - + - Debug - AnyCPU - {281C71ED-C36D-408E-8BAA-75C381DC17E7} - Library - Properties - Raspberry.IO.GeneralPurpose - Raspberry.IO.GeneralPurpose - v4.0 - 512 - ..\ - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Raspberry.IO.GeneralPurpose.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Raspberry.IO.GeneralPurpose.XML + net40 + false + true - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - - - - + + + + + Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {689CB6C4-3D23-45DA-8E00-87C28AEA32D0} - Raspberry.IO.Interop - - - {ACE64F17-87E5-43E7-97A0-BDDE19059C61} - Raspberry.IO - - - - - - \ No newline at end of file diff --git a/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj b/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj index 2d629a4..b2a4c49 100644 --- a/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj +++ b/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj @@ -1,73 +1,18 @@ - - + - Debug - AnyCPU - {63B8403E-BC56-43F9-A045-F61ECC3871F3} - Library - Properties - Raspberry.IO.InterIntegratedCircuit - Raspberry.IO.InterIntegratedCircuit - v4.0 - 512 - ..\ - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\Raspberry.IO.InterIntegratedCircuit.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Raspberry.IO.InterIntegratedCircuit.XML + net40 + false + true - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - - - - + + + + Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - {281C71ED-C36D-408E-8BAA-75C381DC17E7} - Raspberry.IO.GeneralPurpose - - - - - - \ No newline at end of file diff --git a/Raspberry.IO.Interop/Raspberry.IO.Interop.csproj b/Raspberry.IO.Interop/Raspberry.IO.Interop.csproj index 034c6fc..f512ec3 100644 --- a/Raspberry.IO.Interop/Raspberry.IO.Interop.csproj +++ b/Raspberry.IO.Interop/Raspberry.IO.Interop.csproj @@ -1,66 +1,12 @@ - - - + - Debug - AnyCPU - {689CB6C4-3D23-45DA-8E00-87C28AEA32D0} - Library - Properties - Raspberry.IO.Interop - Raspberry.IO.Interop - v4.0 - 512 - + net40 + false + true - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - diff --git a/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj b/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj index 13fa724..b4b862e 100644 --- a/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj +++ b/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj @@ -1,96 +1,19 @@ - - + - Debug - AnyCPU - {326342E5-0411-40E8-9F2D-563D6B192568} - Library - Properties - Raspberry.IO.SerialPeripheralInterface - Raspberry.IO.SerialPeripheralInterface - v4.0 - 512 - ..\ - - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 4 - bin\Debug\Raspberry.IO.SerialPeripheralInterface.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Raspberry.IO.SerialPeripheralInterface.XML + net40 + false + true - - $(SolutionDir)packages\Raspberry.System.2.1\lib\net40\Raspberry.System.dll - True - - - - + + + + + Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - {689CB6C4-3D23-45DA-8E00-87C28AEA32D0} - Raspberry.IO.Interop - - - {D2E41147-5BF6-4109-A497-C76284F3C020} - Raspberry.IO - - - {ACE64F17-87E5-43E7-97A0-BDDE19059C61} - Raspberry.IO - - - - - - \ No newline at end of file From 81bad3d6f39134d4839ba9da20ab2e3248312fbc Mon Sep 17 00:00:00 2001 From: Mark Lopez Date: Sun, 3 Sep 2017 21:44:08 -0500 Subject: [PATCH 4/8] Removed deprecated packages.config. --- Raspberry.IO.Components/packages.config | 7 ------- Raspberry.IO.GeneralPurpose/packages.config | 4 ---- Raspberry.IO.InterIntegratedCircuit/packages.config | 4 ---- Raspberry.IO.SerialPeripheralInterface/packages.config | 4 ---- 4 files changed, 19 deletions(-) delete mode 100644 Raspberry.IO.Components/packages.config delete mode 100644 Raspberry.IO.GeneralPurpose/packages.config delete mode 100644 Raspberry.IO.InterIntegratedCircuit/packages.config delete mode 100644 Raspberry.IO.SerialPeripheralInterface/packages.config diff --git a/Raspberry.IO.Components/packages.config b/Raspberry.IO.Components/packages.config deleted file mode 100644 index 5b70f76..0000000 --- a/Raspberry.IO.Components/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Raspberry.IO.GeneralPurpose/packages.config b/Raspberry.IO.GeneralPurpose/packages.config deleted file mode 100644 index 0f101ec..0000000 --- a/Raspberry.IO.GeneralPurpose/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Raspberry.IO.InterIntegratedCircuit/packages.config b/Raspberry.IO.InterIntegratedCircuit/packages.config deleted file mode 100644 index 0f101ec..0000000 --- a/Raspberry.IO.InterIntegratedCircuit/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Raspberry.IO.SerialPeripheralInterface/packages.config b/Raspberry.IO.SerialPeripheralInterface/packages.config deleted file mode 100644 index 0f101ec..0000000 --- a/Raspberry.IO.SerialPeripheralInterface/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From cd6e213cbc801430b02ca964c42a680fe8a53550 Mon Sep 17 00:00:00 2001 From: Mark Lopez Date: Sun, 3 Sep 2017 21:47:56 -0500 Subject: [PATCH 5/8] Removed implicit nuget references. --- Raspberry.IO.Components/Raspberry.IO.Components.csproj | 1 - .../Raspberry.IO.InterIntegratedCircuit.csproj | 3 --- 2 files changed, 4 deletions(-) diff --git a/Raspberry.IO.Components/Raspberry.IO.Components.csproj b/Raspberry.IO.Components/Raspberry.IO.Components.csproj index 4a228d0..7284de1 100644 --- a/Raspberry.IO.Components/Raspberry.IO.Components.csproj +++ b/Raspberry.IO.Components/Raspberry.IO.Components.csproj @@ -5,7 +5,6 @@ true - diff --git a/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj b/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj index b2a4c49..e616e1b 100644 --- a/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj +++ b/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj @@ -4,9 +4,6 @@ false true - - - From be0a57effcf1e9f0c68edfcc76c5877e89830355 Mon Sep 17 00:00:00 2001 From: Mark Lopez Date: Sun, 3 Sep 2017 22:02:32 -0500 Subject: [PATCH 6/8] Moved to target netstandard2.0. --- Raspberry.IO.Components/Raspberry.IO.Components.csproj | 2 +- Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj | 2 +- .../Raspberry.IO.InterIntegratedCircuit.csproj | 2 +- Raspberry.IO.Interop/Raspberry.IO.Interop.csproj | 2 +- .../Raspberry.IO.SerialPeripheralInterface.csproj | 2 +- Raspberry.IO/Raspberry.IO.csproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Raspberry.IO.Components/Raspberry.IO.Components.csproj b/Raspberry.IO.Components/Raspberry.IO.Components.csproj index 7284de1..b7b2c3b 100644 --- a/Raspberry.IO.Components/Raspberry.IO.Components.csproj +++ b/Raspberry.IO.Components/Raspberry.IO.Components.csproj @@ -1,6 +1,6 @@  - net40 + net40;netstandard2.0 false true diff --git a/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj b/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj index b4b862e..51b6d2d 100644 --- a/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj +++ b/Raspberry.IO.GeneralPurpose/Raspberry.IO.GeneralPurpose.csproj @@ -1,6 +1,6 @@  - net40 + net40;netstandard2.0 false true diff --git a/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj b/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj index e616e1b..ddcd3da 100644 --- a/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj +++ b/Raspberry.IO.InterIntegratedCircuit/Raspberry.IO.InterIntegratedCircuit.csproj @@ -1,6 +1,6 @@  - net40 + net40;netstandard2.0 false true diff --git a/Raspberry.IO.Interop/Raspberry.IO.Interop.csproj b/Raspberry.IO.Interop/Raspberry.IO.Interop.csproj index f512ec3..a6d228b 100644 --- a/Raspberry.IO.Interop/Raspberry.IO.Interop.csproj +++ b/Raspberry.IO.Interop/Raspberry.IO.Interop.csproj @@ -1,6 +1,6 @@  - net40 + net40;netstandard2.0 false true diff --git a/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj b/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj index b4b862e..51b6d2d 100644 --- a/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj +++ b/Raspberry.IO.SerialPeripheralInterface/Raspberry.IO.SerialPeripheralInterface.csproj @@ -1,6 +1,6 @@  - net40 + net40;netstandard2.0 false true diff --git a/Raspberry.IO/Raspberry.IO.csproj b/Raspberry.IO/Raspberry.IO.csproj index f512ec3..a6d228b 100644 --- a/Raspberry.IO/Raspberry.IO.csproj +++ b/Raspberry.IO/Raspberry.IO.csproj @@ -1,6 +1,6 @@  - net40 + net40;netstandard2.0 false true From eb25b347fbdd1166c447b68a840023274a5eacfd Mon Sep 17 00:00:00 2001 From: Mark Lopez Date: Sun, 3 Sep 2017 22:41:18 -0500 Subject: [PATCH 7/8] Created compatibility shim for the ConfigurationManager and dependencies. --- .../Configuration/ConfigurationManagerShim.cs | 20 +++++++++++ .../GpioConnectionConfigurationConstants.cs | 10 ++++++ .../GpioConnectionConfigurationSection.cs | 15 +++------ .../IGpioConnectionConfiguration.cs | 33 +++++++++++++++++++ .../GpioConnectionSettings.cs | 8 ++--- 5 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 Raspberry.IO.GeneralPurpose/Configuration/ConfigurationManagerShim.cs create mode 100644 Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfigurationConstants.cs create mode 100644 Raspberry.IO.GeneralPurpose/Configuration/IGpioConnectionConfiguration.cs diff --git a/Raspberry.IO.GeneralPurpose/Configuration/ConfigurationManagerShim.cs b/Raspberry.IO.GeneralPurpose/Configuration/ConfigurationManagerShim.cs new file mode 100644 index 0000000..b249a5c --- /dev/null +++ b/Raspberry.IO.GeneralPurpose/Configuration/ConfigurationManagerShim.cs @@ -0,0 +1,20 @@ +using System; + +namespace Raspberry.IO.GeneralPurpose.Configuration +{ + public static class ConfigurationManagerShim + { +#if NET40 + public static object GetSection(string sectionName) + { + return System.Configuration.ConfigurationManager.GetSection(sectionName); + } +#endif +#if NETSTANDARD2_0 + public static object GetSection(string sectionName) + { + throw new NotImplementedException(); + } +#endif + } +} \ No newline at end of file diff --git a/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfigurationConstants.cs b/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfigurationConstants.cs new file mode 100644 index 0000000..bf4335f --- /dev/null +++ b/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfigurationConstants.cs @@ -0,0 +1,10 @@ +namespace Raspberry.IO.GeneralPurpose.Configuration +{ + public class GpioConnectionConfigurationConstants + { + /// + /// The default poll interval, in milliseconds. + /// + public const decimal DefaultPollInterval = 50.0m; + } +} \ No newline at end of file diff --git a/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfigurationSection.cs b/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfigurationSection.cs index 51cf93c..0809039 100644 --- a/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfigurationSection.cs +++ b/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfigurationSection.cs @@ -4,22 +4,14 @@ #endregion +#if NET40 namespace Raspberry.IO.GeneralPurpose.Configuration { /// /// Represents the configuration of the GPIO connection. /// - public class GpioConnectionConfigurationSection : ConfigurationSection + public class GpioConnectionConfigurationSection : ConfigurationSection, IGpioConnectionConfiguration { - #region Constants - - /// - /// The default poll interval, in milliseconds. - /// - public const decimal DefaultPollInterval = 50.0m; - - #endregion - #region Properties /// @@ -31,7 +23,7 @@ public class GpioConnectionConfigurationSection : ConfigurationSection [ConfigurationProperty("driver")] public string DriverTypeName { - get { return (string) this["driver"]; } + get { return (string)this["driver"]; } set { this["driver"] = value; } } @@ -68,3 +60,4 @@ public decimal PollInterval #endregion } } +#endif \ No newline at end of file diff --git a/Raspberry.IO.GeneralPurpose/Configuration/IGpioConnectionConfiguration.cs b/Raspberry.IO.GeneralPurpose/Configuration/IGpioConnectionConfiguration.cs new file mode 100644 index 0000000..e547b7e --- /dev/null +++ b/Raspberry.IO.GeneralPurpose/Configuration/IGpioConnectionConfiguration.cs @@ -0,0 +1,33 @@ +namespace Raspberry.IO.GeneralPurpose.Configuration +{ + public interface IGpioConnectionConfiguration + { + /// + /// Gets or sets the name of the driver type. + /// + /// + /// The name of the driver type. + /// + string DriverTypeName { get; set; } + + /// + /// Gets or sets the board connector revision. + /// + /// + /// The board revision, 0 for automatic detection, 1 for model B rev1; 2 for model B rev2 and model A, 3 for model B+, A+ and higher. + /// + int BoardConnectorRevision { get; set; } + + /// + /// Gets or sets the poll interval, in milliseconds. + /// + /// + /// The poll interval, in millisecond. + /// + /// + /// Default value is 50ms. + /// Values lower than 1ms may be specified on Raspberry Pi using decimal notation. + /// + decimal PollInterval { get; set; } + } +} \ No newline at end of file diff --git a/Raspberry.IO.GeneralPurpose/GpioConnectionSettings.cs b/Raspberry.IO.GeneralPurpose/GpioConnectionSettings.cs index a44bc13..d00fe4c 100644 --- a/Raspberry.IO.GeneralPurpose/GpioConnectionSettings.cs +++ b/Raspberry.IO.GeneralPurpose/GpioConnectionSettings.cs @@ -99,10 +99,10 @@ public static TimeSpan DefaultPollInterval { get { - var configurationSection = ConfigurationManager.GetSection("gpioConnection") as GpioConnectionConfigurationSection; + var configurationSection = ConfigurationManagerShim.GetSection("gpioConnection") as IGpioConnectionConfiguration; return TimeSpan.FromMilliseconds(configurationSection != null ? (double)configurationSection.PollInterval - : (double)GpioConnectionConfigurationSection.DefaultPollInterval); + : (double)GpioConnectionConfigurationConstants.DefaultPollInterval); } } @@ -117,7 +117,7 @@ public static ConnectorPinout ConnectorPinout { get { - var configurationSection = ConfigurationManager.GetSection("gpioConnection") as GpioConnectionConfigurationSection; + var configurationSection = ConfigurationManagerShim.GetSection("gpioConnection") as IGpioConnectionConfiguration; if (configurationSection != null) { switch (configurationSection.BoardConnectorRevision) @@ -142,7 +142,7 @@ public static IGpioConnectionDriver DefaultDriver { get { - var configurationSection = ConfigurationManager.GetSection("gpioConnection") as GpioConnectionConfigurationSection; + var configurationSection = ConfigurationManagerShim.GetSection("gpioConnection") as IGpioConnectionConfiguration; return (configurationSection != null && !String.IsNullOrEmpty(configurationSection.DriverTypeName)) ? (IGpioConnectionDriver) Activator.CreateInstance(Type.GetType(configurationSection.DriverTypeName, true)) : GetBestDriver(Board.Current.IsRaspberryPi ? GpioConnectionDriverCapabilities.None : GpioConnectionDriverCapabilities.CanWorkOnThirdPartyComputers); From 4b8297822794177a44794d6a79eadfaa69268d21 Mon Sep 17 00:00:00 2001 From: Mark Lopez Date: Sun, 3 Sep 2017 23:06:17 -0500 Subject: [PATCH 8/8] Implemented global configuration management for .NetStandard APIs. --- .../Configuration/ConfigurationManagerShim.cs | 2 +- .../Configuration/GlobalConfiguration.cs | 19 +++++++++++++++++++ .../GpioConnectionConfiguration.cs | 17 +++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Raspberry.IO.GeneralPurpose/Configuration/GlobalConfiguration.cs create mode 100644 Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfiguration.cs diff --git a/Raspberry.IO.GeneralPurpose/Configuration/ConfigurationManagerShim.cs b/Raspberry.IO.GeneralPurpose/Configuration/ConfigurationManagerShim.cs index b249a5c..356b26e 100644 --- a/Raspberry.IO.GeneralPurpose/Configuration/ConfigurationManagerShim.cs +++ b/Raspberry.IO.GeneralPurpose/Configuration/ConfigurationManagerShim.cs @@ -13,7 +13,7 @@ public static object GetSection(string sectionName) #if NETSTANDARD2_0 public static object GetSection(string sectionName) { - throw new NotImplementedException(); + return GlobalConfiguration.GetConnectionConfiguration(); } #endif } diff --git a/Raspberry.IO.GeneralPurpose/Configuration/GlobalConfiguration.cs b/Raspberry.IO.GeneralPurpose/Configuration/GlobalConfiguration.cs new file mode 100644 index 0000000..f833bbc --- /dev/null +++ b/Raspberry.IO.GeneralPurpose/Configuration/GlobalConfiguration.cs @@ -0,0 +1,19 @@ +#if NETSTANDARD2_0 +namespace Raspberry.IO.GeneralPurpose.Configuration +{ + public static class GlobalConfiguration + { + private static GpioConnectionConfiguration _gpioConnectionConfiguration; + + public static void SetConnectionConfiguration(GpioConnectionConfiguration configuration) + { + _gpioConnectionConfiguration = configuration; + } + + public static GpioConnectionConfiguration GetConnectionConfiguration() + { + return _gpioConnectionConfiguration; + } + } +} +#endif \ No newline at end of file diff --git a/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfiguration.cs b/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfiguration.cs new file mode 100644 index 0000000..f128bef --- /dev/null +++ b/Raspberry.IO.GeneralPurpose/Configuration/GpioConnectionConfiguration.cs @@ -0,0 +1,17 @@ +#if NETSTANDARD2_0 +namespace Raspberry.IO.GeneralPurpose.Configuration +{ + /// + public class GpioConnectionConfiguration : IGpioConnectionConfiguration + { + /// + public string DriverTypeName { get; set; } + + /// + public int BoardConnectorRevision { get; set; } + + /// + public decimal PollInterval { get; set; } + } +} +#endif \ No newline at end of file pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy