2015-04-14 01:24:03 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge;
|
|
|
|
|
|
|
|
import android.bluetooth.BluetoothAdapter;
|
|
|
|
import android.content.Context;
|
|
|
|
|
2015-04-19 02:37:29 +02:00
|
|
|
/**
|
|
|
|
* Provides support for a specific device. Has hooks to manage the life cycle
|
|
|
|
* of a device: instances of this interface will be created, initialized, and disposed
|
|
|
|
* as needed.
|
|
|
|
*
|
|
|
|
* Implementations need to act accordingly, in order to establish, reestablish or close
|
|
|
|
* the connection to the device.
|
|
|
|
*
|
|
|
|
* This interface is agnostic to the kind transport, i.e. whether the device is connected
|
|
|
|
* via Bluetooth, Bluetooth LE, Wifi or something else.
|
|
|
|
*/
|
2015-04-14 01:24:03 +02:00
|
|
|
public interface DeviceSupport extends EventHandler {
|
|
|
|
public void initialize(GBDevice gbDevice, BluetoothAdapter btAdapter, Context context);
|
2015-04-14 10:29:09 +02:00
|
|
|
|
2015-04-19 02:37:29 +02:00
|
|
|
public boolean isConnected();
|
|
|
|
|
2015-04-14 01:24:03 +02:00
|
|
|
public boolean connect();
|
|
|
|
|
2015-04-19 02:37:29 +02:00
|
|
|
public void dispose();
|
|
|
|
|
2015-04-14 01:24:03 +02:00
|
|
|
public GBDevice getDevice();
|
2015-04-14 10:29:09 +02:00
|
|
|
|
2015-04-14 01:24:03 +02:00
|
|
|
public BluetoothAdapter getBluetoothAdapter();
|
2015-04-14 10:29:09 +02:00
|
|
|
|
2015-04-14 01:24:03 +02:00
|
|
|
public Context getContext();
|
2015-04-14 01:39:00 +02:00
|
|
|
|
2015-04-19 02:37:29 +02:00
|
|
|
public boolean useAutoConnect();
|
2015-04-14 01:24:03 +02:00
|
|
|
}
|