2019-10-24 19:44:35 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.adapter;
|
|
|
|
|
|
|
|
import android.bluetooth.BluetoothGatt;
|
|
|
|
import android.bluetooth.BluetoothGattCharacteristic;
|
|
|
|
import android.content.Context;
|
|
|
|
|
2019-10-28 12:35:22 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.NotificationConfiguration;
|
2019-10-24 19:44:35 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.misfit.PlayNotificationRequest;
|
|
|
|
|
|
|
|
public abstract class WatchAdapter {
|
|
|
|
private QHybridSupport deviceSupport;
|
|
|
|
|
|
|
|
public WatchAdapter(QHybridSupport deviceSupport){
|
|
|
|
this.deviceSupport = deviceSupport;
|
|
|
|
}
|
|
|
|
|
2019-10-27 23:24:02 +01:00
|
|
|
public QHybridSupport getDeviceSupport(){
|
2019-10-24 19:44:35 +02:00
|
|
|
return this.deviceSupport;
|
|
|
|
}
|
|
|
|
|
2019-10-30 02:50:00 +01:00
|
|
|
public Context getContext(){
|
2019-10-24 19:44:35 +02:00
|
|
|
return getDeviceSupport().getContext();
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract void initialize();
|
|
|
|
|
|
|
|
public abstract void playPairingAnimation();
|
2019-10-28 12:35:22 +01:00
|
|
|
public abstract void playNotification(NotificationConfiguration config);
|
2019-10-24 19:44:35 +02:00
|
|
|
public abstract void setTime();
|
|
|
|
public abstract void overwriteButtons();
|
|
|
|
public abstract void setActivityHand(double progress);
|
|
|
|
public abstract void setHands(short hour, short minute);
|
|
|
|
public abstract void vibrate(PlayNotificationRequest.VibrationType vibration);
|
2019-10-25 19:13:55 +02:00
|
|
|
public abstract void vibrateFindMyDevicePattern();
|
2019-10-24 19:44:35 +02:00
|
|
|
public abstract void requestHandsControl();
|
|
|
|
public abstract void releaseHandsControl();
|
|
|
|
public abstract void setStepGoal(int stepGoal);
|
|
|
|
public abstract void setVibrationStrength(short strength);
|
2019-10-30 02:50:00 +01:00
|
|
|
public abstract void syncNotificationSettings();
|
2019-10-27 23:24:02 +01:00
|
|
|
public abstract void onTestNewFunction();
|
2019-10-24 19:44:35 +02:00
|
|
|
|
2019-11-04 02:47:38 +01:00
|
|
|
public abstract boolean supportsFindDevice();
|
2019-10-25 19:13:55 +02:00
|
|
|
public abstract boolean supportsExtendedVibration();
|
|
|
|
public abstract boolean supportsActivityHand();
|
|
|
|
public abstract String getModelName();
|
|
|
|
|
|
|
|
public abstract void onFetchActivityData();
|
|
|
|
|
2019-10-24 19:44:35 +02:00
|
|
|
public abstract boolean onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic);
|
2019-11-14 04:56:34 +01:00
|
|
|
public void onMtuChanged(BluetoothGatt gatt, int mtu, int status){};
|
2019-10-27 23:24:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
public String arrayToString(byte[] bytes) {
|
|
|
|
if (bytes.length == 0) return "";
|
|
|
|
StringBuilder s = new StringBuilder();
|
|
|
|
final String chars = "0123456789ABCDEF";
|
|
|
|
for (byte b : bytes) {
|
|
|
|
s.append(chars.charAt((b >> 4) & 0xF)).append(chars.charAt(b & 0xF)).append(" ");
|
|
|
|
}
|
|
|
|
return s.substring(0, s.length() - 1) + "\n";
|
|
|
|
}
|
2019-10-24 19:44:35 +02:00
|
|
|
}
|