blob: 624500ed0ae52fbb6fdb38d4048ebe0febd73724 [file] [log] [blame]
# Copyright 2023 Google LLC
#
# 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.
"""Host grpc interface."""
from typing import AsyncGenerator
from google.protobuf import empty_pb2
import grpc
from pandora import host_grpc_aio
from pandora import host_pb2
class HostService(host_grpc_aio.HostServicer):
"""Service to trigger Bluetooth Host procedures.
This class implements the Pandora bluetooth test interfaces,
where the meta class definition is automatically generated by the protobuf.
The interface definition can be found in:
https://cs.android.com/android/platform/superproject/+/main:external
/pandora/bt-test-interfaces/pandora/host.proto
"""
async def FactoryReset(self, request: empty_pb2.Empty, context: grpc.ServicerContext) -> empty_pb2.Empty:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
async def Reset(self, request: empty_pb2.Empty, context: grpc.ServicerContext) -> empty_pb2.Empty:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
async def ReadLocalAddress(self, request: empty_pb2.Empty,
context: grpc.ServicerContext) -> host_pb2.ReadLocalAddressResponse:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
async def Connect(self, request: host_pb2.ConnectRequest,
context: grpc.ServicerContext) -> host_pb2.ConnectResponse:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
async def WaitConnection(self, request: host_pb2.WaitConnectionRequest,
context: grpc.ServicerContext) -> host_pb2.WaitConnectionResponse:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
async def ConnectLE(self, request: host_pb2.ConnectLERequest,
context: grpc.ServicerContext) -> host_pb2.ConnectLEResponse:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
async def Disconnect(self, request: host_pb2.DisconnectRequest, context: grpc.ServicerContext) -> empty_pb2.Empty:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
async def WaitDisconnection(self, request: host_pb2.WaitDisconnectionRequest,
context: grpc.ServicerContext) -> empty_pb2.Empty:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
async def Advertise(self, request: host_pb2.AdvertiseRequest,
context: grpc.ServicerContext) -> AsyncGenerator[host_pb2.AdvertiseResponse, None]:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
yield host_pb2.AdvertiseResponse() # no-op: to make the linter happy
async def Scan(self, request: host_pb2.ScanRequest,
context: grpc.ServicerContext) -> AsyncGenerator[host_pb2.ScanningResponse, None]:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
yield host_pb2.ScanningResponse() # no-op: to make the linter happy
async def Inquiry(self, request: empty_pb2.Empty,
context: grpc.ServicerContext) -> AsyncGenerator[host_pb2.InquiryResponse, None]:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
yield host_pb2.InquiryResponse() # no-op: to make the linter happy
async def SetDiscoverabilityMode(
self,
request: host_pb2.SetDiscoverabilityModeRequest,
context: grpc.ServicerContext,
) -> empty_pb2.Empty:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")
async def SetConnectabilityMode(
self,
request: host_pb2.SetConnectabilityModeRequest,
context: grpc.ServicerContext,
) -> empty_pb2.Empty:
context.set_code(grpc.StatusCode.UNIMPLEMENTED) # type: ignore
context.set_details("Method not implemented!") # type: ignore
raise NotImplementedError("Method not implemented!")