Bluetooth check, avoid crashing

This commit is contained in:
2026-10-14 07:24:06 +08:00
parent 1ec485701a
commit b22b0df6ed
6 changed files with 118 additions and 9 deletions
+3
View File
@@ -41,6 +41,9 @@ public sealed class SimBleService : IBleService
public IObservable<BleConnectionState> ConnectionStateChanged => _state.AsObservable();
// ── Scan ──────────────────────────────────────────────────────────────────
public Task<BluetoothAvailability> CheckBluetoothAsync() =>
Task.FromResult(new BluetoothAvailability(true, string.Empty));
public IObservable<BleDeviceInfo> StartScan() => Observable.Create<BleDeviceInfo>(o =>
{
o.OnNext(new BleDeviceInfo(0xAABBCCDDEEFF, "B_SIM-PG1", -42));