Package com.flir.thermalsdk.meterlink
Class AbstractMeterlinkDevice
java.lang.Object
com.flir.thermalsdk.meterlink.AbstractMeterlinkDevice
- Direct Known Subclasses:
MeterlinkDeviceBluetoothLe
,MeterlinkDeviceClassicBluetooth
A base class for a Meterlink device.
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractMeterlinkDevice
(FlirBluetoothDevice device, StoreManager storeManager) Non-public constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(OnMeterlinkTransferEventListener listener) Connect to the Meterlink device.abstract void
Disconnects the Meterlink device.boolean
Gets the MAC address of theAbstractMeterlinkDevice
.Gets a custom name for this device.Gets the name of theMeterlinkDeviceClassicBluetooth
.abstract boolean
Checks whether the Meterlink is a Bluetooth Low Energy (BLE) device.boolean
Checks whether the Meterlink is connected with our device.boolean
Checks whether the Meterlink is connecting with our device.void
setCustomName
(String customDeviceName) Stores a custom name for this device.void
Set a callback for reading raw packet data.
-
Constructor Details
-
AbstractMeterlinkDevice
Non-public constructor.- Parameters:
device
- a BluetoothDevice which will be wrapped by this objectstoreManager
- Register aStoreManager
implementation to handle storage operations
-
-
Method Details
-
connect
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
Set a callback for reading raw packet data. Can be useful for debugging.- Parameters:
listener
-MeterlinkRawPacketListener
that report raw packet information
-
getDefaultName
Gets the name of theMeterlinkDeviceClassicBluetooth
. This name is read from the remote device and can be displayed to the user.- Returns:
- the name of the instrument.
-
setCustomName
Stores a custom name for this device.- Parameters:
customDeviceName
- the custom name set for the device
-
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
Gets the MAC address of theAbstractMeterlinkDevice
.- 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
-