Class AbstractMeterlinkDevice

java.lang.Object
com.flir.thermalsdk.meterlink.AbstractMeterlinkDevice
Direct Known Subclasses:
MeterlinkDeviceBluetoothLe, MeterlinkDeviceClassicBluetooth

public abstract class AbstractMeterlinkDevice extends Object
A base class for a Meterlink device.
  • Constructor Details

    • AbstractMeterlinkDevice

      public AbstractMeterlinkDevice(FlirBluetoothDevice device, StoreManager storeManager)
      Non-public constructor.
      Parameters:
      device - a BluetoothDevice which will be wrapped by this object
      storeManager - Register a StoreManager implementation to handle storage operations
  • Method Details

    • connect

      public void connect(OnMeterlinkTransferEventListener listener)
      Connect to the Meterlink device. Use callback to receive message on connect/disconnect and updated values from the device. Connection will be established on an insecure socket (no pairing). Important: this method should be called on a background thread. Important: the MeterLink device DM93 will disconnect itself after 30 seconds, this is an issue with the device itself.
      Parameters:
      listener - a OnMeterlinkTransferEventListener used to receive message on connect/disconnect and updated values from the device
    • disconnect

      public abstract void disconnect()
      Disconnects the Meterlink device.
    • setRawPacketListener

      public void setRawPacketListener(MeterlinkRawPacketListener listener)
      Set a callback for reading raw packet data. Can be useful for debugging.
      Parameters:
      listener - MeterlinkRawPacketListener that report raw packet information
    • getDefaultName

      public String getDefaultName()
      Gets the name of the MeterlinkDeviceClassicBluetooth. This name is read from the remote device and can be displayed to the user.
      Returns:
      the name of the instrument.
    • setCustomName

      public void setCustomName(String customDeviceName)
      Stores a custom name for this device.
      Parameters:
      customDeviceName - the custom name set for the device
    • getCustomName

      public String getCustomName()
      Gets a custom name for this device.
      Returns:
      Returns a custom name for this device or null if it was not set before.
    • getAddress

      public String getAddress()
      Gets the MAC address of the AbstractMeterlinkDevice.
      Returns:
      Bluetooth hardware address as String.
    • isConnected

      public boolean isConnected()
      Checks whether the Meterlink is connected with our device.
      Returns:
      Returns true if the Meterlink is connected with our device, otherwise false.
    • isConnecting

      public boolean isConnecting()
      Checks whether the Meterlink is connecting with our device. Connection process lasts about 0-3 sec.
      Returns:
      Returns true if the Meterlink is in connecting with our device phrase, otherwise false.
    • isBleDevice

      public abstract boolean isBleDevice()
      Checks whether the Meterlink is a Bluetooth Low Energy (BLE) device.
      Returns:
      Returns true if the Meterlink is a Bluetooth Low Energy (BLE) device, otherwise false.
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object