mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-24 02:46:50 +01:00
Improve parsing and debug output for activity summaries from Mi Band/Amazfit
This commit is contained in:
parent
26165f9117
commit
c17c3ed341
@ -43,8 +43,8 @@ import nodomain.freeyourgadget.gadgetbridge.entities.User;
|
|||||||
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
|
import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
|
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
import nodomain.freeyourgadget.gadgetbridge.service.btle.TransactionBuilder;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiSupport;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiSportsActivityType;
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiSportsActivityType;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiSupport;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -197,44 +197,88 @@ public class FetchSportsSummaryOperation extends AbstractFetchOperation {
|
|||||||
summary.setBaseLongitude(baseLongitude);
|
summary.setBaseLongitude(baseLongitude);
|
||||||
summary.setBaseLatitude(baseLatitude);
|
summary.setBaseLatitude(baseLatitude);
|
||||||
summary.setBaseAltitude(baseAltitude);
|
summary.setBaseAltitude(baseAltitude);
|
||||||
|
|
||||||
|
// unused data (for now)
|
||||||
|
float distanceMeters = buffer.getFloat();
|
||||||
|
float ascentMeters = buffer.getFloat();
|
||||||
|
float descentMeters = buffer.getFloat();
|
||||||
|
float maxAltitude = buffer.getFloat();
|
||||||
|
float minAltitude = buffer.getFloat();
|
||||||
|
int maxLatitude = buffer.getInt(); // format?
|
||||||
|
int minLatitude = buffer.getInt(); // format?
|
||||||
|
int maxLongitude = buffer.getInt(); // format?
|
||||||
|
int minLongitude = buffer.getInt(); // format?
|
||||||
|
int steps = buffer.getInt();
|
||||||
|
int activeSeconds = buffer.getInt();
|
||||||
|
float caloriesBurnt = buffer.getFloat();
|
||||||
|
float maxSpeed = buffer.getFloat();
|
||||||
|
float minPace = buffer.getFloat(); // format?
|
||||||
|
float maxPace = buffer.getFloat(); // format?
|
||||||
|
float totalStride = buffer.getFloat();
|
||||||
|
|
||||||
|
buffer.getInt(); // unknown
|
||||||
|
buffer.getInt(); // unknown
|
||||||
|
buffer.getInt(); // unknown
|
||||||
|
|
||||||
|
int ascentSeconds = buffer.getInt() / 1000; //ms?
|
||||||
|
buffer.getInt(); // unknown;
|
||||||
|
int descentSeconds = buffer.getInt() / 1000; //ms?
|
||||||
|
buffer.getInt(); // unknown;
|
||||||
|
int flatSeconds = buffer.getInt() / 1000; // ms?
|
||||||
|
int averageHR = buffer.getShort();
|
||||||
|
int averagePaceSeconds = buffer.getShort();
|
||||||
|
int averageStride = buffer.getShort();
|
||||||
|
buffer.getShort(); // unknown
|
||||||
|
|
||||||
|
LOG.debug("unused data:" +
|
||||||
|
"\ndistanceMeters=" + distanceMeters +
|
||||||
|
"\nascentMeters=" + ascentMeters +
|
||||||
|
"\ndescentMeters=" + descentMeters +
|
||||||
|
"\nmaxAltitude=" + maxAltitude +
|
||||||
|
"\nminAltitude=" + minAltitude +
|
||||||
|
//"\nmaxLatitude=" + maxLatitude + // not useful
|
||||||
|
//"\nminLatitude=" + minLatitude + // not useful
|
||||||
|
//"\nmaxLongitude=" + maxLongitude + // not useful
|
||||||
|
//"\nminLongitude=" + minLongitude + // not useful
|
||||||
|
"\nsteps=" + steps +
|
||||||
|
"\nactiveSeconds=" + activeSeconds +
|
||||||
|
"\ncaloriesBurnt=" + caloriesBurnt +
|
||||||
|
"\nmaxSpeed=" + maxSpeed +
|
||||||
|
"\nminPace=" + minPace +
|
||||||
|
"\nmaxPace=" + maxPace +
|
||||||
|
"\ntotalStride=" + totalStride +
|
||||||
|
"\nascentSeconds=" + ascentSeconds +
|
||||||
|
"\ndescentSeconds=" + descentSeconds +
|
||||||
|
"\nflatSeconds=" + flatSeconds +
|
||||||
|
"\naverageHR=" + averageHR +
|
||||||
|
"\naveragePaceSeconds=" + averagePaceSeconds +
|
||||||
|
"\naverageStride=" + averageStride +
|
||||||
|
""
|
||||||
|
);
|
||||||
|
|
||||||
// summary.setBaseCoordinate(new GPSCoordinate(baseLatitude, baseLongitude, baseAltitude));
|
// summary.setBaseCoordinate(new GPSCoordinate(baseLatitude, baseLongitude, baseAltitude));
|
||||||
|
// summary.setDistanceMeters(distanceMeters);
|
||||||
// summary.setDistanceMeters(Float.intBitsToFloat(buffer.getInt()));
|
// summary.setAscentMeters(ascentMeters);
|
||||||
// summary.setAscentMeters(Float.intBitsToFloat(buffer.getInt()));
|
// summary.setDescentMeters(descentMeters);
|
||||||
// summary.setDescentMeters(Float.intBitsToFloat(buffer.getInt()));
|
// summary.setMinAltitude(maxAltitude);
|
||||||
//
|
// summary.setMaxAltitude(maxAltitude);
|
||||||
// summary.setMinAltitude(Float.intBitsToFloat(buffer.getInt()));
|
// summary.setMinLatitude(minLatitude);
|
||||||
// summary.setMaxAltitude(Float.intBitsToFloat(buffer.getInt()));
|
// summary.setMaxLatitude(maxLatitude);
|
||||||
// summary.setMinLatitude(buffer.getInt());
|
// summary.setMinLongitude(minLatitude);
|
||||||
// summary.setMaxLatitude(buffer.getInt());
|
// summary.setMaxLongitude(maxLatitude);
|
||||||
// summary.setMinLongitude(buffer.getInt());
|
// summary.setSteps(steps);
|
||||||
// summary.setMaxLongitude(buffer.getInt());
|
// summary.setActiveTimeSeconds(secondsActive);
|
||||||
//
|
// summary.setCaloriesBurnt(caloriesBurnt);
|
||||||
// summary.setSteps(BLETypeConversions.toUnsigned(buffer.getInt()));
|
// summary.setMaxSpeed(maxSpeed);
|
||||||
// summary.setActiveTimeSeconds(BLETypeConversions.toUnsigned(buffer.getInt()));
|
// summary.setMinPace(minPace);
|
||||||
//
|
// summary.setMaxPace(maxPace);
|
||||||
// summary.setCaloriesBurnt(Float.intBitsToFloat(buffer.get()));
|
// summary.setTotalStride(totalStride);
|
||||||
// summary.setMaxSpeed(Float.intBitsToFloat(buffer.get()));
|
// summary.setTimeAscent(BLETypeConversions.toUnsigned(ascentSeconds);
|
||||||
// summary.setMinPace(Float.intBitsToFloat(buffer.get()));
|
// summary.setTimeDescent(BLETypeConversions.toUnsigned(descentSeconds);
|
||||||
// summary.setMaxPace(Float.intBitsToFloat(buffer.get()));
|
// summary.setTimeFlat(BLETypeConversions.toUnsigned(flatSeconds);
|
||||||
// summary.setTotalStride(Float.intBitsToFloat(buffer.get()));
|
// summary.setAverageHR(BLETypeConversions.toUnsigned(averageHR);
|
||||||
|
// summary.setAveragePace(BLETypeConversions.toUnsigned(averagePace);
|
||||||
buffer.getInt(); //
|
// summary.setAverageStride(BLETypeConversions.toUnsigned(averageStride);
|
||||||
buffer.getInt(); //
|
|
||||||
buffer.getInt(); //
|
|
||||||
|
|
||||||
// summary.setTimeAscent(BLETypeConversions.toUnsigned(buffer.getInt()));
|
|
||||||
// buffer.getInt(); //
|
|
||||||
// summary.setTimeDescent(BLETypeConversions.toUnsigned(buffer.getInt()));
|
|
||||||
// buffer.getInt(); //
|
|
||||||
// summary.setTimeFlat(BLETypeConversions.toUnsigned(buffer.getInt()));
|
|
||||||
//
|
|
||||||
// summary.setAverageHR(BLETypeConversions.toUnsigned(buffer.getShort()));
|
|
||||||
//
|
|
||||||
// summary.setAveragePace(BLETypeConversions.toUnsigned(buffer.getShort()));
|
|
||||||
// summary.setAverageStride(BLETypeConversions.toUnsigned(buffer.getShort()));
|
|
||||||
|
|
||||||
buffer.getShort(); //
|
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user