Skip to content

Utility library for unconventional Bluetooth tasks on Windows.

License

Notifications You must be signed in to change notification settings

nefarius/Nefarius.Utilities.Bluetooth

Repository files navigation

Nefarius.Utilities.Bluetooth

.NET Requirements Requirements Nuget Nuget

Utility library for unconventional Bluetooth tasks on Windows.

Work in progress, use with care 🔥

About

This is a collection of utility classes using undocumented Windows APIs to achieve wireless greatness! Ever needed a simple method of enabling or disabling Bluetooth without all that UWP and Store App nonsense? Wanna dive into modifying SDP records on your machine? This ever-growing library will provide without any bloated dependencies! Enjoy and use responsibly! 😃

Documentation

Link to API docs.

Generating documentation

  • dotnet build -c:Release
  • dotnet tool install --global Nefarius.Tools.XMLDoc2Markdown
  • xmldoc2md .\bin\netstandard2.0\Nefarius.Utilities.Bluetooth.dll .\docs\

Examples

Check for radio availability

// gives you 'true' if a radio is available (enabled or disabled) 
bool isVailable = HostRadio.IsAvailable;
// gives you 'true' if a radio is enabled (and therefore implicitly available)
bool isEnabled = HostRadio.IsEnabled;
// gives you 'true' if a radio is available and enabled
bool isOperable = HostRadio.IsOperable;

Turn Bluetooth On, Off or Restart it

Turn on:

using var radio = new HostRadio();
radio.EnableRadio();

Turn off:

using var radio = new HostRadio();
radio.DisableRadio();

Restart/reload:

using var radio = new HostRadio();
radio.RestartRadio();

Disconnect a remote device

using var radio = new HostRadio();
radio.DisconnectRemoteDevice("MAC address");

3rd party credits

About

Utility library for unconventional Bluetooth tasks on Windows.

Resources

License

Stars

Watchers

Forks

Languages