1/* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto3"; 18 19package com.example.android.vdmdemo.common; 20 21option java_outer_classname = "RemoteEventProto"; 22option java_package = "com.example.android.vdmdemo.common"; 23 24// Next ID: 25 25message RemoteEvent { 26 int32 display_id = 1; 27 28 oneof event { 29 DeviceCapabilities device_capabilities = 2; 30 DeviceState device_state = 22; 31 StartStreaming start_streaming = 3; 32 StopStreaming stop_streaming = 4; 33 DisplayCapabilities display_capabilities = 5; 34 DisplayRotation display_rotation = 6; 35 BrightnessEvent brightness_event = 23; 36 EncodedFrame display_frame = 7; 37 SensorConfiguration sensor_configuration = 8; 38 RemoteInputEvent input_event = 9; 39 RemoteSensorEvent sensor_event = 10; 40 StartAudio start_audio = 11; 41 AudioFrame audio_frame = 12; 42 StopAudio stop_audio = 13; 43 RemoteHomeEvent home_event = 14; 44 DisplayChangeEvent display_change_event = 15; 45 KeyboardVisibilityEvent keyboard_visibility_event = 16; 46 StartAudioInput start_audio_input = 17; 47 StopAudioInput stop_audio_input = 18; 48 StartCameraStream start_camera_stream = 19; 49 StopCameraStream stop_camera_stream = 20; 50 CameraFrame camera_frame = 21; 51 RequestBluetoothDiscoverable request_bluetooth_discoverable = 24; 52 } 53} 54 55// Next ID: 7 56message DeviceCapabilities { 57 string device_name = 1; 58 string bluetooth_device_name = 6; 59 repeated SensorCapabilities sensor_capabilities = 2; 60 repeated CameraCapabilities camera_capabilities = 5; 61 bool supports_audio_input = 3; 62 bool supports_audio_output = 4; 63} 64 65message DeviceState { 66 bool power_on = 1; 67} 68 69message DisplayRotation { 70 int32 rotation_degrees = 1; 71} 72 73message SensorCapabilities { 74 int32 type = 1; 75 string name = 2; 76 string vendor = 3; 77 float max_range = 4; 78 float resolution = 5; 79 float power = 6; 80 int32 min_delay_us = 7; 81 int32 max_delay_us = 8; 82 bool is_wake_up_sensor = 9; 83 int32 reporting_mode = 10; 84 bool is_additional_info_supported = 11; 85} 86 87message CameraCapabilities { 88 string camera_id = 1; 89 int32 width = 2; 90 int32 height = 3; 91 int32 fps = 4; 92 int32 lens_facing = 5; 93 int32 sensor_orientation = 6; 94} 95 96message StartCameraStream { 97 string camera_id = 1; 98} 99 100message StopCameraStream { 101 string camera_id = 2; 102} 103 104message CameraFrame { 105 string camera_id = 1; 106 EncodedFrame camera_frame = 2; 107} 108 109message StartStreaming { 110 bool home_enabled = 1; 111 bool rotation_supported = 2; 112} 113 114message StopStreaming { 115 bool pause = 1; 116} 117 118message DisplayCapabilities { 119 int32 viewport_width = 1; 120 int32 viewport_height = 2; 121 int32 density_dpi = 3; 122} 123 124message BrightnessEvent { 125 float brightness = 1; 126} 127 128message EncodedFrame { 129 bytes frame_data = 1; 130 int32 frame_index = 2; 131 int32 flags = 3; 132 int64 presentation_time_us = 4; 133} 134 135enum InputDeviceType { 136 DEVICE_TYPE_NONE = 0; 137 DEVICE_TYPE_MOUSE = 1; 138 DEVICE_TYPE_DPAD = 2; 139 DEVICE_TYPE_NAVIGATION_TOUCHPAD = 3; 140 DEVICE_TYPE_TOUCHSCREEN = 4; 141 DEVICE_TYPE_KEYBOARD = 5; 142 DEVICE_TYPE_ROTARY_ENCODER = 6; 143} 144 145message RemoteInputEvent { 146 int64 timestamp_ms = 1; 147 148 InputDeviceType device_type = 2; 149 150 oneof event { 151 RemoteMotionEvent mouse_relative_event = 3; 152 RemoteKeyEvent mouse_button_event = 4; 153 RemoteMotionEvent mouse_scroll_event = 5; 154 155 RemoteKeyEvent key_event = 6; 156 157 RemoteMotionEvent touch_event = 7; 158 } 159} 160 161message RemoteMotionEvent { 162 int32 pointer_id = 1; 163 int32 action = 2; 164 float x = 3; 165 float y = 4; 166 float pressure = 5; 167} 168 169message RemoteKeyEvent { 170 int32 action = 1; 171 int32 key_code = 2; 172} 173 174message SensorConfiguration { 175 int32 sensor_type = 1; 176 bool enabled = 2; 177 int32 sampling_period_us = 3; 178 int32 batch_reporting_latency_us = 4; 179} 180 181message RemoteSensorEvent { 182 int32 sensor_type = 1; 183 repeated float values = 2; 184 int32 additional_info_type = 3; 185} 186 187message StartAudio {} 188 189message StopAudio {} 190 191message StartAudioInput { 192 int32 sample_rate = 1; 193 int32 channel_mask = 2; 194 int32 encoding = 3; 195} 196 197message StopAudioInput {} 198 199message AudioFrame { 200 bytes data = 1; 201} 202 203message RemoteHomeEvent {} 204 205message DisplayChangeEvent { 206 string title = 1; 207 bool focused = 2; 208} 209 210message KeyboardVisibilityEvent { 211 bool visible = 1; 212} 213 214message RequestBluetoothDiscoverable {} 215