Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# LibUsbDotNet
[![Build status](https://ci.appveyor.com/api/projects/status/5fe0th33i60h24bw?svg=true)](https://ci.appveyor.com/project/qmfrederik/libusbdotnet)

> __NOTE__ This repository contains a fork of LibUsbDotNet; the original repository is located on [SourceForge](https://sourceforge.net/p/libusbdotnet/).
> This repository adds some minor bug fixes and support for .NET Core.

[LibUsbDotNet](http://sourceforge.net/projects/libusbdotnet) is a .NET C# USB library for WinUsb, libusb-win32, and Linux libusb v1.x developers.
All basic USB device functionality can be performed through common device classes allowing you to write OS and driver independent code.

* LibUsbDotNet versions 2.2.4 and above support the Libusb-1.0 driver.
* LibUsbDotNet 2.1.0 and above supports the genuine [libusb-win32](http://sourceforge.net/projects/libusb-win32) driver package. However,
access to basic device information via the windows registry is not available. See the [LegacyUsbRegistry](http://libusbdotnet.sourceforge.net/V2/html/9b8a7337-0d0c-c3e6-6f56-d47f1a3e5856.htm)
class for more information.

## Features
* Full support for WinUSB. All WinUSB interfaces are treated as separate devices; each interface can be used by a different application.
* Extended kernel level support for libusb-win32.
* Supports Unix-like operating systems using Mono .NET and libusb-1.0.
* Common device classes allow for a single code base to support multiple drivers and platforms.
* Includes a Usb InfWizard utility (Windows only) for generating usb installation packages, removing devices, and installing drivers.
* Device discovery using any or all of the folowing criteria:
* VendorID
* ProductID
* Revision Code
* Serial Number
* Device Interface GUID

Source package includes many small example applications.
9 changes: 9 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build_script:
- msbuild stage\LibUsbDotNet.sln /p:Configuration=Release /p:Platform="Any CPU" /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- dotnet restore stage\LibUsbDotNet\project.json
- dotnet build stage\LibUsbDotNet\project.json
- dotnet pack stage\LibUsbDotNet\project.json --version-suffix r%APPVEYOR_BUILD_VERSION%

on_success:
- ps: Push-AppVeyorArtifact stage\LibUsbDotNet\bin\Debug\CoreCompat.LibUsbDotNet.2.2.8-r$($env:APPVEYOR_BUILD_VERSION).nupkg
- ps: Push-AppVeyorArtifact stage\LibUsbDotNet\bin\Debug\CoreCompat.LibUsbDotNet.2.2.8-r$($env:APPVEYOR_BUILD_VERSION).symbols.nupkg
23 changes: 15 additions & 8 deletions stage/Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -12,11 +12,12 @@
<AssemblyName>Benchmark</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ApplicationIcon>UsbIco.ico</ApplicationIcon>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -82,14 +83,20 @@
<EmbeddedResource Include="Properties\Resources.resx">
<SubType>Designer</SubType>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="StopWatch.cs" />
Expand All @@ -99,8 +106,8 @@
<Content Include="UsbIco.ico" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibWinUsb\LibUsbDotNet.csproj">
<Project>{0A78F6FF-5586-4052-8104-E23FF83A7CE1}</Project>
<ProjectReference Include="..\LibUsbDotNet\LibUsbDotNet.csproj">
<Project>{0a78f6ff-5586-4052-8104-e23ff83a7ce1}</Project>
<Name>LibUsbDotNet</Name>
</ProjectReference>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions stage/Benchmark/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions stage/Benchmark/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions stage/BenchmarkCon/BenchmarkCon.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,11 +10,15 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LibUsbDotNet</RootNamespace>
<AssemblyName>BenchmarkCon</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkSubset>
</TargetFrameworkSubset>
<ApplicationIcon>UsbDos.ico</ApplicationIcon>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -60,13 +64,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibWinUsb\LibUsbDotNet.csproj">
<Project>{0A78F6FF-5586-4052-8104-E23FF83A7CE1}</Project>
<Name>LibUsbDotNet</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="app.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="BenchmarkHelp.txt" />
Expand All @@ -76,6 +76,12 @@
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibUsbDotNet\LibUsbDotNet.csproj">
<Project>{0a78f6ff-5586-4052-8104-e23ff83a7ce1}</Project>
<Name>LibUsbDotNet</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand All @@ -84,10 +90,4 @@
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>SET USE_ILMERGE=1
IF NOT DEFINED USE_ILMERGE GOTO DONE
ilmerge /out:"$(TargetDir)Bm$(TargetExt)" "$(TargetPath)" "$(TargetDir)LibUsbDotNet.dll"
:DONE</PostBuildEvent>
</PropertyGroup>
</Project>
20 changes: 13 additions & 7 deletions stage/Examples/Device.Notification/Device.Notification.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,10 +10,14 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Device.Notification</RootNamespace>
<AssemblyName>Device.Notification</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkSubset>
</TargetFrameworkSubset>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -57,11 +61,13 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="app.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\LibWinUsb\LibUsbDotNet.csproj">
<Project>{0A78F6FF-5586-4052-8104-E23FF83A7CE1}</Project>
<ProjectReference Include="..\..\LibUsbDotNet\LibUsbDotNet.csproj">
<Project>{0a78f6ff-5586-4052-8104-e23ff83a7ce1}</Project>
<Name>LibUsbDotNet</Name>
</ProjectReference>
</ItemGroup>
Expand Down
14 changes: 10 additions & 4 deletions stage/Examples/Read.Isochronous/Read.Isochronous.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,8 +10,14 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Read.Isochronous</RootNamespace>
<AssemblyName>Read.Isochronous</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -56,8 +62,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\LibWinUsb\LibUsbDotNet.csproj">
<Project>{0A78F6FF-5586-4052-8104-E23FF83A7CE1}</Project>
<ProjectReference Include="..\..\LibUsbDotNet\LibUsbDotNet.csproj">
<Project>{0a78f6ff-5586-4052-8104-e23ff83a7ce1}</Project>
<Name>LibUsbDotNet</Name>
</ProjectReference>
</ItemGroup>
Expand Down
14 changes: 10 additions & 4 deletions stage/Examples/Read.Only/Read.Only.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,8 +10,14 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Read.Only</RootNamespace>
<AssemblyName>Read.Only</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -54,8 +60,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\LibWinUsb\LibUsbDotNet.csproj">
<Project>{0A78F6FF-5586-4052-8104-E23FF83A7CE1}</Project>
<ProjectReference Include="..\..\LibUsbDotNet\LibUsbDotNet.csproj">
<Project>{0a78f6ff-5586-4052-8104-e23ff83a7ce1}</Project>
<Name>LibUsbDotNet</Name>
</ProjectReference>
</ItemGroup>
Expand Down
18 changes: 14 additions & 4 deletions stage/Examples/Read.Write.Async/Read.Write.Async.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -10,8 +10,14 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Read.Write.Async</RootNamespace>
<AssemblyName>Read.Write.Async</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -54,10 +60,14 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\LibWinUsb\LibUsbDotNet.csproj">
<Project>{0A78F6FF-5586-4052-8104-E23FF83A7CE1}</Project>
<ProjectReference Include="..\..\LibUsbDotNet\LibUsbDotNet.csproj">
<Project>{0a78f6ff-5586-4052-8104-e23ff83a7ce1}</Project>
<Name>LibUsbDotNet</Name>
</ProjectReference>
<ProjectReference Include="..\Device.Notification\Device.Notification.csproj">
<Project>{a893cfaa-fcdf-4055-a8d4-435cde59445f}</Project>
<Name>Device.Notification</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
Loading