package com.wytehat.btlogger;

public class DeviceRecord {
    public String address;
    public String name;
    public String customName;
    public String broadcastName;
    public String vendorName;
    public String category = "Other";
    public int categoryManual;
    public int vendorManual;
    public int mapEnabled;
    public int liveEnabled;
    public int locationLocked;
    public int showTrail = 1;
    public int trackBroadcast;
    public String reason;
    public String photoUri;
    public String iconPreset;
    public String pinColor = "#E53935";
    public long connectedAt;
    public long disconnectedAt;
    public long updatedAt;
    public long lastRssiAt;
    public double latitude;
    public double longitude;
    public float accuracy;
    public int battery = -1;
    public int rssi;
    public int connected;
    public int gpsPollingRate = 900000;
    public int trackingPriority = 15;
    public int tracked;
    public int txPowerAtOneMeter = -59;
    public double pathLossExponent = 2.7;
    public boolean hasLocation;


    public String displayName() {
        if (customName != null && customName.trim().length() > 0) return customName;
        if (broadcastName != null && broadcastName.trim().length() > 0 &&
            !"Unknown item".equals(broadcastName)) return broadcastName;
        if (vendorName != null && vendorName.trim().length() > 0) return vendorName;
        if (name != null && name.trim().length() > 0 && !"Unknown item".equals(name)) return name;
        return "Unknown Device";
    }
}
