Skip to content
Shiny Controls v1.0 - The Ultra Control Suite for .NET MAUI & BlazorO...M...G!

BluetoothLE Hosting

GitHub GitHub stars for shinyorg/shiny
Downloads NuGet downloads for Shiny.BluetoothLE.Hosting
Linux NuGet downloads for Shiny.BluetoothLE.Hosting.Linux
Frameworks
.NET
.NET MAUI
Operating Systems
Android
iOS
macOS
Windows
Linux

BluetoothLE Hosting allows your device to act as a BLE peripheral (server). You can advertise services, create GATT services with characteristics, and communicate with central devices that connect to you.

  • Advertise as a BLE peripheral
  • Create GATT services with read/write/notify characteristics via the imperative AddService builder
  • iBeacon broadcasting
  • L2CAP CoC channel listeners for high-throughput streaming, including a directory-backed file server centrals can upload to and download from
  • Cross-platform: iOS, macOS, Android, Linux (Windows hosting is currently stubbed)
Feature iOS macOS Android Windows Linux
Advertising Foreground + limited background Full Full WIP
GATT Server Full Full Full WIP
L2CAP CoC Full Full API 29+ Full (BlueZ socket)
Changed files
  • MyApp/
Delegates/MyBleGattCharacteristic.cs
MyBleGattCharacteristic.cs
1using Shiny.BluetoothLE.Hosting.Managed;23namespace MyApp.Delegates;45[BleGattCharacteristic("SERVICE UUID", "CHARCATERISTIC UUID")]6public class MyBleGattCharacteristic : BleGattCharacteristic7{8    public MyBleGattCharacteristic()9    {10    }1112    // public override Task OnStart() => base.OnStart();13    // public override void OnStop() => base.OnStop();1415    // public override Task<GattResult> OnRead(ReadRequest request) => base.OnRead(request);16    // public override Task OnWrite(WriteRequest request) => base.OnWrite(request);17    // public override Task OnSubscriptionChanged(IPeripheral peripheral, bool subscribed) => base.OnSubscriptionChanged(peripheral, subscribed);18}
IBleHostingManager hostingManager; // injected
var access = await hostingManager.RequestAccess(advertise: true, connect: true);
// Start advertising with a local name and service UUIDs
await hostingManager.StartAdvertising(new AdvertisementOptions(
LocalName: "MyDevice",
ServiceUuids: new[] { "Your-Service-UUID" }
));
// Check advertising state
var isAdvertising = hostingManager.IsAdvertising;
// Stop advertising
hostingManager.StopAdvertising();
claude plugin marketplace add shinyorg/skills
claude plugin install shiny@shiny

One plugin installs all 35 Shiny skills. Your agent loads only the skill relevant to what you're building, so there's no cost to having them all available.

copilot plugin marketplace add https://github.com/shinyorg/skills
copilot plugin install shiny@shiny

One plugin installs all 35 Shiny skills. Your agent loads only the skill relevant to what you're building, so there's no cost to having them all available.

View shiny-ble-hosting Skill