first commit
This commit is contained in:
301
libmaestro/proto/maestro_pw.proto
Normal file
301
libmaestro/proto/maestro_pw.proto
Normal file
@@ -0,0 +1,301 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package maestro_pw;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
|
||||
/* -- Maestro Service --------------------------------------------------------------------------- */
|
||||
|
||||
message SoftwareInfo {
|
||||
int32 unknown2 = 2;
|
||||
FirmwareInfo firmware = 4;
|
||||
fixed64 unknown5 = 5;
|
||||
bool unknown6 = 6;
|
||||
}
|
||||
|
||||
message FirmwareInfo {
|
||||
// Note: order might not be correct
|
||||
FirmwareVersion case = 1;
|
||||
FirmwareVersion right = 2;
|
||||
FirmwareVersion left = 3;
|
||||
}
|
||||
|
||||
message FirmwareVersion {
|
||||
string unknown = 1;
|
||||
string version_string = 2;
|
||||
}
|
||||
|
||||
message HardwareInfo {
|
||||
int32 unknown1 = 1;
|
||||
int32 unknown2 = 2;
|
||||
int32 unknown5 = 5;
|
||||
int32 unknown6 = 6;
|
||||
SerialNumbers serial_number = 7;
|
||||
}
|
||||
|
||||
message SerialNumbers {
|
||||
string case = 1;
|
||||
string right = 2;
|
||||
string left = 3;
|
||||
}
|
||||
|
||||
message RuntimeInfo {
|
||||
int64 timestamp_ms = 2; // maybe unix time in ms (consistent ~60s difference to actual time)
|
||||
int32 unknown3 = 3;
|
||||
BatteryInfo battery_info = 6;
|
||||
PlacementInfo placement = 7;
|
||||
}
|
||||
|
||||
message BatteryInfo {
|
||||
DeviceBatteryInfo case = 1;
|
||||
DeviceBatteryInfo left = 2;
|
||||
DeviceBatteryInfo right = 3;
|
||||
}
|
||||
|
||||
message DeviceBatteryInfo {
|
||||
int32 level = 1; // battery level in percent
|
||||
BatteryState state = 2;
|
||||
}
|
||||
|
||||
enum BatteryState {
|
||||
BATTERY_STATE_UNKNOWN = 0;
|
||||
BATTERY_NOT_CHARGING = 1;
|
||||
BATTERY_CHARGING = 2;
|
||||
}
|
||||
|
||||
message PlacementInfo {
|
||||
bool right_bud_in_case = 1;
|
||||
bool left_bud_in_case = 2;
|
||||
}
|
||||
|
||||
message WallClockMsg {
|
||||
// TODO
|
||||
}
|
||||
|
||||
message ReadSettingMsg {
|
||||
oneof value_oneof {
|
||||
AllegroSettingType settings_id = 4;
|
||||
}
|
||||
}
|
||||
|
||||
enum AllegroSettingType {
|
||||
ALLEGRO_SETTING_TYPE_UNKNOWN = 0;
|
||||
ALLEGRO_AUTO_OTA_ENABLE = 1;
|
||||
ALLEGRO_OHD_ENABLE = 2;
|
||||
ALLEGRO_OOBE_IS_FINISHED = 3;
|
||||
ALLEGRO_GESTURE_ENABLE = 4;
|
||||
ALLEGRO_DIAGNOSTICS_ENABLE = 5;
|
||||
ALLEGRO_OOBE_MODE = 6;
|
||||
ALLEGRO_GESTURE_CONTROL = 7;
|
||||
ALLEGRO_ANC_ACCESSIBILITY_MODE = 8;
|
||||
ALLEGRO_ANCR_STATE_ONE_BUD = 9;
|
||||
ALLEGRO_ANCR_STATE_TWO_BUDS = 10;
|
||||
ALLEGRO_MULTIPOINT_ENABLE = 11;
|
||||
ALLEGRO_ANCR_GESTURE_LOOP = 12;
|
||||
ALLEGRO_CURRENT_ANCR_STATE = 13;
|
||||
ALLEGRO_OTTS_MODE = 14;
|
||||
ALLEGRO_VOLUME_EQ_ENABLE = 15;
|
||||
ALLEGRO_CURRENT_USER_EQ = 16;
|
||||
ALLEGRO_VOLUME_ASYMMETRY = 17;
|
||||
ALLEGRO_LAST_SAVED_USER_EQ = 18;
|
||||
}
|
||||
|
||||
message WriteSettingMsg {
|
||||
oneof value_oneof {
|
||||
SettingValue setting = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message SettingsRsp {
|
||||
oneof value_oneof {
|
||||
SettingValue value = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message SettingValue {
|
||||
oneof value_oneof {
|
||||
bool auto_ota_enable = 1;
|
||||
bool ohd_enable = 2; // on-head detection
|
||||
bool oobe_is_finished = 3; // out-of-box experience?
|
||||
bool gesture_enable = 4;
|
||||
bool diagnostics_enable = 5;
|
||||
bool oobe_mode = 6;
|
||||
GestureControl gesture_control = 7;
|
||||
// reading anc_accessibility_mode returns non-zero status (code: 2)
|
||||
// reading ancr_state_one_bud returns non-zero status (code: 2)
|
||||
// reading ancr_state_two_buds returns non-zero status (code: 2)
|
||||
bool multipoint_enable = 11;
|
||||
AncrGestureLoop ancr_gesture_loop = 12;
|
||||
AncState current_ancr_state = 13;
|
||||
int32 otts_mode = 14; // might be bool
|
||||
bool volume_eq_enable = 15;
|
||||
EqBands current_user_eq = 16;
|
||||
int32 volume_asymmetry = 17; // value goes from 0 t0 200 (incl.), even/odd indicates left/right
|
||||
// reading last_saved_user_eq returns non-zero status (code: 2)
|
||||
bool sum_to_mono = 19;
|
||||
// id 20 does not seem to exist (yet?)
|
||||
bool volume_exposure_notifications = 21;
|
||||
bool speech_detection = 22;
|
||||
}
|
||||
}
|
||||
|
||||
message GestureControl {
|
||||
DeviceGestureControl left = 1;
|
||||
DeviceGestureControl right = 2;
|
||||
}
|
||||
|
||||
message DeviceGestureControl {
|
||||
oneof value_oneof {
|
||||
GestureControlType type = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message GestureControlType {
|
||||
RegularActionTarget value = 1;
|
||||
}
|
||||
|
||||
enum RegularActionTarget {
|
||||
ACTION_TARGET_UNKNOWN = 0;
|
||||
ACTION_TARGET_CHECK_NOTIFICATIONS = 1;
|
||||
ACTION_TARGET_PREVIOUS_TRACK_REPEAT = 2;
|
||||
ACTION_TARGET_NEXT_TRACK = 3;
|
||||
ACTION_TARGET_PLAY_PAUSE_TRACK = 4;
|
||||
ACTION_TARGET_ANC_CONTROL = 5;
|
||||
ACTION_TARGET_ASSISTANT_QUERY = 6;
|
||||
}
|
||||
|
||||
message AncrGestureLoop {
|
||||
bool active = 1;
|
||||
bool off = 2;
|
||||
bool aware = 3;
|
||||
bool adaptive = 4;
|
||||
}
|
||||
|
||||
enum AncState {
|
||||
ANC_STATE_UNKNOWN = 0;
|
||||
ANC_STATE_OFF = 1;
|
||||
ANC_STATE_ACTIVE = 2;
|
||||
ANC_STATE_AWARE = 3;
|
||||
ANC_STATE_ADAPTIVE = 4;
|
||||
}
|
||||
|
||||
message EqBands {
|
||||
// bands go from -6.0 to 6.0
|
||||
float low_bass = 1;
|
||||
float bass = 2;
|
||||
float mid = 3;
|
||||
float treble = 4;
|
||||
float upper_treble = 5;
|
||||
}
|
||||
|
||||
message OobeActionRsp {
|
||||
OobeAction action = 1;
|
||||
}
|
||||
|
||||
enum OobeAction {
|
||||
OOBE_ACTION_UNKNOWN = 0;
|
||||
OOBE_ACTION_SINGLE_TAP = 1;
|
||||
OOBE_ACTION_DOUBLE_TAP = 2;
|
||||
OOBE_ACTION_TRIPLE_TAP = 3;
|
||||
OOBE_ACTION_HOLD = 4;
|
||||
OOBE_ACTION_SWIPE_FORWARD = 5;
|
||||
OOBE_ACTION_SWIPE_BACKWARD = 6;
|
||||
OOBE_ACTION_SWIPE_UP = 7;
|
||||
OOBE_ACTION_SWIPE_DOWN = 8;
|
||||
OOBE_ACTION_HOTWORD = 9;
|
||||
OOBE_ACTION_LEFT_ON_HEAD = 10;
|
||||
OOBE_ACTION_LEFT_OFF_HEAD = 11;
|
||||
OOBE_ACTION_RIGHT_ON_HEAD = 12;
|
||||
OOBE_ACTION_RIGHT_OFF_HEAD = 13;
|
||||
OOBE_ACTION_SPECULATIVE_TAP = 14;
|
||||
OOBE_ACTION_HOLD_END = 15;
|
||||
OOBE_ACTION_HOLD_CANCEL = 16;
|
||||
}
|
||||
|
||||
service Maestro {
|
||||
rpc GetSoftwareInfo(google.protobuf.Empty) returns (SoftwareInfo) {}
|
||||
rpc GetHardwareInfo(google.protobuf.Empty) returns (HardwareInfo) {}
|
||||
rpc SubscribeRuntimeInfo(google.protobuf.Empty) returns (stream RuntimeInfo) {}
|
||||
rpc SetWallClock(WallClockMsg) returns (google.protobuf.Empty) {}
|
||||
rpc WriteSetting(WriteSettingMsg) returns (google.protobuf.Empty) {}
|
||||
rpc ReadSetting(ReadSettingMsg) returns (SettingsRsp) {}
|
||||
rpc SubscribeToSettingsChanges(google.protobuf.Empty) returns (stream SettingsRsp) {}
|
||||
rpc SubscribeToOobeActions(google.protobuf.Empty) returns (stream OobeActionRsp) {}
|
||||
}
|
||||
|
||||
|
||||
/* -- Multipoint Service ------------------------------------------------------------------------ */
|
||||
|
||||
message QuietModeStatusEvent {
|
||||
int32 source = 1;
|
||||
}
|
||||
|
||||
message ForceMultipointSwitchMsg {
|
||||
// TODO
|
||||
}
|
||||
|
||||
service Multipoint {
|
||||
rpc SubscribeToQuietModeStatus(google.protobuf.Empty) returns (stream QuietModeStatusEvent) {}
|
||||
rpc ForceMultipointSwitch(ForceMultipointSwitchMsg) returns (google.protobuf.Empty) {}
|
||||
}
|
||||
|
||||
|
||||
/* -- EartipFitTest Service --------------------------------------------------------------------- */
|
||||
|
||||
message StartEartipFitTestMsg {
|
||||
// TODO
|
||||
}
|
||||
|
||||
message EndEartipFitTestMsg {
|
||||
// TODO
|
||||
}
|
||||
|
||||
message SubscribeToEartipFitTestResultsMsg {
|
||||
// TODO
|
||||
}
|
||||
|
||||
message EartipFitTestResult {
|
||||
// TODO
|
||||
}
|
||||
|
||||
service EartipFitTest {
|
||||
rpc StartTest(StartEartipFitTestMsg) returns (google.protobuf.Empty) {}
|
||||
rpc EndTest(StartEartipFitTestMsg) returns (google.protobuf.Empty) {}
|
||||
rpc SubscribeToResults(SubscribeToEartipFitTestResultsMsg) returns (stream EartipFitTestResult) {}
|
||||
}
|
||||
|
||||
|
||||
/* -- JitterBuffer Service ---------------------------------------------------------------------- */
|
||||
|
||||
message SetJitterBufferSizePreferenceMsg {
|
||||
// TODO
|
||||
}
|
||||
|
||||
service JitterBuffer {
|
||||
rpc SetJitterBufferSizePreference(SetJitterBufferSizePreferenceMsg) returns (google.protobuf.Empty) {}
|
||||
}
|
||||
|
||||
|
||||
/* -- Dosimeter Service ------------------------------------------------------------------------- */
|
||||
|
||||
message DosimeterSummaryEntry {
|
||||
int32 unknown1 = 1;
|
||||
float unknown6 = 6;
|
||||
}
|
||||
|
||||
message DosimeterSummary {
|
||||
int32 unknown1 = 1;
|
||||
repeated DosimeterSummaryEntry unknown2 = 2;
|
||||
int32 unknown4 = 4;
|
||||
float unknown5 = 5;
|
||||
}
|
||||
|
||||
message DosimeterLiveDbMsg {
|
||||
float intensity = 2; // convert to dB via log10(x) * 10
|
||||
}
|
||||
|
||||
service Dosimeter {
|
||||
rpc FetchDailySummaries(google.protobuf.Empty) returns (DosimeterSummary) {}
|
||||
rpc SubscribeToLiveDb(google.protobuf.Empty) returns (DosimeterLiveDbMsg) {}
|
||||
}
|
||||
87
libmaestro/proto/pw.rpc.packet.proto
Normal file
87
libmaestro/proto/pw.rpc.packet.proto
Normal file
@@ -0,0 +1,87 @@
|
||||
// Copied from pigweed RPC library with modifications.
|
||||
// - Changed package specification.
|
||||
// - Removed java-package option.
|
||||
//
|
||||
// Original copyright:
|
||||
// Copyright 2020 The Pigweed Authors
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// https://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.
|
||||
syntax = "proto3";
|
||||
|
||||
package pw.rpc.packet;
|
||||
|
||||
enum PacketType {
|
||||
// To simplify identifying the origin of a packet, client-to-server packets
|
||||
// use even numbers and server-to-client packets use odd numbers.
|
||||
|
||||
// Client-to-server packets
|
||||
|
||||
// The client invokes an RPC. Always the first packet.
|
||||
REQUEST = 0;
|
||||
|
||||
// A message in a client stream. Always sent after a REQUEST and before a
|
||||
// CLIENT_STREAM_END.
|
||||
CLIENT_STREAM = 2;
|
||||
|
||||
// The client received a packet for an RPC it did not request.
|
||||
CLIENT_ERROR = 4;
|
||||
|
||||
// Deprecated, do not use. Send a CLIENT_ERROR with status CANCELLED instead.
|
||||
// TODO(b/234879973): Remove this packet type.
|
||||
DEPRECATED_CANCEL = 6;
|
||||
|
||||
// A client stream has completed.
|
||||
CLIENT_STREAM_END = 8;
|
||||
|
||||
// Server-to-client packets
|
||||
|
||||
// The RPC has finished.
|
||||
RESPONSE = 1;
|
||||
|
||||
// Deprecated, do not use. Formerly was used as the last packet in a server
|
||||
// stream.
|
||||
// TODO(b/234879973): Remove this packet type.
|
||||
DEPRECATED_SERVER_STREAM_END = 3;
|
||||
|
||||
// The server was unable to process a request.
|
||||
SERVER_ERROR = 5;
|
||||
|
||||
// A message in a server stream.
|
||||
SERVER_STREAM = 7;
|
||||
}
|
||||
|
||||
message RpcPacket {
|
||||
// The type of packet. Determines which other fields are used.
|
||||
PacketType type = 1;
|
||||
|
||||
// Channel through which the packet is sent.
|
||||
uint32 channel_id = 2;
|
||||
|
||||
// Hash of the fully-qualified name of the service with which this packet is
|
||||
// associated. For RPC packets, this is the service that processes the packet.
|
||||
fixed32 service_id = 3;
|
||||
|
||||
// Hash of the name of the method which should process this packet.
|
||||
fixed32 method_id = 4;
|
||||
|
||||
// The packet's payload, which is an encoded protobuf.
|
||||
bytes payload = 5;
|
||||
|
||||
// Status code for the RPC response or error.
|
||||
uint32 status = 6;
|
||||
|
||||
// Unique identifier for the call that initiated this RPC. Optionally set by
|
||||
// the client in the initial request and sent in all subsequent client
|
||||
// packets; echoed by the server.
|
||||
uint32 call_id = 7;
|
||||
}
|
||||
Reference in New Issue
Block a user