using BluetoothLENet;

namespace InABox.Avalonia.Platform.Desktop;

public class Desktop_BluetoothDevice : IBluetoothDevice
{
    public Desktop_BluetoothDevice(BLEDevice device)
    {
        Device = device;
        LastSeen = device.LastSeen;
        ManufacturerData = device.ManufacturerData;
    }

    public BLEDevice? Device { get; private set; }
    public string ID => Device?.MacAddress ?? string.Empty;
    public string Name => Device?.Native?.Name ?? "Unknown Device";
    public Guid[] AvailableServices  => Device?.AvailableServices ?? [];
    public DateTime LastSeen { get; set; }
    public byte[]? ManufacturerData { get; set; }

    public void Dispose()
    {
        Device?.Dispose();
        Device = null;
    }
}