forked from upstream-mirrors/OpenTracks
Adding battery_level to protobuffers spec.
This commit is contained in:
@@ -50,4 +50,5 @@ message SensorDataSet {
|
|||||||
optional SensorData heart_rate = 2;
|
optional SensorData heart_rate = 2;
|
||||||
optional SensorData cadence = 3;
|
optional SensorData cadence = 3;
|
||||||
optional SensorData power = 4;
|
optional SensorData power = 4;
|
||||||
|
optional SensorData battery_level = 5;
|
||||||
}
|
}
|
||||||
@@ -398,10 +398,18 @@ public final class Sensor {
|
|||||||
public boolean hasPower() { return hasPower; }
|
public boolean hasPower() { return hasPower; }
|
||||||
public com.google.android.apps.mytracks.content.Sensor.SensorData getPower() { return power_; }
|
public com.google.android.apps.mytracks.content.Sensor.SensorData getPower() { return power_; }
|
||||||
|
|
||||||
|
// optional .com.google.android.apps.mytracks.content.SensorData battery_level = 5;
|
||||||
|
public static final int BATTERY_LEVEL_FIELD_NUMBER = 5;
|
||||||
|
private boolean hasBatteryLevel;
|
||||||
|
private com.google.android.apps.mytracks.content.Sensor.SensorData batteryLevel_;
|
||||||
|
public boolean hasBatteryLevel() { return hasBatteryLevel; }
|
||||||
|
public com.google.android.apps.mytracks.content.Sensor.SensorData getBatteryLevel() { return batteryLevel_; }
|
||||||
|
|
||||||
private void initFields() {
|
private void initFields() {
|
||||||
heartRate_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
|
heartRate_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
|
||||||
cadence_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
|
cadence_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
|
||||||
power_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
|
power_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
|
||||||
|
batteryLevel_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
|
||||||
}
|
}
|
||||||
public final boolean isInitialized() {
|
public final boolean isInitialized() {
|
||||||
if (hasHeartRate()) {
|
if (hasHeartRate()) {
|
||||||
@@ -413,6 +421,9 @@ public final class Sensor {
|
|||||||
if (hasPower()) {
|
if (hasPower()) {
|
||||||
if (!getPower().isInitialized()) return false;
|
if (!getPower().isInitialized()) return false;
|
||||||
}
|
}
|
||||||
|
if (hasBatteryLevel()) {
|
||||||
|
if (!getBatteryLevel().isInitialized()) return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,6 +442,9 @@ public final class Sensor {
|
|||||||
if (hasPower()) {
|
if (hasPower()) {
|
||||||
output.writeMessage(4, getPower());
|
output.writeMessage(4, getPower());
|
||||||
}
|
}
|
||||||
|
if (hasBatteryLevel()) {
|
||||||
|
output.writeMessage(5, getBatteryLevel());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int memoizedSerializedSize = -1;
|
private int memoizedSerializedSize = -1;
|
||||||
@@ -455,6 +469,10 @@ public final class Sensor {
|
|||||||
size += com.google.protobuf.CodedOutputStream
|
size += com.google.protobuf.CodedOutputStream
|
||||||
.computeMessageSize(4, getPower());
|
.computeMessageSize(4, getPower());
|
||||||
}
|
}
|
||||||
|
if (hasBatteryLevel()) {
|
||||||
|
size += com.google.protobuf.CodedOutputStream
|
||||||
|
.computeMessageSize(5, getBatteryLevel());
|
||||||
|
}
|
||||||
memoizedSerializedSize = size;
|
memoizedSerializedSize = size;
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
@@ -611,6 +629,9 @@ public final class Sensor {
|
|||||||
if (other.hasPower()) {
|
if (other.hasPower()) {
|
||||||
mergePower(other.getPower());
|
mergePower(other.getPower());
|
||||||
}
|
}
|
||||||
|
if (other.hasBatteryLevel()) {
|
||||||
|
mergeBatteryLevel(other.getBatteryLevel());
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -660,6 +681,15 @@ public final class Sensor {
|
|||||||
setPower(subBuilder.buildPartial());
|
setPower(subBuilder.buildPartial());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 42: {
|
||||||
|
com.google.android.apps.mytracks.content.Sensor.SensorData.Builder subBuilder = com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder();
|
||||||
|
if (hasBatteryLevel()) {
|
||||||
|
subBuilder.mergeFrom(getBatteryLevel());
|
||||||
|
}
|
||||||
|
input.readMessage(subBuilder, extensionRegistry);
|
||||||
|
setBatteryLevel(subBuilder.buildPartial());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -794,6 +824,43 @@ public final class Sensor {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// optional .com.google.android.apps.mytracks.content.SensorData battery_level = 5;
|
||||||
|
public boolean hasBatteryLevel() {
|
||||||
|
return result.hasBatteryLevel();
|
||||||
|
}
|
||||||
|
public com.google.android.apps.mytracks.content.Sensor.SensorData getBatteryLevel() {
|
||||||
|
return result.getBatteryLevel();
|
||||||
|
}
|
||||||
|
public Builder setBatteryLevel(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
|
||||||
|
if (value == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
result.hasBatteryLevel = true;
|
||||||
|
result.batteryLevel_ = value;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public Builder setBatteryLevel(com.google.android.apps.mytracks.content.Sensor.SensorData.Builder builderForValue) {
|
||||||
|
result.hasBatteryLevel = true;
|
||||||
|
result.batteryLevel_ = builderForValue.build();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public Builder mergeBatteryLevel(com.google.android.apps.mytracks.content.Sensor.SensorData value) {
|
||||||
|
if (result.hasBatteryLevel() &&
|
||||||
|
result.batteryLevel_ != com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance()) {
|
||||||
|
result.batteryLevel_ =
|
||||||
|
com.google.android.apps.mytracks.content.Sensor.SensorData.newBuilder(result.batteryLevel_).mergeFrom(value).buildPartial();
|
||||||
|
} else {
|
||||||
|
result.batteryLevel_ = value;
|
||||||
|
}
|
||||||
|
result.hasBatteryLevel = true;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public Builder clearBatteryLevel() {
|
||||||
|
result.hasBatteryLevel = false;
|
||||||
|
result.batteryLevel_ = com.google.android.apps.mytracks.content.Sensor.SensorData.getDefaultInstance();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
// @@protoc_insertion_point(builder_scope:com.google.android.apps.mytracks.content.SensorDataSet)
|
// @@protoc_insertion_point(builder_scope:com.google.android.apps.mytracks.content.SensorDataSet)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user