Files
OpenTracks/MyTracksLib/proto/sensor.proto
T
Rodrigo Damazio 1988337598 Multiple improvements to the data hub:
* Making registration finer-grained so we only listen to the data we really need.
* Moving the system listener registration to an external class (for testability and readability)
* Adding a unit test (not yet complete)
* Adding documention and cleaning up comments

Still many things TODO:
* Allow pausing of registrations
* Add pause/resume to onPause/onResume of activities
* Move sampling logic out of the hub
* Optimize data reloading when display preferences change
* (maybe) move the data hub and related classes to the "content" package
2011-04-12 01:22:57 -03:00

53 lines
1.5 KiB
Protocol Buffer

// Copyright 2010 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
package com.google.android.apps.mytracks.content;
option optimize_for = LITE_RUNTIME;
// An enumeration of the state of a single sensor.
enum SensorState {
// There is no sensor.
NONE = 1;
// Now initiating an outgoing connection.
CONNECTING = 2;
// Now connected to a remote device.
CONNECTED = 3;
// A state where the sensor is not connected.
DISCONNECTED = 4;
// This is the only state where the sensor data can be used.
SENDING = 5;
};
// The state and possible reading for one integer sensor.
message SensorData {
required SensorState state = 1 [default = NONE];
// Value is only defined if state = SENDING.
optional int32 value = 2;
};
// A message to encapsulate sensor readings associated with a track point.
message SensorDataSet {
// This is a required field.
optional uint64 creation_time = 1 [default = 0];
optional SensorData heart_rate = 2;
optional SensorData cadence = 3;
optional SensorData power = 4;
}