├── experimental ├── IO.Usb.Hid │ ├── Device.fs │ ├── Devices.fs │ ├── DeviceStream.fs │ ├── Native.Kernel32Adapter.fs │ ├── Native.Hid.fs │ ├── Native.Kernel32.fs │ ├── Native.HidAdapter.fs │ ├── AssemblyInfo.fs │ └── IO.Usb.Hid.fsproj ├── packages │ ├── NUnit.2.5.9.10348 │ │ ├── Tools │ │ │ ├── runpnunit.bat │ │ │ ├── agent.conf │ │ │ ├── lib │ │ │ │ ├── fit.dll │ │ │ │ ├── Failure.png │ │ │ │ ├── Ignored.png │ │ │ │ ├── Skipped.png │ │ │ │ ├── Success.png │ │ │ │ ├── log4net.dll │ │ │ │ ├── nunit.core.dll │ │ │ │ ├── nunit.util.dll │ │ │ │ ├── Inconclusive.png │ │ │ │ ├── nunit.uikit.dll │ │ │ │ ├── nunit.fixtures.dll │ │ │ │ ├── nunit-gui-runner.dll │ │ │ │ ├── nunit.uiexception.dll │ │ │ │ ├── nunit-console-runner.dll │ │ │ │ └── nunit.core.interfaces.dll │ │ │ ├── nunit.exe │ │ │ ├── runFile.exe │ │ │ ├── nunit-x86.exe │ │ │ ├── nunit-agent.exe │ │ │ ├── pnunit-agent.exe │ │ │ ├── pnunit.tests.dll │ │ │ ├── nunit-console.exe │ │ │ ├── nunit-agent-x86.exe │ │ │ ├── nunit-console-x86.exe │ │ │ ├── nunit.framework.dll │ │ │ ├── pnunit-launcher.exe │ │ │ ├── pnunit.framework.dll │ │ │ ├── agent.log.conf │ │ │ ├── launcher.log.conf │ │ │ ├── NUnitTests.nunit │ │ │ ├── test.conf │ │ │ ├── runFile.exe.config │ │ │ ├── nunit-console.exe.config │ │ │ ├── nunit-agent.exe.config │ │ │ ├── nunit-console-x86.exe.config │ │ │ ├── nunit-agent-x86.exe.config │ │ │ ├── pnunit-agent.exe.config │ │ │ ├── pnunit-launcher.exe.config │ │ │ ├── nunit-x86.exe.config │ │ │ ├── nunit.exe.config │ │ │ └── NUnitTests.config │ │ ├── Logo.ico │ │ ├── license.txt │ │ ├── lib │ │ │ ├── nunit.mocks.dll │ │ │ ├── nunit.framework.dll │ │ │ └── pnunit.framework.dll │ │ └── NUnit.2.5.9.10348.nupkg │ ├── FsUnit.0.9.1 │ │ ├── FsUnit.0.9.1.nupkg │ │ ├── Lib │ │ │ └── FsUnit.NUnit-0.9.0.dll │ │ └── Content │ │ │ └── FsUnitSample.fs.pp │ └── repositories.config ├── Devices │ ├── MagtekMiniSwipeReader │ │ ├── Artifacts │ │ │ └── UserManual.pdf │ │ ├── Device.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ ├── Honeywell4600Series │ │ ├── Artifacts │ │ │ ├── USBInterfaceApplicationNote.pdf │ │ │ └── USBProgrammingInstructions.pdf │ │ ├── Device.cs │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ └── PhidgetInterfaceKit │ │ ├── Device.cs │ │ └── Properties │ │ └── AssemblyInfo.cs └── Tests │ ├── packages.config │ ├── Native.fs │ └── Tests.fsproj ├── .gitignore ├── etc └── HID1_11.pdf ├── misc └── hidlibrary.png ├── src ├── packages │ ├── NUnit.2.5.10.11092 │ │ ├── tools │ │ │ ├── runpnunit.bat │ │ │ ├── agent.conf │ │ │ ├── nunit.exe │ │ │ ├── lib │ │ │ │ ├── fit.dll │ │ │ │ ├── Failure.png │ │ │ │ ├── Ignored.png │ │ │ │ ├── Skipped.png │ │ │ │ ├── Success.png │ │ │ │ ├── log4net.dll │ │ │ │ ├── nunit.core.dll │ │ │ │ ├── nunit.uikit.dll │ │ │ │ ├── nunit.util.dll │ │ │ │ ├── Inconclusive.png │ │ │ │ ├── nunit-gui-runner.dll │ │ │ │ ├── nunit.fixtures.dll │ │ │ │ ├── nunit.uiexception.dll │ │ │ │ ├── nunit-console-runner.dll │ │ │ │ └── nunit.core.interfaces.dll │ │ │ ├── runFile.exe │ │ │ ├── nunit-x86.exe │ │ │ ├── nunit-agent.exe │ │ │ ├── pnunit-agent.exe │ │ │ ├── pnunit.tests.dll │ │ │ ├── nunit-agent-x86.exe │ │ │ ├── nunit-console.exe │ │ │ ├── nunit.framework.dll │ │ │ ├── pnunit-launcher.exe │ │ │ ├── nunit-console-x86.exe │ │ │ ├── pnunit.framework.dll │ │ │ ├── agent.log.conf │ │ │ ├── launcher.log.conf │ │ │ ├── NUnitTests.nunit │ │ │ ├── test.conf │ │ │ ├── runFile.exe.config │ │ │ ├── nunit-console.exe.config │ │ │ ├── nunit-agent.exe.config │ │ │ ├── nunit-console-x86.exe.config │ │ │ ├── nunit-agent-x86.exe.config │ │ │ ├── pnunit-agent.exe.config │ │ │ ├── pnunit-launcher.exe.config │ │ │ ├── nunit.exe.config │ │ │ ├── nunit-x86.exe.config │ │ │ └── NUnitTests.config │ │ ├── Logo.ico │ │ ├── license.txt │ │ ├── lib │ │ │ ├── nunit.mocks.dll │ │ │ ├── nunit.framework.dll │ │ │ └── pnunit.framework.dll │ │ └── NUnit.2.5.10.11092.nupkg │ ├── Should.1.1.12.0 │ │ ├── lib │ │ │ └── Should.dll │ │ └── Should.1.1.12.0.nupkg │ ├── repositories.config │ └── NSubstitute.1.3.0.0 │ │ ├── NSubstitute.1.3.0.0.nupkg │ │ ├── lib │ │ ├── NET35 │ │ │ └── NSubstitute.dll │ │ └── NET40 │ │ │ └── NSubstitute.dll │ │ ├── LICENSE.txt │ │ └── BreakingChanges.txt ├── TestHarness │ ├── app.config │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ └── Resources.Designer.cs │ ├── Program.cs │ └── TestHarness.csproj ├── Tests │ ├── packages.config │ ├── Hid.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Tests.csproj ├── HidLibrary │ ├── HidAsyncState.cs │ ├── HidDeviceData.cs │ ├── HidDeviceAttributes.cs │ ├── HidDeviceEventMonitor.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── HidReport.cs │ ├── HidDeviceCapabilities.cs │ └── HidLibrary.csproj └── HidLibrary.sln ├── examples ├── MagtekCardReader │ ├── app.config │ ├── MagtekCardReader.sln │ ├── Data.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Program.cs │ └── MagtekCardReader.csproj ├── Honeywell4000Series │ ├── app.config │ ├── Honeywell4000Series.sln │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Report.cs │ └── Honeywell4000Series.csproj ├── GriffinPowerMate │ ├── GriffinPowerMateWindowsForms │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ ├── AssemblyInfo.cs │ │ │ └── Resources.Designer.cs │ │ └── Program.cs │ ├── PowerMate │ │ ├── PowerMateEventArgs.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── PowerMate.csproj │ ├── GriffinPowerMateConsole │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── GriffinPowerMateConsole.csproj │ │ └── Program.cs │ └── GriffinPowerMate.sln └── LogitechGamepad │ ├── MessageFactory.cs │ ├── IMessage.cs │ ├── LogitechGamepad.sln │ ├── Properties │ └── AssemblyInfo.cs │ ├── LogitechGamepad.csproj │ ├── Program.cs │ ├── DualActionMessage.cs │ └── PrecisionMessage.cs ├── LICENSE └── README.md /experimental/IO.Usb.Hid/Device.fs: -------------------------------------------------------------------------------- 1 | module Device -------------------------------------------------------------------------------- /experimental/IO.Usb.Hid/Devices.fs: -------------------------------------------------------------------------------- 1 | module Devices -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | obj 2 | bin 3 | pkg 4 | .nu 5 | _ReSharper.* 6 | *.user 7 | *.suo 8 | *.log -------------------------------------------------------------------------------- /etc/HID1_11.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/etc/HID1_11.pdf -------------------------------------------------------------------------------- /misc/hidlibrary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/misc/hidlibrary.png -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/runpnunit.bat: -------------------------------------------------------------------------------- 1 | start pnunit-agent agent.conf 2 | pnunit-launcher test.conf -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/runpnunit.bat: -------------------------------------------------------------------------------- 1 | start pnunit-agent agent.conf 2 | pnunit-launcher test.conf -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/Logo.ico -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/license.txt -------------------------------------------------------------------------------- /src/packages/Should.1.1.12.0/lib/Should.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/Should.1.1.12.0/lib/Should.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/agent.conf: -------------------------------------------------------------------------------- 1 | 2 | 8080 3 | . 4 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/nunit.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Logo.ico -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/agent.conf: -------------------------------------------------------------------------------- 1 | 2 | 8080 3 | . 4 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/fit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/fit.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/runFile.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/runFile.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/license.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/license.txt -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/lib/nunit.mocks.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe -------------------------------------------------------------------------------- /src/packages/Should.1.1.12.0/Should.1.1.12.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/Should.1.1.12.0/Should.1.1.12.0.nupkg -------------------------------------------------------------------------------- /experimental/packages/FsUnit.0.9.1/FsUnit.0.9.1.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/FsUnit.0.9.1/FsUnit.0.9.1.nupkg -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/Failure.png -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/Ignored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/Ignored.png -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/Skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/Skipped.png -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/Success.png -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/log4net.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/pnunit.tests.dll -------------------------------------------------------------------------------- /src/packages/repositories.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/fit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/fit.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/nunit.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/runFile.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/runFile.exe -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/NUnit.2.5.10.11092.nupkg -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/lib/nunit.framework.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/lib/pnunit.framework.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/nunit.uikit.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/nunit.util.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/nunit-console.exe -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/nunit.framework.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/nunit-x86.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/lib/nunit.mocks.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/lib/nunit.mocks.dll -------------------------------------------------------------------------------- /experimental/packages/repositories.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/packages/NSubstitute.1.3.0.0/NSubstitute.1.3.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NSubstitute.1.3.0.0/NSubstitute.1.3.0.0.nupkg -------------------------------------------------------------------------------- /src/packages/NSubstitute.1.3.0.0/lib/NET35/NSubstitute.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NSubstitute.1.3.0.0/lib/NET35/NSubstitute.dll -------------------------------------------------------------------------------- /src/packages/NSubstitute.1.3.0.0/lib/NET40/NSubstitute.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NSubstitute.1.3.0.0/lib/NET40/NSubstitute.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/Inconclusive.png -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/pnunit.framework.dll -------------------------------------------------------------------------------- /experimental/packages/FsUnit.0.9.1/Lib/FsUnit.NUnit-0.9.0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/FsUnit.0.9.1/Lib/FsUnit.NUnit-0.9.0.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/Failure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/Failure.png -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/Ignored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/Ignored.png -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/Skipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/Skipped.png -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/Success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/Success.png -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/log4net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/log4net.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/nunit-agent.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/pnunit-agent.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/pnunit-agent.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/pnunit.tests.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/pnunit.tests.dll -------------------------------------------------------------------------------- /src/TestHarness/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/nunit-gui-runner.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/nunit.fixtures.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/NUnit.2.5.9.10348.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/NUnit.2.5.9.10348.nupkg -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.core.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.util.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.util.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-console.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/nunit-console.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/lib/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/lib/nunit.framework.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/lib/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/lib/pnunit.framework.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/nunit.uiexception.dll -------------------------------------------------------------------------------- /examples/MagtekCardReader/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /experimental/Devices/MagtekMiniSwipeReader/Artifacts/UserManual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/Devices/MagtekMiniSwipeReader/Artifacts/UserManual.pdf -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/Inconclusive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/Inconclusive.png -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.uikit.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.uikit.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-agent-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/nunit-agent-x86.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-console-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/nunit-console-x86.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/nunit.framework.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/pnunit-launcher.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/pnunit-launcher.exe -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/pnunit.framework.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/pnunit.framework.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/nunit-console-runner.dll -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/src/packages/NUnit.2.5.10.11092/tools/lib/nunit.core.interfaces.dll -------------------------------------------------------------------------------- /examples/Honeywell4000Series/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.fixtures.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.fixtures.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit-gui-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit-gui-runner.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.uiexception.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.uiexception.dll -------------------------------------------------------------------------------- /experimental/Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit-console-runner.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit-console-runner.dll -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.core.interfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/packages/NUnit.2.5.9.10348/Tools/lib/nunit.core.interfaces.dll -------------------------------------------------------------------------------- /experimental/Devices/Honeywell4600Series/Artifacts/USBInterfaceApplicationNote.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/Devices/Honeywell4600Series/Artifacts/USBInterfaceApplicationNote.pdf -------------------------------------------------------------------------------- /experimental/Devices/Honeywell4600Series/Artifacts/USBProgrammingInstructions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shanselman/HidLibrary/master/experimental/Devices/Honeywell4600Series/Artifacts/USBProgrammingInstructions.pdf -------------------------------------------------------------------------------- /src/Tests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /experimental/Devices/Honeywell4600Series/Device.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Honeywell4600Series 7 | { 8 | public class Device 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /experimental/Devices/MagtekMiniSwipeReader/Device.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace MagtekMiniSwipeReader 7 | { 8 | public class Device 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /experimental/Devices/PhidgetInterfaceKit/Device.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace PhidgetInterfaceKit 7 | { 8 | public class Device 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/TestHarness/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Tests/Hid.cs: -------------------------------------------------------------------------------- 1 | using NUnit.Framework; 2 | using Should; 3 | 4 | namespace Tests 5 | { 6 | [TestFixture] 7 | public class Hid 8 | { 9 | [Test] 10 | public void Get_Some_Tests_In_Here() 11 | { 12 | true.ShouldBeTrue(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/GriffinPowerMateWindowsForms/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /experimental/IO.Usb.Hid/DeviceStream.fs: -------------------------------------------------------------------------------- 1 | namespace IO.Usb.Hid 2 | 3 | open System 4 | open System.IO 5 | open IO.Usb.Hid.Native 6 | 7 | type public DeviceStream(path, access:FileAccess, share:FileShare, mode:FileMode, isAsync:bool) = 8 | inherit System.IO.FileStream(Kernel32Adapter.OpenFile path access share mode isAsync, 9 | access, 10 | 0x1000, 11 | isAsync) -------------------------------------------------------------------------------- /src/TestHarness/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace TestHarness 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Main()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/agent.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/launcher.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/HidLibrary/HidAsyncState.cs: -------------------------------------------------------------------------------- 1 | namespace HidLibrary 2 | { 3 | public class HidAsyncState 4 | { 5 | private readonly object _callerDelegate; 6 | private readonly object _callbackDelegate; 7 | 8 | public HidAsyncState(object callerDelegate, object callbackDelegate) 9 | { 10 | _callerDelegate = callerDelegate; 11 | _callbackDelegate = callbackDelegate; 12 | } 13 | 14 | public object CallerDelegate { get { return _callerDelegate; } } 15 | public object CallbackDelegate { get { return _callbackDelegate; } } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/agent.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/launcher.log.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/LogitechGamepad/MessageFactory.cs: -------------------------------------------------------------------------------- 1 | namespace LogitechGamepad 2 | { 3 | internal class MessageFactory 4 | { 5 | internal const int PrecisionId = 0xC21A; 6 | internal const int DualActionId = 0xC216; 7 | 8 | public static IMessage CreateMessage(int productId, byte[] messageData) 9 | { 10 | switch (productId) 11 | { 12 | case PrecisionId: return new PrecisionMessage(messageData); 13 | case DualActionId: return new DualActionMessage(messageData); 14 | } 15 | return null; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /experimental/IO.Usb.Hid/Native.Kernel32Adapter.fs: -------------------------------------------------------------------------------- 1 | module IO.Usb.Hid.Native.Kernel32Adapter 2 | 3 | open System 4 | open System.IO 5 | open IO.Usb.Hid.Native 6 | open System.Runtime.InteropServices 7 | 8 | let OpenFile path (access:FileAccess) (share:FileShare) (mode:FileMode) isAsync = 9 | Kernel32.CreateFileW(path, 10 | access, 11 | share, 12 | IntPtr.Zero, 13 | mode, 14 | (if isAsync then FileOptions.Asynchronous else FileOptions.None), 15 | IntPtr.Zero) -------------------------------------------------------------------------------- /examples/GriffinPowerMate/GriffinPowerMateWindowsForms/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace GriffinPowerMateWindowsForms 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new PowerMateViewer()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/NUnitTests.nunit: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/NUnitTests.nunit: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/LogitechGamepad/IMessage.cs: -------------------------------------------------------------------------------- 1 | namespace LogitechGamepad 2 | { 3 | interface IMessage 4 | { 5 | byte TotalPressed { get; } 6 | bool MultiplePressed { get; } 7 | bool Depress { get; } 8 | bool UpPressed { get; } 9 | bool DownPressed { get; } 10 | bool LeftPressed { get; } 11 | bool RightPressed { get; } 12 | bool Button1Pressed { get; } 13 | bool Button2Pressed { get; } 14 | bool Button3Pressed { get; } 15 | bool Button4Pressed { get; } 16 | bool Button5Pressed { get; } 17 | bool Button6Pressed { get; } 18 | bool Button7Pressed { get; } 19 | bool Button8Pressed { get; } 20 | bool Button9Pressed { get; } 21 | bool Button10Pressed { get; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/HidLibrary/HidDeviceData.cs: -------------------------------------------------------------------------------- 1 | namespace HidLibrary 2 | { 3 | public class HidDeviceData 4 | { 5 | public enum ReadStatus 6 | { 7 | Success = 0, 8 | WaitTimedOut = 1, 9 | WaitFail = 2, 10 | NoDataRead = 3, 11 | ReadError = 4, 12 | NotConnected = 5 13 | } 14 | 15 | public HidDeviceData(ReadStatus status) 16 | { 17 | Data = new byte[] {}; 18 | Status = status; 19 | } 20 | 21 | public HidDeviceData(byte[] data, ReadStatus status) 22 | { 23 | Data = data; 24 | Status = status; 25 | } 26 | 27 | public byte[] Data { get; private set; } 28 | public ReadStatus Status { get; private set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/HidLibrary/HidDeviceAttributes.cs: -------------------------------------------------------------------------------- 1 | namespace HidLibrary 2 | { 3 | public class HidDeviceAttributes 4 | { 5 | internal HidDeviceAttributes(NativeMethods.HIDD_ATTRIBUTES attributes) 6 | { 7 | VendorId = attributes.VendorID; 8 | ProductId = attributes.ProductID; 9 | Version = attributes.VersionNumber; 10 | 11 | VendorHexId = "0x" + attributes.VendorID.ToString("X4"); 12 | ProductHexId = "0x" + attributes.ProductID.ToString("X4"); 13 | } 14 | 15 | public int VendorId { get; private set; } 16 | public int ProductId { get; private set; } 17 | public int Version { get; private set; } 18 | public string VendorHexId { get; set; } 19 | public string ProductHexId { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/test.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Testing 6 | 7 | 8 | Testing 9 | pnunit.tests.dll 10 | TestLibraries.Testing.EqualTo19 11 | localhost:8080 12 | 13 | ..\server 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/PowerMate/PowerMateEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | // This example was written by Thomas Hammer (www.thammer.net). 7 | 8 | namespace GriffinPowerMate 9 | { 10 | /// 11 | /// Provides data for PowerMate events. 12 | /// 13 | public class PowerMateEventArgs : EventArgs 14 | { 15 | /// 16 | /// Initializes a new instance of the PowerMateEventArgs class. 17 | /// 18 | /// 19 | public PowerMateEventArgs(PowerMateState state) 20 | { 21 | State = state; 22 | } 23 | 24 | /// 25 | /// Gets the current PowerMate state. 26 | /// 27 | public PowerMateState State { get; private set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /experimental/IO.Usb.Hid/Native.Hid.fs: -------------------------------------------------------------------------------- 1 | module internal IO.Usb.Hid.Native.Hid 2 | 3 | open System 4 | open Microsoft.Win32.SafeHandles 5 | open System.Runtime.InteropServices 6 | 7 | [] 8 | type HIDD_ATTRIBUTES = 9 | val mutable Size:int 10 | val mutable VendorID:uint16 11 | val mutable ProductID:uint16 12 | val mutable VersionNumber:uint16 13 | member x.Init () = 14 | x.Size <- sizeof 15 | x.VendorID <- 0us 16 | x.ProductID <- 0us 17 | x.VersionNumber <- 0us 18 | 19 | [] 20 | extern void public HidD_GetHidGuid(Guid& hidGuid) 21 | 22 | [] 23 | extern bool HidD_GetAttributes(SafeFileHandle HidDeviceObject, HIDD_ATTRIBUTES& attributes) 24 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/test.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Testing 6 | 7 | 8 | Testing 9 | pnunit.tests.dll 10 | TestLibraries.Testing.EqualTo19 11 | localhost:8080 12 | 13 | ..\server 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/LogitechGamepad/LogitechGamepad.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LogitechGamepad", "LogitechGamepad.csproj", "{66703F1B-6B3D-48FD-BA2D-05A78CA161E0}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {66703F1B-6B3D-48FD-BA2D-05A78CA161E0}.Debug|x86.ActiveCfg = Debug|x86 13 | {66703F1B-6B3D-48FD-BA2D-05A78CA161E0}.Debug|x86.Build.0 = Debug|x86 14 | {66703F1B-6B3D-48FD-BA2D-05A78CA161E0}.Release|x86.ActiveCfg = Release|x86 15 | {66703F1B-6B3D-48FD-BA2D-05A78CA161E0}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /examples/MagtekCardReader/MagtekCardReader.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagtekCardReader", "MagtekCardReader.csproj", "{D1D7BF2B-9681-4419-8B57-825F6B26856B}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {D1D7BF2B-9681-4419-8B57-825F6B26856B}.Debug|x86.ActiveCfg = Debug|x86 13 | {D1D7BF2B-9681-4419-8B57-825F6B26856B}.Debug|x86.Build.0 = Debug|x86 14 | {D1D7BF2B-9681-4419-8B57-825F6B26856B}.Release|x86.ActiveCfg = Release|x86 15 | {D1D7BF2B-9681-4419-8B57-825F6B26856B}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /examples/Honeywell4000Series/Honeywell4000Series.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Honeywell4000Series", "Honeywell4000Series.csproj", "{BA85B480-6793-49F7-9A4D-6EAC8D133B8F}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {BA85B480-6793-49F7-9A4D-6EAC8D133B8F}.Debug|x86.ActiveCfg = Debug|x86 13 | {BA85B480-6793-49F7-9A4D-6EAC8D133B8F}.Debug|x86.Build.0 = Debug|x86 14 | {BA85B480-6793-49F7-9A4D-6EAC8D133B8F}.Release|x86.ActiveCfg = Release|x86 15 | {BA85B480-6793-49F7-9A4D-6EAC8D133B8F}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /experimental/IO.Usb.Hid/Native.Kernel32.fs: -------------------------------------------------------------------------------- 1 | module internal IO.Usb.Hid.Native.Kernel32 2 | 3 | open System 4 | open System.IO 5 | open Microsoft.Win32.SafeHandles 6 | open System.Runtime.InteropServices 7 | 8 | [] 9 | extern SafeFileHandle CreateFileW([] 10 | [] 11 | string lpFileName, 12 | FileAccess dwDesiredAccess, 13 | FileShare dwShareMode, 14 | [] 15 | System.IntPtr lpSecurityAttributes, 16 | FileMode dwCreationDisposition, 17 | FileOptions dwFlagsAndAttributes, 18 | [] 19 | IntPtr hTemplateFile) -------------------------------------------------------------------------------- /experimental/IO.Usb.Hid/Native.HidAdapter.fs: -------------------------------------------------------------------------------- 1 | module IO.Usb.Hid.Native.HidAdapter 2 | 3 | open System 4 | open IO.Usb.Hid.Native 5 | open IO.Usb.Hid.Native.Hid 6 | open System.Runtime.InteropServices 7 | open System.ComponentModel 8 | 9 | type DeviceAttributes (venderId:int, productId:int, version:int) = 10 | member p.VenderId = venderId 11 | member p.ProductId = productId 12 | member p.Version = version 13 | 14 | let HidClass = 15 | let mutable hidClass = Guid.Empty 16 | Hid.HidD_GetHidGuid(&hidClass) 17 | hidClass 18 | 19 | let GetDeviceAttributes handle = 20 | let mutable attributes = new Hid.HIDD_ATTRIBUTES() 21 | attributes.Init() 22 | let success = Hid.HidD_GetAttributes(handle, &attributes) 23 | if success then new DeviceAttributes((int)attributes.VendorID, (int)attributes.ProductID, (int)attributes.VersionNumber) 24 | else 25 | let error = Marshal.GetLastWin32Error() 26 | raise (Win32Exception(Marshal.GetLastWin32Error())) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Ultraviolet Catastrophe 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 14 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 15 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 16 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 17 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 18 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Hid Library 2 | ============= 3 | 4 | This library enables you to enumerate and communicate with Hid compatible USB devices in .NET. It offers synchronous and asynchronous read and write functionality as well as notification of insertion and removal of a device. This library works on x86 and x64. 5 | 6 | Installation 7 | ------------ 8 | 9 | PM> Install-Package hidlibrary 10 | 11 | Props 12 | ------------ 13 | 14 | Thanks to JetBrains for providing OSS licenses for [R#](http://www.jetbrains.com/resharper/features/code_refactoring.html) and [dotTrace](http://www.jetbrains.com/profiler/)! 15 | 16 | Resources 17 | ------------ 18 | 19 | If your interested in HID development here are a few invaluable resources: 20 | 21 | 1. [Jan Axelson's USB Hid Programming Page](http://www.lvr.com/hidpage.htm) - Excellent resource for USB Hid development. Full code samples in a number of different languages demonstrate how to use the Windows setup and Hid API. 22 | 2. [Jan Axelson's book 'USB Complete'](http://www.lvr.com/usbc.htm) - Jan Axelson's guide to USB programming. Very good covereage of Hid. Must read for anyone new to Hid programming. -------------------------------------------------------------------------------- /src/TestHarness/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TestHarness.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /experimental/packages/FsUnit.0.9.1/Content/FsUnitSample.fs.pp: -------------------------------------------------------------------------------- 1 | namespace $rootnamespace$.Tests 2 | 3 | open NUnit.Framework 4 | open FsUnit 5 | 6 | type LightBulb(state) = 7 | member x.On = state 8 | override x.ToString() = 9 | match x.On with 10 | | true -> "On" 11 | | false -> "Off" 12 | 13 | [] 14 | type ``Given a LightBulb that has had its state set to true`` ()= 15 | let lightBulb = new LightBulb(true) 16 | 17 | [] member test. 18 | ``when I ask whether it is On it answers true.`` ()= 19 | lightBulb.On |> should be True 20 | 21 | [] member test. 22 | ``when I convert it to a string it becomes "On".`` ()= 23 | string lightBulb |> should equal "On" 24 | 25 | [] 26 | type ``Given a LightBulb that has had its state set to false`` ()= 27 | let lightBulb = new LightBulb(false) 28 | 29 | [] member test. 30 | ``when I ask whether it is On it answers false.`` ()= 31 | lightBulb.On |> should be False 32 | 33 | [] member test. 34 | ``when I convert it to a string it becomes "Off".`` ()= 35 | string lightBulb |> should equal "Off" -------------------------------------------------------------------------------- /examples/GriffinPowerMate/GriffinPowerMateWindowsForms/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace GriffinPowerMateWindowsForms.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/MagtekCardReader/Data.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MagtekCardReader 4 | { 5 | public class Data 6 | { 7 | private string _errorMessage = string.Empty; 8 | private readonly byte[] _data; 9 | 10 | public Data(byte[] data) 11 | { 12 | _data = GetCardData(data); 13 | } 14 | 15 | public string ErrorMessage { get { return _errorMessage; } } 16 | public bool Error { get; private set; } 17 | public byte[] CardData { get { return _data; } } 18 | 19 | private byte[] GetCardData(byte[] data) 20 | { 21 | if (data != null && data.Length == 337) 22 | { 23 | if (data[0] == 1 || data[1] == 1 || data[2] == 1) 24 | { 25 | Error = true; 26 | _errorMessage = "Error reading data"; 27 | return null; 28 | } 29 | var cardData = new byte[data[3] + data[4] + data[5]]; 30 | Array.Copy(data, 7, cardData, 0, data[3]); 31 | Array.Copy(data, 117, cardData, data[3], data[4]); 32 | Array.Copy(data, 227, cardData, data[3] + data[4], data[5]); 33 | return cardData; 34 | } 35 | Error = true; 36 | _errorMessage = "Data length is invalid"; 37 | return null; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/HidLibrary/HidDeviceEventMonitor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | 4 | namespace HidLibrary 5 | { 6 | internal class HidDeviceEventMonitor 7 | { 8 | public event InsertedEventHandler Inserted; 9 | public event RemovedEventHandler Removed; 10 | 11 | public delegate void InsertedEventHandler(); 12 | public delegate void RemovedEventHandler(); 13 | 14 | private readonly HidDevice _device; 15 | private bool _wasConnected; 16 | 17 | public HidDeviceEventMonitor(HidDevice device) 18 | { 19 | _device = device; 20 | } 21 | 22 | public void Init() 23 | { 24 | var eventMonitor = new Action(DeviceEventMonitor); 25 | eventMonitor.BeginInvoke(DisposeDeviceEventMonitor, eventMonitor); 26 | } 27 | 28 | private void DeviceEventMonitor() 29 | { 30 | var isConnected = _device.IsConnected; 31 | 32 | if (isConnected != _wasConnected) 33 | { 34 | if (isConnected && Inserted != null) Inserted(); 35 | else if (!isConnected && Removed != null) Removed(); 36 | _wasConnected = isConnected; 37 | } 38 | 39 | Thread.Sleep(500); 40 | 41 | if (_device.MonitorDeviceEvents) Init(); 42 | } 43 | 44 | private static void DisposeDeviceEventMonitor(IAsyncResult ar) 45 | { 46 | ((Action)ar.AsyncState).EndInvoke(ar); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Tests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Tests")] 13 | [assembly: AssemblyCopyright("Copyright © 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("06c2304e-c52e-4ed8-88a3-5ee1cd3c51f0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/PowerMate/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PowerMate")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PowerMate")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("83d3f5e1-4ff3-4945-8133-46e7d793ecff")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/TestHarness/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TestHarness")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("TestHarness")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ebbdf7b3-31d9-41ad-b510-737c89302358")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/Honeywell4000Series/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text; 4 | 5 | namespace Honeywell4000Series 6 | { 7 | class Program 8 | { 9 | private static readonly int[] SupportedDevices = new [] { 0x207, 0x1C7 }; 10 | private static Scanner _scanner; 11 | 12 | static void Main() 13 | { 14 | _scanner = Scanner.Enumerate(SupportedDevices).FirstOrDefault(); 15 | 16 | if (_scanner != null) 17 | { 18 | _scanner.Inserted += ScannerInserted; 19 | _scanner.DataRecieved += ScannerDataRecieved; 20 | _scanner.Removed += ScannerRemoved; 21 | _scanner.StartListen(); 22 | 23 | Console.WriteLine("Connected, press any key to quit."); 24 | Console.ReadKey(); 25 | 26 | _scanner.StopListen(); 27 | _scanner.Dispose(); 28 | } 29 | else 30 | { 31 | Console.WriteLine("No scanner found."); 32 | Console.ReadKey(); 33 | } 34 | } 35 | 36 | private static void ScannerDataRecieved(byte[] data) 37 | { 38 | Console.WriteLine(Encoding.ASCII.GetString(data)); 39 | } 40 | 41 | private static void ScannerInserted() 42 | { 43 | Console.WriteLine("Scanner attached."); 44 | } 45 | 46 | private static void ScannerRemoved() 47 | { 48 | Console.WriteLine("Scanner detached."); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /examples/LogitechGamepad/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("LogitechGamepad")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("LogitechGamepad")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8d4b1d65-6f13-4212-9fc0-e94e0ae47d52")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/MagtekCardReader/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MagtekCardReader")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("MagtekCardReader")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("acbc750e-a8bc-4971-a993-18939b0c8c70")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/GriffinPowerMateConsole/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("GriffinPowerMate")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("GriffinPowerMate")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4fc932de-3ee7-4d51-9e2a-1e7d521c1bc0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/Honeywell4000Series/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Honeywell4000Series")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Honeywell4000Series")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b643a922-44b5-46c3-943b-afcd96296260")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /experimental/Devices/Honeywell4600Series/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Honeywell4600Series")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Honeywell4600Series")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3e087929-8230-4560-8801-9cee322f4141")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /experimental/Devices/PhidgetInterfaceKit/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PhidgetInterfaceKit")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("PhidgetInterfaceKit")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8b7ba1aa-9346-47fd-90b9-80d74df13e6a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /experimental/Devices/MagtekMiniSwipeReader/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MagtekMiniSwipeReader")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("MagtekMiniSwipeReader")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("94abdfc9-83bd-40e5-8f2d-b58ee5c3e7a6")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/GriffinPowerMateWindowsForms/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("GriffinPowerMateWindowsForms")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("GriffinPowerMateWindowsForms")] 13 | [assembly: AssemblyCopyright("Copyright © 2012")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("eba188fc-6cc0-41c9-b0ed-8c448f8fe23c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/HidLibrary/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Hid Library")] 9 | [assembly: AssemblyDescription("Hid Device Communication Library")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Ultraviolet Catastrophe")] 12 | [assembly: AssemblyProduct("HidLibrary")] 13 | [assembly: AssemblyCopyright("Copyright © 2011 Ultraviolet Catastrophe")] 14 | [assembly: AssemblyTrademark("HidLibrary")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d51e590e-e0ce-485f-8e64-d12abfbff2d6")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("3.0.0.0")] 36 | [assembly: AssemblyFileVersion("3.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/packages/NSubstitute.1.3.0.0/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 Anthony Egerton (nsubstitute@delfish.com) and David Tchepak (dave@davesquared.net) 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the names of the copyright holders nor the names of 13 | contributors may be used to endorse or promote products derived from this 14 | software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | [ http://www.opensource.org/licenses/bsd-license.php ] -------------------------------------------------------------------------------- /experimental/IO.Usb.Hid/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | module AssemblyInfo 2 | 3 | open System.Reflection 4 | open System.Runtime.CompilerServices 5 | open System.Runtime.InteropServices 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [] 11 | [] 12 | [] 13 | [] 14 | [] 15 | [] 16 | [] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Build and Revision Numbers 34 | // by using the '*' as shown below: 35 | // [assembly: AssemblyVersion("1.0.*")] 36 | [] 37 | [] 38 | 39 | do 40 | ignore() -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/runFile.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /examples/MagtekCardReader/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text; 4 | using HidLibrary; 5 | 6 | namespace MagtekCardReader 7 | { 8 | class Program 9 | { 10 | private const int VendorId = 0x0801; 11 | private const int ProductId = 0x0002; 12 | 13 | private static HidDevice _device; 14 | 15 | static void Main() 16 | { 17 | _device = HidDevices.Enumerate(VendorId, ProductId).FirstOrDefault(); 18 | 19 | if (_device != null) 20 | { 21 | _device.OpenDevice(); 22 | 23 | _device.Inserted += DeviceAttachedHandler; 24 | _device.Removed += DeviceRemovedHandler; 25 | 26 | _device.MonitorDeviceEvents = true; 27 | 28 | _device.ReadReport(OnReport); 29 | 30 | Console.WriteLine("Reader found, press any key to exit."); 31 | Console.ReadKey(); 32 | 33 | _device.CloseDevice(); 34 | } 35 | else 36 | { 37 | Console.WriteLine("Could not find reader."); 38 | Console.ReadKey(); 39 | } 40 | } 41 | 42 | private static void OnReport(HidReport report) 43 | { 44 | if (!_device.IsConnected) { return; } 45 | 46 | var cardData = new Data(report.Data); 47 | 48 | Console.WriteLine(!cardData.Error ? Encoding.ASCII.GetString(cardData.CardData) : cardData.ErrorMessage); 49 | 50 | _device.ReadReport(OnReport); 51 | } 52 | 53 | private static void DeviceAttachedHandler() 54 | { 55 | Console.WriteLine("Device attached."); 56 | _device.ReadReport(OnReport); 57 | } 58 | 59 | private static void DeviceRemovedHandler() 60 | { 61 | Console.WriteLine("Device removed."); 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /examples/Honeywell4000Series/Report.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HidLibrary; 3 | 4 | namespace Honeywell4000Series 5 | { 6 | public class Report 7 | { 8 | private readonly byte[] _data; 9 | private readonly HidDeviceData.ReadStatus _status; 10 | 11 | public Report(HidReport hidReport) 12 | { 13 | _status = hidReport.ReadStatus; 14 | ReportId = hidReport.ReportId; 15 | Exists = hidReport.Exists; 16 | 17 | if (hidReport.Data.Length > 0) Length = hidReport.Data[0]; 18 | if (hidReport.Data.Length > 1) AimSymbologyId0 = hidReport.Data[1]; 19 | if (hidReport.Data.Length > 2) AimSymbologyId1 = hidReport.Data[2]; 20 | if (hidReport.Data.Length > 3) AimSymbologyId2 = hidReport.Data[3]; 21 | 22 | if (hidReport.Data.Length > Length + 3) 23 | { 24 | Array.Resize(ref _data, Length); 25 | Array.Copy(hidReport.Data, 4, _data, 0, Length); 26 | } 27 | 28 | if (hidReport.Data.Length > 60) HhpSymbologyId = hidReport.Data[60]; 29 | if (hidReport.Data.Length > 61) Reserved = hidReport.Data[61]; 30 | if (hidReport.Data.Length > 62) MoreData = hidReport.Data[62] == 1; 31 | } 32 | 33 | public HidDeviceData.ReadStatus ReadStatus { get { return _status; } } 34 | public byte[] Data { get { return _data; } } 35 | public bool Exists { get; private set; } 36 | public byte ReportId { get; private set; } 37 | public byte Length { get; private set; } 38 | public byte AimSymbologyId0 { get; private set; } 39 | public byte AimSymbologyId1 { get; private set; } 40 | public byte AimSymbologyId2 { get; private set; } 41 | public byte HhpSymbologyId { get; private set; } 42 | public byte Reserved { get; private set; } 43 | public bool MoreData { get; private set; } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/runFile.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/HidLibrary/HidReport.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HidLibrary 4 | { 5 | public class HidReport 6 | { 7 | private byte _reportId; 8 | private byte[] _data = new byte[] {}; 9 | 10 | private readonly HidDeviceData.ReadStatus _status; 11 | 12 | public HidReport(int reportSize) 13 | { 14 | Array.Resize(ref _data, reportSize); 15 | } 16 | 17 | public HidReport(int reportSize, HidDeviceData deviceData) 18 | { 19 | _status = deviceData.Status; 20 | 21 | Array.Resize(ref _data, reportSize - 1); 22 | 23 | if ((deviceData.Data != null)) 24 | { 25 | 26 | if (deviceData.Data.Length > 0) 27 | { 28 | _reportId = deviceData.Data[0]; 29 | Exists = true; 30 | 31 | if (deviceData.Data.Length > 1) 32 | { 33 | var dataLength = reportSize - 1; 34 | if (deviceData.Data.Length < reportSize - 1) dataLength = deviceData.Data.Length; 35 | Array.Copy(deviceData.Data, 1, _data, 0, dataLength); 36 | } 37 | } 38 | else Exists = false; 39 | } 40 | else Exists = false; 41 | } 42 | 43 | public bool Exists { get; private set; } 44 | public HidDeviceData.ReadStatus ReadStatus { get { return _status; } } 45 | 46 | public byte ReportId 47 | { 48 | get { return _reportId; } 49 | set 50 | { 51 | _reportId = value; 52 | Exists = true; 53 | } 54 | } 55 | 56 | public byte[] Data 57 | { 58 | get { return _data; } 59 | set 60 | { 61 | _data = value; 62 | Exists = true; 63 | } 64 | } 65 | 66 | public byte[] GetBytes() 67 | { 68 | byte[] data = null; 69 | Array.Resize(ref data, _data.Length + 1); 70 | data[0] = _reportId; 71 | Array.Copy(_data, 0, data, 1, _data.Length); 72 | return data; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /experimental/Tests/Native.fs: -------------------------------------------------------------------------------- 1 | namespace Tests 2 | 3 | open System 4 | open System.IO 5 | open IO.Usb.Hid 6 | open IO.Usb.Hid.Native 7 | open NUnit.Framework 8 | open FsUnit 9 | 10 | [] 11 | type ``Native method tests`` ()= 12 | let GetFirstHidDevice () = 13 | SetupApiAdapter.GetDevices HidAdapter.HidClass true 14 | |> Seq.filter (fun device -> device.Description.Contains("Keyboard") = false && device.Description.Contains("Mouse") = false) 15 | |> Seq.head 16 | 17 | [] 18 | member test.``SetupAPI Device Path Enumeration`` () = 19 | let totalConnected = SetupApiAdapter.GetDevicePaths HidAdapter.HidClass true |> Seq.length 20 | let total = SetupApiAdapter.GetDevicePaths HidAdapter.HidClass false |> Seq.length 21 | Assert.Greater(total, 0) 22 | Assert.Greater(total, totalConnected) 23 | 24 | [] 25 | member test.``SetupAPI Device Enumeration`` () = 26 | let totalConnected = SetupApiAdapter.GetDevices HidAdapter.HidClass true |> Seq.length 27 | let total = SetupApiAdapter.GetDevices HidAdapter.HidClass false |> Seq.length 28 | Assert.Greater(total, 0) 29 | Assert.Greater(total, totalConnected) 30 | 31 | [] 32 | member test.``Create File Handle Test`` () = 33 | let device = GetFirstHidDevice () 34 | let handle = Kernel32Adapter.OpenFile device.Path FileAccess.Read FileShare.ReadWrite FileMode.Open false 35 | handle.Close() 36 | 37 | [] 38 | member test.``Create Device Stream Test`` () = 39 | let device = GetFirstHidDevice () 40 | let stream = new DeviceStream(device.Path, FileAccess.Read, FileShare.ReadWrite, FileMode.Open, false) 41 | stream.Close() 42 | 43 | [] 44 | member test.``Hid Device Id`` () = 45 | new Guid("4d1e55b2-f16f-11cf-88cb-001111000030") |> should equal HidAdapter.HidClass 46 | 47 | [] 48 | member test.``HidDevice Attributes`` () = 49 | let device = GetFirstHidDevice () 50 | let handle = Kernel32Adapter.OpenFile device.Path FileAccess.Read FileShare.ReadWrite FileMode.Open false 51 | let attributes = HidAdapter.GetDeviceAttributes(handle) 52 | handle.Close() 53 | Assert.Greater(attributes.VenderId, 0) 54 | Assert.Greater(attributes.ProductId, 0) 55 | Assert.Greater(attributes.Version, 0) -------------------------------------------------------------------------------- /src/HidLibrary/HidDeviceCapabilities.cs: -------------------------------------------------------------------------------- 1 | namespace HidLibrary 2 | { 3 | public class HidDeviceCapabilities 4 | { 5 | internal HidDeviceCapabilities(NativeMethods.HIDP_CAPS capabilities) 6 | { 7 | Usage = capabilities.Usage; 8 | UsagePage = capabilities.UsagePage; 9 | InputReportByteLength = capabilities.InputReportByteLength; 10 | OutputReportByteLength = capabilities.OutputReportByteLength; 11 | FeatureReportByteLength = capabilities.FeatureReportByteLength; 12 | Reserved = capabilities.Reserved; 13 | NumberLinkCollectionNodes = capabilities.NumberLinkCollectionNodes; 14 | NumberInputButtonCaps = capabilities.NumberInputButtonCaps; 15 | NumberInputValueCaps = capabilities.NumberInputValueCaps; 16 | NumberInputDataIndices = capabilities.NumberInputDataIndices; 17 | NumberOutputButtonCaps = capabilities.NumberOutputButtonCaps; 18 | NumberOutputValueCaps = capabilities.NumberOutputValueCaps; 19 | NumberOutputDataIndices = capabilities.NumberOutputDataIndices; 20 | NumberFeatureButtonCaps = capabilities.NumberFeatureButtonCaps; 21 | NumberFeatureValueCaps = capabilities.NumberFeatureValueCaps; 22 | NumberFeatureDataIndices = capabilities.NumberFeatureDataIndices; 23 | 24 | } 25 | 26 | public short Usage { get; private set; } 27 | public short UsagePage { get; private set; } 28 | public short InputReportByteLength { get; private set; } 29 | public short OutputReportByteLength { get; private set; } 30 | public short FeatureReportByteLength { get; private set; } 31 | public short[] Reserved { get; private set; } 32 | public short NumberLinkCollectionNodes { get; private set; } 33 | public short NumberInputButtonCaps { get; private set; } 34 | public short NumberInputValueCaps { get; private set; } 35 | public short NumberInputDataIndices { get; private set; } 36 | public short NumberOutputButtonCaps { get; private set; } 37 | public short NumberOutputValueCaps { get; private set; } 38 | public short NumberOutputDataIndices { get; private set; } 39 | public short NumberFeatureButtonCaps { get; private set; } 40 | public short NumberFeatureValueCaps { get; private set; } 41 | public short NumberFeatureDataIndices { get; private set; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/packages/NSubstitute.1.3.0.0/BreakingChanges.txt: -------------------------------------------------------------------------------- 1 | ================================================================================================ 2 | 1.2.0 Release 3 | ================================================================================================ 4 | 5 | Auto-substitute for pure virtual classes (in addition to interfaces and delegate types), which 6 | means some methods and properties on substitutes that used to return null by default will now 7 | return a new substitute of that type. 8 | 9 | Reason: 10 | Cut down the code required to configure substitute members that return interface-like types 11 | (e.g. ASP.NET web abstractions like HttpContextBase) which are safe to create and proxy. 12 | 13 | Safe classes are those with all their public methods and properties defined as virtual or 14 | abstract, and containing a default, parameterless constructor defined as public or protected. 15 | 16 | Fix: 17 | Explicitly return null from methods and property getters when required for a test. 18 | e.g. sub.Method().Returns(x => null); 19 | 20 | 21 | ================================================================================================ 22 | 0.9.5 Release 23 | ================================================================================================ 24 | 25 | Raise.Event(...) methods renamed to Raise.EventWith() signature would often conflict with the 29 | Raise.Event() method which is used to raise all types of events. 30 | 31 | Raise.Event() will now always work for any event type, while 32 | Raise.EventWith() can be used as a shortcut to raise 33 | EventHandler-style events with a particular argument. 34 | 35 | Fix: 36 | Replace Raise.Event() calls with equivalent Raise.EventWith() call. 37 | 38 | ------------------------------------------------------------------------------------------------ 39 | Raise.Action() methods removed 40 | 41 | Reason: 42 | The Raise.Event() method can be used to raise all delegate events, including Actions. 43 | Raise.Action() was removed so there is a consistent way of raising all delegate events. 44 | 45 | Fix: 46 | - Replace Raise.Action() calls with Raise.Event(). 47 | - Replace Raise.Action(T arg) calls with Raise.Event>(arg). 48 | - Replace Raise.Action(T1 x, T2 y) calls with Raise.Event>(x, y). 49 | 50 | 51 | ================================================================================================ 52 | 0.9.0 Release 53 | ================================================================================================ 54 | 55 | No breaking changes. 56 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/PowerMate/PowerMate.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B} 9 | Library 10 | Properties 11 | PowerMate 12 | PowerMate 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | ..\..\..\src\HidLibrary\bin\Release\HidLibrary.dll 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | -------------------------------------------------------------------------------- /experimental/IO.Usb.Hid/IO.Usb.Hid.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {845daa5d-3d88-445a-bbbe-0634024db75b} 9 | Library 10 | IO.Usb.Hid 11 | IO.Usb.Hid 12 | v4.0 13 | IO.Usb.Hid 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | 3 24 | 25 | 26 | pdbonly 27 | true 28 | true 29 | bin\Release\ 30 | TRACE 31 | 3 32 | 33 | 34 | 35 | 36 | 37 | 38 | 3.5 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 61 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-console.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-console-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-agent-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-console.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-console-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-agent-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 24 | 25 | 26 | 29 | 31 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/HidLibrary/HidLibrary.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66} 9 | Library 10 | Properties 11 | HidLibrary 12 | HidLibrary 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | AnyCPU 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 63 | -------------------------------------------------------------------------------- /examples/Honeywell4000Series/Honeywell4000Series.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {BA85B480-6793-49F7-9A4D-6EAC8D133B8F} 9 | Exe 10 | Properties 11 | Honeywell4000Series 12 | Honeywell4000Series 13 | v4.0 14 | 15 | 16 | 512 17 | 18 | 19 | x64 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | x86 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | ..\..\Current\HidLibrary\bin\Release\HidLibrary.dll 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 66 | -------------------------------------------------------------------------------- /examples/LogitechGamepad/LogitechGamepad.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {66703F1B-6B3D-48FD-BA2D-05A78CA161E0} 9 | Exe 10 | Properties 11 | LogitechGamepad 12 | LogitechGamepad 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\..\Current\HidLibrary\bin\Release\HidLibrary.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 64 | -------------------------------------------------------------------------------- /examples/MagtekCardReader/MagtekCardReader.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {D1D7BF2B-9681-4419-8B57-825F6B26856B} 9 | Exe 10 | Properties 11 | MagtekCardReader 12 | MagtekCardReader 13 | v4.0 14 | 15 | 16 | 512 17 | 18 | 19 | x86 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | x64 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | False 40 | ..\..\Current\HidLibrary\bin\Release\HidLibrary.dll 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 66 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/GriffinPowerMateConsole/GriffinPowerMateConsole.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {AF254A98-A51D-4529-B5D5-DEA66EA76047} 9 | Exe 10 | Properties 11 | GriffinPowerMate 12 | GriffinPowerMate 13 | v4.0 14 | Client 15 | 512 16 | 17 | 18 | x86 19 | true 20 | full 21 | false 22 | bin\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | x86 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 38 | ..\..\..\src\HidLibrary\bin\Release\HidLibrary.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B} 55 | PowerMate 56 | 57 | 58 | 59 | 66 | -------------------------------------------------------------------------------- /src/TestHarness/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TestHarness.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestHarness.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/pnunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/pnunit-launcher.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/pnunit-agent.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/pnunit-launcher.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 32 | 33 | 34 | 37 | 39 | 40 | 41 | 42 | 45 | 47 | 48 | 49 | 50 | 53 | 55 | 56 | 57 | 58 | 61 | 63 | 64 | 65 | 66 | 69 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/GriffinPowerMateWindowsForms/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.261 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace GriffinPowerMateWindowsForms.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GriffinPowerMateWindowsForms.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /experimental/Tests/Tests.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {49da6881-113b-43e4-b243-65d758b541bd} 9 | Library 10 | TestSuite 11 | TestSuite 12 | v4.0 13 | Tests 14 | 15 | 16 | true 17 | full 18 | false 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | 3 23 | 24 | 25 | pdbonly 26 | true 27 | true 28 | bin\Release\ 29 | TRACE 30 | 3 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | ..\packages\FsUnit.0.9.1\Lib\FsUnit.NUnit-0.9.0.dll 40 | True 41 | 42 | 43 | 44 | 45 | ..\packages\NUnit.2.5.9.10348\lib\nunit.framework.dll 46 | True 47 | 48 | 49 | ..\packages\NUnit.2.5.9.10348\lib\nunit.mocks.dll 50 | True 51 | 52 | 53 | ..\packages\NUnit.2.5.9.10348\lib\pnunit.framework.dll 54 | True 55 | 56 | 57 | 58 | 59 | 60 | IO.Usb.Hid 61 | {845daa5d-3d88-445a-bbbe-0634024db75b} 62 | True 63 | 64 | 65 | 72 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 38 | 39 | 40 | 43 | 45 | 46 | 47 | 48 | 51 | 53 | 54 | 55 | 56 | 59 | 61 | 62 | 63 | 64 | 67 | 69 | 70 | 71 | 72 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/nunit.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 38 | 39 | 40 | 43 | 45 | 46 | 47 | 48 | 51 | 53 | 54 | 55 | 56 | 59 | 61 | 62 | 63 | 64 | 67 | 69 | 70 | 71 | 72 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 38 | 39 | 40 | 43 | 45 | 46 | 47 | 48 | 51 | 53 | 54 | 55 | 56 | 59 | 61 | 62 | 63 | 64 | 67 | 69 | 70 | 71 | 72 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/nunit-x86.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | 38 | 39 | 40 | 43 | 45 | 46 | 47 | 48 | 51 | 53 | 54 | 55 | 56 | 59 | 61 | 62 | 63 | 64 | 67 | 69 | 70 | 71 | 72 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/Tests/Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.30703 7 | 2.0 8 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B} 9 | Library 10 | Properties 11 | Tests 12 | Tests 13 | v4.0 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | ..\packages\NSubstitute.1.3.0.0\lib\NET40\NSubstitute.dll 36 | 37 | 38 | ..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll 39 | 40 | 41 | ..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll 42 | 43 | 44 | ..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll 45 | 46 | 47 | ..\packages\Should.1.1.12.0\lib\Should.dll 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66} 67 | HidLibrary 68 | 69 | 70 | 71 | 78 | -------------------------------------------------------------------------------- /src/HidLibrary.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2010 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HidLibrary", "HidLibrary\HidLibrary.csproj", "{9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}" 4 | EndProject 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestHarness", "TestHarness\TestHarness.csproj", "{3009AC13-6BED-44AF-92F6-8E6C802716C9}" 6 | EndProject 7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{5AFA775C-12DA-453A-8611-11E9FAEE7A8B}" 8 | EndProject 9 | Global 10 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 11 | Debug|Any CPU = Debug|Any CPU 12 | Debug|Mixed Platforms = Debug|Mixed Platforms 13 | Debug|x86 = Debug|x86 14 | Release|Any CPU = Release|Any CPU 15 | Release|Mixed Platforms = Release|Mixed Platforms 16 | Release|x86 = Release|x86 17 | EndGlobalSection 18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 19 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 22 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 23 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Debug|x86.ActiveCfg = Debug|Any CPU 24 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 27 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Release|Mixed Platforms.Build.0 = Release|Any CPU 28 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66}.Release|x86.ActiveCfg = Release|Any CPU 29 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Debug|Any CPU.ActiveCfg = Debug|x86 30 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 31 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Debug|Mixed Platforms.Build.0 = Debug|x86 32 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Debug|x86.ActiveCfg = Debug|x86 33 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Debug|x86.Build.0 = Debug|x86 34 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Release|Any CPU.ActiveCfg = Release|x86 35 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Release|Mixed Platforms.ActiveCfg = Release|x86 36 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Release|Mixed Platforms.Build.0 = Release|x86 37 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Release|x86.ActiveCfg = Release|x86 38 | {3009AC13-6BED-44AF-92F6-8E6C802716C9}.Release|x86.Build.0 = Release|x86 39 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 40 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Debug|Any CPU.Build.0 = Debug|Any CPU 41 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 42 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 43 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Debug|x86.ActiveCfg = Debug|Any CPU 44 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 47 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Release|Mixed Platforms.Build.0 = Release|Any CPU 48 | {5AFA775C-12DA-453A-8611-11E9FAEE7A8B}.Release|x86.ActiveCfg = Release|Any CPU 49 | EndGlobalSection 50 | GlobalSection(SolutionProperties) = preSolution 51 | HideSolutionNode = FALSE 52 | EndGlobalSection 53 | EndGlobal 54 | -------------------------------------------------------------------------------- /experimental/packages/NUnit.2.5.9.10348/Tools/NUnitTests.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 25 | 26 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 54 | 55 | 60 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /src/packages/NUnit.2.5.10.11092/tools/NUnitTests.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 25 | 26 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 54 | 55 | 60 | 61 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/GriffinPowerMate.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GriffinPowerMateConsole", "GriffinPowerMateConsole\GriffinPowerMateConsole.csproj", "{AF254A98-A51D-4529-B5D5-DEA66EA76047}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GriffinPowerMateWindowsForms", "GriffinPowerMateWindowsForms\GriffinPowerMateWindowsForms.csproj", "{ABEBCF51-01B9-4666-9510-011908636639}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerMate", "PowerMate\PowerMate.csproj", "{390FBC50-C9B0-4757-90C0-84EBC2B7C52B}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|Mixed Platforms = Debug|Mixed Platforms 14 | Debug|x86 = Debug|x86 15 | Release|Any CPU = Release|Any CPU 16 | Release|Mixed Platforms = Release|Mixed Platforms 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Debug|Any CPU.ActiveCfg = Debug|x86 21 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 22 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Debug|Mixed Platforms.Build.0 = Debug|x86 23 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Debug|x86.ActiveCfg = Debug|x86 24 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Debug|x86.Build.0 = Debug|x86 25 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Release|Any CPU.ActiveCfg = Release|x86 26 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Release|Mixed Platforms.ActiveCfg = Release|x86 27 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Release|Mixed Platforms.Build.0 = Release|x86 28 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Release|x86.ActiveCfg = Release|x86 29 | {AF254A98-A51D-4529-B5D5-DEA66EA76047}.Release|x86.Build.0 = Release|x86 30 | {ABEBCF51-01B9-4666-9510-011908636639}.Debug|Any CPU.ActiveCfg = Debug|x86 31 | {ABEBCF51-01B9-4666-9510-011908636639}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 32 | {ABEBCF51-01B9-4666-9510-011908636639}.Debug|Mixed Platforms.Build.0 = Debug|x86 33 | {ABEBCF51-01B9-4666-9510-011908636639}.Debug|x86.ActiveCfg = Debug|x86 34 | {ABEBCF51-01B9-4666-9510-011908636639}.Debug|x86.Build.0 = Debug|x86 35 | {ABEBCF51-01B9-4666-9510-011908636639}.Release|Any CPU.ActiveCfg = Release|x86 36 | {ABEBCF51-01B9-4666-9510-011908636639}.Release|Mixed Platforms.ActiveCfg = Release|x86 37 | {ABEBCF51-01B9-4666-9510-011908636639}.Release|Mixed Platforms.Build.0 = Release|x86 38 | {ABEBCF51-01B9-4666-9510-011908636639}.Release|x86.ActiveCfg = Release|x86 39 | {ABEBCF51-01B9-4666-9510-011908636639}.Release|x86.Build.0 = Release|x86 40 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 41 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Debug|Any CPU.Build.0 = Debug|Any CPU 42 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 43 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 44 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Debug|x86.ActiveCfg = Debug|Any CPU 45 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Release|Any CPU.ActiveCfg = Release|Any CPU 46 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Release|Any CPU.Build.0 = Release|Any CPU 47 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 48 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Release|Mixed Platforms.Build.0 = Release|Any CPU 49 | {390FBC50-C9B0-4757-90C0-84EBC2B7C52B}.Release|x86.ActiveCfg = Release|Any CPU 50 | EndGlobalSection 51 | GlobalSection(SolutionProperties) = preSolution 52 | HideSolutionNode = FALSE 53 | EndGlobalSection 54 | EndGlobal 55 | -------------------------------------------------------------------------------- /examples/GriffinPowerMate/GriffinPowerMateConsole/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | // This example was written by Thomas Hammer (www.thammer.net). 7 | 8 | namespace GriffinPowerMate 9 | { 10 | /// 11 | /// Checks to see if a Griffin PowerMate device is connected. If it is, 12 | /// read rotation and button press events and control the LED brightness 13 | /// and pulse speed. 14 | /// 15 | /// This code has not been tested with multiple PowerMates connected at the same time. 16 | /// 17 | class Program 18 | { 19 | static PowerMateManager powerMateManager = new PowerMateManager(); 20 | 21 | static void Main(string[] args) 22 | { 23 | if (powerMateManager.OpenDevice()) 24 | { 25 | powerMateManager.DeviceAttached +=new EventHandler(powerMateManager_DeviceAttached); 26 | powerMateManager.DeviceRemoved +=new EventHandler(powerMateManager_DeviceRemoved); 27 | powerMateManager.ButtonDown += new EventHandler(powerMateManager_ButtonDown); 28 | powerMateManager.ButtonUp += new EventHandler(powerMateManager_ButtonUp); 29 | powerMateManager.KnobDisplacement += new EventHandler(powerMateManager_KnobDisplacement); 30 | 31 | Console.WriteLine("PowerMate found, press any key to exit."); 32 | Console.ReadKey(); 33 | powerMateManager.CloseDevice(); 34 | } 35 | else 36 | { 37 | Console.WriteLine("Could not find a PowerMate."); 38 | Console.ReadKey(); 39 | } 40 | } 41 | 42 | static void powerMateManager_DeviceRemoved(object sender, EventArgs e) 43 | { 44 | Console.WriteLine("PowerMate removed."); 45 | } 46 | 47 | static void powerMateManager_DeviceAttached(object sender, EventArgs e) 48 | { 49 | Console.WriteLine("PowerMate attached."); 50 | } 51 | 52 | static void powerMateManager_KnobDisplacement(object sender, PowerMateEventArgs e) 53 | { 54 | Console.WriteLine("PowerMate knob displacement event"); 55 | Console.WriteLine("PowerMate state button: {0}", (e.State.ButtonState == PowerMateButtonState.Up ? "Up" : "Down")); 56 | Console.WriteLine("PowerMate state knob displacement: {0}", e.State.KnobDisplacement); 57 | 58 | //Console.WriteLine("PowerMate led brightness: {0}", e.State.LedBrightness); 59 | //Console.WriteLine("PowerMate led pulse enabled: {0}", e.State.LedPulseEnabled ? "Yes" : "No"); 60 | //Console.WriteLine("PowerMate led pulse during sleep enabled: {0}", e.State.LedPulseDuringSleepEnabled ? "Yes" : "No"); 61 | //Console.WriteLine("PowerMate led pulse speed: {0}", e.State.LedPulseSpeed); 62 | } 63 | 64 | static void powerMateManager_ButtonUp(object sender, PowerMateEventArgs e) 65 | { 66 | Console.WriteLine("PowerMate button up event"); 67 | Console.WriteLine("PowerMate state button: {0}", (e.State.ButtonState == PowerMateButtonState.Up ? "Up" : "Down")); 68 | Console.WriteLine("PowerMate state knob displacement: {0}", e.State.KnobDisplacement); 69 | } 70 | 71 | static void powerMateManager_ButtonDown(object sender, PowerMateEventArgs e) 72 | { 73 | Console.WriteLine("PowerMate button down event"); 74 | Console.WriteLine("PowerMate state button: {0}", (e.State.ButtonState == PowerMateButtonState.Up ? "Up" : "Down")); 75 | Console.WriteLine("PowerMate state knob displacement: {0}", e.State.KnobDisplacement); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /examples/LogitechGamepad/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using HidLibrary; 4 | 5 | namespace LogitechGamepad 6 | { 7 | class Program 8 | { 9 | private const int VendorId = 0x046D; 10 | private static readonly int[] ProductIds = new[] { MessageFactory.PrecisionId, MessageFactory.DualActionId }; 11 | private static int _currentProductId; 12 | private static HidDevice _device; 13 | private static bool _attached; 14 | 15 | static void Main() 16 | { 17 | foreach (var productId in ProductIds) 18 | { 19 | _device = HidDevices.Enumerate(VendorId, productId).FirstOrDefault(); 20 | 21 | if (_device == null) continue; 22 | 23 | _currentProductId = productId; 24 | 25 | _device.OpenDevice(); 26 | 27 | _device.Inserted += DeviceAttachedHandler; 28 | _device.Removed += DeviceRemovedHandler; 29 | 30 | _device.MonitorDeviceEvents = true; 31 | 32 | _device.ReadReport(OnReport); 33 | break; 34 | } 35 | 36 | if (_device != null) 37 | { 38 | Console.WriteLine("Gamepad found, press any key to exit."); 39 | Console.ReadKey(); 40 | _device.CloseDevice(); 41 | } 42 | else 43 | { 44 | Console.WriteLine("Could not find a gamepad."); 45 | Console.ReadKey(); 46 | } 47 | } 48 | 49 | private static void OnReport(HidReport report) 50 | { 51 | if (_attached == false) { return; } 52 | 53 | if (report.Data.Length >= 4) 54 | { 55 | var message = MessageFactory.CreateMessage(_currentProductId, report.Data); 56 | if (message.Depress) { KeyDepressed(); } 57 | else if (message.MultiplePressed == false) 58 | { 59 | if (message.UpPressed) { KeyPressed(1); } 60 | if (message.DownPressed) { KeyPressed(2); } 61 | if (message.LeftPressed) { KeyPressed(3); } 62 | if (message.RightPressed) { KeyPressed(4); } 63 | if (message.Button1Pressed) { KeyPressed(5); } 64 | if (message.Button2Pressed) { KeyPressed(6); } 65 | if (message.Button3Pressed) { KeyPressed(7); } 66 | if (message.Button4Pressed) { KeyPressed(8); } 67 | if (message.Button5Pressed) { KeyPressed(9); } 68 | if (message.Button6Pressed) { KeyPressed(10); } 69 | if (message.Button7Pressed) { KeyPressed(11); } 70 | if (message.Button8Pressed) { KeyPressed(12); } 71 | if (message.Button9Pressed) { KeyPressed(13); } 72 | if (message.Button10Pressed) { KeyPressed(14); } 73 | } 74 | } 75 | 76 | _device.ReadReport(OnReport); 77 | } 78 | 79 | private static void KeyPressed(int value) 80 | { 81 | Console.WriteLine("Button {0} pressed.", value); 82 | } 83 | 84 | private static void KeyDepressed() 85 | { 86 | Console.WriteLine("Button depressed."); 87 | } 88 | 89 | private static void DeviceAttachedHandler() 90 | { 91 | _attached = true; 92 | Console.WriteLine("Gamepad attached."); 93 | _device.ReadReport(OnReport); 94 | } 95 | 96 | private static void DeviceRemovedHandler() 97 | { 98 | _attached = false; 99 | Console.WriteLine("Gamepad removed."); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /examples/LogitechGamepad/DualActionMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogitechGamepad 4 | { 5 | public class DualActionMessage : IMessage 6 | { 7 | private const int DepressAction = 0x0800; 8 | 9 | private const int PressUp = 0x0000; 10 | private const int PressDown = 0x0400; 11 | private const int PressLeft = 0x0600; 12 | private const int PressRight = 0x0200; 13 | 14 | private const int Press1 = 0x1800; 15 | private const int Press2 = 0x2800; 16 | private const int Press3 = 0x4800; 17 | private const int Press4 = 0x8800; 18 | private const int Press5 = 0x0801; 19 | private const int Press6 = 0x0802; 20 | private const int Press7 = 0x0804; 21 | private const int Press8 = 0x0808; 22 | private const int Press9 = 0x0810; 23 | private const int Press10 = 0x0820; 24 | 25 | private readonly ushort _message; 26 | private readonly byte _buttonsPressed; 27 | 28 | public DualActionMessage(byte[] message) 29 | { 30 | if (message != null && message.Length == 8) 31 | { 32 | var value = new byte[2]; 33 | Array.Copy(message, 4, value, 0, 2); 34 | _message = BitConverter.ToUInt16(value, 0); 35 | } 36 | else throw new InvalidCastException("Cannot convert gamepad message to 32 bit integer."); 37 | _buttonsPressed = GetButtonsPressed(this); 38 | } 39 | 40 | public byte TotalPressed { get { return _buttonsPressed; } } 41 | public bool MultiplePressed { get { return (_buttonsPressed > 1); } } 42 | public bool Depress { get { return (DepressAction & _message) == 0; } } 43 | public bool UpPressed { get { return (PressUp & _message) != 0; } } 44 | public bool DownPressed { get { return (PressDown & _message) != 0; } } 45 | public bool LeftPressed { get { return (PressLeft & _message) != 0; } } 46 | public bool RightPressed { get { return (PressRight & _message) != 0; } } 47 | public bool Button1Pressed { get { return (Press1 & _message) != 0; } } 48 | public bool Button2Pressed { get { return (Press2 & _message) != 0; } } 49 | public bool Button3Pressed { get { return (Press3 & _message) != 0; } } 50 | public bool Button4Pressed { get { return (Press4 & _message) != 0; } } 51 | public bool Button5Pressed { get { return (Press5 & _message) != 0; } } 52 | public bool Button6Pressed { get { return (Press6 & _message) != 0; } } 53 | public bool Button7Pressed { get { return (Press7 & _message) != 0; } } 54 | public bool Button8Pressed { get { return (Press8 & _message) != 0; } } 55 | public bool Button9Pressed { get { return (Press9 & _message) != 0; } } 56 | public bool Button10Pressed { get { return (Press10 & _message) != 0; } } 57 | 58 | private static byte GetButtonsPressed(DualActionMessage message) 59 | { 60 | if (message == null) throw new ArgumentNullException("message"); 61 | byte buttonsPressed = 0; 62 | 63 | if (message.UpPressed) { buttonsPressed++; } 64 | if (message.DownPressed) { buttonsPressed++; } 65 | if (message.LeftPressed) { buttonsPressed++; } 66 | if (message.RightPressed) { buttonsPressed++; } 67 | if (message.Button1Pressed) { buttonsPressed++; } 68 | if (message.Button2Pressed) { buttonsPressed++; } 69 | if (message.Button3Pressed) { buttonsPressed++; } 70 | if (message.Button4Pressed) { buttonsPressed++; } 71 | if (message.Button5Pressed) { buttonsPressed++; } 72 | if (message.Button6Pressed) { buttonsPressed++; } 73 | if (message.Button7Pressed) { buttonsPressed++; } 74 | if (message.Button8Pressed) { buttonsPressed++; } 75 | if (message.Button9Pressed) { buttonsPressed++; } 76 | if (message.Button10Pressed) { buttonsPressed++; } 77 | 78 | return buttonsPressed; 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /examples/LogitechGamepad/PrecisionMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LogitechGamepad 4 | { 5 | public class PrecisionMessage : IMessage 6 | { 7 | private const int DepressMask = 65343; 8 | 9 | private const int PressUpMask = 16; 10 | private const int PressDownMask = 32; 11 | private const int PressLeftMask = 4; 12 | private const int PressRightMask = 8; 13 | 14 | private const int Press1Mask = 256; 15 | private const int Press2Mask = 512; 16 | private const int Press3Mask = 1024; 17 | private const int Press4Mask = 2048; 18 | private const int Press5Mask = 4096; 19 | private const int Press6Mask = 8192; 20 | private const int Press7Mask = 16384; 21 | private const int Press8Mask = 32768; 22 | private const int Press9Mask = 1; 23 | private const int Press10Mask = 2; 24 | 25 | private readonly uint _message; 26 | private readonly byte _buttonsPressed; 27 | 28 | public PrecisionMessage(uint message) 29 | { 30 | _message = message; 31 | } 32 | 33 | public PrecisionMessage(byte[] message) 34 | { 35 | if (message != null && message.Length == 4) 36 | { 37 | Array.Reverse(message); 38 | _message = BitConverter.ToUInt32(message, 0); 39 | } 40 | else throw new InvalidCastException("Cannot convert gamepad message to 32 bit integer."); 41 | _buttonsPressed = GetButtonsPressed(this); 42 | } 43 | 44 | public byte TotalPressed { get { return _buttonsPressed; } } 45 | public bool MultiplePressed { get { return (_buttonsPressed > 1); } } 46 | public bool Depress { get { return (DepressMask & _message) == 0; } } 47 | public bool UpPressed { get { return (PressUpMask & _message) != 0; } } 48 | public bool DownPressed { get { return (PressDownMask & _message) != 0; } } 49 | public bool LeftPressed { get { return (PressLeftMask & _message) != 0; } } 50 | public bool RightPressed { get { return (PressRightMask & _message) != 0; } } 51 | public bool Button1Pressed { get { return (Press1Mask & _message) != 0; } } 52 | public bool Button2Pressed { get { return (Press2Mask & _message) != 0; } } 53 | public bool Button3Pressed { get { return (Press3Mask & _message) != 0; } } 54 | public bool Button4Pressed { get { return (Press4Mask & _message) != 0; } } 55 | public bool Button5Pressed { get { return (Press5Mask & _message) != 0; } } 56 | public bool Button6Pressed { get { return (Press6Mask & _message) != 0; } } 57 | public bool Button7Pressed { get { return (Press7Mask & _message) != 0; } } 58 | public bool Button8Pressed { get { return (Press8Mask & _message) != 0; } } 59 | public bool Button9Pressed { get { return (Press9Mask & _message) != 0; } } 60 | public bool Button10Pressed { get { return (Press10Mask & _message) != 0; } } 61 | 62 | private static byte GetButtonsPressed(IMessage message) 63 | { 64 | byte buttonsPressed = 0; 65 | 66 | if (message.UpPressed) { buttonsPressed++; } 67 | if (message.DownPressed) { buttonsPressed++; } 68 | if (message.LeftPressed) { buttonsPressed++; } 69 | if (message.RightPressed) { buttonsPressed++; } 70 | if (message.Button1Pressed) { buttonsPressed++; } 71 | if (message.Button2Pressed) { buttonsPressed++; } 72 | if (message.Button3Pressed) { buttonsPressed++; } 73 | if (message.Button4Pressed) { buttonsPressed++; } 74 | if (message.Button5Pressed) { buttonsPressed++; } 75 | if (message.Button6Pressed) { buttonsPressed++; } 76 | if (message.Button7Pressed) { buttonsPressed++; } 77 | if (message.Button8Pressed) { buttonsPressed++; } 78 | if (message.Button9Pressed) { buttonsPressed++; } 79 | if (message.Button10Pressed) { buttonsPressed++; } 80 | 81 | return buttonsPressed; 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/TestHarness/TestHarness.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {3009AC13-6BED-44AF-92F6-8E6C802716C9} 9 | WinExe 10 | Properties 11 | TestHarness 12 | TestHarness 13 | v4.0 14 | 15 | 16 | 512 17 | 18 | 19 | AnyCPU 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | x86 30 | pdbonly 31 | true 32 | bin\Release\ 33 | TRACE 34 | prompt 35 | 4 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Form 52 | 53 | 54 | Main.cs 55 | 56 | 57 | 58 | 59 | Main.cs 60 | 61 | 62 | ResXFileCodeGenerator 63 | Resources.Designer.cs 64 | Designer 65 | 66 | 67 | True 68 | Resources.resx 69 | True 70 | 71 | 72 | 73 | SettingsSingleFileGenerator 74 | Settings.Designer.cs 75 | 76 | 77 | True 78 | Settings.settings 79 | True 80 | 81 | 82 | 83 | 84 | {9E8F1D50-74EA-4C60-BD5C-AB2C5B53BC66} 85 | HidLibrary 86 | 87 | 88 | 89 | 96 | --------------------------------------------------------------------------------