# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from bumble.transport.grpc_protobuf.netsim import packet_streamer_pb2 as netsim_dot_packet__streamer__pb2


class PacketStreamerStub(object):
    """*
    This is the packet service for the network simulator.

    Android Virtual Devices (AVDs) and accessory devices use this service to
    connect to the network simulator and pass packets back and forth.

    AVDs running in a guest VM are built with virtual controllers for each radio
    chip. These controllers route chip requests to host emulators (qemu and
    crosvm) using virtio and from there they are forwarded to this gRpc service.

    This setup provides a transparent radio environment across AVDs and
    accessories because the network simulator contains libraries to emulate
    Bluetooth, 80211MAC, UWB, and Rtt chips.

    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.StreamPackets = channel.stream_stream(
                '/netsim.packet.PacketStreamer/StreamPackets',
                request_serializer=netsim_dot_packet__streamer__pb2.PacketRequest.SerializeToString,
                response_deserializer=netsim_dot_packet__streamer__pb2.PacketResponse.FromString,
                )


class PacketStreamerServicer(object):
    """*
    This is the packet service for the network simulator.

    Android Virtual Devices (AVDs) and accessory devices use this service to
    connect to the network simulator and pass packets back and forth.

    AVDs running in a guest VM are built with virtual controllers for each radio
    chip. These controllers route chip requests to host emulators (qemu and
    crosvm) using virtio and from there they are forwarded to this gRpc service.

    This setup provides a transparent radio environment across AVDs and
    accessories because the network simulator contains libraries to emulate
    Bluetooth, 80211MAC, UWB, and Rtt chips.

    """

    def StreamPackets(self, request_iterator, context):
        """Attach a virtual radio controller to the network simulation.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PacketStreamerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'StreamPackets': grpc.stream_stream_rpc_method_handler(
                    servicer.StreamPackets,
                    request_deserializer=netsim_dot_packet__streamer__pb2.PacketRequest.FromString,
                    response_serializer=netsim_dot_packet__streamer__pb2.PacketResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'netsim.packet.PacketStreamer', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class PacketStreamer(object):
    """*
    This is the packet service for the network simulator.

    Android Virtual Devices (AVDs) and accessory devices use this service to
    connect to the network simulator and pass packets back and forth.

    AVDs running in a guest VM are built with virtual controllers for each radio
    chip. These controllers route chip requests to host emulators (qemu and
    crosvm) using virtio and from there they are forwarded to this gRpc service.

    This setup provides a transparent radio environment across AVDs and
    accessories because the network simulator contains libraries to emulate
    Bluetooth, 80211MAC, UWB, and Rtt chips.

    """

    @staticmethod
    def StreamPackets(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_stream(request_iterator, target, '/netsim.packet.PacketStreamer/StreamPackets',
            netsim_dot_packet__streamer__pb2.PacketRequest.SerializeToString,
            netsim_dot_packet__streamer__pb2.PacketResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
