├── docs
├── styles
│ ├── main.css
│ └── main.js
├── favicon.ico
├── images
│ ├── Diagram.png
│ └── WindowsSample.png
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
├── toc.html
└── logo.svg
├── FUNDING.yml
├── Diagram.png
├── src
├── Flutter
│ └── flutnet_thermometer_bridge
│ │ ├── LICENSE
│ │ ├── CHANGELOG.md
│ │ ├── lib
│ │ ├── exceptions.dart
│ │ └── index.dart
│ │ ├── .metadata
│ │ ├── README.md
│ │ └── pubspec.yaml
├── Samples
│ ├── Flutnet
│ │ ├── Flutter
│ │ │ ├── flutnet_thermometer_bridge
│ │ │ │ ├── LICENSE
│ │ │ │ ├── CHANGELOG.md
│ │ │ │ ├── lib
│ │ │ │ │ ├── exceptions.dart
│ │ │ │ │ ├── index.dart
│ │ │ │ │ ├── flutnet
│ │ │ │ │ │ ├── data
│ │ │ │ │ │ │ ├── flutnet_error_code.dart
│ │ │ │ │ │ │ └── flutnet_exception.dart
│ │ │ │ │ │ └── service_model
│ │ │ │ │ │ │ └── platform_operation_exception.g.dart
│ │ │ │ │ └── flutnet_thermometer
│ │ │ │ │ │ └── service_library
│ │ │ │ │ │ ├── generated
│ │ │ │ │ │ ├── cmd_thermometer_service_stop_monitoring.g.dart
│ │ │ │ │ │ ├── res_thermometer_service_stop_monitoring.g.dart
│ │ │ │ │ │ ├── cmd_thermometer_service_start_monitoring.g.dart
│ │ │ │ │ │ ├── res_thermometer_service_start_monitoring.g.dart
│ │ │ │ │ │ ├── cmd_thermometer_service_get_temperature_async.g.dart
│ │ │ │ │ │ ├── res_thermometer_service_get_temperature_async.g.dart
│ │ │ │ │ │ ├── cmd_thermometer_service_stop_monitoring.dart
│ │ │ │ │ │ ├── res_thermometer_service_stop_monitoring.dart
│ │ │ │ │ │ ├── cmd_thermometer_service_start_monitoring.dart
│ │ │ │ │ │ ├── res_thermometer_service_start_monitoring.dart
│ │ │ │ │ │ ├── cmd_thermometer_service_get_temperature_async.dart
│ │ │ │ │ │ └── res_thermometer_service_get_temperature_async.dart
│ │ │ │ │ │ ├── temperature_changed_args.g.dart
│ │ │ │ │ │ └── temperature_changed_args.dart
│ │ │ │ ├── .metadata
│ │ │ │ ├── README.md
│ │ │ │ └── pubspec.yaml
│ │ │ └── flutnet_thermometer
│ │ │ │ ├── assets
│ │ │ │ ├── flutnet_logo.png
│ │ │ │ └── xamarin_logo.png
│ │ │ │ ├── .metadata
│ │ │ │ ├── README.md
│ │ │ │ ├── .vscode
│ │ │ │ └── launch.json
│ │ │ │ ├── pubspec.yaml
│ │ │ │ ├── .gitignore
│ │ │ │ ├── flutnet_thermometer.iml
│ │ │ │ └── test
│ │ │ │ └── widget_test.dart
│ │ ├── app.jpg
│ │ ├── FlutnetThermometer.ModuleInterop.Android
│ │ │ ├── Transforms
│ │ │ │ ├── EnumFields.xml
│ │ │ │ ├── EnumMethods.xml
│ │ │ │ └── Metadata.xml
│ │ │ └── Properties
│ │ │ │ └── AssemblyInfo.cs
│ │ ├── FlutnetThermometer.Android
│ │ │ ├── Resources
│ │ │ │ ├── xml
│ │ │ │ │ └── device_filter.xml
│ │ │ │ ├── drawable
│ │ │ │ │ ├── launch_image.png
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── values
│ │ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ ├── colors.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ ├── ic_launcher_round.png
│ │ │ │ │ └── ic_launcher_foreground.png
│ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ └── layout
│ │ │ │ │ └── activity_main.xml
│ │ │ ├── Properties
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ └── AssemblyInfo.cs
│ │ │ └── Assets
│ │ │ │ └── AboutAssets.txt
│ │ └── FlutnetThermometer.ServiceLibrary
│ │ │ └── TemperatureChangedArgs.cs
│ └── UnoPlatform
│ │ ├── UnoCrossPlatform.UWP
│ │ ├── Assets
│ │ │ ├── storelogo.png
│ │ │ ├── splashscreen.scale-200.png
│ │ │ ├── lockscreenlogo.scale-200.png
│ │ │ ├── square44x44logo.scale-200.png
│ │ │ ├── wide310x150logo.scale-200.png
│ │ │ └── square150x150logo.scale-200.png
│ │ ├── UnoCrossPlatform.UWP_TemporaryKey.pfx
│ │ ├── App.xaml
│ │ ├── DontDeleteMe.xaml.cs
│ │ ├── DontDeleteMe.xaml
│ │ └── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ └── Default.rd.xml
│ │ ├── UnoCrossPlatform.Droid
│ │ ├── Assets
│ │ │ ├── SplashScreen.png
│ │ │ ├── Fonts
│ │ │ │ └── uno-fluentui-assets.ttf
│ │ │ └── AboutAssets.txt
│ │ ├── Resources
│ │ │ ├── drawable
│ │ │ │ └── Icon.png
│ │ │ ├── xml
│ │ │ │ └── device_filter.xml
│ │ │ └── values
│ │ │ │ ├── Strings.xml
│ │ │ │ └── Styles.xml
│ │ ├── Properties
│ │ │ ├── AndroidManifest.xml
│ │ │ └── AssemblyInfo.cs
│ │ ├── MainActivity.cs
│ │ └── Main.cs
│ │ └── UnoCrossPlatform
│ │ ├── MainPage.xaml
│ │ └── DispatchingExtensions.cs
├── Device.Net
│ ├── Device.Net.pfx
│ ├── DeviceType.cs
│ ├── DeviceEventArgs.cs
│ ├── Logging
│ │ ├── LoggerFactoryExtensions.cs
│ │ ├── NullLoggerFactory.cs
│ │ ├── ILoggerFactory.cs
│ │ ├── DummyDisposable.cs
│ │ ├── ILoggerProvider.cs
│ │ ├── EventId.cs
│ │ ├── ILogger.cs
│ │ ├── NullLogger.cs
│ │ └── NullLoggerOfT.cs
│ ├── LoggingExtensions.cs
│ ├── Windows
│ │ ├── FileAccessRights.cs
│ │ ├── SpDeviceInterfaceDetailData.cs
│ │ ├── SpDeviceInfoData.cs
│ │ ├── CommTimeouts.cs
│ │ ├── SpDeviceInterfaceData.cs
│ │ ├── WindowsDeviceConstants.cs
│ │ ├── WindowsHelpers.cs
│ │ └── IApiService.cs
│ ├── UnsubscribeDisposable.cs
│ ├── Exceptions
│ │ ├── AsyncException.cs
│ │ ├── DeviceException.cs
│ │ ├── ApiException.cs
│ │ ├── ValidationException.cs
│ │ └── NotInitializedException.cs
│ ├── Delegates.cs
│ ├── IDeviceListener.cs
│ ├── Properties.cs
│ ├── Trace.cs
│ ├── IDataReceiver.cs
│ ├── Observer.cs
│ ├── Observable.cs
│ ├── AsyncExtensions.cs
│ ├── FilterDeviceDefinition.cs
│ └── Device.Net.csproj
├── Device.Net.UnoSample
│ ├── Device.Net.UnoSample.Skia.Wpf
│ │ ├── Program.cs
│ │ └── Device.Net.UnoSample.Skia.Wpf.csproj
│ ├── Device.Net.UnoSample.macOS
│ │ ├── Assets.xcassets
│ │ │ ├── Contents.json
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── AppIcon-16.png
│ │ │ │ ├── AppIcon-32.png
│ │ │ │ ├── AppIcon-128.png
│ │ │ │ ├── AppIcon-256.png
│ │ │ │ ├── AppIcon-512.png
│ │ │ │ ├── AppIcon-128@2x.png
│ │ │ │ ├── AppIcon-16@2x.png
│ │ │ │ ├── AppIcon-256@2x.png
│ │ │ │ ├── AppIcon-32@2x.png
│ │ │ │ └── AppIcon-512@2x.png
│ │ │ └── unologo.imageset
│ │ │ │ └── unoplatform.jpg
│ │ ├── Resources
│ │ │ └── Fonts
│ │ │ │ └── uno-fluentui-assets.ttf
│ │ ├── Entitlements.plist
│ │ ├── Main.cs
│ │ └── Info.plist
│ ├── Device.Net.UnoSample.UWP
│ │ ├── Assets
│ │ │ ├── storelogo.png
│ │ │ ├── splashscreen.scale-200.png
│ │ │ ├── lockscreenlogo.scale-200.png
│ │ │ ├── square44x44logo.scale-200.png
│ │ │ ├── wide310x150logo.scale-200.png
│ │ │ └── square150x150logo.scale-200.png
│ │ ├── Device.Net.UnoSample.Uwp_temporarykey.pfx
│ │ └── Properties
│ │ │ └── AssemblyInfo.cs
│ ├── Device.Net.UnoSample.Droid
│ │ ├── Resources
│ │ │ ├── drawable
│ │ │ │ └── Icon.png
│ │ │ └── values
│ │ │ │ ├── Strings.xml
│ │ │ │ └── Styles.xml
│ │ ├── Assets
│ │ │ ├── Fonts
│ │ │ │ └── uno-fluentui-assets.ttf
│ │ │ └── AboutAssets.txt
│ │ ├── Properties
│ │ │ ├── AndroidManifest.xml
│ │ │ └── AssemblyInfo.cs
│ │ ├── MainActivity.cs
│ │ └── Main.cs
│ ├── Device.Net.UnoSample.Skia.Gtk
│ │ ├── Assets
│ │ │ └── Fonts
│ │ │ │ └── uno-fluentui-assets.ttf
│ │ └── Program.cs
│ ├── Device.Net.UnoSample.Skia.Wpf.Host
│ │ ├── Assets
│ │ │ └── Fonts
│ │ │ │ └── uno-fluentui-assets.ttf
│ │ ├── App.config
│ │ ├── Properties
│ │ │ └── Settings.settings
│ │ ├── App.xaml.cs
│ │ ├── App.xaml
│ │ ├── MainWindow.xaml
│ │ ├── Device.Net.UnoSample.Skia.Wpf.Host.csproj
│ │ └── MainWindow.xaml.cs
│ └── Device.Net.UnoSample.Shared
│ │ ├── App.xaml
│ │ ├── MainPage.xaml
│ │ ├── DispatchingExtensions.cs
│ │ ├── Assets
│ │ └── SharedAssets.md
│ │ └── Device.Net.UnoSample.Shared.shproj
├── Hid.Net
│ ├── Delegates.cs
│ ├── GlobalSuppressions.cs
│ ├── Properties.cs
│ ├── Windows
│ │ ├── HidAttributes.cs
│ │ └── IHidApiService.cs
│ ├── IHidDevice.cs
│ ├── ReadResult.cs
│ └── IHidDeviceHandler.cs
├── Usb.Net.AndroidSample
│ ├── Resources
│ │ ├── values
│ │ │ ├── dimens.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── Strings.xml
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── xml
│ │ │ └── device_filter.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── menu
│ │ │ └── menu_main.xml
│ │ └── layout
│ │ │ └── content_main.axml
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ └── Assets
│ │ └── AboutAssets.txt
├── Usb.Net.UWP.Sample
│ ├── Assets
│ │ ├── StoreLogo.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ └── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── Usb.Net.UWP.Sample_TemporaryKey.pfx
│ ├── App.xaml
│ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
├── Device.Net.MacOSLibUsbSample
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ ├── AppIcon-128.png
│ │ │ ├── AppIcon-16.png
│ │ │ ├── AppIcon-256.png
│ │ │ ├── AppIcon-32.png
│ │ │ ├── AppIcon-512.png
│ │ │ ├── AppIcon-128@2x.png
│ │ │ ├── AppIcon-16@2x.png
│ │ │ ├── AppIcon-256@2x.png
│ │ │ ├── AppIcon-32@2x.png
│ │ │ └── AppIcon-512@2x.png
│ ├── Entitlements.plist
│ ├── Main.cs
│ ├── packages.config
│ ├── AppDelegate.cs
│ └── Info.plist
├── Device.Net.UWPUnitTests
│ ├── Assets
│ │ ├── StoreLogo.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ └── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── Device.Net.UWPUnitTests_TemporaryKey.pfx
│ ├── UnitTestApp.xaml
│ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── UnitTestApp.rd.xml
├── Device.Net.Reactive
│ ├── IRequest.cs
│ ├── Device.Net.Reactive.csproj
│ ├── Delegates.cs
│ └── IDeviceManager.cs
├── Usb.Net.Android.Fakes
│ ├── Android
│ │ ├── Content
│ │ │ ├── IntentFilter.cs
│ │ │ ├── Intent.cs
│ │ │ └── Context.cs
│ │ ├── App
│ │ │ ├── BroadcastReceiver.cs
│ │ │ └── PendingIntent.cs
│ │ └── Hardware
│ │ │ └── Usb
│ │ │ ├── UsbRequest.cs
│ │ │ ├── UsbEndpoint.cs
│ │ │ ├── UsbDevice.cs
│ │ │ ├── UsbInterface.cs
│ │ │ ├── UsbManager.cs
│ │ │ └── UsbDeviceConnection.cs
│ ├── Usb.Net.Android.Fakes.csproj
│ ├── GlobalSuppressions.cs
│ └── Java
│ │ └── Nio
│ │ ├── Buffer.cs
│ │ └── ByteBuffer.cs
├── Device.Net.UWP
│ ├── Device.Net.UWP.XML
│ └── ConnectionInfo.cs
├── Device.Net.LibUsb
│ ├── Device.Net.LibUsb.xml
│ ├── ExtensionMethods.cs
│ ├── ReadEndpoint.cs
│ ├── WriteEndpoint.cs
│ └── Device.Net.LibUsb.csproj
├── SerialPort.Net
│ ├── Parity.cs
│ ├── StopBits.cs
│ └── GlobalSuppressions.cs
├── Usb.Net
│ ├── IUsbDevice.cs
│ ├── Delegates.cs
│ ├── IUsbInterfaceEndpoint.cs
│ ├── Windows
│ │ ├── WinUsbApiCalls.POLICY_TYPE.cs
│ │ ├── WINUSB_PIPE_INFORMATION.cs
│ │ ├── WindowsUsbExtensions.cs
│ │ ├── WinUsbApiCalls.USBD_PIPE_TYPE.cs
│ │ ├── WinUsbApiCalls.USB_DEVICE_SPEED.cs
│ │ ├── USB_DEVICE_DESCRIPTOR.cs
│ │ ├── WindowsUsbInterfaceEndpoint.cs
│ │ ├── USB_CONFIGURATION_DESCRIPTOR.cs
│ │ └── USB_INTERFACE_DESCRIPTOR.cs
│ ├── ControlTransferException.cs
│ ├── GlobalSuppressions.cs
│ ├── WINUSB_SETUP_PACKET.cs
│ ├── UsbDeviceExtensions.cs
│ ├── RequestDirection.cs
│ ├── Usb.Net.csproj
│ ├── RequestType.cs
│ ├── UsbDeviceRequestType.cs
│ └── SetupPacket.cs
├── Usb.Net.Android
│ ├── IUsbPermissionBroadcastReceiver.cs
│ ├── AndroidFactory.cs
│ ├── IAndroidFactory.cs
│ ├── packages.config
│ └── Properties
│ │ └── AssemblyInfo.cs
├── Device.Net.UnitTests
│ ├── MockClasses
│ │ ├── MockUsbDevice.cs
│ │ └── MockHidDevice.cs
│ └── TrezorResponseByteBuffer.cs
├── Directory.Build.props
└── Usb.Net.Android.Standard
│ └── Usb.Net.Android.Standard.csproj
├── Build
└── Icon.png
├── Images
└── WindowsSample.png
├── docfx_project
├── api
│ ├── .gitignore
│ └── index.md
├── images
│ ├── Diagram.png
│ └── WindowsSample.png
├── filterconfig.yml
├── .gitignore
├── toc.yml
└── articles
│ ├── NuGet.md
│ └── toc.yml
├── Build.bat
├── .github
├── workflows
│ └── dotnet-core.yml
└── ISSUE_TEMPLATE
│ └── issue-report.md
├── Diagram.xml
├── .gitignore
├── LICENSE
├── azure-pipelines.yml
└── CONTRIBUTING.md
/docs/styles/main.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: MelbourneDeveloper
2 |
--------------------------------------------------------------------------------
/Diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/Diagram.png
--------------------------------------------------------------------------------
/src/Flutter/flutnet_thermometer_bridge/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/Build/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/Build/Icon.png
--------------------------------------------------------------------------------
/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/docs/favicon.ico
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/LICENSE:
--------------------------------------------------------------------------------
1 | TODO: Add your license here.
2 |
--------------------------------------------------------------------------------
/docs/images/Diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/docs/images/Diagram.png
--------------------------------------------------------------------------------
/Images/WindowsSample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/Images/WindowsSample.png
--------------------------------------------------------------------------------
/docfx_project/api/.gitignore:
--------------------------------------------------------------------------------
1 | ###############
2 | # temp file #
3 | ###############
4 | *.yml
5 | .manifest
6 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/app.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/app.jpg
--------------------------------------------------------------------------------
/docs/images/WindowsSample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/docs/images/WindowsSample.png
--------------------------------------------------------------------------------
/src/Device.Net/Device.Net.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net/Device.Net.pfx
--------------------------------------------------------------------------------
/docfx_project/images/Diagram.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/docfx_project/images/Diagram.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf/Program.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Device.Net.UnoSample.Skia.Gtk
3 | {
4 | }
5 |
--------------------------------------------------------------------------------
/src/Hid.Net/Delegates.cs:
--------------------------------------------------------------------------------
1 | namespace Hid.Net
2 | {
3 | public delegate Report WriteReportTransform(byte[] data);
4 | }
5 |
--------------------------------------------------------------------------------
/docfx_project/images/WindowsSample.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/docfx_project/images/WindowsSample.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 |
--------------------------------------------------------------------------------
/src/Flutter/flutnet_thermometer_bridge/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.ModuleInterop.Android/Transforms/EnumFields.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.ModuleInterop.Android/Transforms/EnumMethods.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/docs/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/docs/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/docs/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/docs/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.UWP.Sample/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/docfx_project/filterconfig.yml:
--------------------------------------------------------------------------------
1 | apiRules:
2 | - exclude:
3 | uidRegex: ^Device\.Net\.LoggingExtensions$
4 | type: Type
5 |
--------------------------------------------------------------------------------
/docs/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/docs/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/docs/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/docs/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UWPUnitTests/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/src/Device.Net.Reactive/IRequest.cs:
--------------------------------------------------------------------------------
1 | namespace Device.Net
2 | {
3 | public interface IRequest
4 | {
5 | byte[] ToArray();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/Content/IntentFilter.cs:
--------------------------------------------------------------------------------
1 | namespace Android.Content
2 | {
3 | public interface IntentFilter
4 | {
5 |
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.UWP.Sample/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/docs/styles/main.js:
--------------------------------------------------------------------------------
1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.
2 |
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.UWP.Sample/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Usb.Net.UWP.Sample_TemporaryKey.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.UWP.Sample/Usb.Net.UWP.Sample_TemporaryKey.pfx
--------------------------------------------------------------------------------
/docfx_project/.gitignore:
--------------------------------------------------------------------------------
1 | ###############
2 | # folder #
3 | ###############
4 | /**/DROP/
5 | /**/TEMP/
6 | /**/packages/
7 | /**/bin/
8 | /**/obj/
9 | _site
10 |
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UWPUnitTests/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.UWP.Sample/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.UWP.Sample/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.UWP.Sample/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UWPUnitTests/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/src/Device.Net/DeviceType.cs:
--------------------------------------------------------------------------------
1 | namespace Device.Net
2 | {
3 | public enum DeviceType
4 | {
5 | Hid,
6 | Usb,
7 | SerialPort
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UWPUnitTests/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UWPUnitTests/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UWPUnitTests/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/storelogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/storelogo.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Device.Net.UWPUnitTests_TemporaryKey.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UWPUnitTests/Device.Net.UWPUnitTests_TemporaryKey.pfx
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/storelogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/storelogo.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer/assets/flutnet_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/Flutter/flutnet_thermometer/assets/flutnet_logo.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer/assets/xamarin_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/Flutter/flutnet_thermometer/assets/xamarin_logo.png
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Assets/SplashScreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Assets/SplashScreen.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Device.Net.UWP/Device.Net.UWP.XML:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Device.Net.UWP
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2C3E50
4 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/xml/device_filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Resources/drawable/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Resources/drawable/Icon.png
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Resources/xml/device_filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Usb.Net.AndroidSample
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/src/Device.Net.LibUsb/Device.Net.LibUsb.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Device.Net.LibUsb
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/splashscreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/splashscreen.scale-200.png
--------------------------------------------------------------------------------
/src/SerialPort.Net/Parity.cs:
--------------------------------------------------------------------------------
1 | namespace SerialPort.Net
2 | {
3 | public enum Parity
4 | {
5 | None,
6 | Odd,
7 | Even,
8 | Mark,
9 | Space,
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/Content/Intent.cs:
--------------------------------------------------------------------------------
1 | namespace Android.Content
2 | {
3 | public interface Intent
4 | {
5 | bool GetBooleanExtra(string? name, bool defaultValue);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.AndroidSample/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Resources/drawable/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Resources/drawable/Icon.png
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/lockscreenlogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/lockscreenlogo.scale-200.png
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/square44x44logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/square44x44logo.scale-200.png
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/wide310x150logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/wide310x150logo.scale-200.png
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Usb.Net.UWP.Sample/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/docfx_project/api/index.md:
--------------------------------------------------------------------------------
1 | # API Documentation
2 |
3 | This contains reference documentation for Device.Net and all the associated libraries. See [Getting Started](../articles/GettingStarted.html) for a quick start guide.
--------------------------------------------------------------------------------
/docfx_project/toc.yml:
--------------------------------------------------------------------------------
1 | - name: Articles
2 | href: articles/
3 | - name: Api Documentation
4 | href: api/
5 | homepage: api/index.md
6 | - name: Sponsor
7 | href: https://github.com/sponsors/MelbourneDeveloper
8 |
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/splashscreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/splashscreen.scale-200.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/drawable/launch_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/drawable/launch_image.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2C3E50
4 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Assets/Fonts/uno-fluentui-assets.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Assets/Fonts/uno-fluentui-assets.ttf
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/square150x150logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Assets/square150x150logo.scale-200.png
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/UnoCrossPlatform.UWP_TemporaryKey.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/UnoCrossPlatform.UWP_TemporaryKey.pfx
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.MacOSLibUsbSample/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UWPUnitTests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/lockscreenlogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/lockscreenlogo.scale-200.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/square44x44logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/square44x44logo.scale-200.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/wide310x150logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/wide310x150logo.scale-200.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FlutnetThermometer
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.ModuleInterop.Android/Transforms/Metadata.xml:
--------------------------------------------------------------------------------
1 |
2 | Flutnet.Interop.Plugins
3 |
4 |
--------------------------------------------------------------------------------
/src/Device.Net.UWP/ConnectionInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Device.Net.UWP
2 | {
3 | public class ConnectionInfo
4 | {
5 | public bool CanConnect { get; set; }
6 | public ushort? UsagePage { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Assets/Fonts/uno-fluentui-assets.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Assets/Fonts/uno-fluentui-assets.ttf
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/square150x150logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Assets/square150x150logo.scale-200.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Gtk/Assets/Fonts/uno-fluentui-assets.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Gtk/Assets/Fonts/uno-fluentui-assets.ttf
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Device.Net.UnoSample.Uwp_temporarykey.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/Device.Net.UnoSample.Uwp_temporarykey.pfx
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Resources/Fonts/uno-fluentui-assets.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Resources/Fonts/uno-fluentui-assets.ttf
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf.Host/Assets/Fonts/uno-fluentui-assets.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf.Host/Assets/Fonts/uno-fluentui-assets.ttf
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/unologo.imageset/unoplatform.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/unologo.imageset/unoplatform.jpg
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512.png
--------------------------------------------------------------------------------
/src/Hid.Net/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 |
2 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "", Scope = "member", Target = "~P:Hid.Net.Report.TransferResult")]
3 |
4 |
--------------------------------------------------------------------------------
/src/Hid.Net/Properties.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.Runtime.CompilerServices;
3 |
4 | [assembly: InternalsVisibleTo("Device.Net.UnitTests")]
5 | [assembly: InternalsVisibleTo("Device.Net.UWPUnitTests")]
6 | [assembly: InternalsVisibleTo("Hid.Net.UWP")]
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-128@2x.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-16@2x.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-256@2x.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-32@2x.png
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andyvorld/Device.Net/main/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png
--------------------------------------------------------------------------------
/src/Usb.Net/IUsbDevice.cs:
--------------------------------------------------------------------------------
1 | using Device.Net;
2 |
3 | namespace Usb.Net
4 | {
5 | ///
6 | public interface IUsbDevice : IDevice
7 | {
8 | IUsbInterfaceManager UsbInterfaceManager { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf.Host/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | UnoCrossPlatform
5 |
6 |
--------------------------------------------------------------------------------
/src/SerialPort.Net/StopBits.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SerialPort.Net
4 | {
5 | //Is flags correct here?
6 | [Flags]
7 | public enum StopBits
8 | {
9 | None,
10 | One,
11 | Two,
12 | OnePointFive,
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | Device.Net.UnoSample
5 |
6 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/App/BroadcastReceiver.cs:
--------------------------------------------------------------------------------
1 | using Android.Content;
2 |
3 | namespace Android.App
4 | {
5 | public abstract class BroadcastReceiver
6 | {
7 | public abstract void OnReceive(Context? context, Intent? intent);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2c3e50
4 | #1B3147
5 | #3498db
6 |
7 |
--------------------------------------------------------------------------------
/src/Device.Net/DeviceEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Device.Net
4 | {
5 | public class DeviceEventArgs : EventArgs
6 | {
7 | public IDevice Device { get; }
8 |
9 | public DeviceEventArgs(IDevice device) => Device = device;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/xml/device_filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf.Host/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2c3e50
4 | #1B3147
5 | #3498db
6 |
7 |
--------------------------------------------------------------------------------
/src/Device.Net/Logging/LoggerFactoryExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.Extensions.Logging.Abstractions
2 | {
3 | public static class LoggerFactoryExtensions
4 | {
5 | public static ILogger CreateLogger(this ILoggerFactory loggerFactory) => new NullLogger(loggerFactory);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/UnitTestApp.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Flutter/flutnet_thermometer_bridge/lib/exceptions.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 |
5 |
6 | export 'flutnet/service_model/platform_operation_exception.dart';
7 | export 'flutnet/data/flutnet_exception.dart';
8 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android/IUsbPermissionBroadcastReceiver.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Usb.Net.Android
4 | {
5 | public interface IUsbPermissionBroadcastReceiver
6 | {
7 | bool? IsPermissionGranted { get; }
8 | event EventHandler Received;
9 | void Register();
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Usb.Net/Delegates.cs:
--------------------------------------------------------------------------------
1 | using Device.Net;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Usb.Net
6 | {
7 | public delegate Task PerformControlTransferAsync(SetupPacket setupPacket, byte[] buffer, CancellationToken cancellationToken = default);
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/src/Usb.Net/IUsbInterfaceEndpoint.cs:
--------------------------------------------------------------------------------
1 | namespace Usb.Net
2 | {
3 | public interface IUsbInterfaceEndpoint
4 | {
5 | bool IsRead { get; }
6 | bool IsWrite { get; }
7 | bool IsInterrupt { get; }
8 | byte PipeId { get; }
9 | ushort MaxPacketSize { get; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Shared/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Main.cs:
--------------------------------------------------------------------------------
1 | using AppKit;
2 |
3 | namespace Device.Net.MacOSLibUsbSample
4 | {
5 | static class MainClass
6 | {
7 | static void Main(string[] args)
8 | {
9 | NSApplication.Init();
10 | NSApplication.Main(args);
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Device.Net/LoggingExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Device.Net
4 | {
5 | internal static class LoggingExtensions
6 | {
7 | public static void LogDataTransfer(this ILogger logger, Trace trace)
8 | => logger?.LogDebug("{trace}", trace);
9 | }
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/exceptions.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 |
5 |
6 | export 'flutnet/service_model/platform_operation_exception.dart';
7 | export 'flutnet/data/flutnet_exception.dart';
8 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/Hardware/Usb/UsbRequest.cs:
--------------------------------------------------------------------------------
1 | using Java.Nio;
2 |
3 | namespace Android.Hardware.Usb
4 | {
5 | public interface UsbRequest
6 | {
7 | bool Initialize(UsbDeviceConnection? connection, UsbEndpoint? endpoint);
8 | bool Queue(ByteBuffer? buffer, int length);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/Content/Context.cs:
--------------------------------------------------------------------------------
1 |
2 | using Android.App;
3 |
4 | namespace Android.Content
5 | {
6 | public interface Context
7 | {
8 | Intent? RegisterReceiver(BroadcastReceiver? receiver, IntentFilter? filter);
9 | void UnregisterReceiver(BroadcastReceiver? receiver);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Main.cs:
--------------------------------------------------------------------------------
1 | using AppKit;
2 |
3 | namespace Device.Net.UnoSample.macOS
4 | {
5 | static class MainClass
6 | {
7 | static void Main(string[] args)
8 | {
9 | NSApplication.Init();
10 | NSApplication.SharedApplication.Delegate = new App();
11 | NSApplication.Main(args);
12 | }
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/src/Device.Net/Windows/FileAccessRights.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Device.Net.Windows
4 | {
5 | [Flags]
6 | #pragma warning disable CA1028
7 | public enum FileAccessRights : uint
8 | #pragma warning restore CA1028
9 | {
10 | None = 0,
11 | GenericRead = 2147483648,
12 | GenericWrite = 1073741824
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Device.Net/Logging/NullLoggerFactory.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.Extensions.Logging.Abstractions
2 | {
3 | public class NullLoggerFactory : ILoggerFactory
4 | {
5 | public static NullLoggerFactory Instance { get; } = new NullLoggerFactory();
6 |
7 | public ILogger CreateLogger(string name) => NullLogger.Instance;
8 | }
9 | }
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Usb.Net.Android.Fakes.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | false
6 | false
7 | Full
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/Device.Net/UnsubscribeDisposable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Device.Net
4 | {
5 | public class UnsubscribeDisposable : IDisposable
6 | {
7 | private readonly Action _unsubscribe;
8 |
9 | public UnsubscribeDisposable(Action unsubscribe) => _unsubscribe = unsubscribe;
10 |
11 | public void Dispose() => _unsubscribe();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Flutter/flutnet_thermometer_bridge/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: fba99f6cf9a14512e461e3122c8ddfaa25394e89
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/src/Device.Net/Logging/ILoggerFactory.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2 |
3 | namespace Microsoft.Extensions.Logging
4 | {
5 | public interface ILoggerFactory
6 | {
7 | ILogger CreateLogger(string name);
8 | }
9 | }
10 |
11 | #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
12 |
--------------------------------------------------------------------------------
/src/Device.Net/Logging/DummyDisposable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Device.Net
4 | {
5 | internal class DummyDisposable : IDisposable
6 | {
7 | #pragma warning disable CA1816 // Dispose methods should call SuppressFinalize
8 | public void Dispose()
9 | #pragma warning restore CA1816 // Dispose methods should call SuppressFinalize
10 | {
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: fba99f6cf9a14512e461e3122c8ddfaa25394e89
8 | channel: stable
9 |
10 | project_type: module
11 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.ServiceLibrary/TemperatureChangedArgs.cs:
--------------------------------------------------------------------------------
1 | using Flutnet.ServiceModel;
2 | using System;
3 |
4 | namespace FlutnetThermometer.ServiceLibrary
5 | {
6 | [PlatformData]
7 | public class TemperatureChangedArgs : EventArgs
8 | {
9 | public double Celsius { get; set; }
10 |
11 | public double Fahrenheit { get; set; }
12 | }
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/Hardware/Usb/UsbEndpoint.cs:
--------------------------------------------------------------------------------
1 | namespace Android.Hardware.Usb
2 | {
3 | public interface UsbEndpoint
4 | {
5 | int EndpointNumber { get; }
6 | int MaxPacketSize { get; set; }
7 | UsbAddressing Address { get; }
8 | int Attributes { get; }
9 | UsbAddressing Direction { get; }
10 | UsbAddressing Type { get; }
11 | }
12 | }
--------------------------------------------------------------------------------
/docfx_project/articles/NuGet.md:
--------------------------------------------------------------------------------
1 | For Hid Devices:
2 |
3 | **Install-Package Hid.Net**
4 |
5 | For Usb Devices on Android, Windows, or UWP:
6 |
7 | **Install-Package Usb.Net**
8 |
9 | For Usb Devices on Linux or MacOS
10 |
11 | **Install-Package Device.Net.LibUsb**
12 |
13 | Device.Net only provides the base interface. This would allow you to create a provider for a new device type like Bluetooth for example.
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: fba99f6cf9a14512e461e3122c8ddfaa25394e89
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer/README.md:
--------------------------------------------------------------------------------
1 | # flutnet_thermometer
2 |
3 | A new flutter module project.
4 |
5 | ## Getting Started
6 |
7 | For help getting started with Flutter, view our online
8 | [documentation](https://flutter.dev/).
9 |
10 | For instructions integrating Flutter modules to your existing applications,
11 | see the [add-to-app documentation](https://flutter.dev/docs/development/add-to-app).
12 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/Hardware/Usb/UsbDevice.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Android.Hardware.Usb
4 | {
5 | public interface UsbDevice : IDisposable
6 | {
7 | int DeviceId { get; }
8 | string DeviceName { get; }
9 | int InterfaceCount { get; }
10 | int ProductId { get; }
11 | int VendorId { get; }
12 | UsbInterface GetInterface(int interfaceNumber);
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Flutter/flutnet_thermometer_bridge/lib/index.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 |
5 | library flutnet_thermometer_bridge;
6 |
7 | export 'flutnet_thermometer/service_library/temperature_changed_args.dart';
8 | export 'flutnet/data/flutnet_error_code.dart';
9 | export 'flutnet_thermometer/service_library/thermometer_service.dart';
10 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/src/Device.Net.Reactive/Device.Net.Reactive.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | false
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/App/PendingIntent.cs:
--------------------------------------------------------------------------------
1 | using Android.Content;
2 |
3 | namespace Android.App
4 | {
5 | public interface PendingIntent
6 | {
7 | #pragma warning disable IDE0060 // Remove unused parameter
8 | public static PendingIntent? GetBroadcast(Context? context, int requestCode, Intent? intent, PendingIntentFlags flags) => default;
9 | #pragma warning restore IDE0060 // Remove unused parameter
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android/AndroidFactory.cs:
--------------------------------------------------------------------------------
1 | using Android.Content;
2 | using Android.Hardware.Usb;
3 |
4 | namespace Usb.Net.Android
5 | {
6 | public class AndroidFactory : IAndroidFactory
7 | {
8 | public Intent CreateIntent(string action) => new Intent(action);
9 | public IntentFilter CreateIntentFilter(string action) => new IntentFilter(action);
10 | public UsbRequest CreateUsbRequest() => new UsbRequest();
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Usb.Net/Windows/WinUsbApiCalls.POLICY_TYPE.cs:
--------------------------------------------------------------------------------
1 | // ReSharper disable UnusedMember.Global
2 | // ReSharper disable InconsistentNaming
3 | namespace Usb.Net.Windows
4 | {
5 | internal enum POLICY_TYPE
6 | {
7 | SHORT_PACKET_TERMINATE = 1,
8 | AUTO_CLEAR_STALL,
9 | PIPE_TRANSFER_TIMEOUT,
10 | IGNORE_SHORT_PACKETS,
11 | ALLOW_PARTIAL_READS,
12 | AUTO_FLUSH,
13 | RAW_IO
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/index.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 |
5 | library flutnet_thermometer_bridge;
6 |
7 | export 'flutnet_thermometer/service_library/temperature_changed_args.dart';
8 | export 'flutnet/data/flutnet_error_code.dart';
9 | export 'flutnet_thermometer/service_library/thermometer_service.dart';
10 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/Hardware/Usb/UsbInterface.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Android.Hardware.Usb
4 | {
5 | public interface UsbInterface : IDisposable
6 | {
7 | int Id { get; }
8 | int EndpointCount { get; }
9 | UsbClass InterfaceClass { get; }
10 | UsbClass InterfaceSubclass { get; }
11 | string Name { get; }
12 | UsbEndpoint GetEndpoint(int endpointNumber);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Device.Net/Windows/SpDeviceInterfaceDetailData.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | // ReSharper disable FieldCanBeMadeReadOnly.Global
3 |
4 | namespace Device.Net.Windows
5 | {
6 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
7 | internal struct SpDeviceInterfaceDetailData
8 | {
9 | public int CbSize;
10 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
11 | public string DevicePath;
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Resources/values/Styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Resources/values/Styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
--------------------------------------------------------------------------------
/src/Device.Net/Logging/ILoggerProvider.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2 |
3 |
4 | namespace Device.Net.Logging
5 | {
6 | #pragma warning disable CA1040 // Avoid empty interfaces
7 | public interface ILoggerProvider
8 | #pragma warning restore CA1040 // Avoid empty interfaces
9 | {
10 | }
11 | }
12 |
13 |
14 | #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
15 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Flutter",
9 | "request": "launch",
10 | "type": "dart"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf.Host/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace Device.Net.UnoSample.WPF.Host
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Device.Net/Exceptions/AsyncException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Device.Net.Exceptions
4 | {
5 | public class AsyncException : Exception
6 | {
7 | public AsyncException(string message) : base(message)
8 | {
9 | }
10 |
11 | public AsyncException()
12 | {
13 | }
14 |
15 | public AsyncException(string message, Exception innerException) : base(message, innerException)
16 | {
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Views;
3 | using Windows.UI.Xaml;
4 |
5 | namespace Device.Net.UnoSample.Droid
6 | {
7 | [Activity(
8 | MainLauncher = true,
9 | ConfigurationChanges = Uno.UI.ActivityHelper.AllConfigChanges,
10 | WindowSoftInputMode = SoftInput.AdjustPan | SoftInput.StateHidden
11 | )]
12 | public class MainActivity : ApplicationActivity
13 | {
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/src/Device.Net/Exceptions/DeviceException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Device.Net.Exceptions
4 | {
5 | public class DeviceException : Exception
6 | {
7 | public DeviceException(string message) : base(message)
8 | {
9 | }
10 |
11 | public DeviceException()
12 | {
13 | }
14 |
15 | public DeviceException(string message, Exception innerException) : base(message, innerException)
16 | {
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Device.Net/Windows/SpDeviceInfoData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 | // ReSharper disable MemberCanBePrivate.Global
4 | // ReSharper disable FieldCanBeMadeReadOnly.Global
5 |
6 | namespace Device.Net.Windows
7 | {
8 | [StructLayout(LayoutKind.Sequential)]
9 | internal struct SpDeviceInfoData
10 | {
11 | public uint CbSize;
12 | public Guid ClassGuid;
13 | public uint DevInst;
14 | public IntPtr Reserved;
15 | }
16 | }
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Views;
3 |
4 | namespace UnoCrossPlatform.Droid
5 | {
6 | [Activity(
7 | MainLauncher = true,
8 | ConfigurationChanges = Uno.UI.ActivityHelper.AllConfigChanges,
9 | WindowSoftInputMode = SoftInput.AdjustPan | SoftInput.StateHidden
10 | )]
11 | public class MainActivity : Windows.UI.Xaml.ApplicationActivity
12 | {
13 | }
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf.Host/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/SerialPort.Net/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 |
2 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA1816:Dispose methods should call SuppressFinalize", Justification = "", Scope = "member", Target = "~M:SerialPort.Net.Windows.WindowsSerialPortDevice.Dispose")]
3 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1063:Implement IDisposable Correctly", Justification = "", Scope = "member", Target = "~M:SerialPort.Net.Windows.WindowsSerialPortDevice.Dispose")]
4 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 |
6 | using System.Diagnostics.CodeAnalysis;
7 |
8 | [assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "", Scope = "type", Target = "~T:Android.Hardware.Usb.UsbRequest")]
9 |
--------------------------------------------------------------------------------
/src/Usb.Net/ControlTransferException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Usb.Net
4 | {
5 | public class ControlTransferException : Exception
6 | {
7 | public ControlTransferException(string message) : base(message)
8 | {
9 | }
10 |
11 | public ControlTransferException(string message, Exception innerException) : base(message, innerException)
12 | {
13 | }
14 |
15 | public ControlTransferException()
16 | {
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/Hardware/Usb/UsbManager.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 | using Android.App;
4 | using System.Collections.Generic;
5 |
6 | namespace Android.Hardware.Usb
7 | {
8 | public interface UsbManager
9 | {
10 | public const string ExtraPermissionGranted = "permission";
11 | IDictionary? DeviceList { get; }
12 | UsbDeviceConnection OpenDevice(UsbDevice usbDevice);
13 | void RequestPermission(UsbDevice? device, PendingIntent? pi);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/DontDeleteMe.xaml.cs:
--------------------------------------------------------------------------------
1 | using Windows.UI.Xaml.Controls;
2 |
3 | // The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
4 |
5 | namespace UnoCrossPlatform
6 | {
7 | ///
8 | /// An empty page that can be used on its own or navigated to within a Frame.
9 | ///
10 | public sealed partial class DontDeleteMe : Page
11 | {
12 | public DontDeleteMe() => InitializeComponent();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Java/Nio/Buffer.cs:
--------------------------------------------------------------------------------
1 | namespace Java.Nio
2 | {
3 | //
4 | // Summary:
5 | // A buffer is a list of elements of a specific primitive type.
6 | //
7 | // Remarks:
8 | // Android platform documentation
9 | // Portions of this page are modifications based on work created and shared by the
10 | // Android Open Source Project and used according to terms described in the Creative
11 | // Commons 2.5 Attribution License.
12 | public interface Buffer
13 | {
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/Device.Net.Reactive/Delegates.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading.Tasks;
4 |
5 | namespace Device.Net
6 | {
7 | public delegate void DevicesNotify(IReadOnlyCollection connectedDevices);
8 | public delegate void DeviceNotify(ConnectedDeviceDefinition connectedDevice);
9 | public delegate void NotifyDeviceException(ConnectedDeviceDefinition connectedDevice, Exception exception);
10 | public delegate Task> GetConnectedDevicesAsync();
11 | }
12 |
--------------------------------------------------------------------------------
/src/Device.Net/Delegates.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 |
6 | namespace Device.Net
7 | {
8 | public delegate Task> GetConnectedDeviceDefinitionsAsync(CancellationToken cancellationToken = default);
9 | public delegate ConnectedDeviceDefinition GetDeviceDefinition(string deviceId, Guid classGuid);
10 | public delegate Task GetDeviceAsync(ConnectedDeviceDefinition deviceId, CancellationToken cancellationToken = default);
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/Build.bat:
--------------------------------------------------------------------------------
1 | git clean -x -f -d
2 |
3 | "c:\temp\nuget" restore src/Device.Net.Pipelines.sln
4 |
5 | dotnet test src/Device.Net.UnitTests/Device.Net.UnitTests.csproj --filter TestCategory!=NotPipelineReady
6 |
7 | msbuild src/Device.Net.Pipelines.sln /property:Configuration=Release
8 |
9 | "c:\temp\nuget" pack Build/NuSpecs/Device.Net.nuspec
10 | "c:\temp\nuget" pack Build/NuSpecs/Device.Net.LibUsb.nuspec
11 | "c:\temp\nuget" pack Build/NuSpecs/Hid.Net.nuspec
12 | "c:\temp\nuget" pack Build/NuSpecs/SerialPort.Net.nuspec
13 | "c:\temp\nuget" pack Build/NuSpecs/Usb.Net.nuspec
14 |
15 |
--------------------------------------------------------------------------------
/src/Device.Net.Reactive/IDeviceManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Device.Net
5 | {
6 | ///
7 | /// This interface is a work in progress. It is not production ready.
8 | ///
9 | public interface IDeviceManager
10 | {
11 | void QueueRequest(IRequest request);
12 |
13 | Task WriteAndReadAsync(IRequest request, Func convertFunc);
14 |
15 | void SelectDevice(ConnectedDeviceDefinition connectedDevice);
16 |
17 | void Start();
18 | }
19 | }
--------------------------------------------------------------------------------
/.github/workflows/dotnet-core.yml:
--------------------------------------------------------------------------------
1 | name: .NET Core
2 |
3 | on:
4 | push:
5 | branches: [ Releases/4.0.0/master ]
6 | pull_request:
7 | branches: [ Releases/4.0.0/master ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v2
16 | - name: Setup .NET Core
17 | uses: actions/setup-dotnet@v1
18 | with:
19 | dotnet-version: 3.1.301
20 | - name: Install dependencies
21 | run: dotnet restore
22 | - name: Build
23 | run: dotnet build --configuration Release --no-restore
24 |
25 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/DontDeleteMe.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/Usb.Net/Windows/WINUSB_PIPE_INFORMATION.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | // ReSharper disable MemberCanBePrivate.Global
3 | // ReSharper disable FieldCanBeMadeReadOnly.Global
4 |
5 | #pragma warning disable CA1707 // Identifiers should not contain underscores
6 |
7 | namespace Usb.Net.Windows
8 | {
9 | [StructLayout(LayoutKind.Sequential)]
10 | internal struct WINUSB_PIPE_INFORMATION
11 | {
12 | public USBD_PIPE_TYPE PipeType;
13 | public byte PipeId;
14 | public ushort MaximumPacketSize;
15 | public byte Interval;
16 | }
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet/data/flutnet_error_code.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 |
5 | enum FlutnetErrorCode {
6 | OperationNotImplemented,
7 | OperationArgumentCountMismatch,
8 | InvalidOperationArguments,
9 | OperationArgumentParsingError,
10 | OperationFailed,
11 | OperationCanceled,
12 | EnvironmentNotInitialized,
13 | AppKeyErrorBadFormat,
14 | AppKeyErrorApplicationIdMismatch,
15 | AppKeyErrorUnsupportedLibraryVersion,
16 | TrialCallsExceeded,
17 | }
18 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf.Host/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/Flutter/flutnet_thermometer_bridge/README.md:
--------------------------------------------------------------------------------
1 | # flutnet_thermometer_bridge
2 |
3 | Auto-generated Flutter package that acts as a proxy between Dart code and native (Xamarin) code.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Device.Net.LibUsb/ExtensionMethods.cs:
--------------------------------------------------------------------------------
1 | using LibUsbDotNet.Main;
2 | using System;
3 |
4 | namespace Device.Net.LibUsb
5 | {
6 | public static class ExtensionMethods
7 | {
8 | public static ConnectedDeviceDefinition ToConnectedDevice(this UsbRegistry usbRegistry)
9 | => usbRegistry == null ? throw new ArgumentNullException(nameof(usbRegistry)) :
10 | new ConnectedDeviceDefinition(
11 | usbRegistry.DevicePath,
12 | vendorId: (uint)usbRegistry.Vid,
13 | productId: (uint)usbRegistry.Pid,
14 | deviceType: DeviceType.Usb);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Flutter/flutnet_thermometer_bridge/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutnet_thermometer_bridge
2 | description: Auto-generated Flutter package that acts as a proxy between Dart code and native (Xamarin) code.
3 | version: 0.0.1
4 | author:
5 | homepage:
6 | environment:
7 | sdk: ">=2.6.0 <3.0.0"
8 | flutter: ">=1.17.0 <2.0.0"
9 | dependencies:
10 | flutter:
11 | sdk: flutter
12 | json_annotation: ^3.0.1
13 | intl: ^0.15.7
14 | web_socket_channel: ^1.1.0
15 | synchronized: ^2.2.0+2
16 | dev_dependencies:
17 | flutter_test:
18 | sdk: flutter
19 | build_runner: ^1.10.0
20 | json_serializable: ^3.3.0
21 | flutter:
22 | ...
23 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | -
9 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Shared/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Device.Net/IDeviceListener.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Device.Net
6 | {
7 | public interface IDeviceListener : IDisposable
8 | {
9 | event EventHandler DeviceDisconnected;
10 | event EventHandler DeviceInitialized;
11 |
12 | Task CheckForDevicesAsync(CancellationToken cancellationToken = default);
13 | void Start();
14 | #pragma warning disable CA1716 // Identifiers should not match keywords
15 | void Stop();
16 | #pragma warning restore CA1716 // Identifiers should not match keywords
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/README.md:
--------------------------------------------------------------------------------
1 | # flutnet_thermometer_bridge
2 |
3 | Auto-generated Flutter package that acts as a proxy between Dart code and native (Xamarin) code.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Dart
8 | [package](https://flutter.dev/developing-packages/),
9 | a library module containing code that can be shared easily across
10 | multiple Flutter or Dart projects.
11 |
12 | For help getting started with Flutter, view our
13 | [online documentation](https://flutter.dev/docs), which offers tutorials,
14 | samples, guidance on mobile development, and a full API reference.
15 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android/IAndroidFactory.cs:
--------------------------------------------------------------------------------
1 | using Android.Content;
2 | using Android.Hardware.Usb;
3 |
4 | namespace Usb.Net.Android
5 | {
6 | #pragma warning disable CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
7 | public interface IAndroidFactory
8 | {
9 | UsbRequest CreateUsbRequest();
10 | IntentFilter CreateIntentFilter(string? action);
11 | Intent CreateIntent(string? action);
12 | }
13 | #pragma warning restore CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
14 | }
--------------------------------------------------------------------------------
/src/Device.Net/Exceptions/ApiException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace Device.Net.Exceptions
5 | {
6 | public class ApiException : Exception
7 | {
8 | public ApiException()
9 | {
10 | }
11 |
12 | public ApiException(string message) : base(message)
13 | {
14 | }
15 |
16 | public ApiException(string message, Exception innerException) : base(message, innerException)
17 | {
18 | }
19 |
20 | protected ApiException(SerializationInfo info, StreamingContext context) : base(info, context)
21 | {
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Device.Net/Properties.cs:
--------------------------------------------------------------------------------
1 |
2 | using System.Runtime.CompilerServices;
3 | [assembly: InternalsVisibleTo("Device.Net.LibUsb")]
4 | [assembly: InternalsVisibleTo("Device.Net.UWP")]
5 | [assembly: InternalsVisibleTo("Device.Net.UnitTests")]
6 | [assembly: InternalsVisibleTo("Device.Net.UWPUnitTests")]
7 | [assembly: InternalsVisibleTo("SerialPort.Net")]
8 | [assembly: InternalsVisibleTo("Usb.Net")]
9 | [assembly: InternalsVisibleTo("Hid.Net")]
10 | [assembly: InternalsVisibleTo("Hid.Net.UWP")]
11 | [assembly: InternalsVisibleTo("Usb.Net.UWP")]
12 | [assembly: InternalsVisibleTo("Usb.Net.Android.Standard")]
13 | [assembly: InternalsVisibleTo("Usb.Net.Android")]
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutnet_thermometer_bridge
2 | description: Auto-generated Flutter package that acts as a proxy between Dart code and native (Xamarin) code.
3 | version: 0.0.1
4 | author:
5 | homepage:
6 | environment:
7 | sdk: ">=2.6.0 <3.0.0"
8 | flutter: ">=1.17.0 <2.0.0"
9 | dependencies:
10 | flutter:
11 | sdk: flutter
12 | json_annotation: ^3.0.1
13 | intl: ^0.15.7
14 | web_socket_channel: ^1.1.0
15 | synchronized: ^2.2.0+2
16 | dev_dependencies:
17 | flutter_test:
18 | sdk: flutter
19 | build_runner: ^1.10.0
20 | json_serializable: ^3.3.0
21 | flutter:
22 | ...
23 |
--------------------------------------------------------------------------------
/src/Device.Net.UnitTests/MockClasses/MockUsbDevice.cs:
--------------------------------------------------------------------------------
1 | //using Microsoft.Extensions.Logging;
2 |
3 | //namespace Device.Net.UnitTests
4 | //{
5 | // public class MockUsbDevice : MockDeviceBase
6 | // {
7 | // public const uint ProductId = 2;
8 | // public const uint VendorId = 2;
9 | // public const string MockedDeviceId = "321";
10 |
11 | // public MockUsbDevice(string deviceId, ILogger logger) : base(deviceId, logger)
12 | // {
13 | // ConnectedDeviceDefinition = new ConnectedDeviceDefinition(DeviceId) { ProductId = ProductId, VendorId = VendorId, DeviceType = DeviceType.Usb };
14 | // }
15 | // }
16 | //}
17 |
18 |
--------------------------------------------------------------------------------
/src/Device.Net/Windows/CommTimeouts.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | // ReSharper disable MemberCanBePrivate.Global
3 | // ReSharper disable FieldCanBeMadeReadOnly.Global
4 |
5 | #pragma warning disable CA1815 // Override equals and operator equals on value types
6 |
7 | namespace Device.Net.Windows
8 | {
9 | [StructLayout(LayoutKind.Sequential)]
10 | public struct CommTimeouts
11 | {
12 | public uint ReadIntervalTimeout;
13 | public uint ReadTotalTimeoutMultiplier;
14 | public uint ReadTotalTimeoutConstant;
15 | public uint WriteTotalTimeoutMultiplier;
16 | public uint WriteTotalTimeoutConstant;
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform/DispatchingExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Windows.UI.Core;
4 |
5 | #if NETFX_CORE
6 | using Windows.ApplicationModel.Core;
7 | #endif
8 |
9 | namespace UnoCrossPlatform
10 | {
11 | public static class DispatchingExtensions
12 | {
13 | public static async Task RunOnDispatcher(Action action) =>
14 | #if NETFX_CORE
15 | await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());
16 | #else
17 | await CoreDispatcher.Main.RunAsync(CoreDispatcherPriority.Normal, () => action());
18 | #endif
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using AppKit;
2 | using Foundation;
3 |
4 | namespace Device.Net.MacOSLibUsbSample
5 | {
6 | [Register("AppDelegate")]
7 | public class AppDelegate : NSApplicationDelegate
8 | {
9 | public AppDelegate()
10 | {
11 | }
12 |
13 | public override void DidFinishLaunching(NSNotification notification)
14 | {
15 | // Insert code here to initialize your application
16 | }
17 |
18 | public override void WillTerminate(NSNotification notification)
19 | {
20 | // Insert code here to tear down your application
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Device.Net/Windows/SpDeviceInterfaceData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 | // ReSharper disable MemberCanBePrivate.Global
4 | // ReSharper disable FieldCanBeMadeReadOnly.Global
5 |
6 | namespace Device.Net.Windows
7 | {
8 | [StructLayout(LayoutKind.Sequential)]
9 | #pragma warning disable CA1815 // Override equals and operator equals on value types
10 | internal struct SpDeviceInterfaceData
11 | #pragma warning restore CA1815 // Override equals and operator equals on value types
12 | {
13 | public uint CbSize;
14 | public Guid InterfaceClassGuid;
15 | public uint Flags;
16 | public IntPtr Reserved;
17 | }
18 | }
--------------------------------------------------------------------------------
/src/Usb.Net/Windows/WindowsUsbExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Usb.Net.Windows
4 | {
5 | public static class WindowsUsbExtensions
6 | {
7 | public static WINUSB_SETUP_PACKET ToWindowsSetupPacket(this SetupPacket setupPacket)
8 | => setupPacket == null ? throw new ArgumentNullException(nameof(setupPacket)) : new WINUSB_SETUP_PACKET
9 | {
10 | Index = setupPacket.Length,
11 | Length = setupPacket.Length,
12 | Request = setupPacket.Request,
13 | RequestType = setupPacket.RequestType.ToByte(),
14 | Value = setupPacket.Value
15 | };
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Shared/DispatchingExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Windows.UI.Core;
4 |
5 | #if WINDOWS_UWP
6 | using Windows.ApplicationModel.Core;
7 | #endif
8 |
9 | namespace Device.Net.UnoSample
10 | {
11 | public static class DispatchingExtensions
12 | {
13 | public static async Task RunOnDispatcher(Action action) =>
14 | #if WINDOWS_UWP
15 | await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());
16 | #else
17 | await CoreDispatcher.Main.RunAsync(CoreDispatcherPriority.Normal, () => action());
18 | #endif
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Device.Net/Exceptions/ValidationException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace Device.Net.Exceptions
5 | {
6 | public class ValidationException : Exception
7 | {
8 | public ValidationException()
9 | {
10 | }
11 |
12 | public ValidationException(string message) : base(message)
13 | {
14 | }
15 |
16 | public ValidationException(string message, Exception innerException) : base(message, innerException)
17 | {
18 | }
19 |
20 | protected ValidationException(SerializationInfo info, StreamingContext context) : base(info, context)
21 | {
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Usb.Net/Windows/WinUsbApiCalls.USBD_PIPE_TYPE.cs:
--------------------------------------------------------------------------------
1 | // ReSharper disable MemberCanBePrivate.Global
2 | // ReSharper disable FieldCanBeMadeReadOnly.Global
3 | // ReSharper disable UnusedMember.Global
4 | // ReSharper disable InconsistentNaming
5 | // ReSharper disable IdentifierTypo
6 |
7 | #pragma warning disable CA1707 // Identifiers should not contain underscores
8 |
9 | namespace Usb.Net.Windows
10 | {
11 | internal enum USBD_PIPE_TYPE
12 | {
13 | UsbdPipeTypeControl,
14 | UsbdPipeTypeIsochronous,
15 | UsbdPipeTypeBulk,
16 | UsbdPipeTypeInterrupt
17 | }
18 | }
19 |
20 | #pragma warning restore CA1707 // Identifiers should not contain underscores
21 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Gtk/Program.cs:
--------------------------------------------------------------------------------
1 | using GLib;
2 | using System;
3 | using Uno.UI.Runtime.Skia;
4 |
5 | namespace Device.Net.UnoSample.Skia.Gtk
6 | {
7 | class Program
8 | {
9 | static void Main(string[] args)
10 | {
11 | ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
12 | {
13 | Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
14 | expArgs.ExitApplication = true;
15 | };
16 |
17 | var host = new GtkHost(() => new App(), args);
18 |
19 | host.Run();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Android/Hardware/Usb/UsbDeviceConnection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 |
4 | namespace Android.Hardware.Usb
5 | {
6 | #pragma warning disable IDE1006 // Naming Styles
7 | public interface UsbDeviceConnection : IDisposable
8 | #pragma warning restore IDE1006 // Naming Styles
9 | {
10 | void Close();
11 | bool ClaimInterface(UsbInterface usbInterface, bool force);
12 | Task RequestWaitAsync();
13 | Task RequestWaitAsync(long timeout);
14 | int ControlTransfer(UsbAddressing requestType, int request, int value, int index, byte[]? buffer, int length, int timeout);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: flutnet_thermometer
2 | description: A new flutter module project.
3 | version: 1.0.0+1
4 | environment:
5 | sdk: ">=2.1.0 <3.0.0"
6 | dependencies:
7 | flutter:
8 | sdk: flutter
9 | cupertino_icons: ^0.1.3
10 | flutter_thermometer: ^1.0.0
11 | dev_dependencies:
12 | flutter_test:
13 | sdk: flutter
14 | flutnet_thermometer_bridge:
15 | path: ../flutnet_thermometer_bridge
16 | flutter:
17 | uses-material-design: true
18 | assets:
19 | - assets/
20 | module:
21 | androidX: true
22 | androidPackage: com.flutnet.flutnet_thermometer
23 | iosBundleIdentifier: com.flutnet.flutnetThermometer
24 | ...
25 |
--------------------------------------------------------------------------------
/src/Device.Net/Trace.cs:
--------------------------------------------------------------------------------
1 | // ReSharper disable MemberCanBePrivate.Global
2 | namespace Device.Net
3 | {
4 | public class Trace
5 | {
6 | public Trace(bool isWrite, TransferResult transferResult)
7 | {
8 | IsWrite = isWrite;
9 | TransferResult = transferResult;
10 | }
11 |
12 | #pragma warning disable CA1819 // Properties should not return arrays
13 | public TransferResult TransferResult { get; }
14 | #pragma warning restore CA1819 // Properties should not return arrays
15 | public bool IsWrite { get; }
16 |
17 | public override string ToString() => $"Physical {(IsWrite ? "Write" : "Read")} - {TransferResult}";
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | [assembly: AssemblyTitle("Device.Net.UWPUnitTests")]
5 | [assembly: AssemblyDescription("")]
6 | [assembly: AssemblyConfiguration("")]
7 | [assembly: AssemblyCompany("")]
8 | [assembly: AssemblyProduct("Device.Net.UWPUnitTests")]
9 | [assembly: AssemblyCopyright("Copyright © 2019")]
10 | [assembly: AssemblyTrademark("")]
11 | [assembly: AssemblyCulture("")]
12 | [assembly: AssemblyMetadata("TargetPlatform", "UAP")]
13 |
14 | // [assembly: AssemblyVersion("1.0.*")]
15 | [assembly: AssemblyVersion("1.0.0.0")]
16 | [assembly: AssemblyFileVersion("1.0.0.0")]
17 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/src/Device.Net/Exceptions/NotInitializedException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 |
4 | namespace Device.Net.Exceptions
5 | {
6 | public class NotInitializedException : Exception
7 | {
8 | public NotInitializedException()
9 | {
10 | }
11 |
12 | public NotInitializedException(string message) : base(message)
13 | {
14 | }
15 |
16 | public NotInitializedException(string message, Exception innerException) : base(message, innerException)
17 | {
18 | }
19 |
20 | protected NotInitializedException(SerializationInfo info, StreamingContext context) : base(info, context)
21 | {
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | Latest
5 | true
6 | true
7 | true
8 | true
9 | true
10 | latest
11 | true
12 | true
13 | 4.2.1
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | .idea/
8 | .vagrant/
9 | .sconsign.dblite
10 | .svn/
11 |
12 | *.swp
13 | profile
14 |
15 | DerivedData/
16 |
17 | .generated/
18 |
19 | *.pbxuser
20 | *.mode1v3
21 | *.mode2v3
22 | *.perspectivev3
23 |
24 | !default.pbxuser
25 | !default.mode1v3
26 | !default.mode2v3
27 | !default.perspectivev3
28 |
29 | xcuserdata
30 |
31 | *.moved-aside
32 |
33 | *.pyc
34 | *sync/
35 | Icon?
36 | .tags*
37 |
38 | build/
39 | .android/
40 | .ios/
41 | .flutter-plugins
42 | .flutter-plugins-dependencies
43 |
44 | # Symbolication related
45 | app.*.symbols
46 |
47 | # Obfuscation related
48 | app.*.map.json
49 |
--------------------------------------------------------------------------------
/src/Usb.Net/Windows/WinUsbApiCalls.USB_DEVICE_SPEED.cs:
--------------------------------------------------------------------------------
1 | // ReSharper disable MemberCanBePrivate.Global
2 | // ReSharper disable FieldCanBeMadeReadOnly.Global
3 | // ReSharper disable UnusedMember.Global
4 | // ReSharper disable InconsistentNaming
5 |
6 | #pragma warning disable CA1008 // Enums should have zero value
7 | #pragma warning disable CA1707 // Identifiers should not contain underscores
8 |
9 | namespace Usb.Net.Windows
10 | {
11 | internal enum USB_DEVICE_SPEED
12 | {
13 | UsbLowSpeed = 1,
14 | UsbFullSpeed,
15 | UsbHighSpeed
16 | }
17 | }
18 |
19 | #pragma warning restore CA1008 // Enums should have zero value
20 | #pragma warning restore CA1707 // Identifiers should not contain underscores
--------------------------------------------------------------------------------
/src/Device.Net/Logging/EventId.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable CA1815 // Override equals and operator equals on value types
2 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
3 |
4 | namespace Microsoft.Extensions.Logging
5 | {
6 | public readonly struct EventId
7 | {
8 | public EventId(int id, string name = null)
9 | {
10 | Id = id;
11 | Name = name;
12 | }
13 |
14 | public int Id { get; }
15 | public string Name { get; }
16 | }
17 | }
18 |
19 | #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
20 | #pragma warning restore CA1815 // Override equals and operator equals on value types
21 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
--------------------------------------------------------------------------------
/src/Usb.Net/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 |
2 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "", Scope = "member", Target = "~P:Usb.Net.UsbInterfaceBase.ReadBufferSize")]
3 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "", Scope = "member", Target = "~P:Usb.Net.UsbInterfaceBase.WriteBufferSize")]
4 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1065:Do not raise exceptions in unexpected locations", Justification = "", Scope = "member", Target = "~P:Usb.Net.Windows.WindowsUsbInterfaceEndpoint.MaxPacketSize")]
5 |
6 |
--------------------------------------------------------------------------------
/src/Device.Net.UnitTests/MockClasses/MockHidDevice.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Device.Net.UnitTests
4 | {
5 | public class MockHidDevice : MockDeviceBase
6 | {
7 | public const uint ProductId = 1;
8 | public const uint VendorId = 1;
9 | public const string MockedDeviceId = "123";
10 |
11 | public MockHidDevice(string deviceId, ILoggerFactory loggerFactory, ILogger logger) : base(deviceId, loggerFactory, logger) => ConnectedDeviceDefinition = new ConnectedDeviceDefinition
12 | (
13 | DeviceId,
14 | DeviceType.Hid,
15 | productId: ProductId,
16 | vendorId: VendorId
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/layout/content_main.axml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet/service_model/platform_operation_exception.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'platform_operation_exception.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | PlatformOperationException _$PlatformOperationExceptionFromJson(Map json) {
10 | return PlatformOperationException(
11 | message: json['Message'] as String,
12 | );
13 | }
14 |
15 | Map _$PlatformOperationExceptionToJson(
16 | PlatformOperationException instance) =>
17 | {
18 | 'Message': instance.message,
19 | };
20 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/cmd_thermometer_service_stop_monitoring.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'cmd_thermometer_service_stop_monitoring.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | CmdThermometerServiceStopMonitoring
10 | _$CmdThermometerServiceStopMonitoringFromJson(Map json) {
11 | return CmdThermometerServiceStopMonitoring();
12 | }
13 |
14 | Map _$CmdThermometerServiceStopMonitoringToJson(
15 | CmdThermometerServiceStopMonitoring instance) =>
16 | {};
17 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/res_thermometer_service_stop_monitoring.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'res_thermometer_service_stop_monitoring.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | ResThermometerServiceStopMonitoring
10 | _$ResThermometerServiceStopMonitoringFromJson(Map json) {
11 | return ResThermometerServiceStopMonitoring();
12 | }
13 |
14 | Map _$ResThermometerServiceStopMonitoringToJson(
15 | ResThermometerServiceStopMonitoring instance) =>
16 | {};
17 |
--------------------------------------------------------------------------------
/src/Hid.Net/Windows/HidAttributes.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | // ReSharper disable FieldCanBeMadeReadOnly.Global
3 | // ReSharper disable MemberCanBePrivate.Global
4 |
5 | namespace Hid.Net.Windows
6 | {
7 | [StructLayout(LayoutKind.Sequential)]
8 | #pragma warning disable CA1815 // Override equals and operator equals on value types
9 | internal struct HidAttributes
10 | #pragma warning restore CA1815 // Override equals and operator equals on value types
11 | {
12 | #pragma warning disable CA1051 // Do not declare visible instance fields
13 | public int Size;
14 | public short VendorId;
15 | public short ProductId;
16 | public short VersionNumber;
17 | #pragma warning restore CA1051 // Do not declare visible instance fields
18 | }
19 | }
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/cmd_thermometer_service_start_monitoring.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'cmd_thermometer_service_start_monitoring.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | CmdThermometerServiceStartMonitoring
10 | _$CmdThermometerServiceStartMonitoringFromJson(Map json) {
11 | return CmdThermometerServiceStartMonitoring();
12 | }
13 |
14 | Map _$CmdThermometerServiceStartMonitoringToJson(
15 | CmdThermometerServiceStartMonitoring instance) =>
16 | {};
17 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/res_thermometer_service_start_monitoring.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'res_thermometer_service_start_monitoring.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | ResThermometerServiceStartMonitoring
10 | _$ResThermometerServiceStartMonitoringFromJson(Map json) {
11 | return ResThermometerServiceStartMonitoring();
12 | }
13 |
14 | Map _$ResThermometerServiceStartMonitoringToJson(
15 | ResThermometerServiceStartMonitoring instance) =>
16 | {};
17 |
--------------------------------------------------------------------------------
/src/Device.Net.LibUsb/ReadEndpoint.cs:
--------------------------------------------------------------------------------
1 | using LibUsbDotNet;
2 | using Usb.Net;
3 |
4 | namespace Device.Net.LibUsb
5 | {
6 | public class ReadEndpoint : IUsbInterfaceEndpoint
7 | {
8 | public UsbEndpointReader UsbEndpointReader { get; }
9 |
10 | public ReadEndpoint(UsbEndpointReader usbEndpointReader, ushort? maxPacketSize)
11 | {
12 | UsbEndpointReader = usbEndpointReader;
13 |
14 | if (maxPacketSize.HasValue) MaxPacketSize = maxPacketSize.Value;
15 | }
16 |
17 | public bool IsRead => true;
18 |
19 | public bool IsWrite => false;
20 |
21 | public bool IsInterrupt => false;
22 |
23 | public byte PipeId => UsbEndpointReader.EpNum;
24 |
25 | public ushort MaxPacketSize { get; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Device.Net.LibUsb/WriteEndpoint.cs:
--------------------------------------------------------------------------------
1 | using LibUsbDotNet;
2 | using Usb.Net;
3 |
4 | namespace Device.Net.LibUsb
5 | {
6 | public class WriteEndpoint : IUsbInterfaceEndpoint
7 | {
8 | public UsbEndpointWriter UsbEndpointWriter { get; }
9 |
10 | public WriteEndpoint(UsbEndpointWriter usbEndpointWriter, ushort? maxPacketSize)
11 | {
12 | UsbEndpointWriter = usbEndpointWriter;
13 |
14 | if (maxPacketSize.HasValue) MaxPacketSize = maxPacketSize.Value;
15 | }
16 |
17 | public bool IsRead => false;
18 |
19 | public bool IsWrite => true;
20 |
21 | public bool IsInterrupt => false;
22 |
23 | public byte PipeId => UsbEndpointWriter.EpNum;
24 |
25 | public ushort MaxPacketSize { get; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Usb.Net/WINUSB_SETUP_PACKET.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | // ReSharper disable MemberCanBePrivate.Global
3 | // ReSharper disable FieldCanBeMadeReadOnly.Global
4 |
5 | #pragma warning disable CA1815 // Override equals and operator equals on value types
6 | #pragma warning disable CA1815 // Override equals and operator equals on value types
7 | #pragma warning disable CA1707 // Identifiers should not contain underscores
8 | #pragma warning disable CA1051
9 |
10 | namespace Usb.Net
11 | {
12 | [StructLayout(LayoutKind.Sequential, Pack = 1)]
13 | public struct WINUSB_SETUP_PACKET
14 | {
15 | public byte RequestType;
16 | public byte Request;
17 | public ushort Value;
18 | public ushort Index;
19 | public ushort Length;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf.Host/Device.Net.UnoSample.Skia.Wpf.Host.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | Exe
6 | netcoreapp3.1
7 | true
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Usb.Net/UsbDeviceExtensions.cs:
--------------------------------------------------------------------------------
1 | using Device.Net;
2 | using System;
3 | using System.Linq;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 |
7 | namespace Usb.Net
8 | {
9 | public static class UsbDeviceExtensions
10 | {
11 | public static Task PerformControlTransferAsync(this IUsbDevice usbDevice, SetupPacket setupPacket, byte[] buffer = null, CancellationToken cancellationToken = default)
12 | => usbDevice == null ? throw new ArgumentNullException(nameof(usbDevice)) :
13 | (usbDevice.UsbInterfaceManager.UsbInterfaces.FirstOrDefault() ??
14 | throw new ControlTransferException("There are no interfaces to send a control transfer to"))
15 | .PerformControlTransferAsync(setupPacket, buffer, cancellationToken);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/cmd_thermometer_service_get_temperature_async.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'cmd_thermometer_service_get_temperature_async.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | CmdThermometerServiceGetTemperatureAsync
10 | _$CmdThermometerServiceGetTemperatureAsyncFromJson(Map json) {
11 | return CmdThermometerServiceGetTemperatureAsync();
12 | }
13 |
14 | Map _$CmdThermometerServiceGetTemperatureAsyncToJson(
15 | CmdThermometerServiceGetTemperatureAsync instance) =>
16 | {};
17 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/temperature_changed_args.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'temperature_changed_args.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | TemperatureChangedArgs _$TemperatureChangedArgsFromJson(Map json) {
10 | return TemperatureChangedArgs(
11 | celsius: (json['Celsius'] as num).toDouble(),
12 | fahrenheit: (json['Fahrenheit'] as num).toDouble(),
13 | );
14 | }
15 |
16 | Map _$TemperatureChangedArgsToJson(
17 | TemperatureChangedArgs instance) =>
18 | {
19 | 'Celsius': instance.celsius,
20 | 'Fahrenheit': instance.fahrenheit,
21 | };
22 |
--------------------------------------------------------------------------------
/src/Device.Net.UnitTests/TrezorResponseByteBuffer.cs:
--------------------------------------------------------------------------------
1 | #if !WINDOWS_UWP && !NET45
2 |
3 | using Java.Nio;
4 |
5 | namespace Device.Net.UnitTests
6 | {
7 | public class TrezorResponseByteBuffer : ByteBuffer
8 | {
9 | private int _currentPosition;
10 | private readonly byte[] TrezorResponse = new byte[] { 63, 35, 35, 0, 17, 0, 0, 0, 194, 10, 9, 116, 114, 101, 122, 111, 114, 46, 105, 111, 16, 1, 24, 9, 32, 3, 50, 24, 51, 66, 69, 65, 55, 66, 50, 55, 50, 55, 66, 49, 55, 57, 50, 52, 67, 56, 67, 70, 68, 56, 53, 48, 56, 1, 64, 0, 74, 5, 101, 110, 45, 85, 83, 82 };
11 |
12 | public sbyte Get()
13 | {
14 | var returnValue = (sbyte)TrezorResponse[_currentPosition];
15 | _currentPosition++;
16 | return returnValue;
17 | }
18 |
19 | public Buffer Rewind() { _currentPosition = 0; return default; }
20 | }
21 | }
22 | #endif
23 |
--------------------------------------------------------------------------------
/src/Hid.Net/Windows/IHidApiService.cs:
--------------------------------------------------------------------------------
1 | using Device.Net;
2 | using Device.Net.Windows;
3 | using Microsoft.Win32.SafeHandles;
4 | using System;
5 | using System.IO;
6 |
7 | namespace Hid.Net.Windows
8 | {
9 | ///
10 | /// Service to handle Hid API calls. Windows oriented for now.
11 | ///
12 | public interface IHidApiService : IApiService
13 | {
14 | ConnectedDeviceDefinition GetDeviceDefinition(string deviceId, SafeFileHandle safeFileHandle);
15 | Guid GetHidGuid();
16 | string GetManufacturer(SafeFileHandle safeFileHandle);
17 | string GetProduct(SafeFileHandle safeFileHandle);
18 | string GetSerialNumber(SafeFileHandle safeFileHandle);
19 | Stream OpenRead(SafeFileHandle readSafeFileHandle, ushort readBufferSize);
20 | Stream OpenWrite(SafeFileHandle writeSafeFileHandle, ushort writeBufferSize);
21 | }
22 | }
--------------------------------------------------------------------------------
/src/Device.Net/Windows/WindowsDeviceConstants.cs:
--------------------------------------------------------------------------------
1 | // ReSharper disable MemberCanBePrivate.Global
2 | // ReSharper disable FieldCanBeMadeReadOnly.Global
3 | // ReSharper disable UnusedMember.Global
4 | // ReSharper disable InconsistentNaming
5 | // ReSharper disable IdentifierTypo
6 |
7 | using System;
8 |
9 | #pragma warning disable CA1707 // Identifiers should not contain underscores
10 |
11 | namespace Device.Net.Windows
12 | {
13 | public static class WindowsDeviceConstants
14 | {
15 | public static Guid GUID_DEVINTERFACE_HID { get; } = new Guid("4D1E55B2-F16F-11CF-88CB-001111000030");
16 | public static Guid GUID_DEVINTERFACE_USB_DEVICE { get; } = new Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED");
17 | public static Guid WinUSBGuid { get; } = new Guid("dee824ef-729b-4a0e-9c14-b7117d33a817");
18 | }
19 | }
20 |
21 | #pragma warning restore CA1707 // Identifiers should not contain underscores
22 |
--------------------------------------------------------------------------------
/src/Usb.Net/RequestDirection.cs:
--------------------------------------------------------------------------------
1 | namespace Usb.Net
2 | {
3 | ///
4 | /// Defines constants that indicate the direction of USB transfer: IN or OUT transfers.
5 | ///
6 | ///
7 | /// See 9.3 of the Universal Serial Bus (USB) specification ()
8 | /// The direction of a USB transfer is determined from the host side and not the target USB device.
9 | /// In an IN transfer, data moves from the device to the host. In an OUT transfer, data moves from the host to the device.
10 | ///
11 | public enum RequestDirection
12 | {
13 | ///
14 | /// Indicates an IN transfer from the device to the host.
15 | ///
16 | In = 1,
17 |
18 | ///
19 | /// Indicates an OUT transfer from the host to the device.
20 | ///
21 | Out = 0
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Device.Net/Logging/ILogger.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2 |
3 | using System;
4 |
5 | namespace Microsoft.Extensions.Logging
6 | {
7 | public interface ILogger
8 | {
9 | IDisposable BeginScope(string messageFormat, params object[] args);
10 | void LogError(EventId eventId, Exception exception, string message, params object[] args);
11 | void LogError(Exception exception, string message, params object[] args);
12 | void LogInformation(string message, params object[] args);
13 | void LogWarning(string message, params object[] args);
14 | void LogDebug(string message, params object[] args);
15 | void LogTrace(T state);
16 | }
17 |
18 | public interface ILogger : ILogger
19 | {
20 |
21 | }
22 | }
23 |
24 |
25 | #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
26 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/res_thermometer_service_get_temperature_async.g.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 |
3 | part of 'res_thermometer_service_get_temperature_async.dart';
4 |
5 | // **************************************************************************
6 | // JsonSerializableGenerator
7 | // **************************************************************************
8 |
9 | ResThermometerServiceGetTemperatureAsync
10 | _$ResThermometerServiceGetTemperatureAsyncFromJson(Map json) {
11 | return ResThermometerServiceGetTemperatureAsync(
12 | returnValue: (json['ReturnValue'] as num).toDouble(),
13 | );
14 | }
15 |
16 | Map _$ResThermometerServiceGetTemperatureAsyncToJson(
17 | ResThermometerServiceGetTemperatureAsync instance) =>
18 | {
19 | 'ReturnValue': instance.returnValue,
20 | };
21 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf.Host/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Navigation;
14 | using System.Windows.Shapes;
15 |
16 | namespace Device.Net.UnoSample.WPF.Host
17 | {
18 | ///
19 | /// Interaction logic for MainWindow.xaml
20 | ///
21 | public partial class MainWindow : Window
22 | {
23 | public MainWindow()
24 | {
25 | InitializeComponent();
26 |
27 | root.Content = new global::Uno.UI.Skia.Platform.WpfHost(Dispatcher, () => new Device.Net.UnoSample.App());
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/docfx_project/articles/toc.yml:
--------------------------------------------------------------------------------
1 | - name: Sponsor This Project
2 | href: https://github.com/sponsors/MelbourneDeveloper
3 |
4 | - name: Getting Started
5 | href: GettingStarted.md
6 |
7 | - name: Build Issues
8 | href: BuildIssues.md
9 |
10 | - name: Device Permission Setup
11 | href: DevicePermissionSetup.md
12 |
13 | - name: Device Manager
14 | href: DeviceManager.md
15 |
16 | - name: Device Listener
17 | href: DeviceListener.md
18 |
19 | - name: Debugging, Logging and Tracing
20 | href: DebuggingLoggingTracing.md
21 |
22 | - name: Device Firmware Developer Program
23 | href: DeviceFirmwareDeveloperProgram.md
24 |
25 | - name: Enumerating Connected Devices
26 | href: EnumeratingConnectedDevices.md
27 |
28 | - name: Hid Transfer
29 | href: HidTransfer.md
30 |
31 | - name: Linux and macOS Support
32 | href: LinuxmacOSSupport.md
33 |
34 | - name: NuGet
35 | href: NuGet.md
36 |
37 | - name: Samples and Unit Tests
38 | href: SamplesAndUnitTests.md
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Skia.Wpf/Device.Net.UnoSample.Skia.Wpf.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/cmd_thermometer_service_stop_monitoring.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 | import 'package:json_annotation/json_annotation.dart';
5 | import 'package:meta/meta.dart';
6 |
7 | part 'cmd_thermometer_service_stop_monitoring.g.dart';
8 |
9 |
10 | /// An annotation for the code generator to know that this class needs the
11 | /// the star denotes the source file name.
12 | @immutable
13 | @JsonSerializable(nullable: true, explicitToJson: true, anyMap: true)
14 | class CmdThermometerServiceStopMonitoring {
15 |
16 | CmdThermometerServiceStopMonitoring();
17 |
18 |
19 | factory CmdThermometerServiceStopMonitoring.fromJson(Map json) => _$CmdThermometerServiceStopMonitoringFromJson(json);
20 |
21 | Map toJson() => _$CmdThermometerServiceStopMonitoringToJson(this);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/res_thermometer_service_stop_monitoring.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 | import 'package:json_annotation/json_annotation.dart';
5 | import 'package:meta/meta.dart';
6 |
7 | part 'res_thermometer_service_stop_monitoring.g.dart';
8 |
9 |
10 | /// An annotation for the code generator to know that this class needs the
11 | /// the star denotes the source file name.
12 | @immutable
13 | @JsonSerializable(nullable: true, explicitToJson: true, anyMap: true)
14 | class ResThermometerServiceStopMonitoring {
15 |
16 | ResThermometerServiceStopMonitoring();
17 |
18 |
19 | factory ResThermometerServiceStopMonitoring.fromJson(Map json) => _$ResThermometerServiceStopMonitoringFromJson(json);
20 |
21 | Map toJson() => _$ResThermometerServiceStopMonitoringToJson(this);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/Diagram.xml:
--------------------------------------------------------------------------------
1 | 1ZZLj5swEMc/DceuwDwCxyT7urSXVdWzF0/AWoNZ4ySkn74DNgEKkbJqqnbhgOc/D9u/sZw4/rZonhSt8q+SgXCIyxrHv3cI8dzExU+rnIwSe7ERMsWZDRqEF/4T+kyr7jmDehKopRSaV1MxlWUJqZ5oVCl5nIbtpJjOWtEMZsJLSsVc/cGZzq3qRcngeAae5XbqmKyM45Wmb5mS+9LO5xB/1z3GXdC+lt1onVMmjyPJf3D8rZJSm1HRbEG0bHtsJu/xgve8bgWlviaBeKFPTNKBij30q+7Wpk89D0xC9GhsdlyIrRRSdQ7fI+v1JkRdVjTlum135KJZayXfoA8sZdnm5roQaHltGVnqUZnH7kE9U5RxmPiSqH3RN9+b3e4BlIZmJNm9PoEsQKsThlgvVrsLTZI9mV7cC8eh0aFr25OPenwWqT1c2bn8ABgHlvFl3v4f8IY4jALyV3mvwva9De8gcP817WBG+3v9evcN9Aw67klbVPZGIgHaVPCsRCNFDICMNu32Od4Va+soOGPiSt63OMPJ72cY758FrF6ygHV1I6rhjOozZ5+ZavQ/UF0t3AyR6PFNuEbve9k7vtQd2DUGkKBqBieOsvZ7DweegmmPqYerMSVNwKWuzbp0RTNGnfZudG2H8fQaIcFSa4KFzgQf7wyaw+9v5xv9yfEffgE=
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer/flutnet_thermometer.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Device.Net/IDataReceiver.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Device.Net
6 | {
7 | ///
8 | /// Receives data from some source
9 | ///
10 | public interface IDataReceiver : IDisposable
11 | {
12 | ///
13 | /// Read from the source or wait for data to appear for reading
14 | ///
15 | ///
16 | ///
17 | Task ReadAsync(CancellationToken cancellationToken = default);
18 |
19 | ///
20 | /// Manually set the data that appears at the source
21 | ///
22 | ///
23 | void DataReceived(TransferResult bytes);
24 |
25 | ///
26 | /// Whether or not data has already been received that has not yet been read
27 | ///
28 | bool HasData { get; }
29 | }
30 | }
--------------------------------------------------------------------------------
/src/Device.Net/Observer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Device.Net
4 | {
5 | ///
6 | /// This class is a fill in for the Reactive extensions so that we don't need to depend on those at the low level
7 | ///
8 | ///
9 | internal class Observer : IObserver
10 | {
11 | private readonly Action _onNext;
12 | private readonly Action _onError;
13 | private readonly Action _onCompleted;
14 |
15 | public Observer(
16 | Action onNext,
17 | Action onError = null,
18 | Action onCompleted = null
19 | )
20 | {
21 | _onNext = onNext;
22 | _onError = onError;
23 | _onCompleted = onCompleted;
24 | }
25 |
26 |
27 | public void OnCompleted() => _onCompleted();
28 | public void OnError(Exception error) => _onError(error);
29 | public void OnNext(T value) => _onNext(value);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/cmd_thermometer_service_start_monitoring.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 | import 'package:json_annotation/json_annotation.dart';
5 | import 'package:meta/meta.dart';
6 |
7 | part 'cmd_thermometer_service_start_monitoring.g.dart';
8 |
9 |
10 | /// An annotation for the code generator to know that this class needs the
11 | /// the star denotes the source file name.
12 | @immutable
13 | @JsonSerializable(nullable: true, explicitToJson: true, anyMap: true)
14 | class CmdThermometerServiceStartMonitoring {
15 |
16 | CmdThermometerServiceStartMonitoring();
17 |
18 |
19 | factory CmdThermometerServiceStartMonitoring.fromJson(Map json) => _$CmdThermometerServiceStartMonitoringFromJson(json);
20 |
21 | Map toJson() => _$CmdThermometerServiceStartMonitoringToJson(this);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/res_thermometer_service_start_monitoring.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 | import 'package:json_annotation/json_annotation.dart';
5 | import 'package:meta/meta.dart';
6 |
7 | part 'res_thermometer_service_start_monitoring.g.dart';
8 |
9 |
10 | /// An annotation for the code generator to know that this class needs the
11 | /// the star denotes the source file name.
12 | @immutable
13 | @JsonSerializable(nullable: true, explicitToJson: true, anyMap: true)
14 | class ResThermometerServiceStartMonitoring {
15 |
16 | ResThermometerServiceStartMonitoring();
17 |
18 |
19 | factory ResThermometerServiceStartMonitoring.fromJson(Map json) => _$ResThermometerServiceStartMonitoringFromJson(json);
20 |
21 | Map toJson() => _$ResThermometerServiceStartMonitoringToJson(this);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/Device.Net/Windows/WindowsHelpers.cs:
--------------------------------------------------------------------------------
1 | using Device.Net.Exceptions;
2 | using Microsoft.Extensions.Logging;
3 | using Microsoft.Extensions.Logging.Abstractions;
4 | using System.Runtime.InteropServices;
5 |
6 | namespace Device.Net.Windows
7 | {
8 | public static class WindowsHelpers
9 | {
10 | internal static int HandleError(bool isSuccess, string message, ILogger logger, bool throwException = true)
11 | {
12 | logger ??= NullLogger.Instance;
13 |
14 | if (isSuccess) return 0;
15 |
16 | var errorCode = Marshal.GetLastWin32Error();
17 |
18 | if (errorCode == 0)
19 | {
20 | return 0;
21 | }
22 |
23 | if (!throwException) return errorCode;
24 |
25 | var apiException = new ApiException($"{message}. Error code: {errorCode}");
26 | logger.LogError(new EventId(errorCode), apiException, "Windows error", errorCode);
27 | throw apiException;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.dll
2 | *.pdb
3 | *.suo
4 | *.lock.json
5 | *.dll.mdb
6 | *.user
7 | .svn
8 | .vs
9 | bin
10 | obj
11 | packages
12 | BundleArtifacts
13 | AppPackages
14 | *.designer.cs
15 | *.CodeAnalysisLog.xml
16 | *.lastcodeanalysissucceeded
17 | *.targets
18 | *.csproj.bak
19 | *.targets
20 | file_paths.xml
21 | /NuGet/netstandard2.0/Hid.Net.deps.json
22 | *.nupkg
23 | *.snupkg
24 | *.bak
25 | /.vscode
26 | src/.idea/
27 |
28 | src/Flutter/flutnet_thermometer_bridge/lib/flutnet/data/
29 |
30 | src/Flutter/flutnet_thermometer_bridge/lib/flutnet/service_model/
31 |
32 | src/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/
33 |
34 | src/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/
35 |
36 | src/Usb.Net/Usb.Net.xml
37 |
38 | src/Device.Net/Device.Net.xml
39 |
40 | src/Hid.Net/Hid.Net.xml
41 |
42 | src/SerialPort.Net/SerialPort.Net.xml
43 |
44 | src/Hid.Net.UWP/Hid.Net.UWP.xml
45 |
46 | src/Usb.Net.UWP/Usb.Net.UWP.xml
47 |
48 | src/Usb.Net.Android/Usb.Net.Android.xml
49 |
--------------------------------------------------------------------------------
/src/Hid.Net/IHidDevice.cs:
--------------------------------------------------------------------------------
1 | using Device.Net;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Hid.Net
6 | {
7 | ///
8 | public interface IHidDevice : IDevice
9 | {
10 | ///
11 | /// Reads data as a cref="ReadReport"
12 | ///
13 | /// Allows you to cancel the operation
14 | /// The cref="ReadReport"
15 | Task ReadReportAsync(CancellationToken cancellationToken = default);
16 |
17 | ///
18 | /// Writes data and allows you to specify the report id
19 | ///
20 | ///
21 | ///
22 | /// Allows you to cancel the operation
23 | ///
24 | Task WriteReportAsync(byte[] data, byte reportId, CancellationToken cancellationToken = default);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/cmd_thermometer_service_get_temperature_async.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 | import 'package:json_annotation/json_annotation.dart';
5 | import 'package:meta/meta.dart';
6 |
7 | part 'cmd_thermometer_service_get_temperature_async.g.dart';
8 |
9 |
10 | /// An annotation for the code generator to know that this class needs the
11 | /// the star denotes the source file name.
12 | @immutable
13 | @JsonSerializable(nullable: true, explicitToJson: true, anyMap: true)
14 | class CmdThermometerServiceGetTemperatureAsync {
15 |
16 | CmdThermometerServiceGetTemperatureAsync();
17 |
18 |
19 | factory CmdThermometerServiceGetTemperatureAsync.fromJson(Map json) => _$CmdThermometerServiceGetTemperatureAsyncFromJson(json);
20 |
21 | Map toJson() => _$CmdThermometerServiceGetTemperatureAsyncToJson(this);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/Hid.Net/ReadResult.cs:
--------------------------------------------------------------------------------
1 | using Device.Net;
2 |
3 | #pragma warning disable CA1815 // Override equals and operator equals on value types
4 |
5 | namespace Hid.Net
6 | {
7 | ///
8 | /// Represents a Hid Input or Output report. It consists of a TransferResult to/from the device, and a Report Id. An output report is for writing to the device, and input report is for reading from the device.
9 | ///
10 | public struct Report
11 | {
12 | ///
13 | /// Data Transferred to/from the device
14 | ///
15 | public TransferResult TransferResult { get; }
16 |
17 | ///
18 | /// The Hid report Id
19 | ///
20 | public byte ReportId { get; }
21 |
22 | ///
23 | /// Constructs a report
24 | ///
25 | public Report(byte reportId, TransferResult transferResult)
26 | {
27 | TransferResult = transferResult;
28 | ReportId = reportId;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/Device.Net/Logging/NullLogger.cs:
--------------------------------------------------------------------------------
1 | using Device.Net;
2 | using System;
3 |
4 | namespace Microsoft.Extensions.Logging.Abstractions
5 | {
6 | public class NullLogger : ILogger
7 | {
8 | public static NullLogger Instance { get; } = new NullLogger();
9 |
10 | public IDisposable BeginScope(string messageFormat, params object[] args) => new DummyDisposable();
11 |
12 | public void LogDebug(string message, params object[] args)
13 | {
14 | }
15 |
16 | public void LogError(EventId eventId, Exception exception, string message, params object[] args)
17 | {
18 | }
19 |
20 | public void LogError(Exception exception, string message, params object[] args)
21 | {
22 | }
23 |
24 | public void LogInformation(string message, params object[] args)
25 | {
26 | }
27 |
28 | public void LogTrace(T state)
29 | {
30 | }
31 |
32 | public void LogWarning(string message, params object[] args)
33 | {
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/Usb.Net/Windows/USB_DEVICE_DESCRIPTOR.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | // ReSharper disable FieldCanBeMadeReadOnly.Global
3 | // ReSharper disable MemberCanBePrivate.Global
4 |
5 | #pragma warning disable CA1815 // Override equals and operator equals on value types
6 | #pragma warning disable CA1707 // Identifiers should not contain underscores
7 | #pragma warning disable CA1051
8 |
9 | namespace Usb.Net.Windows
10 | {
11 | [StructLayout(LayoutKind.Sequential, Pack = 1)]
12 | internal struct USB_DEVICE_DESCRIPTOR
13 | {
14 | public byte bLength;
15 | public byte bDescriptorType;
16 | public ushort bcdUSB;
17 | public byte bDeviceClass;
18 | public byte bDeviceSubClass;
19 | public byte bDeviceProtocol;
20 | public byte bMaxPacketSize0;
21 | public ushort idVendor;
22 | public ushort idProduct;
23 | public ushort bcdDevice;
24 | public byte iManufacturer;
25 | public byte iProduct;
26 | public byte iSerialNumber;
27 | public byte bNumConfigurations;
28 | }
29 | }
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Fakes/Java/Nio/ByteBuffer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Java.Nio
4 | {
5 | //
6 | // Summary:
7 | // A buffer for bytes.
8 | //
9 | // Remarks:
10 | // Android platform documentation
11 | // Portions of this page are modifications based on work created and shared by the
12 | // Android Open Source Project and used according to terms described in the Creative
13 | // Commons 2.5 Attribution License.
14 |
15 | public interface ByteBuffer
16 | {
17 | ///Use these to inject funcs for returning values
18 | public static Func AllocateFunc { get; set; }
19 | public static Func WrapFunc { get; set; }
20 |
21 | sbyte Get();
22 | #pragma warning disable IDE0060 // Remove unused parameter
23 | public static ByteBuffer Allocate(int capacity) => AllocateFunc(capacity);
24 | public static ByteBuffer? Wrap(byte[]? array) => WrapFunc(array);
25 | #pragma warning restore IDE0060 // Remove unused parameter
26 | Buffer? Rewind();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/temperature_changed_args.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 | import 'package:json_annotation/json_annotation.dart';
5 | import 'package:meta/meta.dart';
6 |
7 | part 'temperature_changed_args.g.dart';
8 |
9 |
10 | /// An annotation for the code generator to know that this class needs the
11 | /// the star denotes the source file name.
12 | @immutable
13 | @JsonSerializable(nullable: true, explicitToJson: true, anyMap: true)
14 | class TemperatureChangedArgs {
15 |
16 | TemperatureChangedArgs({
17 | this.celsius,
18 | this.fahrenheit,
19 | });
20 |
21 | @JsonKey(name: "Celsius", nullable: false)
22 | final double celsius;
23 |
24 | @JsonKey(name: "Fahrenheit", nullable: false)
25 | final double fahrenheit;
26 |
27 |
28 | factory TemperatureChangedArgs.fromJson(Map json) => _$TemperatureChangedArgsFromJson(json);
29 |
30 | Map toJson() => _$TemperatureChangedArgsToJson(this);
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/Device.Net/Observable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Device.Net
5 | {
6 | ///
7 | /// Basic observable which does thib of the Rx extensions so that we don't have to add that dependency
8 | ///
9 | ///
10 | internal class Observable : IObservable
11 | {
12 | #region Fields
13 | private readonly List> _observers = new List>();
14 | #endregion
15 |
16 | #region Implementation
17 | public IDisposable Subscribe(IObserver observer)
18 | {
19 | Locked(() => _observers.Add(observer));
20 | return new UnsubscribeDisposable(() => Unsubscribe(observer));
21 | }
22 | #endregion
23 |
24 | #region Private or internal methods
25 | private void Locked(Action action)
26 | {
27 | lock (_observers) action();
28 | }
29 |
30 | internal void Unsubscribe(IObserver observer) => Locked(() => _observers.Remove(observer));
31 | #endregion
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Shared/Assets/SharedAssets.md:
--------------------------------------------------------------------------------
1 | See documentation about assets here : https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md
2 |
3 | # Here is a cheat sheet:
4 |
5 | 1. Add the image file to the `Assets` directory of a shared project.
6 | 2. Set the build action to `Content`.
7 | 3. (Recommended) Provide an asset for various scales/dpi
8 |
9 | ## Examples
10 |
11 | ```
12 | \Assets\Images\logo.scale-100.png
13 | \Assets\Images\logo.scale-200.png
14 | \Assets\Images\logo.scale-400.png
15 |
16 | \Assets\Images\scale-100\logo.png
17 | \Assets\Images\scale-200\logo.png
18 | \Assets\Images\scale\400\logo.png
19 | ```
20 |
21 | ## Table of scales
22 |
23 | | Scale | UWP | iOS | Android |
24 | |-------|:-----------:|:--------:|:-------:|
25 | | `100` | scale-100 | @1x | mdpi |
26 | | `125` | scale-125 | N/A | N/A |
27 | | `150` | scale-150 | N/A | hdpi |
28 | | `200` | scale-200 | @2x | xhdpi |
29 | | `300` | scale-300 | @3x | xxhdpi |
30 | | `400` | scale-400 | N/A | xxxhdpi |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Christian Findlay
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | trigger:
2 | - main
3 |
4 | pool:
5 | vmImage: "windows-latest"
6 |
7 | steps:
8 | - task: NuGetCommand@2
9 | inputs:
10 | command: "restore"
11 | restoreSolution: "src/Device.Net.Pipelines.sln"
12 | feedsToUse: "select"
13 |
14 | - task: MSBuild@1
15 | inputs:
16 | solution: "src/Device.Net.Pipelines.sln"
17 | configuration: "Release"
18 |
19 | - task: NuGetCommand@2
20 | inputs:
21 | command: "pack"
22 | packagesToPack: "Build/NuSpecs/*.nuspec"
23 | versioningScheme: "off"
24 |
25 | - task: DotNetCoreCLI@2
26 | inputs:
27 | command: 'test'
28 | projects: 'src/Device.Net.UnitTests/Device.Net.UnitTests.csproj'
29 | arguments: '--filter TestCategory!=NotPipelineReady'
30 | testRunTitle: 'Unit Tests'
31 |
32 | - task: NuGetCommand@2
33 | inputs:
34 | command: 'push'
35 | packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
36 | nuGetFeedType: 'internal'
37 | publishVstsFeed: 'a579837a-f36e-462f-8492-1a622b5cadb9/f3bac9de-5bde-4855-b10a-d1fe458ac336'
--------------------------------------------------------------------------------
/docs/toc.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/Device.Net/AsyncExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading;
5 | using System.Threading.Tasks;
6 |
7 | namespace Device.Net
8 | {
9 | internal static class AsyncExtensions
10 | {
11 |
12 | ///
13 | /// TODO: Why do I need to do this? Why doesn't linq have this?
14 | ///
15 | public static async Task FirstOrDefaultAsync(this IEnumerable enumerable, Func> predicate = null, CancellationToken cancellationToken = default)
16 | {
17 | if (enumerable == null) throw new ArgumentNullException(nameof(enumerable));
18 |
19 | if (predicate == null) return enumerable.FirstOrDefault();
20 |
21 | foreach (var item in enumerable)
22 | {
23 | if (cancellationToken.IsCancellationRequested) return default;
24 |
25 | if (await predicate(item).ConfigureAwait(false))
26 | {
27 | return item;
28 | }
29 | }
30 |
31 | return default;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Usb.Net/Usb.Net.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0;net45
4 | 1701;1702;NU5125
5 | Usb.Net.xml
6 | embedded
7 |
8 |
9 |
10 | all
11 | runtime; build; native; contentfiles; analyzers; buildtransitive
12 |
13 |
14 |
15 |
16 | all
17 | runtime; build; native; contentfiles; analyzers; buildtransitive
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet_thermometer/service_library/generated/res_thermometer_service_get_temperature_async.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 | import 'package:json_annotation/json_annotation.dart';
5 | import 'package:meta/meta.dart';
6 |
7 | part 'res_thermometer_service_get_temperature_async.g.dart';
8 |
9 |
10 | /// An annotation for the code generator to know that this class needs the
11 | /// the star denotes the source file name.
12 | @immutable
13 | @JsonSerializable(nullable: true, explicitToJson: true, anyMap: true)
14 | class ResThermometerServiceGetTemperatureAsync {
15 |
16 | ResThermometerServiceGetTemperatureAsync({
17 | this.returnValue,
18 | });
19 |
20 | @JsonKey(name: "ReturnValue", nullable: false)
21 | final double returnValue;
22 |
23 |
24 | factory ResThermometerServiceGetTemperatureAsync.fromJson(Map json) => _$ResThermometerServiceGetTemperatureAsyncFromJson(json);
25 |
26 | Map toJson() => _$ResThermometerServiceGetTemperatureAsyncToJson(this);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/Usb.Net/Windows/WindowsUsbInterfaceEndpoint.cs:
--------------------------------------------------------------------------------
1 | namespace Usb.Net.Windows
2 | {
3 | public class WindowsUsbInterfaceEndpoint : IUsbInterfaceEndpoint
4 | {
5 | #region Public Properties
6 | public byte PipeId { get; }
7 | public bool IsRead => (PipeId & WinUsbApiCalls.WritePipeId) != 0;
8 | public bool IsWrite => (PipeId & WinUsbApiCalls.WritePipeId) == 0;
9 |
10 | //Do we need deed to call WinUsb_GetPipePolicy. https://github.com/MelbourneDeveloper/Device.Net/issues/72?
11 |
12 | public ushort MaxPacketSize { get; }
13 |
14 | public bool IsInterrupt { get; }
15 | #endregion
16 |
17 | #region Constructor
18 | internal WindowsUsbInterfaceEndpoint(byte pipeId, USBD_PIPE_TYPE usbPipeType, ushort maxPacketSize)
19 | {
20 | PipeId = pipeId;
21 | IsInterrupt = usbPipeType == USBD_PIPE_TYPE.UsbdPipeTypeInterrupt;
22 | MaxPacketSize = maxPacketSize;
23 | }
24 | #endregion
25 |
26 | #pragma warning disable CA1305
27 | public override string ToString() => PipeId.ToString();
28 | #pragma warning restore CA1305
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Main.cs:
--------------------------------------------------------------------------------
1 | using Android.Runtime;
2 | using Com.Nostra13.Universalimageloader.Core;
3 | using System;
4 | using Windows.UI.Xaml;
5 | using Windows.UI.Xaml.Media;
6 |
7 | namespace Device.Net.UnoSample.Droid
8 | {
9 | [Android.App.Application(
10 | Label = "@string/ApplicationName",
11 | LargeHeap = true,
12 | HardwareAccelerated = true,
13 | Theme = "@style/AppTheme"
14 | )]
15 | public class Application : NativeApplication
16 | {
17 | public Application(IntPtr javaReference, JniHandleOwnership transfer)
18 | : base(() => new App(), javaReference, transfer) => ConfigureUniversalImageLoader();
19 |
20 | private void ConfigureUniversalImageLoader()
21 | {
22 | // Create global configuration and initialize ImageLoader with this config
23 | var config = new ImageLoaderConfiguration
24 | .Builder(Context)
25 | .Build();
26 |
27 | ImageLoader.Instance.Init(config);
28 |
29 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Usb.Net.UWP.Sample")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Usb.Net.UWP.Sample")]
12 | [assembly: AssemblyCopyright("Copyright © Christian Findlay 2019")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Version information for an assembly consists of the following four values:
17 | //
18 | // Major Version
19 | // Minor Version
20 | // Build Number
21 | // Revision
22 | //
23 | // You can specify all the values or you can default the Build and Revision Numbers
24 | // by using the '*' as shown below:
25 | // [assembly: AssemblyVersion("1.0.*")]
26 | [assembly: AssemblyVersion("1.0.0.0")]
27 | [assembly: AssemblyFileVersion("1.0.0.0")]
28 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/issue-report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Issue report
3 | about: Issue Report
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the issue**
11 | Explain your issue clearly
12 |
13 | **Screenshots**
14 | Add screenshots to help explain your problem. Use Ctrl-V to paste an image here.
15 |
16 | - Screenshot of where the exception is occurring (See [Break On All Exceptions](https://christianfindlay.com/2019/07/14/visual-studio-break-on-all-exceptions/) and [this](https://github.com/MelbourneDeveloper/Device.Net/wiki/Debugging,-Logging,-and-Tracing) )
17 |
18 | - Screenshot of the Windows Sample. I.e. run the windows sample and post the console window here.
19 |
20 | **Your Code**
21 | Post your code here. Please use markdown so that the code is formatted.
22 |
23 | **Log / Stack Trace**
24 | Please include the stack trace of where the problem occurred as text or a screenshot. You *must* use logging and include the output here. Please see [this](https://github.com/MelbourneDeveloper/Device.Net/wiki/Debugging,-Logging,-and-Tracing)
25 |
26 | **Info**
27 | - Platform: [e.g. Android]
28 | - Device Type: [e.g. USB/Hid]
29 | - Version: [e.g. 3.0]
30 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Shared/Device.Net.UnoSample.Shared.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 6279c845-92f8-4333-ab99-3d213163593c
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("UnoCrossPlatform.UWP")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("UnoCrossPlatform.UWP")]
12 | [assembly: AssemblyCopyright("Copyright © 2021")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Version information for an assembly consists of the following four values:
17 | //
18 | // Major Version
19 | // Minor Version
20 | // Build Number
21 | // Revision
22 | //
23 | // You can specify all the values or you can default the Build and Revision Numbers
24 | // by using the '*' as shown below:
25 | // [assembly: AssemblyVersion("1.0.*")]
26 | [assembly: AssemblyVersion("1.0.0.0")]
27 | [assembly: AssemblyFileVersion("1.0.0.0")]
28 | [assembly: ComVisible(false)]
29 |
--------------------------------------------------------------------------------
/src/Usb.Net.AndroidSample/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Usb.Net.AndroidSample")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Usb.Net.AndroidSample")]
12 | [assembly: AssemblyCopyright("Copyright © Christian Findlay 2019")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 | [assembly: ComVisible(false)]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("UnoCrossPlatform.Droid")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("UnoCrossPlatform.Droid")]
12 | [assembly: AssemblyCopyright("Copyright © 2021")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 | [assembly: ComVisible(false)]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 |
--------------------------------------------------------------------------------
/src/Device.Net/Windows/IApiService.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32.SafeHandles;
2 |
3 | #pragma warning disable CA1707 // Identifiers should not contain underscores
4 | #pragma warning disable CA1021 // Avoid out parameters
5 | #pragma warning disable CA1045 // Do not pass types by reference
6 |
7 | namespace Device.Net.Windows
8 | {
9 | public interface IApiService
10 | {
11 | SafeFileHandle CreateWriteConnection(string deviceId);
12 | SafeFileHandle CreateReadConnection(string deviceId, FileAccessRights desiredAccess);
13 | //TODO: Get rid of read/write. They can be done with file streams...
14 | bool AReadFile(SafeFileHandle hFile, byte[] lpBuffer, int nNumberOfBytesToRead, out uint lpNumberOfBytesRead, int lpOverlapped);
15 | bool AWriteFile(SafeFileHandle hFile, byte[] lpBuffer, int nNumberOfBytesToWrite, out int lpNumberOfBytesWritten, int lpOverlapped);
16 | bool AGetCommState(SafeFileHandle hFile, ref Dcb lpDCB);
17 | bool ASetCommState(SafeFileHandle hFile, ref Dcb lpDCB);
18 | bool ASetCommTimeouts(SafeFileHandle hFile, ref CommTimeouts lpCommTimeouts);
19 | bool APurgeComm(SafeFileHandle hFile, int dwFlags);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Usb.Net/RequestType.cs:
--------------------------------------------------------------------------------
1 | // ReSharper disable UnusedMember.Global
2 | // ReSharper disable InconsistentNaming
3 |
4 | namespace Usb.Net
5 | {
6 | ///
7 | /// Defines the type of USB device request.
8 | ///
9 | ///
10 | /// See 9.3 of the Universal Serial Bus (USB) specification ()
11 | ///
12 | public enum RequestType
13 | {
14 | ///
15 | /// Indicates a class-specific USB control request described by a specific device class specification.
16 | ///
17 | Class = 1,
18 |
19 | ///
20 | /// Indicates a standard USB control request that the app can send to obtain information about the device, its configurations, interfaces, and endpoints.
21 | /// The standard requests are described in section 9.4 of the Universal Serial Bus(USB) specification(www.usb.org).
22 | ///
23 | Standard = 0,
24 |
25 | ///
26 | /// Indicates a vendor-specified USB control request and depends on the requests supported by the device.
27 | ///
28 | Vendor = 2
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Device.Net.MacOSLibUsbSample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleName
6 | Device.Net.MacOSLibUsbSample
7 | CFBundleIdentifier
8 | com.companyname.Device-Net-MacOSLibUsbSample
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1
13 | LSMinimumSystemVersion
14 | 10.14
15 | CFBundleDevelopmentRegion
16 | en
17 | CFBundleInfoDictionaryVersion
18 | 6.0
19 | CFBundlePackageType
20 | APPL
21 | CFBundleSignature
22 | ????
23 | NSHumanReadableCopyright
24 | ${AuthorCopyright:HtmlEncode}
25 | NSPrincipalClass
26 | NSApplication
27 | NSMainStoryboardFile
28 | Main
29 | XSAppIconAssets
30 | Assets.xcassets/AppIcon.appiconset
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/Device.Net.LibUsb/Device.Net.LibUsb.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0;net45
4 | 1701;1702;CA1063
5 | Device.Net.LibUsb.xml
6 | embedded
7 |
8 |
9 |
10 |
11 | all
12 | runtime; build; native; contentfiles; analyzers; buildtransitive
13 |
14 |
15 | all
16 | runtime; build; native; contentfiles; analyzers; buildtransitive
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:flutnet_thermometer/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.macOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleName
6 | Device.Net.UnoSample.macOS
7 | CFBundleIdentifier
8 | com.companyname.Device.Net.UnoSample-macOS
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1
13 | LSMinimumSystemVersion
14 | 10.11
15 | CFBundleDevelopmentRegion
16 | en
17 | CFBundleInfoDictionaryVersion
18 | 6.0
19 | CFBundlePackageType
20 | APPL
21 | CFBundleSignature
22 | ????
23 | NSHumanReadableCopyright
24 | ${AuthorCopyright:HtmlEncode}
25 | NSPrincipalClass
26 | NSApplication
27 | XSAppIconAssets
28 | Assets.xcassets/AppIcon.appiconset
29 | ATSApplicationFontsPath
30 | Fonts/uno-fluentui-assets.ttf
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.UWP/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("Device.Net.UnoSample.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Device.Net.UnoSample.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2021")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
30 |
--------------------------------------------------------------------------------
/src/Usb.Net/Windows/USB_CONFIGURATION_DESCRIPTOR.cs:
--------------------------------------------------------------------------------
1 | // ReSharper disable MemberCanBePrivate.Global
2 | // ReSharper disable FieldCanBeMadeReadOnly.Global
3 | // ReSharper disable UnusedMember.Global
4 | // ReSharper disable InconsistentNaming
5 | using System.Runtime.InteropServices;
6 |
7 | #pragma warning disable CA1051 // Do not declare visible instance fields
8 | #pragma warning disable CA1815 // Override equals and operator equals on value types
9 | #pragma warning disable CA1707 // Identifiers should not contain underscores
10 |
11 | namespace Usb.Net.Windows
12 | {
13 | [StructLayout(LayoutKind.Sequential)]
14 | internal struct USB_CONFIGURATION_DESCRIPTOR
15 | {
16 | public byte bLength;
17 | public byte bDescriptorType;
18 | public ushort wTotalLength;
19 | public byte bNumInterfaces;
20 | public byte bConfigurationValue;
21 | public byte iConfiguration;
22 | public byte bmAttributes;
23 | public byte MaxPower;
24 | }
25 | }
26 | #pragma warning restore CA1815 // Override equals and operator equals on value types
27 | #pragma warning restore CA1051 // Do not declare visible instance fields
28 | #pragma warning restore CA1707 // Identifiers should not contain underscores
29 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("FlutnetThermometer.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("FlutnetThermometer")]
14 | [assembly: AssemblyCopyright("Copyright © 2021")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/src/Samples/Flutnet/Flutter/flutnet_thermometer_bridge/lib/flutnet/data/flutnet_exception.dart:
--------------------------------------------------------------------------------
1 | // *************************************
2 | // NOT EDIT THIS FILE *
3 | // *************************************
4 | import 'package:json_annotation/json_annotation.dart';
5 | import 'package:meta/meta.dart';
6 | import 'package:flutnet_thermometer_bridge/flutnet/data/flutnet_error_code.dart';
7 | import 'package:flutnet_thermometer_bridge/flutnet/service_model/platform_operation_exception.dart';
8 |
9 | part 'flutnet_exception.g.dart';
10 |
11 |
12 | /// An annotation for the code generator to know that this class needs the
13 | /// the star denotes the source file name.
14 | @immutable
15 | @JsonSerializable(nullable: true, explicitToJson: true, anyMap: true)
16 | class FlutnetException extends PlatformOperationException {
17 |
18 | FlutnetException({
19 | this.code,
20 | String message,
21 | }) : super(
22 | message: message,
23 | );
24 |
25 | @JsonKey(name: "Code", nullable: false)
26 | final FlutnetErrorCode code;
27 |
28 |
29 | factory FlutnetException.fromJson(Map json) => _$FlutnetExceptionFromJson(json);
30 |
31 | Map toJson() => _$FlutnetExceptionToJson(this);
32 |
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Usb.Net.Android")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("Usb.Net.Android")]
12 | [assembly: AssemblyCopyright("Copyright © Christian Findlay 2021")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 | [assembly: ComVisible(false)]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | [assembly: AssemblyVersion("4.0.0")]
24 | #pragma warning disable CS7035 // The specified version string does not conform to the recommended format - major.minor.build.revision
25 | [assembly: AssemblyFileVersion("4.0.0")]
26 | #pragma warning restore CS7035 // The specified version string does not conform to the recommended format - major.minor.build.revision
27 |
--------------------------------------------------------------------------------
/src/Usb.Net/UsbDeviceRequestType.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Usb.Net
3 | {
4 | public class UsbDeviceRequestType
5 | {
6 | ///
7 | /// Gets the type of the USB device request.
8 | ///
9 | public RequestType Type { get; }
10 |
11 | ///
12 | /// Gets the direction of the USB device request.
13 | ///
14 | public RequestDirection Direction { get; }
15 |
16 | ///
17 | /// Gets the direction of the USB device request.
18 | ///
19 | public RequestRecipient Recipient { get; }
20 |
21 | public UsbDeviceRequestType(
22 | RequestDirection direction,
23 | RequestType type,
24 | RequestRecipient recipient)
25 | {
26 | Direction = direction;
27 | Type = type;
28 | Recipient = recipient;
29 | }
30 |
31 | public byte ToByte() =>
32 | (byte)(
33 | ((byte)Direction << 7) +
34 | ((byte)Type << 5) +
35 | (byte)Recipient);
36 |
37 | public override string ToString() => $"RequestType: {Type} RequestDirection: {Direction} RequestRecipient: {Recipient}";
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Device.Net.UnoSample/Device.Net.UnoSample.Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("Device.Net.UnoSample.Droid")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("Device.Net.UnoSample.Droid")]
14 | [assembly: AssemblyCopyright("Copyright © 2021")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
--------------------------------------------------------------------------------
/src/Device.Net/FilterDeviceDefinition.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Device.Net
4 | {
5 | public sealed class FilterDeviceDefinition
6 | {
7 | public FilterDeviceDefinition(
8 | uint? vendorId = null,
9 | uint? productId = null,
10 | ushort? usagePage = null,
11 | string label = null,
12 | Guid? classGuid = null)
13 | {
14 | VendorId = vendorId;
15 | ProductId = productId;
16 | UsagePage = usagePage;
17 | Label = label;
18 | ClassGuid = classGuid;
19 | }
20 |
21 | public uint? VendorId { get; }
22 |
23 | ///
24 | /// Product Id
25 | ///
26 | public uint? ProductId { get; }
27 |
28 | ///
29 | /// Used to further filter down device definitions on some platforms
30 | ///
31 | public ushort? UsagePage { get; }
32 |
33 | ///
34 | /// Not used for filtering. Only used to give a meaningful name to the filter that is carried on to the device definition
35 | ///
36 | public string Label { get; }
37 |
38 |
39 | public Guid? ClassGuid { get; }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Samples/Flutnet/FlutnetThermometer.ModuleInterop.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("FlutnetThermometer.ModuleInterop.Android")]
8 | [assembly: AssemblyDescription("Xamarin.Android bindings for Flutter module AAR")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("FlutnetThermometer.ModuleInterop")]
12 | [assembly: AssemblyCopyright("Copyright © 2021")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 | [assembly: ComVisible(false)]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
--------------------------------------------------------------------------------
/src/Usb.Net/SetupPacket.cs:
--------------------------------------------------------------------------------
1 | namespace Usb.Net
2 | {
3 | public class SetupPacket
4 | {
5 | ///
6 | /// Size of to be used in byte arrays.
7 | ///
8 | // this is the "byte" size of the properties below
9 | public const int SetupPacketSize = 1 + 1 + 2 + 2 + 2;
10 |
11 | #region Public Properties
12 | public UsbDeviceRequestType RequestType { get; }
13 | public byte Request { get; }
14 | public ushort Value { get; }
15 | public ushort Index { get; }
16 | public ushort Length { get; }
17 | #endregion
18 |
19 | #region Constructors
20 | public SetupPacket(
21 | UsbDeviceRequestType requestType,
22 | byte request,
23 | ushort value = 0,
24 | ushort index = 0,
25 | ushort length = 0)
26 | {
27 | RequestType = requestType;
28 | Request = request;
29 | Value = value;
30 | Index = index;
31 | Length = length;
32 | }
33 | #endregion
34 |
35 | public override string ToString() => $"RequestType: {RequestType} Request: {Request} Value: {Value} Index: {Index} Length: {Length}";
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Usb.Net/Windows/USB_INTERFACE_DESCRIPTOR.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.InteropServices;
2 | // ReSharper disable MemberCanBePrivate.Global
3 | // ReSharper disable FieldCanBeMadeReadOnly.Global
4 |
5 | #pragma warning disable CA1815 // Override equals and operator equals on value types
6 | #pragma warning disable CA1815 // Override equals and operator equals on value types
7 | #pragma warning disable CA1707 // Identifiers should not contain underscores
8 | #pragma warning disable CA1051
9 |
10 | namespace Usb.Net.Windows
11 | {
12 | [StructLayout(LayoutKind.Sequential)]
13 | internal struct USB_INTERFACE_DESCRIPTOR
14 | {
15 | public byte bLength;
16 | public byte bDescriptorType;
17 | public byte bInterfaceNumber;
18 | public byte bAlternateSetting;
19 | public byte bNumEndpoints;
20 | public byte bInterfaceClass;
21 | public byte bInterfaceSubClass;
22 | public byte bInterfaceProtocol;
23 | public byte iInterface;
24 | }
25 | }
26 |
27 |
28 | #pragma warning restore CA1051
29 | #pragma warning restore CA1051 // Do not declare visible instance fields
30 | #pragma warning restore CA1051 // Do not declare visible instance fields
31 | #pragma warning restore CA1707 // Identifiers should not contain underscores
32 |
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.Droid/Main.cs:
--------------------------------------------------------------------------------
1 | using Android.Hardware.Usb;
2 | using Android.Runtime;
3 | using Com.Nostra13.Universalimageloader.Core;
4 | using System;
5 | using Windows.UI.Xaml.Media;
6 |
7 | namespace UnoCrossPlatform.Droid
8 | {
9 | [Android.App.Application(
10 | Label = "@string/ApplicationName",
11 | LargeHeap = true,
12 | HardwareAccelerated = true,
13 | Theme = "@style/AppTheme"
14 | )]
15 | public class Application : Windows.UI.Xaml.NativeApplication
16 | {
17 | public Application(IntPtr javaReference, JniHandleOwnership transfer)
18 | : base(() => new App(), javaReference, transfer) => ConfigureUniversalImageLoader();
19 |
20 | private void ConfigureUniversalImageLoader()
21 | {
22 | MainPage.AppContext = Context;
23 | MainPage.UsbManager = (UsbManager)GetSystemService(UsbService);
24 |
25 | // Create global configuration and initialize ImageLoader with this config
26 | var config = new ImageLoaderConfiguration
27 | .Builder(Context)
28 | .Build();
29 |
30 | ImageLoader.Instance.Init(config);
31 |
32 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/docs/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
26 |
--------------------------------------------------------------------------------
/src/Device.Net.UWPUnitTests/Properties/UnitTestApp.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/Device.Net/Device.Net.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0;net45;
4 | NU5125
5 | Device.Net.xml
6 | embedded
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | all
15 | runtime; build; native; contentfiles; analyzers; buildtransitive
16 |
17 |
18 | all
19 | runtime; build; native; contentfiles; analyzers; buildtransitive
20 |
21 |
22 |
23 |
24 |
25 | 3.1.7
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/Device.Net/Logging/NullLoggerOfT.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Microsoft.Extensions.Logging.Abstractions
4 | {
5 |
6 | internal class NullLogger : ILogger
7 | {
8 | private readonly ILogger _logger;
9 |
10 | public NullLogger(ILoggerFactory factory)
11 | {
12 | if (factory == null)
13 | {
14 | throw new ArgumentNullException(nameof(factory));
15 | }
16 |
17 | _logger = factory.CreateLogger(typeof(T).Name);
18 | }
19 |
20 | public IDisposable BeginScope(string messageFormat, params object[] args) => _logger.BeginScope(messageFormat, args);
21 | public void LogDebug(string message, params object[] args) => _logger.LogDebug(message, args);
22 | public void LogError(EventId eventId, Exception exception, string message, params object[] args) => _logger.LogError(eventId, exception, message, args);
23 | public void LogError(Exception exception, string message, params object[] args) => _logger.LogError(exception, message, args);
24 | public void LogInformation(string message, params object[] args) => _logger.LogInformation(message, args);
25 | public void LogTrace(T1 state) => _logger.LogTrace(state);
26 | public void LogWarning(string message, params object[] args) => _logger.LogWarning(message, args);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contribution
2 |
3 | This library needs:
4 |
5 | - Unit tests (See [here](https://github.com/MelbourneDeveloper/Device.Net/blob/7af1cc461ef79685a3499f87a450208b3a36a62e/src/Device.Net.UnitTests/UnitTests.cs#L23) )
6 | - Bug fixes (See [here](https://github.com/MelbourneDeveloper/Device.Net/issues) )
7 | - Documentation. Please add and fix up the XML Doc. This makes a big difference!
8 | - More platform support. Particularly for macOS and Linux
9 |
10 | I welcome feedback, and pull requests. If there's something that you need to change in the library, please log an issue, and explain the problem. If you have a proposed solution, please write it up and explain why you think it is the answer to the problem. The best way to highlight a bug is to submit a pull request with a unit test that fails so I can clearly see what the problem is in the first place.
11 |
12 | ## Pull Requests
13 |
14 | Please break pull requests up in to their smallest possible parts. If you have a small feature or refactor that other code depends on, try submitting that first. Please try to reference an issue so that I understand the context of the pull request. If there is no issue, I don't know what the code is about. If you need help, please jump on Join us on [Discord](https://discord.gg/ZcvXARm).
15 |
16 | **Please submit pull requests to the develop branch. Please do not submit to the master branch**
17 |
18 |
--------------------------------------------------------------------------------
/src/Usb.Net.UWP.Sample/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Usb.Net.Android.Standard/Usb.Net.Android.Standard.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.1
5 | false
6 | false
7 | Full
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/Hid.Net/IHidDeviceHandler.cs:
--------------------------------------------------------------------------------
1 | using Device.Net;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 |
5 | namespace Hid.Net
6 | {
7 | public interface IHidDeviceHandler
8 | {
9 | ConnectedDeviceDefinition ConnectedDeviceDefinition { get; }
10 | bool? IsReadOnly { get; }
11 | ushort? ReadBufferSize { get; }
12 | ushort? WriteBufferSize { get; }
13 | string DeviceId { get; }
14 |
15 | Task InitializeAsync(CancellationToken cancellationToken = default);
16 | ///
17 | /// Reads data as a cref="ReadReport"
18 | ///
19 | /// Allows you to cancel the operation
20 | /// The cref="ReadReport"
21 | Task ReadReportAsync(CancellationToken cancellationToken = default);
22 |
23 | ///
24 | /// Writes data and allows you to specify the report id
25 | ///
26 | ///
27 | ///
28 | /// Allows you to cancel the operation
29 | ///
30 | Task WriteReportAsync(byte[] data, byte reportId, CancellationToken cancellationToken = default);
31 |
32 | public bool IsInitialized { get; }
33 | public void Close();
34 | }
35 | }
--------------------------------------------------------------------------------
/src/Samples/UnoPlatform/UnoCrossPlatform.UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------