package io.trygvis.soilmoisture; import android.util.Log; import java.util.ArrayList; import java.util.List; import io.trygvis.android.bt.BtDevice; class SmDevice implements BtDevice.BtDeviceWrapper { private final static String TAG = SmDevice.class.getSimpleName(); private final BtDevice btDevice; private String name; private Boolean isUseful; private List monitors = new ArrayList<>(); public SmDevice(BtDevice btDevice) { this.btDevice = btDevice; Log.i(TAG, "new device"); name = btDevice.getName(); if (name != null && name.trim().length() == 0) { name = null; } } public BtDevice getBtDevice() { return btDevice; } public boolean isUseful() { return isUseful != null && isUseful; } public Boolean getIsUseful() { return isUseful; } public boolean isProbed() { return isUseful != null; } public void setIsUseful(Boolean isUseful) { Log.i(TAG, "useful=" + isUseful); this.isUseful = isUseful; } public String getName() { return name; } public List getMonitors() { return monitors; } }