2015-08-03 23:09:49 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.devices;
|
2015-07-27 23:49:53 +02:00
|
|
|
|
2016-05-16 23:00:04 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.entities.AbstractActivitySample;
|
|
|
|
|
2016-05-16 23:36:54 +02:00
|
|
|
public interface SampleProvider<T extends AbstractActivitySample> {
|
|
|
|
// TODO: these constants can all be removed
|
2016-02-29 20:54:39 +01:00
|
|
|
int PROVIDER_MIBAND = 0;
|
|
|
|
int PROVIDER_PEBBLE_MORPHEUZ = 1;
|
|
|
|
int PROVIDER_PEBBLE_GADGETBRIDGE = 2;
|
|
|
|
int PROVIDER_PEBBLE_MISFIT = 3;
|
|
|
|
int PROVIDER_PEBBLE_HEALTH = 4;
|
2015-10-21 16:11:16 +02:00
|
|
|
|
2016-02-29 20:54:39 +01:00
|
|
|
int PROVIDER_UNKNOWN = 100;
|
2016-05-16 23:36:54 +02:00
|
|
|
// TODO: can also be removed
|
|
|
|
int getID();
|
2015-07-27 23:49:53 +02:00
|
|
|
|
2016-02-29 20:54:39 +01:00
|
|
|
int normalizeType(int rawType);
|
2015-07-27 23:49:53 +02:00
|
|
|
|
2016-02-29 20:54:39 +01:00
|
|
|
int toRawActivityKind(int activityKind);
|
2015-07-27 23:49:53 +02:00
|
|
|
|
2016-02-29 20:54:39 +01:00
|
|
|
float normalizeIntensity(int rawIntensity);
|
2015-07-27 23:49:53 +02:00
|
|
|
|
2016-05-16 23:00:04 +02:00
|
|
|
List<T> getAllActivitySamples(int timestamp_from, int timestamp_to);
|
|
|
|
|
|
|
|
List<T> getActivitySamples(int timestamp_from, int timestamp_to);
|
|
|
|
|
|
|
|
List<T> getSleepSamples(int timestamp_from, int timestamp_to);
|
|
|
|
|
2016-05-16 23:36:54 +02:00
|
|
|
void changeStoredSamplesType(int timestampFrom, int timestampTo, int kind);
|
2016-05-16 23:00:04 +02:00
|
|
|
|
2016-05-16 23:36:54 +02:00
|
|
|
void changeStoredSamplesType(int timestampFrom, int timestampTo, int fromKind, int toKind);
|
2016-05-16 23:00:04 +02:00
|
|
|
|
2016-05-16 23:36:54 +02:00
|
|
|
int fetchLatestTimestamp();
|
2016-05-16 23:00:04 +02:00
|
|
|
|
2016-05-16 23:36:54 +02:00
|
|
|
void addGBActivitySample(T activitySample);
|
|
|
|
|
|
|
|
void addGBActivitySamples(T[] activitySamples);
|
2016-06-16 21:54:53 +02:00
|
|
|
|
|
|
|
T createActivitySample();
|
2015-07-27 23:49:53 +02:00
|
|
|
}
|