UsbBluetooth 0.1.2
dotnet add package UsbBluetooth --version 0.1.2
NuGet\Install-Package UsbBluetooth -Version 0.1.2
<PackageReference Include="UsbBluetooth" Version="0.1.2" />
<PackageVersion Include="UsbBluetooth" Version="0.1.2" />
<PackageReference Include="UsbBluetooth" />
paket add UsbBluetooth --version 0.1.2
#r "nuget: UsbBluetooth, 0.1.2"
#:package UsbBluetooth@0.1.2
#addin nuget:?package=UsbBluetooth&version=0.1.2
#tool nuget:?package=UsbBluetooth&version=0.1.2
USB Bluetooth
Take full control of your USB Bluetooth controllers from C#!
For general documentation about the project, please visit usbbluetooth.github.io.
For a C version of this library, check out UsbBluetooth for C.
For a Python version of this library, check out UsbBluetooth for Python or Scapy UsbBluetooth for direct integration with Scapy.
Installation
Use the NuGet package!
Usage
Once installed, you may list devices using UsbBluetoothManager.ListControllersWithDriver(), and for each device you may Open() the device, Write() and Read() to them and Close() it once you are done.
See the Examples folder for some sample code.
Plaform quirks
Windows
In Windows you may have to install WinUSB driver in your device using Zadig. Otherwise, UsbBluetooth will detect your device but it may not be able to take control of your device.
Linux
Your Linux user must have permissions to access USB hardware. Here are several options to ensure access:
Run as root: Execute the application with elevated privileges using
sudo. Note that this may not be ideal for security reasons.Add user to a group: Add your user to the
plugdev,usboruucpgroup (depending on your distribution). Remeber to reboot or log out and log back in for the changes to take effect. For example:sudo usermod -a -G plugdev $USERCreate a udev rule: Create a custom udev rule to automatically set permissions for USB Bluetooth devices. Create a file like
/etc/udev/rules.d/99-usbbluetooth.ruleswith content similar to:SUBSYSTEM=="usb", ATTR{idVendor}=="your_vendor_id", ATTR{idProduct}=="your_product_id", MODE="0666"Replace
your_vendor_idandyour_product_idwith the actual vendor and product IDs of your device (you can find these usinglsusb). Then reload udev rules withsudo udevadm control --reload-rules && sudo udevadm trigger.
History
Package versions < 0.1 were bindings around the original C library. The history for those packages can be found in the usbbluetooth repository in the respective tags.
Package versions >= 0.1 are developed in this repo and based of LibUsbDotNet, the C# LibUSB binding.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- LibUsbDotNet (>= 3.0.167-alpha)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.