diff options
author | 2024-09-30 14:16:14 +0000 | |
---|---|---|
committer | 2024-10-23 06:44:13 +0000 | |
commit | 43ab3cae2c92aac3e7cc8cba3d74d4c35bc4cec8 (patch) | |
tree | 10055287204341881883961e71a69ec8e5844ee0 /pandora | |
parent | 41e81e10b5ca1bc6f5b40784df965b4e6feaa1c2 (diff) |
pandora: add support to VCP tests
Implements VCP tests that are supported by bluetooth stack. Tests
that are skipped require mechanism to trigger sending write to Volume
Control Point with "Unmute" OP code
Bug: 369938109
Flag: TEST_ONLY
Test: atest pts-bot:VCP -v
Change-Id: I1fa01b7e184abe164da0420a70c46b4c1c2fb75d
Diffstat (limited to 'pandora')
-rw-r--r-- | pandora/interfaces/pandora_experimental/vcp.proto | 47 | ||||
-rw-r--r-- | pandora/interfaces/python/Android.bp | 5 |
2 files changed, 52 insertions, 0 deletions
diff --git a/pandora/interfaces/pandora_experimental/vcp.proto b/pandora/interfaces/pandora_experimental/vcp.proto new file mode 100644 index 0000000000..42641c8545 --- /dev/null +++ b/pandora/interfaces/pandora_experimental/vcp.proto @@ -0,0 +1,47 @@ +// Copyright (C) 2024 The Android Open Source Project +// 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. + +syntax = "proto3"; + +package pandora.vcp; + +import "pandora/host.proto"; +option java_outer_classname = "VcpProto"; +import "google/protobuf/empty.proto"; + +service VCP { + // set absolute volume on remote device + rpc SetDeviceVolume(SetDeviceVolumeRequest) returns (google.protobuf.Empty); + // set volume offset on remote device + rpc SetVolumeOffset(SetVolumeOffsetRequest) returns (google.protobuf.Empty); + // Wait for device to be connected. + rpc WaitConnect(WaitConnectRequest) returns (google.protobuf.Empty); +} + +// Request of the `SetDeviceVolume` method +message SetDeviceVolumeRequest{ + // Connection crafted by grpc server + Connection connection = 1; + // Volume value to be set + int32 volume = 2; +} + +// Request of the `SetVolumeOffset` method +message SetVolumeOffsetRequest{ + // Connection crafted by grpc server + Connection connection = 1; + // Volume offset value to be set + int32 offset = 2; +} + +message WaitConnectRequest { + Connection connection = 1; +} diff --git a/pandora/interfaces/python/Android.bp b/pandora/interfaces/python/Android.bp index d295f2cfd3..c866c4a138 100644 --- a/pandora/interfaces/python/Android.bp +++ b/pandora/interfaces/python/Android.bp @@ -95,6 +95,10 @@ genrule { "pandora_experimental/rfcomm_grpc_aio.py", "pandora_experimental/rfcomm_pb2.py", "pandora_experimental/rfcomm_pb2.pyi", + "pandora_experimental/vcp_grpc.py", + "pandora_experimental/vcp_grpc_aio.py", + "pandora_experimental/vcp_pb2.py", + "pandora_experimental/vcp_pb2.pyi", ], } @@ -129,6 +133,7 @@ filegroup { ":pandora_experimental-python-gen-src{pandora_experimental/pbap_pb2.pyi}", ":pandora_experimental-python-gen-src{pandora_experimental/py.typed}", ":pandora_experimental-python-gen-src{pandora_experimental/rfcomm_pb2.pyi}", + ":pandora_experimental-python-gen-src{pandora_experimental/vcp_pb2.pyi}", ], } |