1# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! 2"""Client and server classes corresponding to protobuf-defined services.""" 3import grpc 4 5from . import packet_streamer_pb2 as packet__streamer__pb2 6 7 8class PacketStreamerStub(object): 9 """* 10 This is the packet service for the network simulator. 11 12 Android Virtual Devices (AVDs) and accessory devices use this service to 13 connect to the network simulator and pass packets back and forth. 14 15 AVDs running in a guest VM are built with virtual controllers for each radio 16 chip. These controllers route chip requests to host emulators (qemu and 17 crosvm) using virtio and from there they are forwarded to this gRpc service. 18 19 This setup provides a transparent radio environment across AVDs and 20 accessories because the network simulator contains libraries to emulate 21 Bluetooth, 80211MAC, UWB, and Rtt chips. 22 23 """ 24 25 def __init__(self, channel): 26 """Constructor. 27 28 Args: 29 channel: A grpc.Channel. 30 """ 31 self.StreamPackets = channel.stream_stream( 32 '/netsim.packet.PacketStreamer/StreamPackets', 33 request_serializer=packet__streamer__pb2.PacketRequest.SerializeToString, 34 response_deserializer=packet__streamer__pb2.PacketResponse.FromString, 35 ) 36 37 38class PacketStreamerServicer(object): 39 """* 40 This is the packet service for the network simulator. 41 42 Android Virtual Devices (AVDs) and accessory devices use this service to 43 connect to the network simulator and pass packets back and forth. 44 45 AVDs running in a guest VM are built with virtual controllers for each radio 46 chip. These controllers route chip requests to host emulators (qemu and 47 crosvm) using virtio and from there they are forwarded to this gRpc service. 48 49 This setup provides a transparent radio environment across AVDs and 50 accessories because the network simulator contains libraries to emulate 51 Bluetooth, 80211MAC, UWB, and Rtt chips. 52 53 """ 54 55 def StreamPackets(self, request_iterator, context): 56 """Attach a virtual radio controller to the network simulation. 57 """ 58 context.set_code(grpc.StatusCode.UNIMPLEMENTED) 59 context.set_details('Method not implemented!') 60 raise NotImplementedError('Method not implemented!') 61 62 63def add_PacketStreamerServicer_to_server(servicer, server): 64 rpc_method_handlers = { 65 'StreamPackets': grpc.stream_stream_rpc_method_handler( 66 servicer.StreamPackets, 67 request_deserializer=packet__streamer__pb2.PacketRequest.FromString, 68 response_serializer=packet__streamer__pb2.PacketResponse.SerializeToString, 69 ), 70 } 71 generic_handler = grpc.method_handlers_generic_handler( 72 'netsim.packet.PacketStreamer', rpc_method_handlers) 73 server.add_generic_rpc_handlers((generic_handler,)) 74 75 76 # This class is part of an EXPERIMENTAL API. 77class PacketStreamer(object): 78 """* 79 This is the packet service for the network simulator. 80 81 Android Virtual Devices (AVDs) and accessory devices use this service to 82 connect to the network simulator and pass packets back and forth. 83 84 AVDs running in a guest VM are built with virtual controllers for each radio 85 chip. These controllers route chip requests to host emulators (qemu and 86 crosvm) using virtio and from there they are forwarded to this gRpc service. 87 88 This setup provides a transparent radio environment across AVDs and 89 accessories because the network simulator contains libraries to emulate 90 Bluetooth, 80211MAC, UWB, and Rtt chips. 91 92 """ 93 94 @staticmethod 95 def StreamPackets(request_iterator, 96 target, 97 options=(), 98 channel_credentials=None, 99 call_credentials=None, 100 insecure=False, 101 compression=None, 102 wait_for_ready=None, 103 timeout=None, 104 metadata=None): 105 return grpc.experimental.stream_stream(request_iterator, target, '/netsim.packet.PacketStreamer/StreamPackets', 106 packet__streamer__pb2.PacketRequest.SerializeToString, 107 packet__streamer__pb2.PacketResponse.FromString, 108 options, channel_credentials, 109 insecure, call_credentials, compression, wait_for_ready, timeout, metadata) 110