diff options
author | uael <uael@google.com> | 2023-03-31 00:09:39 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-03-31 00:09:39 +0000 |
commit | 9b2fb63334605e19e8b3ae43291dcf1ea763fd0c (patch) | |
tree | 508ecc0598bbd112b74c91a90960d8fbf11d433c | |
parent | 270595a4bef2dd1b261c114b2644a95b487ec493 (diff) | |
parent | 3089ef72d610aac97057e14dc9af2510ebde0b4a (diff) | |
download | bt-test-interfaces-9b2fb63334605e19e8b3ae43291dcf1ea763fd0c.tar.gz |
Merge remote-tracking branch 'aosp/upstream-main' into master am: 52a25e22b9 am: 82ad70d75c am: 298373f240 am: 3089ef72d6
Original change: https://android-review.googlesource.com/c/platform/external/pandora/bt-test-interfaces/+/2514339
Change-Id: I5a2bc0358e143c72f77c3a4681b96bd84b78007b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | pandora/asha.proto | 59 | ||||
-rwxr-xr-x | python/_build/protoc-gen-custom_grpc | 16 |
2 files changed, 64 insertions, 11 deletions
diff --git a/pandora/asha.proto b/pandora/asha.proto index 4fafc5b..6b2ab64 100644 --- a/pandora/asha.proto +++ b/pandora/asha.proto @@ -14,17 +14,26 @@ syntax = "proto3"; -option java_outer_classname = "ASHAProto"; +option java_outer_classname = "AshaProto"; -package pandora; +package pandora.asha; import "google/protobuf/empty.proto"; +import "pandora/host.proto"; // Service to trigger Audio Streaming for Hearing Aid (ASHA) procedures. // ASHA uses connection-oriented L2CAP channels (CoC) and GATT. -service ASHA { +service Asha { // Register ASHA Service. rpc Register(RegisterRequest) returns (google.protobuf.Empty); + // Capture Audio. + rpc CaptureAudio(CaptureAudioRequest) returns (stream CaptureAudioResponse); + // Start a suspended stream. + rpc Start(StartRequest) returns (StartResponse); + // Playback audio + rpc PlaybackAudio(stream PlaybackAudioRequest) returns (PlaybackAudioResponse); + // Stop a started stream. + rpc Stop(stream StopRequest) returns (StopResponse); } // Request of the `Register` method. @@ -32,3 +41,47 @@ message RegisterRequest { uint32 capability = 1; // left or right device, monaural or binaural device. repeated uint32 hisyncid = 2; // id identifying two hearing aids as one pair. } + +// Request of the `CaptureAudio` method. +message CaptureAudioRequest { + // Low Energy connection. + Connection connection = 1; +} + +// Response of the `CaptureAudio` method. +message CaptureAudioResponse { + // Audio data received on peripheral side. + // `data` is decoded by G722 decoder. + bytes data = 1; +} + +// Request of the `Start` method. +message StartRequest { + // Low Energy connection. + Connection connection = 1; +} + +// Response of the `Start` method. +message StartResponse {} + +// Request of the `PlaybackAudio` method. +message PlaybackAudioRequest { + // Low Energy connection. + Connection connection = 1; + // Audio data to playback. + // `data` should be interleaved stereo frames with 16-bit signed little-endian + // linear PCM samples at 44100Hz sample rate + bytes data = 2; +} + +// Response of the `PlaybackAudio` method. +message PlaybackAudioResponse {} + +// Request of the `Stop` method. +message StopRequest { + // Low Energy connection. + Connection connection = 1; +} + +// Response of the `Stop` method. +message StopResponse {} diff --git a/python/_build/protoc-gen-custom_grpc b/python/_build/protoc-gen-custom_grpc index 37b31b7..7f6a381 100755 --- a/python/_build/protoc-gen-custom_grpc +++ b/python/_build/protoc-gen-custom_grpc @@ -273,19 +273,19 @@ def generate_service_method(imports: List[str], file: FileDescriptorProto, servi if input_mode == 'stream': output_type_hint = f'StreamStream[{input_type}, {output_type}]' if sync: - add_import(imports, f'from {file.package}._utils import Sender') - add_import(imports, f'from {file.package}._utils import Stream') - add_import(imports, f'from {file.package}._utils import StreamStream') + add_import(imports, f'from ._utils import Sender') + add_import(imports, f'from ._utils import Stream') + add_import(imports, f'from ._utils import StreamStream') else: - add_import(imports, f'from {file.package}._utils import AioSender as Sender') - add_import(imports, f'from {file.package}._utils import AioStream as Stream') - add_import(imports, f'from {file.package}._utils import AioStreamStream as StreamStream') + add_import(imports, f'from ._utils import AioSender as Sender') + add_import(imports, f'from ._utils import AioStream as Stream') + add_import(imports, f'from ._utils import AioStreamStream as StreamStream') else: output_type_hint = f'Stream[{output_type}]' if sync: - add_import(imports, f'from {file.package}._utils import Stream') + add_import(imports, f'from ._utils import Stream') else: - add_import(imports, f'from {file.package}._utils import AioStream as Stream') + add_import(imports, f'from ._utils import AioStream as Stream') else: output_type_hint = output_type if sync else f'Awaitable[{output_type}]' if not sync: add_import(imports, f'from typing import Awaitable') |