Android_BluetoothDevice.cs 605 B

123456789101112131415161718
  1. using Android.Bluetooth.LE;
  2. namespace InABox.Avalonia.Platform.Android;
  3. public class Android_BluetoothDevice(ScanResult scan, Guid[] availableservices, DateTime timestamp) : IBluetoothDevice
  4. {
  5. public ScanResult Scan { get; } = scan;
  6. public string ID { get; } = scan.Device?.Address ?? string.Empty;
  7. public string Name { get; } = scan.ScanRecord?.DeviceName ?? "Unknown Device";
  8. public Guid[] AvailableServices { get; } = availableservices;
  9. public DateTime LastSeen { get; set; } = timestamp;
  10. public void Dispose()
  11. {
  12. scan.Dispose();
  13. Scan.Dispose();
  14. }
  15. }