aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Duarte <licorne@google.com>2021-10-30 16:17:21 +0000
committerDavid Duarte <licorne@google.com>2021-10-30 16:17:42 +0000
commitc8e0a2be5f0b4149885f6ec4397fb001199b870c (patch)
tree5a1349e29861cbe5f9b1624673c1af4d87aa90ef
parent478531d15ea1c4a8a3b50647221538e2074fd0dd (diff)
downloadmmi2grpc-c8e0a2be5f0b4149885f6ec4397fb001199b870c.tar.gz
interact: add a reset function
Change-Id: I4b7ecba900aedd14f3da1c508db1bd06ef30954e
-rw-r--r--interact/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/interact/__init__.py b/interact/__init__.py
index faa92b2..dac3702 100644
--- a/interact/__init__.py
+++ b/interact/__init__.py
@@ -5,6 +5,7 @@ from blueberry.host_grpc import Host
GRPC_PORT = 8999
+
def run(profile: str, interaction_id: str, test: str, pts_addr: bytes):
channel = grpc.insecure_channel(f'localhost:{GRPC_PORT}')
print(f'{profile} mmi: {interaction_id}')
@@ -12,6 +13,13 @@ def run(profile: str, interaction_id: str, test: str, pts_addr: bytes):
a2dp.interact(channel, interaction_id, test, pts_addr)
channel.close()
+
+def reset():
+ channel = grpc.insecure_channel(f'localhost:{GRPC_PORT}')
+ Host(channel).Reset(wait_for_ready=True)
+ channel.close()
+
+
def read_local_address() -> bytes:
channel = grpc.insecure_channel(f'localhost:{GRPC_PORT}')
bluetooth_address = Host(channel).ReadLocalAddress(wait_for_ready=True)